diff options
author | Son Ho | 2024-03-11 09:43:21 +0100 |
---|---|---|
committer | Son Ho | 2024-03-11 09:43:21 +0100 |
commit | bf0b35b9b1fa90d50587e906432077b63a9ad34d (patch) | |
tree | 76507daab5827cdca8f75aea975deb5d0b9aed2f /tests | |
parent | 5af8412b48aef44448d3ce674612aa18feb961b3 (diff) |
Update the generated files
Diffstat (limited to 'tests')
-rw-r--r-- | tests/coq/arrays/Arrays.v | 2 | ||||
-rw-r--r-- | tests/coq/demo/Demo.v | 10 | ||||
-rw-r--r-- | tests/coq/misc/Constants.v | 59 | ||||
-rw-r--r-- | tests/coq/misc/NoNestedBorrows.v | 4 | ||||
-rw-r--r-- | tests/coq/traits/Traits.v | 187 | ||||
-rw-r--r-- | tests/fstar/arrays/Arrays.Funs.fst | 2 | ||||
-rw-r--r-- | tests/fstar/demo/Demo.fst | 8 | ||||
-rw-r--r-- | tests/fstar/misc/Constants.fst | 58 | ||||
-rw-r--r-- | tests/fstar/misc/NoNestedBorrows.fst | 4 | ||||
-rw-r--r-- | tests/fstar/traits/Traits.fst | 165 | ||||
-rw-r--r-- | tests/lean/Arrays.lean | 4 | ||||
-rw-r--r-- | tests/lean/Constants.lean | 80 | ||||
-rw-r--r-- | tests/lean/Demo/Demo.lean | 10 | ||||
-rw-r--r-- | tests/lean/NoNestedBorrows.lean | 8 | ||||
-rw-r--r-- | tests/lean/Traits.lean | 168 |
15 files changed, 389 insertions, 380 deletions
diff --git a/tests/coq/arrays/Arrays.v b/tests/coq/arrays/Arrays.v index 79be3678..34d163b7 100644 --- a/tests/coq/arrays/Arrays.v +++ b/tests/coq/arrays/Arrays.v @@ -492,7 +492,7 @@ Definition f3 (n : nat) : result u32 := (** [arrays::SZ] Source: 'src/arrays.rs', lines 286:0-286:19 *) Definition sz_body : result usize := Return 32%usize. -Definition sz_c : usize := sz_body%global. +Definition sz : usize := sz_body%global. (** [arrays::f5]: Source: 'src/arrays.rs', lines 289:0-289:31 *) diff --git a/tests/coq/demo/Demo.v b/tests/coq/demo/Demo.v index 1abe7c5c..22a0a131 100644 --- a/tests/coq/demo/Demo.v +++ b/tests/coq/demo/Demo.v @@ -145,16 +145,16 @@ Record Counter_t (Self : Type) := mkCounter_t { Arguments mkCounter_t { _ }. Arguments Counter_t_incr { _ }. -(** [demo::{usize}::incr]: +(** [demo::{(demo::Counter for usize)}::incr]: Source: 'src/demo.rs', lines 88:4-88:31 *) -Definition usize_incr (self : usize) : result (usize * usize) := +Definition counterUsize_incr (self : usize) : result (usize * usize) := self1 <- usize_add self 1%usize; Return (self, self1) . -(** Trait implementation: [demo::{usize}] +(** Trait implementation: [demo::{(demo::Counter for usize)}] Source: 'src/demo.rs', lines 87:0-87:22 *) -Definition demo_CounterUsizeInst : Counter_t usize := {| - Counter_t_incr := usize_incr; +Definition CounterUsize : Counter_t usize := {| + Counter_t_incr := counterUsize_incr; |}. (** [demo::use_counter]: diff --git a/tests/coq/misc/Constants.v b/tests/coq/misc/Constants.v index 0f33cbd6..5fa952b4 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_c : 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_c : 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_c : u32 := x2_body%global. +Definition x2 : u32 := x2_body%global. (** [constants::incr]: Source: 'src/constants.rs', lines 17:0-17:32 *) @@ -31,12 +31,13 @@ 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_c : u32 := x3_body%global. +Definition x3 : u32 := x3_body%global. (** [constants::mk_pair0]: Source: 'src/constants.rs', lines 23:0-23:51 *) -Definition mk_pair0 (x : u32) (y : u32) : result (u32 * u32) := - Return (x, y). +Definition mk_pair0 (x : u32) (y1 : u32) : result (u32 * u32) := + Return (x, y1) +. (** [constants::Pair] Source: 'src/constants.rs', lines 36:0-36:23 *) @@ -48,31 +49,31 @@ Arguments pair_y { _ _ }. (** [constants::mk_pair1]: Source: 'src/constants.rs', lines 27:0-27:55 *) -Definition mk_pair1 (x : u32) (y : u32) : result (Pair_t u32 u32) := - Return {| pair_x := x; pair_y := y |} +Definition mk_pair1 (x : u32) (y1 : u32) : result (Pair_t u32 u32) := + Return {| pair_x := x; pair_y := y1 |} . (** [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_c : (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_c : 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_c : (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_c : 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 *) @@ -90,27 +91,27 @@ 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_c : 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 *) Definition unwrap_y : result i32 := - Return y_c.(wrap_value). + Return y.(wrap_value). (** [constants::YVAL] Source: 'src/constants.rs', lines 47:0-47:19 *) Definition yval_body : result i32 := unwrap_y. -Definition yval_c : 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_c : 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 *) Definition get_z1 : result i32 := - Return get_z1_z1_c. + Return get_z1_z1. (** [constants::add]: Source: 'src/constants.rs', lines 66:0-66:39 *) @@ -120,41 +121,41 @@ 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_c : 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_c. -Definition q2_c : i32 := q2_body%global. +Definition q2_body : result i32 := Return q1. +Definition q2 : i32 := q2_body%global. (** [constants::Q3] Source: 'src/constants.rs', lines 76:0-76:17 *) -Definition q3_body : result i32 := add q2_c 3%i32. -Definition q3_c : i32 := q3_body%global. +Definition q3_body : result i32 := add q2 3%i32. +Definition q3 : i32 := q3_body%global. (** [constants::get_z2]: Source: 'src/constants.rs', lines 70:0-70:28 *) Definition get_z2 : result i32 := - i <- get_z1; i1 <- add i q3_c; add q1_c i1. + i <- get_z1; i1 <- add i q3; add q1 i1. (** [constants::S1] Source: 'src/constants.rs', lines 80:0-80:18 *) Definition s1_body : result u32 := Return 6%u32. -Definition s1_c : 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_c. -Definition s2_c : u32 := s2_body%global. +Definition s2_body : result u32 := incr s1. +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_c. -Definition s3_c : Pair_t u32 u32 := s3_body%global. +Definition s3_body : result (Pair_t u32 u32) := Return p3. +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_c : Pair_t u32 u32 := s4_body%global. +Definition s4 : Pair_t u32 u32 := s4_body%global. End Constants. diff --git a/tests/coq/misc/NoNestedBorrows.v b/tests/coq/misc/NoNestedBorrows.v index 8857d4b6..73c4ee58 100644 --- a/tests/coq/misc/NoNestedBorrows.v +++ b/tests/coq/misc/NoNestedBorrows.v @@ -150,12 +150,12 @@ Definition mix_arith_i32 (x : i32) (y : i32) (z : i32) : result i32 := (** [no_nested_borrows::CONST0] Source: 'src/no_nested_borrows.rs', lines 125:0-125:23 *) Definition const0_body : result usize := usize_add 1%usize 1%usize. -Definition const0_c : usize := const0_body%global. +Definition const0 : usize := const0_body%global. (** [no_nested_borrows::CONST1] Source: 'src/no_nested_borrows.rs', lines 126:0-126:23 *) Definition const1_body : result usize := usize_mul 2%usize 2%usize. -Definition const1_c : usize := const1_body%global. +Definition const1 : usize := const1_body%global. (** [no_nested_borrows::cast_u32_to_i32]: Source: 'src/no_nested_borrows.rs', lines 128:0-128:37 *) diff --git a/tests/coq/traits/Traits.v b/tests/coq/traits/Traits.v index 4d0beae2..70ebf483 100644 --- a/tests/coq/traits/Traits.v +++ b/tests/coq/traits/Traits.v @@ -17,15 +17,15 @@ Record BoolTrait_t (Self : Type) := mkBoolTrait_t { Arguments mkBoolTrait_t { _ }. Arguments BoolTrait_t_get_bool { _ }. -(** [traits::{bool}::get_bool]: +(** [traits::{(traits::BoolTrait for bool)}::get_bool]: Source: 'src/traits.rs', lines 12:4-12:30 *) -Definition bool_get_bool (self : bool) : result bool := +Definition boolTraitBool_get_bool (self : bool) : result bool := Return self. -(** Trait implementation: [traits::{bool}] +(** Trait implementation: [traits::{(traits::BoolTrait for bool)}] Source: 'src/traits.rs', lines 11:0-11:23 *) -Definition traits_BoolTraitBoolInst : BoolTrait_t bool := {| - BoolTrait_t_get_bool := bool_get_bool; +Definition BoolTraitBool : BoolTrait_t bool := {| + BoolTrait_t_get_bool := boolTraitBool_get_bool; |}. (** [traits::BoolTrait::ret_true]: @@ -38,29 +38,29 @@ Definition boolTrait_ret_true (** [traits::test_bool_trait_bool]: Source: 'src/traits.rs', lines 17:0-17:44 *) Definition test_bool_trait_bool (x : bool) : result bool := - b <- bool_get_bool x; - if b then boolTrait_ret_true traits_BoolTraitBoolInst x else Return false + b <- boolTraitBool_get_bool x; + if b then boolTrait_ret_true BoolTraitBool x else Return false . -(** [traits::{core::option::Option<T>#1}::get_bool]: +(** [traits::{(traits::BoolTrait for core::option::Option<T>)#1}::get_bool]: Source: 'src/traits.rs', lines 23:4-23:30 *) -Definition option_get_bool (T : Type) (self : option T) : result bool := +Definition boolTraitcoreoptionOptionT_get_bool + (T : Type) (self : option T) : result bool := match self with | None => Return false | Some _ => Return true end . -(** Trait implementation: [traits::{core::option::Option<T>#1}] +(** Trait implementation: [traits::{(traits::BoolTrait for core::option::Option<T>)#1}] Source: 'src/traits.rs', lines 22:0-22:31 *) -Definition traits_BoolTraitcoreoptionOptionTInst (T : Type) : BoolTrait_t - (option T) := {| - BoolTrait_t_get_bool := option_get_bool T; +Definition BoolTraitcoreoptionOptionT (T : Type) : BoolTrait_t (option T) := {| + BoolTrait_t_get_bool := boolTraitcoreoptionOptionT_get_bool T; |}. (** [traits::test_bool_trait_option]: Source: 'src/traits.rs', lines 31:0-31:54 *) Definition test_bool_trait_option (T : Type) (x : option T) : result bool := - b <- option_get_bool T x; + b <- boolTraitcoreoptionOptionT_get_bool T x; if b - then boolTrait_ret_true (traits_BoolTraitcoreoptionOptionTInst T) x + then boolTrait_ret_true (BoolTraitcoreoptionOptionT T) x else Return false . @@ -80,20 +80,18 @@ Record ToU64_t (Self : Type) := mkToU64_t { Arguments mkToU64_t { _ }. Arguments ToU64_t_to_u64 { _ }. -(** [traits::{u64#2}::to_u64]: +(** [traits::{(traits::ToU64 for u64)#2}::to_u64]: Source: 'src/traits.rs', lines 44:4-44:26 *) -Definition u64_to_u64 (self : u64) : result u64 := +Definition toU64U64_to_u64 (self : u64) : result u64 := Return self. -(** Trait implementation: [traits::{u64#2}] +(** Trait implementation: [traits::{(traits::ToU64 for u64)#2}] Source: 'src/traits.rs', lines 43:0-43:18 *) -Definition traits_ToU64U64Inst : ToU64_t u64 := {| - ToU64_t_to_u64 := u64_to_u64; -|}. +Definition ToU64U64 : ToU64_t u64 := {| ToU64_t_to_u64 := toU64U64_to_u64; |}. -(** [traits::{(A, A)#3}::to_u64]: +(** [traits::{(traits::ToU64 for (A, A))#3}::to_u64]: Source: 'src/traits.rs', lines 50:4-50:26 *) -Definition pair_to_u64 +Definition toU64Pair_to_u64 (A : Type) (toU64AInst : ToU64_t A) (self : (A * A)) : result u64 := let (t, t1) := self in i <- toU64AInst.(ToU64_t_to_u64) t; @@ -101,30 +99,30 @@ Definition pair_to_u64 u64_add i i1 . -(** Trait implementation: [traits::{(A, A)#3}] +(** Trait implementation: [traits::{(traits::ToU64 for (A, A))#3}] Source: 'src/traits.rs', lines 49:0-49:31 *) -Definition traits_ToU64TupleAAInst (A : Type) (toU64AInst : ToU64_t A) : - ToU64_t (A * A) := {| - ToU64_t_to_u64 := pair_to_u64 A toU64AInst; +Definition ToU64Pair (A : Type) (toU64AInst : ToU64_t A) : ToU64_t (A * A) + := {| + ToU64_t_to_u64 := toU64Pair_to_u64 A toU64AInst; |}. (** [traits::f]: Source: 'src/traits.rs', lines 55:0-55:36 *) Definition f (T : Type) (toU64TInst : ToU64_t T) (x : (T * T)) : result u64 := - pair_to_u64 T toU64TInst x + toU64Pair_to_u64 T toU64TInst x . (** [traits::g]: Source: 'src/traits.rs', lines 59:0-61:18 *) Definition g - (T : Type) (toU64TupleTTInst : ToU64_t (T * T)) (x : (T * T)) : result u64 := - toU64TupleTTInst.(ToU64_t_to_u64) x + (T : Type) (toU64PairInst : ToU64_t (T * T)) (x : (T * T)) : result u64 := + toU64PairInst.(ToU64_t_to_u64) x . (** [traits::h0]: Source: 'src/traits.rs', lines 66:0-66:24 *) Definition h0 (x : u64) : result u64 := - u64_to_u64 x. + toU64U64_to_u64 x. (** [traits::Wrapper] Source: 'src/traits.rs', lines 70:0-70:21 *) @@ -133,31 +131,31 @@ Record Wrapper_t (T : Type) := mkWrapper_t { wrapper_x : T; }. Arguments mkWrapper_t { _ }. Arguments wrapper_x { _ }. -(** [traits::{traits::Wrapper<T>#4}::to_u64]: +(** [traits::{(traits::ToU64 for traits::Wrapper<T>)#4}::to_u64]: Source: 'src/traits.rs', lines 75:4-75:26 *) -Definition wrapper_to_u64 +Definition toU64traitsWrapperT_to_u64 (T : Type) (toU64TInst : ToU64_t T) (self : Wrapper_t T) : result u64 := toU64TInst.(ToU64_t_to_u64) self.(wrapper_x) . -(** Trait implementation: [traits::{traits::Wrapper<T>#4}] +(** Trait implementation: [traits::{(traits::ToU64 for traits::Wrapper<T>)#4}] Source: 'src/traits.rs', lines 74:0-74:35 *) -Definition traits_ToU64traitsWrapperTInst (T : Type) (toU64TInst : ToU64_t T) : - ToU64_t (Wrapper_t T) := {| - ToU64_t_to_u64 := wrapper_to_u64 T toU64TInst; +Definition ToU64traitsWrapperT (T : Type) (toU64TInst : ToU64_t T) : ToU64_t + (Wrapper_t T) := {| + ToU64_t_to_u64 := toU64traitsWrapperT_to_u64 T toU64TInst; |}. (** [traits::h1]: Source: 'src/traits.rs', lines 80:0-80:33 *) Definition h1 (x : Wrapper_t u64) : result u64 := - wrapper_to_u64 u64 traits_ToU64U64Inst x + toU64traitsWrapperT_to_u64 u64 ToU64U64 x . (** [traits::h2]: Source: 'src/traits.rs', lines 84:0-84:41 *) Definition h2 (T : Type) (toU64TInst : ToU64_t T) (x : Wrapper_t T) : result u64 := - wrapper_to_u64 T toU64TInst x + toU64traitsWrapperT_to_u64 T toU64TInst x . (** Trait declaration: [traits::ToType] @@ -169,15 +167,16 @@ Record ToType_t (Self T : Type) := mkToType_t { Arguments mkToType_t { _ _ }. Arguments ToType_t_to_type { _ _ }. -(** [traits::{u64#5}::to_type]: +(** [traits::{(traits::ToType<bool> for u64)#5}::to_type]: Source: 'src/traits.rs', lines 93:4-93:28 *) -Definition u64_to_type (self : u64) : result bool := - Return (self s> 0%u64). +Definition toTypeU64Bool_to_type (self : u64) : result bool := + Return (self s> 0%u64) +. -(** Trait implementation: [traits::{u64#5}] +(** Trait implementation: [traits::{(traits::ToType<bool> for u64)#5}] Source: 'src/traits.rs', lines 92:0-92:25 *) -Definition traits_ToTypeU64BoolInst : ToType_t u64 bool := {| - ToType_t_to_type := u64_to_type; +Definition ToTypeU64Bool : ToType_t u64 bool := {| + ToType_t_to_type := toTypeU64Bool_to_type; |}. (** Trait declaration: [traits::OfType] @@ -238,18 +237,19 @@ Record TestType_test_TestTrait_t (Self : Type) := mkTestType_test_TestTrait_t { Arguments mkTestType_test_TestTrait_t { _ }. Arguments TestType_test_TestTrait_t_test { _ }. -(** [traits::{traits::TestType<T>#6}::test::{traits::{traits::TestType<T>#6}::test::TestType1}::test]: +(** [traits::{traits::TestType<T>#6}::test::{(traits::{traits::TestType<T>#6}::test::TestTrait for traits::{traits::TestType<T>#6}::test::TestType1)}::test]: Source: 'src/traits.rs', lines 139:12-139:34 *) -Definition testType_test_TestType1_test +Definition testType_test_TestTraittraitsTestTypetestTestType1_test (self : TestType_test_TestType1_t) : result bool := Return (self s> 1%u64) . -(** Trait implementation: [traits::{traits::TestType<T>#6}::test::{traits::{traits::TestType<T>#6}::test::TestType1}] +(** Trait implementation: [traits::{traits::TestType<T>#6}::test::{(traits::{traits::TestType<T>#6}::test::TestTrait for traits::{traits::TestType<T>#6}::test::TestType1)}] Source: 'src/traits.rs', lines 138:8-138:36 *) -Definition traits_TestType_test_TestTraittraitstraitsTestTypeTtestTestType1Inst - : TestType_test_TestTrait_t TestType_test_TestType1_t := {| - TestType_test_TestTrait_t_test := testType_test_TestType1_test; +Definition TestType_test_TestTraittraitsTestTypetestTestType1 : + TestType_test_TestTrait_t TestType_test_TestType1_t := {| + TestType_test_TestTrait_t_test := + testType_test_TestTraittraitsTestTypetestTestType1_test; |}. (** [traits::{traits::TestType<T>#6}::test]: @@ -259,33 +259,37 @@ Definition testType_test result bool := x1 <- toU64TInst.(ToU64_t_to_u64) x; - if x1 s> 0%u64 then testType_test_TestType1_test 0%u64 else Return false + if x1 s> 0%u64 + then testType_test_TestTraittraitsTestTypetestTestType1_test 0%u64 + else Return false . (** [traits::BoolWrapper] Source: 'src/traits.rs', lines 150:0-150:22 *) Definition BoolWrapper_t : Type := bool. -(** [traits::{traits::BoolWrapper#7}::to_type]: +(** [traits::{(traits::ToType<T> for traits::BoolWrapper)#7}::to_type]: Source: 'src/traits.rs', lines 156:4-156:25 *) -Definition boolWrapper_to_type +Definition toTypetraitsBoolWrapperT_to_type (T : Type) (toTypeBoolTInst : ToType_t bool T) (self : BoolWrapper_t) : result T := toTypeBoolTInst.(ToType_t_to_type) self . -(** Trait implementation: [traits::{traits::BoolWrapper#7}] +(** Trait implementation: [traits::{(traits::ToType<T> for traits::BoolWrapper)#7}] Source: 'src/traits.rs', lines 152:0-152:33 *) -Definition traits_ToTypetraitsBoolWrapperTInst (T : Type) (toTypeBoolTInst : - ToType_t bool T) : ToType_t BoolWrapper_t T := {| - ToType_t_to_type := boolWrapper_to_type T toTypeBoolTInst; +Definition ToTypetraitsBoolWrapperT (T : Type) (toTypeBoolTInst : ToType_t bool + T) : ToType_t BoolWrapper_t T := {| + ToType_t_to_type := toTypetraitsBoolWrapperT_to_type T toTypeBoolTInst; |}. (** [traits::WithConstTy::LEN2] Source: 'src/traits.rs', lines 164:4-164:21 *) -Definition with_const_ty_len2_body : result usize := Return 32%usize. -Definition with_const_ty_len2_c : usize := with_const_ty_len2_body%global. +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 +. (** Trait declaration: [traits::WithConstTy] Source: 'src/traits.rs', lines 161:0-161:39 *) @@ -307,25 +311,29 @@ Arguments WithConstTy_tWithConstTy_t_W { _ _ }. Arguments WithConstTy_tWithConstTy_t_W_clause_0 { _ _ }. Arguments WithConstTy_t_f { _ _ }. -(** [traits::{bool#8}::LEN1] +(** [traits::{(traits::WithConstTy<32: usize> for bool)#8}::LEN1] Source: 'src/traits.rs', lines 175:4-175:21 *) -Definition bool_len1_body : result usize := Return 12%usize. -Definition bool_len1_c : usize := bool_len1_body%global. +Definition with_const_ty_bool32_len1_body : result usize := Return 12%usize. +Definition with_const_ty_bool32_len1 : usize := + with_const_ty_bool32_len1_body%global +. -(** [traits::{bool#8}::f]: +(** [traits::{(traits::WithConstTy<32: usize> for bool)#8}::f]: Source: 'src/traits.rs', lines 180:4-180:39 *) -Definition bool_f (i : u64) (a : array u8 32%usize) : result u64 := - Return i. +Definition withConstTyBool32_f + (i : u64) (a : array u8 32%usize) : result u64 := + Return i +. -(** Trait implementation: [traits::{bool#8}] +(** Trait implementation: [traits::{(traits::WithConstTy<32: usize> for bool)#8}] Source: 'src/traits.rs', lines 174:0-174:29 *) -Definition traits_WithConstTyBool32Inst : WithConstTy_t bool 32%usize := {| - WithConstTy_tWithConstTy_t_LEN1 := bool_len1_c; - WithConstTy_tWithConstTy_t_LEN2 := with_const_ty_len2_c; +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_V := u8; WithConstTy_tWithConstTy_t_W := u64; - WithConstTy_tWithConstTy_t_W_clause_0 := traits_ToU64U64Inst; - WithConstTy_t_f := bool_f; + WithConstTy_tWithConstTy_t_W_clause_0 := ToU64U64; + WithConstTy_t_f := withConstTyBool32_f; |}. (** [traits::use_with_const_ty1]: @@ -440,16 +448,14 @@ Record ChildTrait1_t (Self : Type) := mkChildTrait1_t { Arguments mkChildTrait1_t { _ }. Arguments ChildTrait1_tChildTrait1_t_ParentTrait1SelfInst { _ }. -(** Trait implementation: [traits::{usize#9}] +(** Trait implementation: [traits::{(traits::ParentTrait1 for usize)#9}] Source: 'src/traits.rs', lines 224:0-224:27 *) -Definition traits_ParentTrait1UsizeInst : ParentTrait1_t usize - := mkParentTrait1_t. +Definition ParentTrait1Usize : ParentTrait1_t usize := mkParentTrait1_t. -(** Trait implementation: [traits::{usize#10}] +(** Trait implementation: [traits::{(traits::ChildTrait1 for usize)#10}] Source: 'src/traits.rs', lines 225:0-225:26 *) -Definition traits_ChildTrait1UsizeInst : ChildTrait1_t usize := {| - ChildTrait1_tChildTrait1_t_ParentTrait1SelfInst := - traits_ParentTrait1UsizeInst; +Definition ChildTrait1Usize : ChildTrait1_t usize := {| + ChildTrait1_tChildTrait1_t_ParentTrait1SelfInst := ParentTrait1Usize; |}. (** Trait declaration: [traits::Iterator] @@ -531,30 +537,29 @@ Arguments mkChildTrait2_t { _ }. Arguments ChildTrait2_tChildTrait2_t_ParentTrait2SelfInst { _ }. Arguments ChildTrait2_t_convert { _ }. -(** Trait implementation: [traits::{u32#11}] +(** Trait implementation: [traits::{(traits::WithTarget for u32)#11}] Source: 'src/traits.rs', lines 264:0-264:23 *) -Definition traits_WithTargetU32Inst : WithTarget_t u32 := {| +Definition WithTargetU32 : WithTarget_t u32 := {| WithTarget_tWithTarget_t_Target := u32; |}. -(** Trait implementation: [traits::{u32#12}] +(** Trait implementation: [traits::{(traits::ParentTrait2 for u32)#12}] Source: 'src/traits.rs', lines 268:0-268:25 *) -Definition traits_ParentTrait2U32Inst : ParentTrait2_t u32 := {| +Definition ParentTrait2U32 : ParentTrait2_t u32 := {| ParentTrait2_tParentTrait2_t_U := u32; - ParentTrait2_tParentTrait2_t_U_clause_0 := traits_WithTargetU32Inst; + ParentTrait2_tParentTrait2_t_U_clause_0 := WithTargetU32; |}. -(** [traits::{u32#13}::convert]: +(** [traits::{(traits::ChildTrait2 for u32)#13}::convert]: Source: 'src/traits.rs', lines 273:4-273:29 *) -Definition u32_convert (x : u32) : result u32 := +Definition childTrait2U32_convert (x : u32) : result u32 := Return x. -(** Trait implementation: [traits::{u32#13}] +(** Trait implementation: [traits::{(traits::ChildTrait2 for u32)#13}] Source: 'src/traits.rs', lines 272:0-272:24 *) -Definition traits_ChildTrait2U32Inst : ChildTrait2_t u32 := {| - ChildTrait2_tChildTrait2_t_ParentTrait2SelfInst := - traits_ParentTrait2U32Inst; - ChildTrait2_t_convert := u32_convert; +Definition ChildTrait2U32 : ChildTrait2_t u32 := {| + ChildTrait2_tChildTrait2_t_ParentTrait2SelfInst := ParentTrait2U32; + ChildTrait2_t_convert := childTrait2U32_convert; |}. (** Trait declaration: [traits::CFnOnce] diff --git a/tests/fstar/arrays/Arrays.Funs.fst b/tests/fstar/arrays/Arrays.Funs.fst index ac57b8fc..cf0f4f8b 100644 --- a/tests/fstar/arrays/Arrays.Funs.fst +++ b/tests/fstar/arrays/Arrays.Funs.fst @@ -398,7 +398,7 @@ let f3 : result u32 = (** [arrays::SZ] Source: 'src/arrays.rs', lines 286:0-286:19 *) let sz_body : result usize = Return 32 -let sz_c : usize = eval_global sz_body +let sz : usize = eval_global sz_body (** [arrays::f5]: Source: 'src/arrays.rs', lines 289:0-289:31 *) diff --git a/tests/fstar/demo/Demo.fst b/tests/fstar/demo/Demo.fst index f9082979..22322ee7 100644 --- a/tests/fstar/demo/Demo.fst +++ b/tests/fstar/demo/Demo.fst @@ -121,14 +121,14 @@ let rec i32_id (n : nat) (i : i32) : result i32 = Source: 'src/demo.rs', lines 83:0-83:17 *) noeq type counter_t (self : Type0) = { incr : self -> result (usize & self); } -(** [demo::{usize}::incr]: +(** [demo::{(demo::Counter for usize)}::incr]: Source: 'src/demo.rs', lines 88:4-88:31 *) -let usize_incr (self : usize) : result (usize & usize) = +let counterUsize_incr (self : usize) : result (usize & usize) = let* self1 = usize_add self 1 in Return (self, self1) -(** Trait implementation: [demo::{usize}] +(** Trait implementation: [demo::{(demo::Counter for usize)}] Source: 'src/demo.rs', lines 87:0-87:22 *) -let demo_CounterUsizeInst : counter_t usize = { incr = usize_incr; } +let counterUsize : counter_t usize = { incr = counterUsize_incr; } (** [demo::use_counter]: Source: 'src/demo.rs', lines 95:0-95:59 *) diff --git a/tests/fstar/misc/Constants.fst b/tests/fstar/misc/Constants.fst index 7bf42b46..66429c80 100644 --- a/tests/fstar/misc/Constants.fst +++ b/tests/fstar/misc/Constants.fst @@ -8,17 +8,17 @@ open Primitives (** [constants::X0] Source: 'src/constants.rs', lines 5:0-5:17 *) let x0_body : result u32 = Return 0 -let x0_c : u32 = eval_global x0_body +let x0 : u32 = eval_global x0_body (** [constants::X1] Source: 'src/constants.rs', lines 7:0-7:17 *) let x1_body : result u32 = Return core_u32_max -let x1_c : u32 = eval_global x1_body +let x1 : u32 = eval_global x1_body (** [constants::X2] Source: 'src/constants.rs', lines 10:0-10:17 *) let x2_body : result u32 = Return 3 -let x2_c : u32 = eval_global x2_body +let x2 : u32 = eval_global x2_body (** [constants::incr]: Source: 'src/constants.rs', lines 17:0-17:32 *) @@ -28,12 +28,12 @@ let incr (n : u32) : result u32 = (** [constants::X3] Source: 'src/constants.rs', lines 15:0-15:17 *) let x3_body : result u32 = incr 32 -let x3_c : u32 = eval_global x3_body +let x3 : u32 = eval_global x3_body (** [constants::mk_pair0]: Source: 'src/constants.rs', lines 23:0-23:51 *) -let mk_pair0 (x : u32) (y : u32) : result (u32 & u32) = - Return (x, y) +let mk_pair0 (x : u32) (y1 : u32) : result (u32 & u32) = + Return (x, y1) (** [constants::Pair] Source: 'src/constants.rs', lines 36:0-36:23 *) @@ -41,28 +41,28 @@ type pair_t (t1 t2 : Type0) = { x : t1; y : t2; } (** [constants::mk_pair1]: Source: 'src/constants.rs', lines 27:0-27:55 *) -let mk_pair1 (x : u32) (y : u32) : result (pair_t u32 u32) = - Return { x = x; y = y } +let mk_pair1 (x : u32) (y1 : u32) : result (pair_t u32 u32) = + Return { x = x; y = y1 } (** [constants::P0] Source: 'src/constants.rs', lines 31:0-31:24 *) let p0_body : result (u32 & u32) = mk_pair0 0 1 -let p0_c : (u32 & u32) = eval_global p0_body +let p0 : (u32 & u32) = eval_global p0_body (** [constants::P1] Source: 'src/constants.rs', lines 32:0-32:28 *) let p1_body : result (pair_t u32 u32) = mk_pair1 0 1 -let p1_c : pair_t u32 u32 = eval_global p1_body +let p1 : pair_t u32 u32 = eval_global p1_body (** [constants::P2] Source: 'src/constants.rs', lines 33:0-33:24 *) let p2_body : result (u32 & u32) = Return (0, 1) -let p2_c : (u32 & u32) = eval_global p2_body +let p2 : (u32 & u32) = eval_global p2_body (** [constants::P3] Source: 'src/constants.rs', lines 34:0-34:28 *) let p3_body : result (pair_t u32 u32) = Return { x = 0; y = 1 } -let p3_c : pair_t u32 u32 = eval_global p3_body +let p3 : pair_t u32 u32 = eval_global p3_body (** [constants::Wrap] Source: 'src/constants.rs', lines 49:0-49:18 *) @@ -76,27 +76,27 @@ let wrap_new (t : Type0) (value : t) : result (wrap_t t) = (** [constants::Y] Source: 'src/constants.rs', lines 41:0-41:22 *) let y_body : result (wrap_t i32) = wrap_new i32 2 -let y_c : wrap_t i32 = eval_global y_body +let y : wrap_t i32 = eval_global y_body (** [constants::unwrap_y]: Source: 'src/constants.rs', lines 43:0-43:30 *) let unwrap_y : result i32 = - Return y_c.value + Return y.value (** [constants::YVAL] Source: 'src/constants.rs', lines 47:0-47:19 *) let yval_body : result i32 = unwrap_y -let yval_c : i32 = eval_global yval_body +let yval : i32 = eval_global yval_body (** [constants::get_z1::Z1] Source: 'src/constants.rs', lines 62:4-62:17 *) let get_z1_z1_body : result i32 = Return 3 -let get_z1_z1_c : i32 = eval_global get_z1_z1_body +let get_z1_z1 : i32 = eval_global get_z1_z1_body (** [constants::get_z1]: Source: 'src/constants.rs', lines 61:0-61:28 *) let get_z1 : result i32 = - Return get_z1_z1_c + Return get_z1_z1 (** [constants::add]: Source: 'src/constants.rs', lines 66:0-66:39 *) @@ -106,40 +106,40 @@ let add (a : i32) (b : i32) : result i32 = (** [constants::Q1] Source: 'src/constants.rs', lines 74:0-74:17 *) let q1_body : result i32 = Return 5 -let q1_c : i32 = eval_global q1_body +let q1 : i32 = eval_global q1_body (** [constants::Q2] Source: 'src/constants.rs', lines 75:0-75:17 *) -let q2_body : result i32 = Return q1_c -let q2_c : i32 = eval_global q2_body +let q2_body : result i32 = Return q1 +let q2 : i32 = eval_global q2_body (** [constants::Q3] Source: 'src/constants.rs', lines 76:0-76:17 *) -let q3_body : result i32 = add q2_c 3 -let q3_c : i32 = eval_global q3_body +let q3_body : result i32 = add q2 3 +let q3 : i32 = eval_global q3_body (** [constants::get_z2]: Source: 'src/constants.rs', lines 70:0-70:28 *) let get_z2 : result i32 = - let* i = get_z1 in let* i1 = add i q3_c in add q1_c i1 + let* i = get_z1 in let* i1 = add i q3 in add q1 i1 (** [constants::S1] Source: 'src/constants.rs', lines 80:0-80:18 *) let s1_body : result u32 = Return 6 -let s1_c : u32 = eval_global s1_body +let s1 : u32 = eval_global s1_body (** [constants::S2] Source: 'src/constants.rs', lines 81:0-81:18 *) -let s2_body : result u32 = incr s1_c -let s2_c : u32 = eval_global s2_body +let s2_body : result u32 = incr s1 +let s2 : u32 = eval_global s2_body (** [constants::S3] Source: 'src/constants.rs', lines 82:0-82:29 *) -let s3_body : result (pair_t u32 u32) = Return p3_c -let s3_c : pair_t u32 u32 = eval_global s3_body +let s3_body : result (pair_t u32 u32) = Return p3 +let s3 : pair_t u32 u32 = eval_global s3_body (** [constants::S4] Source: 'src/constants.rs', lines 83:0-83:29 *) let s4_body : result (pair_t u32 u32) = mk_pair1 7 8 -let s4_c : pair_t u32 u32 = eval_global s4_body +let s4 : pair_t u32 u32 = eval_global s4_body diff --git a/tests/fstar/misc/NoNestedBorrows.fst b/tests/fstar/misc/NoNestedBorrows.fst index ffcc32f3..c71f8dbb 100644 --- a/tests/fstar/misc/NoNestedBorrows.fst +++ b/tests/fstar/misc/NoNestedBorrows.fst @@ -131,12 +131,12 @@ let mix_arith_i32 (x : i32) (y : i32) (z : i32) : result i32 = (** [no_nested_borrows::CONST0] Source: 'src/no_nested_borrows.rs', lines 125:0-125:23 *) let const0_body : result usize = usize_add 1 1 -let const0_c : usize = eval_global const0_body +let const0 : usize = eval_global const0_body (** [no_nested_borrows::CONST1] Source: 'src/no_nested_borrows.rs', lines 126:0-126:23 *) let const1_body : result usize = usize_mul 2 2 -let const1_c : usize = eval_global const1_body +let const1 : usize = eval_global const1_body (** [no_nested_borrows::cast_u32_to_i32]: Source: 'src/no_nested_borrows.rs', lines 128:0-128:37 *) diff --git a/tests/fstar/traits/Traits.fst b/tests/fstar/traits/Traits.fst index 0760de2e..b4a4e7bc 100644 --- a/tests/fstar/traits/Traits.fst +++ b/tests/fstar/traits/Traits.fst @@ -9,14 +9,14 @@ open Primitives Source: 'src/traits.rs', lines 1:0-1:19 *) noeq type boolTrait_t (self : Type0) = { get_bool : self -> result bool; } -(** [traits::{bool}::get_bool]: +(** [traits::{(traits::BoolTrait for bool)}::get_bool]: Source: 'src/traits.rs', lines 12:4-12:30 *) -let bool_get_bool (self : bool) : result bool = +let boolTraitBool_get_bool (self : bool) : result bool = Return self -(** Trait implementation: [traits::{bool}] +(** Trait implementation: [traits::{(traits::BoolTrait for bool)}] Source: 'src/traits.rs', lines 11:0-11:23 *) -let traits_BoolTraitBoolInst : boolTrait_t bool = { get_bool = bool_get_bool; } +let boolTraitBool : boolTrait_t bool = { get_bool = boolTraitBool_get_bool; } (** [traits::BoolTrait::ret_true]: Source: 'src/traits.rs', lines 6:4-6:30 *) @@ -29,27 +29,27 @@ let boolTrait_ret_true (** [traits::test_bool_trait_bool]: Source: 'src/traits.rs', lines 17:0-17:44 *) let test_bool_trait_bool (x : bool) : result bool = - let* b = bool_get_bool x in - if b then boolTrait_ret_true traits_BoolTraitBoolInst x else Return false + let* b = boolTraitBool_get_bool x in + if b then boolTrait_ret_true boolTraitBool x else Return false -(** [traits::{core::option::Option<T>#1}::get_bool]: +(** [traits::{(traits::BoolTrait for core::option::Option<T>)#1}::get_bool]: Source: 'src/traits.rs', lines 23:4-23:30 *) -let option_get_bool (t : Type0) (self : option t) : result bool = +let boolTraitcoreoptionOptionT_get_bool + (t : Type0) (self : option t) : result bool = begin match self with | None -> Return false | Some _ -> Return true end -(** Trait implementation: [traits::{core::option::Option<T>#1}] +(** Trait implementation: [traits::{(traits::BoolTrait for core::option::Option<T>)#1}] Source: 'src/traits.rs', lines 22:0-22:31 *) -let traits_BoolTraitcoreoptionOptionTInst (t : Type0) : boolTrait_t (option t) - = { - get_bool = option_get_bool t; +let boolTraitcoreoptionOptionT (t : Type0) : boolTrait_t (option t) = { + get_bool = boolTraitcoreoptionOptionT_get_bool t; } (** [traits::test_bool_trait_option]: Source: 'src/traits.rs', lines 31:0-31:54 *) let test_bool_trait_option (t : Type0) (x : option t) : result bool = - let* b = option_get_bool t x in + let* b = boolTraitcoreoptionOptionT_get_bool t x in if b - then boolTrait_ret_true (traits_BoolTraitcoreoptionOptionTInst t) x + then boolTrait_ret_true (boolTraitcoreoptionOptionT t) x else Return false (** [traits::test_bool_trait]: @@ -62,86 +62,85 @@ let test_bool_trait Source: 'src/traits.rs', lines 39:0-39:15 *) noeq type toU64_t (self : Type0) = { to_u64 : self -> result u64; } -(** [traits::{u64#2}::to_u64]: +(** [traits::{(traits::ToU64 for u64)#2}::to_u64]: Source: 'src/traits.rs', lines 44:4-44:26 *) -let u64_to_u64 (self : u64) : result u64 = +let toU64U64_to_u64 (self : u64) : result u64 = Return self -(** Trait implementation: [traits::{u64#2}] +(** Trait implementation: [traits::{(traits::ToU64 for u64)#2}] Source: 'src/traits.rs', lines 43:0-43:18 *) -let traits_ToU64U64Inst : toU64_t u64 = { to_u64 = u64_to_u64; } +let toU64U64 : toU64_t u64 = { to_u64 = toU64U64_to_u64; } -(** [traits::{(A, A)#3}::to_u64]: +(** [traits::{(traits::ToU64 for (A, A))#3}::to_u64]: Source: 'src/traits.rs', lines 50:4-50:26 *) -let pair_to_u64 +let toU64Pair_to_u64 (a : Type0) (toU64AInst : toU64_t a) (self : (a & a)) : result u64 = let (x, x1) = self in let* i = toU64AInst.to_u64 x in let* i1 = toU64AInst.to_u64 x1 in u64_add i i1 -(** Trait implementation: [traits::{(A, A)#3}] +(** Trait implementation: [traits::{(traits::ToU64 for (A, A))#3}] Source: 'src/traits.rs', lines 49:0-49:31 *) -let traits_ToU64TupleAAInst (a : Type0) (toU64AInst : toU64_t a) : toU64_t (a & - a) = { - to_u64 = pair_to_u64 a toU64AInst; +let toU64Pair (a : Type0) (toU64AInst : toU64_t a) : toU64_t (a & a) = { + to_u64 = toU64Pair_to_u64 a toU64AInst; } (** [traits::f]: Source: 'src/traits.rs', lines 55:0-55:36 *) let f (t : Type0) (toU64TInst : toU64_t t) (x : (t & t)) : result u64 = - pair_to_u64 t toU64TInst x + toU64Pair_to_u64 t toU64TInst x (** [traits::g]: Source: 'src/traits.rs', lines 59:0-61:18 *) let g - (t : Type0) (toU64TupleTTInst : toU64_t (t & t)) (x : (t & t)) : result u64 = - toU64TupleTTInst.to_u64 x + (t : Type0) (toU64PairInst : toU64_t (t & t)) (x : (t & t)) : result u64 = + toU64PairInst.to_u64 x (** [traits::h0]: Source: 'src/traits.rs', lines 66:0-66:24 *) let h0 (x : u64) : result u64 = - u64_to_u64 x + toU64U64_to_u64 x (** [traits::Wrapper] Source: 'src/traits.rs', lines 70:0-70:21 *) type wrapper_t (t : Type0) = { x : t; } -(** [traits::{traits::Wrapper<T>#4}::to_u64]: +(** [traits::{(traits::ToU64 for traits::Wrapper<T>)#4}::to_u64]: Source: 'src/traits.rs', lines 75:4-75:26 *) -let wrapper_to_u64 +let toU64traitsWrapperT_to_u64 (t : Type0) (toU64TInst : toU64_t t) (self : wrapper_t t) : result u64 = toU64TInst.to_u64 self.x -(** Trait implementation: [traits::{traits::Wrapper<T>#4}] +(** Trait implementation: [traits::{(traits::ToU64 for traits::Wrapper<T>)#4}] Source: 'src/traits.rs', lines 74:0-74:35 *) -let traits_ToU64traitsWrapperTInst (t : Type0) (toU64TInst : toU64_t t) : - toU64_t (wrapper_t t) = { - to_u64 = wrapper_to_u64 t toU64TInst; +let toU64traitsWrapperT (t : Type0) (toU64TInst : toU64_t t) : toU64_t + (wrapper_t t) = { + to_u64 = toU64traitsWrapperT_to_u64 t toU64TInst; } (** [traits::h1]: Source: 'src/traits.rs', lines 80:0-80:33 *) let h1 (x : wrapper_t u64) : result u64 = - wrapper_to_u64 u64 traits_ToU64U64Inst x + toU64traitsWrapperT_to_u64 u64 toU64U64 x (** [traits::h2]: Source: 'src/traits.rs', lines 84:0-84:41 *) let h2 (t : Type0) (toU64TInst : toU64_t t) (x : wrapper_t t) : result u64 = - wrapper_to_u64 t toU64TInst x + toU64traitsWrapperT_to_u64 t toU64TInst x (** Trait declaration: [traits::ToType] Source: 'src/traits.rs', lines 88:0-88:19 *) noeq type toType_t (self t : Type0) = { to_type : self -> result t; } -(** [traits::{u64#5}::to_type]: +(** [traits::{(traits::ToType<bool> for u64)#5}::to_type]: Source: 'src/traits.rs', lines 93:4-93:28 *) -let u64_to_type (self : u64) : result bool = +let toTypeU64Bool_to_type (self : u64) : result bool = Return (self > 0) -(** Trait implementation: [traits::{u64#5}] +(** Trait implementation: [traits::{(traits::ToType<bool> for u64)#5}] Source: 'src/traits.rs', lines 92:0-92:25 *) -let traits_ToTypeU64BoolInst : toType_t u64 bool = { to_type = u64_to_type; } +let toTypeU64Bool : toType_t u64 bool = { to_type = toTypeU64Bool_to_type; } (** Trait declaration: [traits::OfType] Source: 'src/traits.rs', lines 98:0-98:16 *) @@ -189,17 +188,17 @@ noeq type testType_test_TestTrait_t (self : Type0) = { test : self -> result bool; } -(** [traits::{traits::TestType<T>#6}::test::{traits::{traits::TestType<T>#6}::test::TestType1}::test]: +(** [traits::{traits::TestType<T>#6}::test::{(traits::{traits::TestType<T>#6}::test::TestTrait for traits::{traits::TestType<T>#6}::test::TestType1)}::test]: Source: 'src/traits.rs', lines 139:12-139:34 *) -let testType_test_TestType1_test +let testType_test_TestTraittraitsTestTypetestTestType1_test (self : testType_test_TestType1_t) : result bool = Return (self > 1) -(** Trait implementation: [traits::{traits::TestType<T>#6}::test::{traits::{traits::TestType<T>#6}::test::TestType1}] +(** Trait implementation: [traits::{traits::TestType<T>#6}::test::{(traits::{traits::TestType<T>#6}::test::TestTrait for traits::{traits::TestType<T>#6}::test::TestType1)}] Source: 'src/traits.rs', lines 138:8-138:36 *) -let traits_TestType_test_TestTraittraitstraitsTestTypeTtestTestType1Inst : +let testType_test_TestTraittraitsTestTypetestTestType1 : testType_test_TestTrait_t testType_test_TestType1_t = { - test = testType_test_TestType1_test; + test = testType_test_TestTraittraitsTestTypetestTestType1_test; } (** [traits::{traits::TestType<T>#6}::test]: @@ -209,31 +208,34 @@ let testType_test result bool = let* x1 = toU64TInst.to_u64 x in - if x1 > 0 then testType_test_TestType1_test 0 else Return false + if x1 > 0 + then testType_test_TestTraittraitsTestTypetestTestType1_test 0 + else Return false (** [traits::BoolWrapper] Source: 'src/traits.rs', lines 150:0-150:22 *) type boolWrapper_t = bool -(** [traits::{traits::BoolWrapper#7}::to_type]: +(** [traits::{(traits::ToType<T> for traits::BoolWrapper)#7}::to_type]: Source: 'src/traits.rs', lines 156:4-156:25 *) -let boolWrapper_to_type +let toTypetraitsBoolWrapperT_to_type (t : Type0) (toTypeBoolTInst : toType_t bool t) (self : boolWrapper_t) : result t = toTypeBoolTInst.to_type self -(** Trait implementation: [traits::{traits::BoolWrapper#7}] +(** Trait implementation: [traits::{(traits::ToType<T> for traits::BoolWrapper)#7}] Source: 'src/traits.rs', lines 152:0-152:33 *) -let traits_ToTypetraitsBoolWrapperTInst (t : Type0) (toTypeBoolTInst : toType_t - bool t) : toType_t boolWrapper_t t = { - to_type = boolWrapper_to_type t toTypeBoolTInst; +let toTypetraitsBoolWrapperT (t : Type0) (toTypeBoolTInst : toType_t bool t) : + toType_t boolWrapper_t t = { + to_type = toTypetraitsBoolWrapperT_to_type t toTypeBoolTInst; } (** [traits::WithConstTy::LEN2] Source: 'src/traits.rs', lines 164:4-164:21 *) -let with_const_ty_len2_body : result usize = Return 32 -let with_const_ty_len2_c : usize = eval_global with_const_ty_len2_body +let with_const_ty_len2_default_body : result usize = Return 32 +let with_const_ty_len2_default : usize = + eval_global with_const_ty_len2_default_body (** Trait declaration: [traits::WithConstTy] Source: 'src/traits.rs', lines 161:0-161:39 *) @@ -246,25 +248,26 @@ noeq type withConstTy_t (self : Type0) (len : usize) = { f : tW -> array u8 len -> result tW; } -(** [traits::{bool#8}::LEN1] +(** [traits::{(traits::WithConstTy<32: usize> for bool)#8}::LEN1] Source: 'src/traits.rs', lines 175:4-175:21 *) -let bool_len1_body : result usize = Return 12 -let bool_len1_c : usize = eval_global bool_len1_body +let with_const_ty_bool32_len1_body : result usize = Return 12 +let with_const_ty_bool32_len1 : usize = + eval_global with_const_ty_bool32_len1_body -(** [traits::{bool#8}::f]: +(** [traits::{(traits::WithConstTy<32: usize> for bool)#8}::f]: Source: 'src/traits.rs', lines 180:4-180:39 *) -let bool_f (i : u64) (a : array u8 32) : result u64 = +let withConstTyBool32_f (i : u64) (a : array u8 32) : result u64 = Return i -(** Trait implementation: [traits::{bool#8}] +(** Trait implementation: [traits::{(traits::WithConstTy<32: usize> for bool)#8}] Source: 'src/traits.rs', lines 174:0-174:29 *) -let traits_WithConstTyBool32Inst : withConstTy_t bool 32 = { - cLEN1 = bool_len1_c; - cLEN2 = with_const_ty_len2_c; +let withConstTyBool32 : withConstTy_t bool 32 = { + cLEN1 = with_const_ty_bool32_len1; + cLEN2 = with_const_ty_len2_default; tV = u8; tW = u64; - tW_clause_0 = traits_ToU64U64Inst; - f = bool_f; + tW_clause_0 = toU64U64; + f = withConstTyBool32_f; } (** [traits::use_with_const_ty1]: @@ -354,14 +357,14 @@ noeq type childTrait1_t (self : Type0) = { parentTrait1SelfInst : parentTrait1_t self; } -(** Trait implementation: [traits::{usize#9}] +(** Trait implementation: [traits::{(traits::ParentTrait1 for usize)#9}] Source: 'src/traits.rs', lines 224:0-224:27 *) -let traits_ParentTrait1UsizeInst : parentTrait1_t usize = () +let parentTrait1Usize : parentTrait1_t usize = () -(** Trait implementation: [traits::{usize#10}] +(** Trait implementation: [traits::{(traits::ChildTrait1 for usize)#10}] Source: 'src/traits.rs', lines 225:0-225:26 *) -let traits_ChildTrait1UsizeInst : childTrait1_t usize = { - parentTrait1SelfInst = traits_ParentTrait1UsizeInst; +let childTrait1Usize : childTrait1_t usize = { + parentTrait1SelfInst = parentTrait1Usize; } (** Trait declaration: [traits::Iterator] @@ -407,27 +410,27 @@ noeq type childTrait2_t (self : Type0) = { parentTrait2SelfInst.tU_clause_0.tTarget; } -(** Trait implementation: [traits::{u32#11}] +(** Trait implementation: [traits::{(traits::WithTarget for u32)#11}] Source: 'src/traits.rs', lines 264:0-264:23 *) -let traits_WithTargetU32Inst : withTarget_t u32 = { tTarget = u32; } +let withTargetU32 : withTarget_t u32 = { tTarget = u32; } -(** Trait implementation: [traits::{u32#12}] +(** Trait implementation: [traits::{(traits::ParentTrait2 for u32)#12}] Source: 'src/traits.rs', lines 268:0-268:25 *) -let traits_ParentTrait2U32Inst : parentTrait2_t u32 = { +let parentTrait2U32 : parentTrait2_t u32 = { tU = u32; - tU_clause_0 = traits_WithTargetU32Inst; + tU_clause_0 = withTargetU32; } -(** [traits::{u32#13}::convert]: +(** [traits::{(traits::ChildTrait2 for u32)#13}::convert]: Source: 'src/traits.rs', lines 273:4-273:29 *) -let u32_convert (x : u32) : result u32 = +let childTrait2U32_convert (x : u32) : result u32 = Return x -(** Trait implementation: [traits::{u32#13}] +(** Trait implementation: [traits::{(traits::ChildTrait2 for u32)#13}] Source: 'src/traits.rs', lines 272:0-272:24 *) -let traits_ChildTrait2U32Inst : childTrait2_t u32 = { - parentTrait2SelfInst = traits_ParentTrait2U32Inst; - convert = u32_convert; +let childTrait2U32 : childTrait2_t u32 = { + parentTrait2SelfInst = parentTrait2U32; + convert = childTrait2U32_convert; } (** Trait declaration: [traits::CFnOnce] diff --git a/tests/lean/Arrays.lean b/tests/lean/Arrays.lean index 59458393..d637ee13 100644 --- a/tests/lean/Arrays.lean +++ b/tests/lean/Arrays.lean @@ -451,8 +451,8 @@ def f3 : Result U32 := /- [arrays::SZ] Source: 'src/arrays.rs', lines 286:0-286:19 -/ -def sz_body : Result Usize := Result.ret 32#usize -def sz_c : Usize := eval_global sz_body +def SZ_body : Result Usize := Result.ret 32#usize +def SZ : Usize := eval_global SZ_body /- [arrays::f5]: Source: 'src/arrays.rs', lines 289:0-289:31 -/ diff --git a/tests/lean/Constants.lean b/tests/lean/Constants.lean index 32e0317b..7949a25c 100644 --- a/tests/lean/Constants.lean +++ b/tests/lean/Constants.lean @@ -7,18 +7,18 @@ namespace constants /- [constants::X0] Source: 'src/constants.rs', lines 5:0-5:17 -/ -def x0_body : Result U32 := Result.ret 0#u32 -def x0_c : U32 := eval_global x0_body +def X0_body : Result U32 := Result.ret 0#u32 +def X0 : U32 := eval_global X0_body /- [constants::X1] Source: 'src/constants.rs', lines 7:0-7:17 -/ -def x1_body : Result U32 := Result.ret core_u32_max -def x1_c : U32 := eval_global x1_body +def X1_body : Result U32 := Result.ret core_u32_max +def X1 : U32 := eval_global X1_body /- [constants::X2] Source: 'src/constants.rs', lines 10:0-10:17 -/ -def x2_body : Result U32 := Result.ret 3#u32 -def x2_c : U32 := eval_global x2_body +def X2_body : Result U32 := Result.ret 3#u32 +def X2 : U32 := eval_global X2_body /- [constants::incr]: Source: 'src/constants.rs', lines 17:0-17:32 -/ @@ -27,8 +27,8 @@ def incr (n : U32) : Result U32 := /- [constants::X3] Source: 'src/constants.rs', lines 15:0-15:17 -/ -def x3_body : Result U32 := incr 32#u32 -def x3_c : U32 := eval_global x3_body +def X3_body : Result U32 := incr 32#u32 +def X3 : U32 := eval_global X3_body /- [constants::mk_pair0]: Source: 'src/constants.rs', lines 23:0-23:51 -/ @@ -48,23 +48,23 @@ def mk_pair1 (x : U32) (y : U32) : Result (Pair U32 U32) := /- [constants::P0] Source: 'src/constants.rs', lines 31:0-31:24 -/ -def p0_body : Result (U32 × U32) := mk_pair0 0#u32 1#u32 -def p0_c : (U32 × U32) := eval_global p0_body +def P0_body : Result (U32 × U32) := mk_pair0 0#u32 1#u32 +def P0 : (U32 × U32) := eval_global P0_body /- [constants::P1] Source: 'src/constants.rs', lines 32:0-32:28 -/ -def p1_body : Result (Pair U32 U32) := mk_pair1 0#u32 1#u32 -def p1_c : Pair U32 U32 := eval_global p1_body +def P1_body : Result (Pair U32 U32) := mk_pair1 0#u32 1#u32 +def P1 : Pair U32 U32 := eval_global P1_body /- [constants::P2] Source: 'src/constants.rs', lines 33:0-33:24 -/ -def p2_body : Result (U32 × U32) := Result.ret (0#u32, 1#u32) -def p2_c : (U32 × U32) := eval_global p2_body +def P2_body : Result (U32 × U32) := Result.ret (0#u32, 1#u32) +def P2 : (U32 × U32) := eval_global P2_body /- [constants::P3] Source: 'src/constants.rs', lines 34:0-34:28 -/ -def p3_body : Result (Pair U32 U32) := Result.ret { x := 0#u32, y := 1#u32 } -def p3_c : Pair U32 U32 := eval_global p3_body +def P3_body : Result (Pair U32 U32) := Result.ret { x := 0#u32, y := 1#u32 } +def P3 : Pair U32 U32 := eval_global P3_body /- [constants::Wrap] Source: 'src/constants.rs', lines 49:0-49:18 -/ @@ -78,28 +78,28 @@ def Wrap.new (T : Type) (value : T) : Result (Wrap T) := /- [constants::Y] Source: 'src/constants.rs', lines 41:0-41:22 -/ -def y_body : Result (Wrap I32) := Wrap.new I32 2#i32 -def y_c : Wrap I32 := eval_global y_body +def Y_body : Result (Wrap I32) := Wrap.new I32 2#i32 +def Y : Wrap I32 := eval_global Y_body /- [constants::unwrap_y]: Source: 'src/constants.rs', lines 43:0-43:30 -/ def unwrap_y : Result I32 := - Result.ret y_c.value + Result.ret Y.value /- [constants::YVAL] Source: 'src/constants.rs', lines 47:0-47:19 -/ -def yval_body : Result I32 := unwrap_y -def yval_c : I32 := eval_global yval_body +def YVAL_body : Result I32 := unwrap_y +def YVAL : I32 := eval_global YVAL_body /- [constants::get_z1::Z1] Source: 'src/constants.rs', lines 62:4-62:17 -/ -def get_z1_z1_body : Result I32 := Result.ret 3#i32 -def get_z1_z1_c : I32 := eval_global get_z1_z1_body +def get_z1.Z1_body : Result I32 := Result.ret 3#i32 +def get_z1.Z1 : I32 := eval_global get_z1.Z1_body /- [constants::get_z1]: Source: 'src/constants.rs', lines 61:0-61:28 -/ def get_z1 : Result I32 := - Result.ret get_z1_z1_c + Result.ret get_z1.Z1 /- [constants::add]: Source: 'src/constants.rs', lines 66:0-66:39 -/ @@ -108,45 +108,45 @@ def add (a : I32) (b : I32) : Result I32 := /- [constants::Q1] Source: 'src/constants.rs', lines 74:0-74:17 -/ -def q1_body : Result I32 := Result.ret 5#i32 -def q1_c : I32 := eval_global q1_body +def Q1_body : Result I32 := Result.ret 5#i32 +def Q1 : I32 := eval_global Q1_body /- [constants::Q2] Source: 'src/constants.rs', lines 75:0-75:17 -/ -def q2_body : Result I32 := Result.ret q1_c -def q2_c : I32 := eval_global q2_body +def Q2_body : Result I32 := Result.ret Q1 +def Q2 : I32 := eval_global Q2_body /- [constants::Q3] Source: 'src/constants.rs', lines 76:0-76:17 -/ -def q3_body : Result I32 := add q2_c 3#i32 -def q3_c : I32 := eval_global q3_body +def Q3_body : Result I32 := add Q2 3#i32 +def Q3 : I32 := eval_global Q3_body /- [constants::get_z2]: Source: 'src/constants.rs', lines 70:0-70:28 -/ def get_z2 : Result I32 := do let i ← get_z1 - let i1 ← add i q3_c - add q1_c i1 + let i1 ← add i Q3 + add Q1 i1 /- [constants::S1] Source: 'src/constants.rs', lines 80:0-80:18 -/ -def s1_body : Result U32 := Result.ret 6#u32 -def s1_c : U32 := eval_global s1_body +def S1_body : Result U32 := Result.ret 6#u32 +def S1 : U32 := eval_global S1_body /- [constants::S2] Source: 'src/constants.rs', lines 81:0-81:18 -/ -def s2_body : Result U32 := incr s1_c -def s2_c : U32 := eval_global s2_body +def S2_body : Result U32 := incr S1 +def S2 : U32 := eval_global S2_body /- [constants::S3] Source: 'src/constants.rs', lines 82:0-82:29 -/ -def s3_body : Result (Pair U32 U32) := Result.ret p3_c -def s3_c : Pair U32 U32 := eval_global s3_body +def S3_body : Result (Pair U32 U32) := Result.ret P3 +def S3 : Pair U32 U32 := eval_global S3_body /- [constants::S4] Source: 'src/constants.rs', lines 83:0-83:29 -/ -def s4_body : Result (Pair U32 U32) := mk_pair1 7#u32 8#u32 -def s4_c : Pair U32 U32 := eval_global s4_body +def S4_body : Result (Pair U32 U32) := mk_pair1 7#u32 8#u32 +def S4 : Pair U32 U32 := eval_global S4_body end constants diff --git a/tests/lean/Demo/Demo.lean b/tests/lean/Demo/Demo.lean index 01818585..b6a4a797 100644 --- a/tests/lean/Demo/Demo.lean +++ b/tests/lean/Demo/Demo.lean @@ -126,17 +126,17 @@ divergent def i32_id (i : I32) : Result I32 := structure Counter (Self : Type) where incr : Self → Result (Usize × Self) -/- [demo::{usize}::incr]: +/- [demo::{(demo::Counter for usize)}::incr]: Source: 'src/demo.rs', lines 88:4-88:31 -/ -def Usize.incr (self : Usize) : Result (Usize × Usize) := +def CounterUsize.incr (self : Usize) : Result (Usize × Usize) := do let self1 ← self + 1#usize Result.ret (self, self1) -/- Trait implementation: [demo::{usize}] +/- Trait implementation: [demo::{(demo::Counter for usize)}] Source: 'src/demo.rs', lines 87:0-87:22 -/ -def demo.CounterUsizeInst : Counter Usize := { - incr := Usize.incr +def CounterUsize : Counter Usize := { + incr := CounterUsize.incr } /- [demo::use_counter]: diff --git a/tests/lean/NoNestedBorrows.lean b/tests/lean/NoNestedBorrows.lean index a85209ea..2112e282 100644 --- a/tests/lean/NoNestedBorrows.lean +++ b/tests/lean/NoNestedBorrows.lean @@ -138,13 +138,13 @@ def mix_arith_i32 (x : I32) (y : I32) (z : I32) : Result I32 := /- [no_nested_borrows::CONST0] Source: 'src/no_nested_borrows.rs', lines 125:0-125:23 -/ -def const0_body : Result Usize := 1#usize + 1#usize -def const0_c : Usize := eval_global const0_body +def CONST0_body : Result Usize := 1#usize + 1#usize +def CONST0 : Usize := eval_global CONST0_body /- [no_nested_borrows::CONST1] Source: 'src/no_nested_borrows.rs', lines 126:0-126:23 -/ -def const1_body : Result Usize := 2#usize * 2#usize -def const1_c : Usize := eval_global const1_body +def CONST1_body : Result Usize := 2#usize * 2#usize +def CONST1 : Usize := eval_global CONST1_body /- [no_nested_borrows::cast_u32_to_i32]: Source: 'src/no_nested_borrows.rs', lines 128:0-128:37 -/ diff --git a/tests/lean/Traits.lean b/tests/lean/Traits.lean index f83fbc2f..d74a4dbe 100644 --- a/tests/lean/Traits.lean +++ b/tests/lean/Traits.lean @@ -10,15 +10,15 @@ namespace traits structure BoolTrait (Self : Type) where get_bool : Self → Result Bool -/- [traits::{bool}::get_bool]: +/- [traits::{(traits::BoolTrait for bool)}::get_bool]: Source: 'src/traits.rs', lines 12:4-12:30 -/ -def Bool.get_bool (self : Bool) : Result Bool := +def BoolTraitBool.get_bool (self : Bool) : Result Bool := Result.ret self -/- Trait implementation: [traits::{bool}] +/- Trait implementation: [traits::{(traits::BoolTrait for bool)}] Source: 'src/traits.rs', lines 11:0-11:23 -/ -def traits.BoolTraitBoolInst : BoolTrait Bool := { - get_bool := Bool.get_bool +def BoolTraitBool : BoolTrait Bool := { + get_bool := BoolTraitBool.get_bool } /- [traits::BoolTrait::ret_true]: @@ -31,32 +31,32 @@ def BoolTrait.ret_true Source: 'src/traits.rs', lines 17:0-17:44 -/ def test_bool_trait_bool (x : Bool) : Result Bool := do - let b ← Bool.get_bool x + let b ← BoolTraitBool.get_bool x if b - then BoolTrait.ret_true traits.BoolTraitBoolInst x + then BoolTrait.ret_true BoolTraitBool x else Result.ret false -/- [traits::{core::option::Option<T>#1}::get_bool]: +/- [traits::{(traits::BoolTrait for core::option::Option<T>)#1}::get_bool]: Source: 'src/traits.rs', lines 23:4-23:30 -/ -def Option.get_bool (T : Type) (self : Option T) : Result Bool := +def BoolTraitcoreoptionOptionT.get_bool + (T : Type) (self : Option T) : Result Bool := match self with | none => Result.ret false | some _ => Result.ret true -/- Trait implementation: [traits::{core::option::Option<T>#1}] +/- Trait implementation: [traits::{(traits::BoolTrait for core::option::Option<T>)#1}] Source: 'src/traits.rs', lines 22:0-22:31 -/ -def traits.BoolTraitcoreoptionOptionTInst (T : Type) : BoolTrait (Option T) - := { - get_bool := Option.get_bool T +def BoolTraitcoreoptionOptionT (T : Type) : BoolTrait (Option T) := { + get_bool := BoolTraitcoreoptionOptionT.get_bool T } /- [traits::test_bool_trait_option]: Source: 'src/traits.rs', lines 31:0-31:54 -/ def test_bool_trait_option (T : Type) (x : Option T) : Result Bool := do - let b ← Option.get_bool T x + let b ← BoolTraitcoreoptionOptionT.get_bool T x if b - then BoolTrait.ret_true (traits.BoolTraitcoreoptionOptionTInst T) x + then BoolTrait.ret_true (BoolTraitcoreoptionOptionT T) x else Result.ret false /- [traits::test_bool_trait]: @@ -70,20 +70,20 @@ def test_bool_trait structure ToU64 (Self : Type) where to_u64 : Self → Result U64 -/- [traits::{u64#2}::to_u64]: +/- [traits::{(traits::ToU64 for u64)#2}::to_u64]: Source: 'src/traits.rs', lines 44:4-44:26 -/ -def U64.to_u64 (self : U64) : Result U64 := +def ToU64U64.to_u64 (self : U64) : Result U64 := Result.ret self -/- Trait implementation: [traits::{u64#2}] +/- Trait implementation: [traits::{(traits::ToU64 for u64)#2}] Source: 'src/traits.rs', lines 43:0-43:18 -/ -def traits.ToU64U64Inst : ToU64 U64 := { - to_u64 := U64.to_u64 +def ToU64U64 : ToU64 U64 := { + to_u64 := ToU64U64.to_u64 } -/- [traits::{(A, A)#3}::to_u64]: +/- [traits::{(traits::ToU64 for (A, A))#3}::to_u64]: Source: 'src/traits.rs', lines 50:4-50:26 -/ -def Pair.to_u64 +def ToU64Pair.to_u64 (A : Type) (ToU64AInst : ToU64 A) (self : (A × A)) : Result U64 := do let (t, t1) := self @@ -91,71 +91,70 @@ def Pair.to_u64 let i1 ← ToU64AInst.to_u64 t1 i + i1 -/- Trait implementation: [traits::{(A, A)#3}] +/- Trait implementation: [traits::{(traits::ToU64 for (A, A))#3}] Source: 'src/traits.rs', lines 49:0-49:31 -/ -def traits.ToU64TupleAAInst (A : Type) (ToU64AInst : ToU64 A) : ToU64 (A × A) - := { - to_u64 := Pair.to_u64 A ToU64AInst +def ToU64Pair (A : Type) (ToU64AInst : ToU64 A) : ToU64 (A × A) := { + to_u64 := ToU64Pair.to_u64 A ToU64AInst } /- [traits::f]: Source: 'src/traits.rs', lines 55:0-55:36 -/ def f (T : Type) (ToU64TInst : ToU64 T) (x : (T × T)) : Result U64 := - Pair.to_u64 T ToU64TInst x + ToU64Pair.to_u64 T ToU64TInst x /- [traits::g]: Source: 'src/traits.rs', lines 59:0-61:18 -/ def g - (T : Type) (ToU64TupleTTInst : ToU64 (T × T)) (x : (T × T)) : Result U64 := - ToU64TupleTTInst.to_u64 x + (T : Type) (ToU64PairInst : ToU64 (T × T)) (x : (T × T)) : Result U64 := + ToU64PairInst.to_u64 x /- [traits::h0]: Source: 'src/traits.rs', lines 66:0-66:24 -/ def h0 (x : U64) : Result U64 := - U64.to_u64 x + ToU64U64.to_u64 x /- [traits::Wrapper] Source: 'src/traits.rs', lines 70:0-70:21 -/ structure Wrapper (T : Type) where x : T -/- [traits::{traits::Wrapper<T>#4}::to_u64]: +/- [traits::{(traits::ToU64 for traits::Wrapper<T>)#4}::to_u64]: Source: 'src/traits.rs', lines 75:4-75:26 -/ -def Wrapper.to_u64 +def ToU64traitsWrapperT.to_u64 (T : Type) (ToU64TInst : ToU64 T) (self : Wrapper T) : Result U64 := ToU64TInst.to_u64 self.x -/- Trait implementation: [traits::{traits::Wrapper<T>#4}] +/- Trait implementation: [traits::{(traits::ToU64 for traits::Wrapper<T>)#4}] Source: 'src/traits.rs', lines 74:0-74:35 -/ -def traits.ToU64traitsWrapperTInst (T : Type) (ToU64TInst : ToU64 T) : ToU64 - (Wrapper T) := { - to_u64 := Wrapper.to_u64 T ToU64TInst +def ToU64traitsWrapperT (T : Type) (ToU64TInst : ToU64 T) : ToU64 (Wrapper T) + := { + to_u64 := ToU64traitsWrapperT.to_u64 T ToU64TInst } /- [traits::h1]: Source: 'src/traits.rs', lines 80:0-80:33 -/ def h1 (x : Wrapper U64) : Result U64 := - Wrapper.to_u64 U64 traits.ToU64U64Inst x + ToU64traitsWrapperT.to_u64 U64 ToU64U64 x /- [traits::h2]: Source: 'src/traits.rs', lines 84:0-84:41 -/ def h2 (T : Type) (ToU64TInst : ToU64 T) (x : Wrapper T) : Result U64 := - Wrapper.to_u64 T ToU64TInst x + ToU64traitsWrapperT.to_u64 T ToU64TInst x /- Trait declaration: [traits::ToType] Source: 'src/traits.rs', lines 88:0-88:19 -/ structure ToType (Self T : Type) where to_type : Self → Result T -/- [traits::{u64#5}::to_type]: +/- [traits::{(traits::ToType<bool> for u64)#5}::to_type]: Source: 'src/traits.rs', lines 93:4-93:28 -/ -def U64.to_type (self : U64) : Result Bool := +def ToTypeU64Bool.to_type (self : U64) : Result Bool := Result.ret (self > 0#u64) -/- Trait implementation: [traits::{u64#5}] +/- Trait implementation: [traits::{(traits::ToType<bool> for u64)#5}] Source: 'src/traits.rs', lines 92:0-92:25 -/ -def traits.ToTypeU64BoolInst : ToType U64 Bool := { - to_type := U64.to_type +def ToTypeU64Bool : ToType U64 Bool := { + to_type := ToTypeU64Bool.to_type } /- Trait declaration: [traits::OfType] @@ -201,17 +200,17 @@ def h4 structure TestType.test.TestTrait (Self : Type) where test : Self → Result Bool -/- [traits::{traits::TestType<T>#6}::test::{traits::{traits::TestType<T>#6}::test::TestType1}::test]: +/- [traits::{traits::TestType<T>#6}::test::{(traits::{traits::TestType<T>#6}::test::TestTrait for traits::{traits::TestType<T>#6}::test::TestType1)}::test]: Source: 'src/traits.rs', lines 139:12-139:34 -/ -def TestType.test.TestType1.test +def TestType.test.TestTraittraitsTestTypetestTestType1.test (self : TestType.test.TestType1) : Result Bool := Result.ret (self > 1#u64) -/- Trait implementation: [traits::{traits::TestType<T>#6}::test::{traits::{traits::TestType<T>#6}::test::TestType1}] +/- Trait implementation: [traits::{traits::TestType<T>#6}::test::{(traits::{traits::TestType<T>#6}::test::TestTrait for traits::{traits::TestType<T>#6}::test::TestType1)}] Source: 'src/traits.rs', lines 138:8-138:36 -/ -def traits.TestType.test.TestTraittraitstraitsTestTypeTtestTestType1Inst : +def TestType.test.TestTraittraitsTestTypetestTestType1 : TestType.test.TestTrait TestType.test.TestType1 := { - test := TestType.test.TestType1.test + test := TestType.test.TestTraittraitsTestTypetestTestType1.test } /- [traits::{traits::TestType<T>#6}::test]: @@ -223,32 +222,33 @@ def TestType.test do let x1 ← ToU64TInst.to_u64 x if x1 > 0#u64 - then TestType.test.TestType1.test 0#u64 + then TestType.test.TestTraittraitsTestTypetestTestType1.test 0#u64 else Result.ret false /- [traits::BoolWrapper] Source: 'src/traits.rs', lines 150:0-150:22 -/ @[reducible] def BoolWrapper := Bool -/- [traits::{traits::BoolWrapper#7}::to_type]: +/- [traits::{(traits::ToType<T> for traits::BoolWrapper)#7}::to_type]: Source: 'src/traits.rs', lines 156:4-156:25 -/ -def BoolWrapper.to_type +def ToTypetraitsBoolWrapperT.to_type (T : Type) (ToTypeBoolTInst : ToType Bool T) (self : BoolWrapper) : Result T := ToTypeBoolTInst.to_type self -/- Trait implementation: [traits::{traits::BoolWrapper#7}] +/- Trait implementation: [traits::{(traits::ToType<T> for traits::BoolWrapper)#7}] Source: 'src/traits.rs', lines 152:0-152:33 -/ -def traits.ToTypetraitsBoolWrapperTInst (T : Type) (ToTypeBoolTInst : ToType - Bool T) : ToType BoolWrapper T := { - to_type := BoolWrapper.to_type T ToTypeBoolTInst +def ToTypetraitsBoolWrapperT (T : Type) (ToTypeBoolTInst : ToType Bool T) : + ToType BoolWrapper T := { + to_type := ToTypetraitsBoolWrapperT.to_type T ToTypeBoolTInst } /- [traits::WithConstTy::LEN2] Source: 'src/traits.rs', lines 164:4-164:21 -/ -def with_const_ty_len2_body : Result Usize := Result.ret 32#usize -def with_const_ty_len2_c : Usize := eval_global with_const_ty_len2_body +def WithConstTy.LEN2_default_body : Result Usize := Result.ret 32#usize +def WithConstTy.LEN2_default : Usize := + eval_global WithConstTy.LEN2_default_body /- Trait declaration: [traits::WithConstTy] Source: 'src/traits.rs', lines 161:0-161:39 -/ @@ -260,25 +260,25 @@ structure WithConstTy (Self : Type) (LEN : Usize) where W_clause_0 : ToU64 W f : W → Array U8 LEN → Result W -/- [traits::{bool#8}::LEN1] +/- [traits::{(traits::WithConstTy<32: usize> for bool)#8}::LEN1] Source: 'src/traits.rs', lines 175:4-175:21 -/ -def bool_len1_body : Result Usize := Result.ret 12#usize -def bool_len1_c : Usize := eval_global bool_len1_body +def WithConstTyBool32.LEN1_body : Result Usize := Result.ret 12#usize +def WithConstTyBool32.LEN1 : Usize := eval_global WithConstTyBool32.LEN1_body -/- [traits::{bool#8}::f]: +/- [traits::{(traits::WithConstTy<32: usize> for bool)#8}::f]: Source: 'src/traits.rs', lines 180:4-180:39 -/ -def Bool.f (i : U64) (a : Array U8 32#usize) : Result U64 := +def WithConstTyBool32.f (i : U64) (a : Array U8 32#usize) : Result U64 := Result.ret i -/- Trait implementation: [traits::{bool#8}] +/- Trait implementation: [traits::{(traits::WithConstTy<32: usize> for bool)#8}] Source: 'src/traits.rs', lines 174:0-174:29 -/ -def traits.WithConstTyBool32Inst : WithConstTy Bool 32#usize := { - LEN1 := bool_len1_c - LEN2 := with_const_ty_len2_c +def WithConstTyBool32 : WithConstTy Bool 32#usize := { + LEN1 := WithConstTyBool32.LEN1 + LEN2 := WithConstTy.LEN2_default V := U8 W := U64 - W_clause_0 := traits.ToU64U64Inst - f := Bool.f + W_clause_0 := ToU64U64 + f := WithConstTyBool32.f } /- [traits::use_with_const_ty1]: @@ -365,15 +365,15 @@ def order1 structure ChildTrait1 (Self : Type) where ParentTrait1SelfInst : ParentTrait1 Self -/- Trait implementation: [traits::{usize#9}] +/- Trait implementation: [traits::{(traits::ParentTrait1 for usize)#9}] Source: 'src/traits.rs', lines 224:0-224:27 -/ -def traits.ParentTrait1UsizeInst : ParentTrait1 Usize := { +def ParentTrait1Usize : ParentTrait1 Usize := { } -/- Trait implementation: [traits::{usize#10}] +/- Trait implementation: [traits::{(traits::ChildTrait1 for usize)#10}] Source: 'src/traits.rs', lines 225:0-225:26 -/ -def traits.ChildTrait1UsizeInst : ChildTrait1 Usize := { - ParentTrait1SelfInst := traits.ParentTrait1UsizeInst +def ChildTrait1Usize : ChildTrait1 Usize := { + ParentTrait1SelfInst := ParentTrait1Usize } /- Trait declaration: [traits::Iterator] @@ -417,29 +417,29 @@ structure ChildTrait2 (Self : Type) where convert : ParentTrait2SelfInst.U → Result ParentTrait2SelfInst.U_clause_0.Target -/- Trait implementation: [traits::{u32#11}] +/- Trait implementation: [traits::{(traits::WithTarget for u32)#11}] Source: 'src/traits.rs', lines 264:0-264:23 -/ -def traits.WithTargetU32Inst : WithTarget U32 := { +def WithTargetU32 : WithTarget U32 := { Target := U32 } -/- Trait implementation: [traits::{u32#12}] +/- Trait implementation: [traits::{(traits::ParentTrait2 for u32)#12}] Source: 'src/traits.rs', lines 268:0-268:25 -/ -def traits.ParentTrait2U32Inst : ParentTrait2 U32 := { +def ParentTrait2U32 : ParentTrait2 U32 := { U := U32 - U_clause_0 := traits.WithTargetU32Inst + U_clause_0 := WithTargetU32 } -/- [traits::{u32#13}::convert]: +/- [traits::{(traits::ChildTrait2 for u32)#13}::convert]: Source: 'src/traits.rs', lines 273:4-273:29 -/ -def U32.convert (x : U32) : Result U32 := +def ChildTrait2U32.convert (x : U32) : Result U32 := Result.ret x -/- Trait implementation: [traits::{u32#13}] +/- Trait implementation: [traits::{(traits::ChildTrait2 for u32)#13}] Source: 'src/traits.rs', lines 272:0-272:24 -/ -def traits.ChildTrait2U32Inst : ChildTrait2 U32 := { - ParentTrait2SelfInst := traits.ParentTrait2U32Inst - convert := U32.convert +def ChildTrait2U32 : ChildTrait2 U32 := { + ParentTrait2SelfInst := ParentTrait2U32 + convert := ChildTrait2U32.convert } /- Trait declaration: [traits::CFnOnce] |