From 5a1317e51a5854699befb3b470bc346551b1691a Mon Sep 17 00:00:00 2001 From: Son Ho Date: Mon, 18 Mar 2024 02:05:58 +0100 Subject: Regenerate the test files --- tests/coq/misc/Constants.v | 36 ++++++++-------- tests/coq/traits/Traits.v | 100 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 114 insertions(+), 22 deletions(-) (limited to 'tests/coq') diff --git a/tests/coq/misc/Constants.v b/tests/coq/misc/Constants.v index 81240847..fcafed53 100644 --- a/tests/coq/misc/Constants.v +++ b/tests/coq/misc/Constants.v @@ -11,17 +11,17 @@ Module Constants. (** [constants::X0] Source: 'src/constants.rs', lines 5:0-5:17 *) Definition x0_body : result u32 := Return 0%u32. -Definition x0 : u32 := (x0_body)%global. +Definition x0 : u32 := x0_body%global. (** [constants::X1] Source: 'src/constants.rs', lines 7:0-7:17 *) Definition x1_body : result u32 := Return core_u32_max. -Definition x1 : u32 := (x1_body)%global. +Definition x1 : u32 := x1_body%global. (** [constants::X2] Source: 'src/constants.rs', lines 10:0-10:17 *) Definition x2_body : result u32 := Return 3%u32. -Definition x2 : u32 := (x2_body)%global. +Definition x2 : u32 := x2_body%global. (** [constants::incr]: Source: 'src/constants.rs', lines 17:0-17:32 *) @@ -31,7 +31,7 @@ Definition incr (n : u32) : result u32 := (** [constants::X3] Source: 'src/constants.rs', lines 15:0-15:17 *) Definition x3_body : result u32 := incr 32%u32. -Definition x3 : u32 := (x3_body)%global. +Definition x3 : u32 := x3_body%global. (** [constants::mk_pair0]: Source: 'src/constants.rs', lines 23:0-23:51 *) @@ -56,24 +56,24 @@ Definition mk_pair1 (x : u32) (y1 : u32) : result (Pair_t u32 u32) := (** [constants::P0] Source: 'src/constants.rs', lines 31:0-31:24 *) Definition p0_body : result (u32 * u32) := mk_pair0 0%u32 1%u32. -Definition p0 : (u32 * u32) := (p0_body)%global. +Definition p0 : (u32 * u32) := p0_body%global. (** [constants::P1] Source: 'src/constants.rs', lines 32:0-32:28 *) Definition p1_body : result (Pair_t u32 u32) := mk_pair1 0%u32 1%u32. -Definition p1 : Pair_t u32 u32 := (p1_body)%global. +Definition p1 : Pair_t u32 u32 := p1_body%global. (** [constants::P2] Source: 'src/constants.rs', lines 33:0-33:24 *) Definition p2_body : result (u32 * u32) := Return (0%u32, 1%u32). -Definition p2 : (u32 * u32) := (p2_body)%global. +Definition p2 : (u32 * u32) := p2_body%global. (** [constants::P3] Source: 'src/constants.rs', lines 34:0-34:28 *) Definition p3_body : result (Pair_t u32 u32) := Return {| pair_x := 0%u32; pair_y := 1%u32 |} . -Definition p3 : Pair_t u32 u32 := (p3_body)%global. +Definition p3 : Pair_t u32 u32 := p3_body%global. (** [constants::Wrap] Source: 'src/constants.rs', lines 49:0-49:18 *) @@ -91,7 +91,7 @@ Definition wrap_new (T : Type) (value : T) : result (Wrap_t T) := (** [constants::Y] Source: 'src/constants.rs', lines 41:0-41:22 *) Definition y_body : result (Wrap_t i32) := wrap_new i32 2%i32. -Definition y : Wrap_t i32 := (y_body)%global. +Definition y : Wrap_t i32 := y_body%global. (** [constants::unwrap_y]: Source: 'src/constants.rs', lines 43:0-43:30 *) @@ -101,12 +101,12 @@ Definition unwrap_y : result i32 := (** [constants::YVAL] Source: 'src/constants.rs', lines 47:0-47:19 *) Definition yval_body : result i32 := unwrap_y. -Definition yval : i32 := (yval_body)%global. +Definition yval : i32 := yval_body%global. (** [constants::get_z1::Z1] Source: 'src/constants.rs', lines 62:4-62:17 *) Definition get_z1_z1_body : result i32 := Return 3%i32. -Definition get_z1_z1 : i32 := (get_z1_z1_body)%global. +Definition get_z1_z1 : i32 := get_z1_z1_body%global. (** [constants::get_z1]: Source: 'src/constants.rs', lines 61:0-61:28 *) @@ -121,17 +121,17 @@ Definition add (a : i32) (b : i32) : result i32 := (** [constants::Q1] Source: 'src/constants.rs', lines 74:0-74:17 *) Definition q1_body : result i32 := Return 5%i32. -Definition q1 : i32 := (q1_body)%global. +Definition q1 : i32 := q1_body%global. (** [constants::Q2] Source: 'src/constants.rs', lines 75:0-75:17 *) Definition q2_body : result i32 := Return q1. -Definition q2 : i32 := (q2_body)%global. +Definition q2 : i32 := q2_body%global. (** [constants::Q3] Source: 'src/constants.rs', lines 76:0-76:17 *) Definition q3_body : result i32 := add q2 3%i32. -Definition q3 : i32 := (q3_body)%global. +Definition q3 : i32 := q3_body%global. (** [constants::get_z2]: Source: 'src/constants.rs', lines 70:0-70:28 *) @@ -141,22 +141,22 @@ Definition get_z2 : result i32 := (** [constants::S1] Source: 'src/constants.rs', lines 80:0-80:18 *) Definition s1_body : result u32 := Return 6%u32. -Definition s1 : u32 := (s1_body)%global. +Definition s1 : u32 := s1_body%global. (** [constants::S2] Source: 'src/constants.rs', lines 81:0-81:18 *) Definition s2_body : result u32 := incr s1. -Definition s2 : u32 := (s2_body)%global. +Definition s2 : u32 := s2_body%global. (** [constants::S3] Source: 'src/constants.rs', lines 82:0-82:29 *) Definition s3_body : result (Pair_t u32 u32) := Return p3. -Definition s3 : Pair_t u32 u32 := (s3_body)%global. +Definition s3 : Pair_t u32 u32 := s3_body%global. (** [constants::S4] Source: 'src/constants.rs', lines 83:0-83:29 *) Definition s4_body : result (Pair_t u32 u32) := mk_pair1 7%u32 8%u32. -Definition s4 : Pair_t u32 u32 := (s4_body)%global. +Definition s4 : Pair_t u32 u32 := s4_body%global. (** [constants::V] Source: 'src/constants.rs', lines 86:0-86:31 *) diff --git a/tests/coq/traits/Traits.v b/tests/coq/traits/Traits.v index a9cd7e91..a861c114 100644 --- a/tests/coq/traits/Traits.v +++ b/tests/coq/traits/Traits.v @@ -283,9 +283,12 @@ Definition ToTypetraitsBoolWrapperT (T : Type) (toTypeBoolTInst : ToType_t bool (** [traits::WithConstTy::LEN2] Source: 'src/traits.rs', lines 164:4-164:21 *) -Definition with_const_ty_len2_default_body : result usize := Return 32%usize. -Definition with_const_ty_len2_default : usize := - with_const_ty_len2_default_body%global +Definition with_const_ty_len2_default_body (Self : Type) (LEN : usize) + : result usize := + Return 32%usize +. +Definition with_const_ty_len2_default (Self : Type) (LEN : usize) : usize := + (with_const_ty_len2_default_body Self LEN)%global . (** Trait declaration: [traits::WithConstTy] @@ -326,7 +329,7 @@ Definition withConstTyBool32_f Source: 'src/traits.rs', lines 174:0-174:29 *) Definition WithConstTyBool32 : WithConstTy_t bool 32%usize := {| WithConstTy_tWithConstTy_t_LEN1 := with_const_ty_bool32_len1; - WithConstTy_tWithConstTy_t_LEN2 := with_const_ty_len2_default; + WithConstTy_tWithConstTy_t_LEN2 := with_const_ty_len2_default bool 32%usize; WithConstTy_tWithConstTy_t_V := u8; WithConstTy_tWithConstTy_t_W := u64; WithConstTy_tWithConstTy_t_W_clause_0 := ToU64U64; @@ -613,4 +616,93 @@ Definition test_get_trait getTraitInst.(GetTrait_t_get_w) x . +(** Trait declaration: [traits::Trait] + Source: 'src/traits.rs', lines 310:0-310:15 *) +Record Trait_t (Self : Type) := mkTrait_t { Trait_tTrait_t_LEN : usize; }. + +Arguments mkTrait_t { _ }. +Arguments Trait_tTrait_t_LEN { _ }. + +(** [traits::{(traits::Trait for @Array)#14}::LEN] + Source: 'src/traits.rs', lines 315:4-315:20 *) +Definition trait_array_len_body (T : Type) (N : usize) : result usize := + Return N +. +Definition trait_array_len (T : Type) (N : usize) : usize := + (trait_array_len_body T N)%global +. + +(** Trait implementation: [traits::{(traits::Trait for @Array)#14}] + Source: 'src/traits.rs', lines 314:0-314:40 *) +Definition TraitArray (T : Type) (N : usize) : Trait_t (array T N) := {| + Trait_tTrait_t_LEN := trait_array_len T N; +|}. + +(** [traits::{(traits::Trait for traits::Wrapper)#15}::LEN] + Source: 'src/traits.rs', lines 319:4-319:20 *) +Definition traittraits_wrapper_len_body (T : Type) (traitInst : Trait_t T) + : result usize := + Return 0%usize +. +Definition traittraits_wrapper_len (T : Type) (traitInst : Trait_t T) + : usize := + (traittraits_wrapper_len_body T traitInst)%global +. + +(** Trait implementation: [traits::{(traits::Trait for traits::Wrapper)#15}] + Source: 'src/traits.rs', lines 318:0-318:35 *) +Definition TraittraitsWrapper (T : Type) (traitInst : Trait_t T) : Trait_t + (Wrapper_t T) := {| + Trait_tTrait_t_LEN := traittraits_wrapper_len T traitInst; +|}. + +(** [traits::use_wrapper_len]: + Source: 'src/traits.rs', lines 322:0-322:43 *) +Definition use_wrapper_len (T : Type) (traitInst : Trait_t T) : result usize := + Return (TraittraitsWrapper T traitInst).(Trait_tTrait_t_LEN) +. + +(** [traits::Foo] + Source: 'src/traits.rs', lines 326:0-326:20 *) +Record Foo_t (T U : Type) := mkFoo_t { foo_x : T; foo_y : U; }. + +Arguments mkFoo_t { _ _ }. +Arguments foo_x { _ _ }. +Arguments foo_y { _ _ }. + +(** [core::result::Result] + Source: '/rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753/library/core/src/result.rs', lines 502:0-502:21 *) +Inductive core_result_Result_t (T E : Type) := +| Core_result_Result_Ok : T -> core_result_Result_t T E +| Core_result_Result_Err : E -> core_result_Result_t T E +. + +Arguments Core_result_Result_Ok { _ _ }. +Arguments Core_result_Result_Err { _ _ }. + +(** [traits::{traits::Foo#16}::FOO] + Source: 'src/traits.rs', lines 332:4-332:33 *) +Definition foo_foo_body (T U : Type) (traitInst : Trait_t T) + : result (core_result_Result_t T i32) := + Return (Core_result_Result_Err 0%i32) +. +Definition foo_foo (T U : Type) (traitInst : Trait_t T) + : core_result_Result_t T i32 := + (foo_foo_body T U traitInst)%global +. + +(** [traits::use_foo1]: + Source: 'src/traits.rs', lines 335:0-335:48 *) +Definition use_foo1 + (T U : Type) (traitInst : Trait_t T) : result (core_result_Result_t T i32) := + Return (foo_foo T U traitInst) +. + +(** [traits::use_foo2]: + Source: 'src/traits.rs', lines 339:0-339:48 *) +Definition use_foo2 + (T U : Type) (traitInst : Trait_t U) : result (core_result_Result_t U i32) := + Return (foo_foo U T traitInst) +. + End Traits. -- cgit v1.2.3