diff options
-rw-r--r-- | tests/coq/betree/BetreeMain_Funs.v | 14 | ||||
-rw-r--r-- | tests/coq/demo/Demo.v | 4 | ||||
-rw-r--r-- | tests/coq/traits/Traits.v | 143 | ||||
-rw-r--r-- | tests/fstar/betree/BetreeMain.Clauses.Template.fst | 2 | ||||
-rw-r--r-- | tests/fstar/betree/BetreeMain.Clauses.fst | 2 | ||||
-rw-r--r-- | tests/fstar/betree/BetreeMain.Funs.fst | 16 | ||||
-rw-r--r-- | tests/fstar/betree_back_stateful/BetreeMain.Clauses.Template.fst | 2 | ||||
-rw-r--r-- | tests/fstar/betree_back_stateful/BetreeMain.Clauses.fst | 2 | ||||
-rw-r--r-- | tests/fstar/betree_back_stateful/BetreeMain.Funs.fst | 16 | ||||
-rw-r--r-- | tests/fstar/demo/Demo.fst | 4 | ||||
-rw-r--r-- | tests/fstar/traits/Traits.fst | 127 | ||||
-rw-r--r-- | tests/lean/BetreeMain/Funs.lean | 14 | ||||
-rw-r--r-- | tests/lean/Demo/Demo.lean | 4 | ||||
-rw-r--r-- | tests/lean/Traits.lean | 121 |
14 files changed, 227 insertions, 244 deletions
diff --git a/tests/coq/betree/BetreeMain_Funs.v b/tests/coq/betree/BetreeMain_Funs.v index cefab0f4..3863a90f 100644 --- a/tests/coq/betree/BetreeMain_Funs.v +++ b/tests/coq/betree/BetreeMain_Funs.v @@ -159,7 +159,7 @@ Definition betree_List_hd (T : Type) (self : betree_List_t T) : result T := (** [betree_main::betree::{betree_main::betree::List<(u64, T)>#2}::head_has_key]: Source: 'src/betree.rs', lines 327:4-327:44 *) -Definition betree_ListTupleU64T_head_has_key +Definition betree_ListPairU64T_head_has_key (T : Type) (self : betree_List_t (u64 * T)) (key : u64) : result bool := match self with | Betree_List_Cons hd _ => let (i, _) := hd in Return (i s= key) @@ -169,7 +169,7 @@ Definition betree_ListTupleU64T_head_has_key (** [betree_main::betree::{betree_main::betree::List<(u64, T)>#2}::partition_at_pivot]: Source: 'src/betree.rs', lines 339:4-339:73 *) -Fixpoint betree_ListTupleU64T_partition_at_pivot +Fixpoint betree_ListPairU64T_partition_at_pivot (T : Type) (n : nat) (self : betree_List_t (u64 * T)) (pivot : u64) : result ((betree_List_t (u64 * T)) * (betree_List_t (u64 * T))) := @@ -182,7 +182,7 @@ Fixpoint betree_ListTupleU64T_partition_at_pivot if i s>= pivot then Return (Betree_List_Nil, Betree_List_Cons (i, t) tl) else ( - p <- betree_ListTupleU64T_partition_at_pivot T n1 tl pivot; + p <- betree_ListPairU64T_partition_at_pivot T n1 tl pivot; let (ls0, ls1) := p in Return (Betree_List_Cons (i, t) ls0, ls1)) | Betree_List_Nil => Return (Betree_List_Nil, Betree_List_Nil) @@ -286,7 +286,7 @@ Fixpoint betree_Node_apply_upserts match n with | O => Fail_ OutOfFuel | S n1 => - b <- betree_ListTupleU64T_head_has_key betree_Message_t msgs key; + b <- betree_ListPairU64T_head_has_key betree_Message_t msgs key; if b then ( p <- betree_List_pop_front (u64 * betree_Message_t) msgs; @@ -462,7 +462,7 @@ Definition betree_Node_apply_to_internal := p <- betree_Node_lookup_first_message_for_key n key msgs; let (msgs1, lookup_first_message_for_key_back) := p in - b <- betree_ListTupleU64T_head_has_key betree_Message_t msgs1 key; + b <- betree_ListPairU64T_head_has_key betree_Message_t msgs1 key; if b then match new_msg with @@ -570,7 +570,7 @@ Definition betree_Node_apply_to_leaf := p <- betree_Node_lookup_mut_in_bindings n key bindings; let (bindings1, lookup_mut_in_bindings_back) := p in - b <- betree_ListTupleU64T_head_has_key u64 bindings1 key; + b <- betree_ListPairU64T_head_has_key u64 bindings1 key; if b then ( p1 <- betree_List_pop_front (u64 * u64) bindings1; @@ -632,7 +632,7 @@ Fixpoint betree_Internal_flush | O => Fail_ OutOfFuel | S n1 => p <- - betree_ListTupleU64T_partition_at_pivot betree_Message_t n1 content + betree_ListPairU64T_partition_at_pivot betree_Message_t n1 content self.(betree_Internal_pivot); let (msgs_left, msgs_right) := p in len_left <- betree_List_len (u64 * betree_Message_t) n1 msgs_left; diff --git a/tests/coq/demo/Demo.v b/tests/coq/demo/Demo.v index 22a0a131..ec7ca29d 100644 --- a/tests/coq/demo/Demo.v +++ b/tests/coq/demo/Demo.v @@ -160,8 +160,8 @@ Definition CounterUsize : Counter_t usize := {| (** [demo::use_counter]: Source: 'src/demo.rs', lines 95:0-95:59 *) Definition use_counter - (T : Type) (counterTInst : Counter_t T) (cnt : T) : result (usize * T) := - counterTInst.(Counter_t_incr) cnt + (T : Type) (counterInst : Counter_t T) (cnt : T) : result (usize * T) := + counterInst.(Counter_t_incr) cnt . End Demo. diff --git a/tests/coq/traits/Traits.v b/tests/coq/traits/Traits.v index 70ebf483..a9cd7e91 100644 --- a/tests/coq/traits/Traits.v +++ b/tests/coq/traits/Traits.v @@ -44,31 +44,29 @@ Definition test_bool_trait_bool (x : bool) : result bool := (** [traits::{(traits::BoolTrait for core::option::Option<T>)#1}::get_bool]: Source: 'src/traits.rs', lines 23:4-23:30 *) -Definition boolTraitcoreoptionOptionT_get_bool +Definition boolTraitOption_get_bool (T : Type) (self : option T) : result bool := match self with | None => Return false | Some _ => Return true end . (** Trait implementation: [traits::{(traits::BoolTrait for core::option::Option<T>)#1}] Source: 'src/traits.rs', lines 22:0-22:31 *) -Definition BoolTraitcoreoptionOptionT (T : Type) : BoolTrait_t (option T) := {| - BoolTrait_t_get_bool := boolTraitcoreoptionOptionT_get_bool T; +Definition BoolTraitOption (T : Type) : BoolTrait_t (option T) := {| + BoolTrait_t_get_bool := boolTraitOption_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 <- boolTraitcoreoptionOptionT_get_bool T x; - if b - then boolTrait_ret_true (BoolTraitcoreoptionOptionT T) x - else Return false + b <- boolTraitOption_get_bool T x; + if b then boolTrait_ret_true (BoolTraitOption T) x else Return false . (** [traits::test_bool_trait]: Source: 'src/traits.rs', lines 35:0-35:50 *) Definition test_bool_trait - (T : Type) (boolTraitTInst : BoolTrait_t T) (x : T) : result bool := - boolTraitTInst.(BoolTrait_t_get_bool) x + (T : Type) (boolTraitInst : BoolTrait_t T) (x : T) : result bool := + boolTraitInst.(BoolTrait_t_get_bool) x . (** Trait declaration: [traits::ToU64] @@ -92,24 +90,23 @@ Definition ToU64U64 : ToU64_t u64 := {| ToU64_t_to_u64 := toU64U64_to_u64; |}. (** [traits::{(traits::ToU64 for (A, A))#3}::to_u64]: Source: 'src/traits.rs', lines 50:4-50:26 *) Definition toU64Pair_to_u64 - (A : Type) (toU64AInst : ToU64_t A) (self : (A * A)) : result u64 := + (A : Type) (toU64Inst : ToU64_t A) (self : (A * A)) : result u64 := let (t, t1) := self in - i <- toU64AInst.(ToU64_t_to_u64) t; - i1 <- toU64AInst.(ToU64_t_to_u64) t1; + i <- toU64Inst.(ToU64_t_to_u64) t; + i1 <- toU64Inst.(ToU64_t_to_u64) t1; u64_add i i1 . (** Trait implementation: [traits::{(traits::ToU64 for (A, A))#3}] Source: 'src/traits.rs', lines 49:0-49:31 *) -Definition ToU64Pair (A : Type) (toU64AInst : ToU64_t A) : ToU64_t (A * A) - := {| - ToU64_t_to_u64 := toU64Pair_to_u64 A toU64AInst; +Definition ToU64Pair (A : Type) (toU64Inst : ToU64_t A) : ToU64_t (A * A) := {| + ToU64_t_to_u64 := toU64Pair_to_u64 A toU64Inst; |}. (** [traits::f]: Source: 'src/traits.rs', lines 55:0-55:36 *) -Definition f (T : Type) (toU64TInst : ToU64_t T) (x : (T * T)) : result u64 := - toU64Pair_to_u64 T toU64TInst x +Definition f (T : Type) (toU64Inst : ToU64_t T) (x : (T * T)) : result u64 := + toU64Pair_to_u64 T toU64Inst x . (** [traits::g]: @@ -133,29 +130,29 @@ Arguments wrapper_x { _ }. (** [traits::{(traits::ToU64 for traits::Wrapper<T>)#4}::to_u64]: Source: 'src/traits.rs', lines 75:4-75:26 *) -Definition toU64traitsWrapperT_to_u64 - (T : Type) (toU64TInst : ToU64_t T) (self : Wrapper_t T) : result u64 := - toU64TInst.(ToU64_t_to_u64) self.(wrapper_x) +Definition toU64traitsWrapper_to_u64 + (T : Type) (toU64Inst : ToU64_t T) (self : Wrapper_t T) : result u64 := + toU64Inst.(ToU64_t_to_u64) self.(wrapper_x) . (** Trait implementation: [traits::{(traits::ToU64 for traits::Wrapper<T>)#4}] Source: 'src/traits.rs', lines 74:0-74:35 *) -Definition ToU64traitsWrapperT (T : Type) (toU64TInst : ToU64_t T) : ToU64_t +Definition ToU64traitsWrapper (T : Type) (toU64Inst : ToU64_t T) : ToU64_t (Wrapper_t T) := {| - ToU64_t_to_u64 := toU64traitsWrapperT_to_u64 T toU64TInst; + ToU64_t_to_u64 := toU64traitsWrapper_to_u64 T toU64Inst; |}. (** [traits::h1]: Source: 'src/traits.rs', lines 80:0-80:33 *) Definition h1 (x : Wrapper_t u64) : result u64 := - toU64traitsWrapperT_to_u64 u64 ToU64U64 x + toU64traitsWrapper_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 := - toU64traitsWrapperT_to_u64 T toU64TInst x + (T : Type) (toU64Inst : ToU64_t T) (x : Wrapper_t T) : result u64 := + toU64traitsWrapper_to_u64 T toU64Inst x . (** Trait declaration: [traits::ToType] @@ -182,8 +179,8 @@ Definition ToTypeU64Bool : ToType_t u64 bool := {| (** Trait declaration: [traits::OfType] Source: 'src/traits.rs', lines 98:0-98:16 *) Record OfType_t (Self : Type) := mkOfType_t { - OfType_t_of_type : forall (T : Type) (toTypeTSelfInst : ToType_t T Self), T - -> result Self; + OfType_t_of_type : forall (T : Type) (toTypeInst : ToType_t T Self), T -> + result Self; }. Arguments mkOfType_t { _ }. @@ -192,32 +189,32 @@ Arguments OfType_t_of_type { _ }. (** [traits::h3]: Source: 'src/traits.rs', lines 104:0-104:50 *) Definition h3 - (T1 T2 : Type) (ofTypeT1Inst : OfType_t T1) (toTypeT2T1Inst : ToType_t T2 T1) + (T1 T2 : Type) (ofTypeInst : OfType_t T1) (toTypeInst : ToType_t T2 T1) (y : T2) : result T1 := - ofTypeT1Inst.(OfType_t_of_type) T2 toTypeT2T1Inst y + ofTypeInst.(OfType_t_of_type) T2 toTypeInst y . (** Trait declaration: [traits::OfTypeBis] Source: 'src/traits.rs', lines 109:0-109:36 *) Record OfTypeBis_t (Self T : Type) := mkOfTypeBis_t { - OfTypeBis_tOfTypeBis_t_ToTypeTSelfInst : ToType_t T Self; + OfTypeBis_tOfTypeBis_t_ToTypeInst : ToType_t T Self; OfTypeBis_t_of_type : T -> result Self; }. Arguments mkOfTypeBis_t { _ _ }. -Arguments OfTypeBis_tOfTypeBis_t_ToTypeTSelfInst { _ _ }. +Arguments OfTypeBis_tOfTypeBis_t_ToTypeInst { _ _ }. Arguments OfTypeBis_t_of_type { _ _ }. (** [traits::h4]: Source: 'src/traits.rs', lines 118:0-118:57 *) Definition h4 - (T1 T2 : Type) (ofTypeBisT1T2Inst : OfTypeBis_t T1 T2) (toTypeT2T1Inst : - ToType_t T2 T1) (y : T2) : + (T1 T2 : Type) (ofTypeBisInst : OfTypeBis_t T1 T2) (toTypeInst : ToType_t T2 + T1) (y : T2) : result T1 := - ofTypeBisT1T2Inst.(OfTypeBis_t_of_type) y + ofTypeBisInst.(OfTypeBis_t_of_type) y . (** [traits::TestType] @@ -255,10 +252,10 @@ Definition TestType_test_TestTraittraitsTestTypetestTestType1 : (** [traits::{traits::TestType<T>#6}::test]: Source: 'src/traits.rs', lines 126:4-126:36 *) Definition testType_test - (T : Type) (toU64TInst : ToU64_t T) (self : TestType_t T) (x : T) : + (T : Type) (toU64Inst : ToU64_t T) (self : TestType_t T) (x : T) : result bool := - x1 <- toU64TInst.(ToU64_t_to_u64) x; + x1 <- toU64Inst.(ToU64_t_to_u64) x; if x1 s> 0%u64 then testType_test_TestTraittraitsTestTypetestTestType1_test 0%u64 else Return false @@ -339,17 +336,17 @@ Definition WithConstTyBool32 : WithConstTy_t bool 32%usize := {| (** [traits::use_with_const_ty1]: Source: 'src/traits.rs', lines 183:0-183:75 *) Definition use_with_const_ty1 - (H : Type) (LEN : usize) (withConstTyHLENInst : WithConstTy_t H LEN) : + (H : Type) (LEN : usize) (withConstTyInst : WithConstTy_t H LEN) : result usize := - Return withConstTyHLENInst.(WithConstTy_tWithConstTy_t_LEN1) + Return withConstTyInst.(WithConstTy_tWithConstTy_t_LEN1) . (** [traits::use_with_const_ty2]: Source: 'src/traits.rs', lines 187:0-187:73 *) Definition use_with_const_ty2 - (H : Type) (LEN : usize) (withConstTyHLENInst : WithConstTy_t H LEN) - (w : withConstTyHLENInst.(WithConstTy_tWithConstTy_t_W)) : + (H : Type) (LEN : usize) (withConstTyInst : WithConstTy_t H LEN) + (w : withConstTyInst.(WithConstTy_tWithConstTy_t_W)) : result unit := Return tt @@ -358,12 +355,11 @@ Definition use_with_const_ty2 (** [traits::use_with_const_ty3]: Source: 'src/traits.rs', lines 189:0-189:80 *) Definition use_with_const_ty3 - (H : Type) (LEN : usize) (withConstTyHLENInst : WithConstTy_t H LEN) - (x : withConstTyHLENInst.(WithConstTy_tWithConstTy_t_W)) : + (H : Type) (LEN : usize) (withConstTyInst : WithConstTy_t H LEN) + (x : withConstTyInst.(WithConstTy_tWithConstTy_t_W)) : result u64 := - withConstTyHLENInst.(WithConstTy_tWithConstTy_t_W_clause_0).(ToU64_t_to_u64) - x + withConstTyInst.(WithConstTy_tWithConstTy_t_W_clause_0).(ToU64_t_to_u64) x . (** [traits::test_where1]: @@ -402,37 +398,37 @@ Arguments mkParentTrait1_t { _ }. (** Trait declaration: [traits::ChildTrait] Source: 'src/traits.rs', lines 206:0-206:49 *) Record ChildTrait_t (Self : Type) := mkChildTrait_t { - ChildTrait_tChildTrait_t_ParentTrait0SelfInst : ParentTrait0_t Self; - ChildTrait_tChildTrait_t_ParentTrait1SelfInst : ParentTrait1_t Self; + ChildTrait_tChildTrait_t_ParentTrait0Inst : ParentTrait0_t Self; + ChildTrait_tChildTrait_t_ParentTrait1Inst : ParentTrait1_t Self; }. Arguments mkChildTrait_t { _ }. -Arguments ChildTrait_tChildTrait_t_ParentTrait0SelfInst { _ }. -Arguments ChildTrait_tChildTrait_t_ParentTrait1SelfInst { _ }. +Arguments ChildTrait_tChildTrait_t_ParentTrait0Inst { _ }. +Arguments ChildTrait_tChildTrait_t_ParentTrait1Inst { _ }. (** [traits::test_child_trait1]: Source: 'src/traits.rs', lines 209:0-209:56 *) Definition test_child_trait1 - (T : Type) (childTraitTInst : ChildTrait_t T) (x : T) : result string := - childTraitTInst.(ChildTrait_tChildTrait_t_ParentTrait0SelfInst).(ParentTrait0_t_get_name) + (T : Type) (childTraitInst : ChildTrait_t T) (x : T) : result string := + childTraitInst.(ChildTrait_tChildTrait_t_ParentTrait0Inst).(ParentTrait0_t_get_name) x . (** [traits::test_child_trait2]: Source: 'src/traits.rs', lines 213:0-213:54 *) Definition test_child_trait2 - (T : Type) (childTraitTInst : ChildTrait_t T) (x : T) : + (T : Type) (childTraitInst : ChildTrait_t T) (x : T) : result - childTraitTInst.(ChildTrait_tChildTrait_t_ParentTrait0SelfInst).(ParentTrait0_tParentTrait0_t_W) + childTraitInst.(ChildTrait_tChildTrait_t_ParentTrait0Inst).(ParentTrait0_tParentTrait0_t_W) := - childTraitTInst.(ChildTrait_tChildTrait_t_ParentTrait0SelfInst).(ParentTrait0_t_get_w) + childTraitInst.(ChildTrait_tChildTrait_t_ParentTrait0Inst).(ParentTrait0_t_get_w) x . (** [traits::order1]: Source: 'src/traits.rs', lines 219:0-219:59 *) Definition order1 - (T U : Type) (parentTrait0TInst : ParentTrait0_t T) (parentTrait0UInst : + (T U : Type) (parentTrait0Inst : ParentTrait0_t T) (parentTrait0Inst1 : ParentTrait0_t U) : result unit := @@ -442,11 +438,11 @@ Definition order1 (** Trait declaration: [traits::ChildTrait1] Source: 'src/traits.rs', lines 222:0-222:35 *) Record ChildTrait1_t (Self : Type) := mkChildTrait1_t { - ChildTrait1_tChildTrait1_t_ParentTrait1SelfInst : ParentTrait1_t Self; + ChildTrait1_tChildTrait1_t_ParentTrait1Inst : ParentTrait1_t Self; }. Arguments mkChildTrait1_t { _ }. -Arguments ChildTrait1_tChildTrait1_t_ParentTrait1SelfInst { _ }. +Arguments ChildTrait1_tChildTrait1_t_ParentTrait1Inst { _ }. (** Trait implementation: [traits::{(traits::ParentTrait1 for usize)#9}] Source: 'src/traits.rs', lines 224:0-224:27 *) @@ -455,7 +451,7 @@ Definition ParentTrait1Usize : ParentTrait1_t usize := mkParentTrait1_t. (** Trait implementation: [traits::{(traits::ChildTrait1 for usize)#10}] Source: 'src/traits.rs', lines 225:0-225:26 *) Definition ChildTrait1Usize : ChildTrait1_t usize := {| - ChildTrait1_tChildTrait1_t_ParentTrait1SelfInst := ParentTrait1Usize; + ChildTrait1_tChildTrait1_t_ParentTrait1Inst := ParentTrait1Usize; |}. (** Trait declaration: [traits::Iterator] @@ -494,13 +490,13 @@ Arguments mkFromResidual_t { _ _ }. Source: 'src/traits.rs', lines 246:0-246:48 *) Record Try_t (Self : Type) := mkTry_t { Try_tTry_t_Residual : Type; - Try_tTry_t_FromResidualSelftraitsTrySelfResidualInst : FromResidual_t Self + Try_tTry_t_FromResidualSelftraitsTryResidualInst : FromResidual_t Self Try_tTry_t_Residual; }. Arguments mkTry_t { _ }. Arguments Try_tTry_t_Residual { _ }. -Arguments Try_tTry_t_FromResidualSelftraitsTrySelfResidualInst { _ }. +Arguments Try_tTry_t_FromResidualSelftraitsTryResidualInst { _ }. (** Trait declaration: [traits::WithTarget] Source: 'src/traits.rs', lines 252:0-252:20 *) @@ -526,15 +522,15 @@ Arguments ParentTrait2_tParentTrait2_t_U_clause_0 { _ }. (** Trait declaration: [traits::ChildTrait2] Source: 'src/traits.rs', lines 260:0-260:35 *) Record ChildTrait2_t (Self : Type) := mkChildTrait2_t { - ChildTrait2_tChildTrait2_t_ParentTrait2SelfInst : ParentTrait2_t Self; + ChildTrait2_tChildTrait2_t_ParentTrait2Inst : ParentTrait2_t Self; ChildTrait2_t_convert : - (ChildTrait2_tChildTrait2_t_ParentTrait2SelfInst).(ParentTrait2_tParentTrait2_t_U) + (ChildTrait2_tChildTrait2_t_ParentTrait2Inst).(ParentTrait2_tParentTrait2_t_U) -> result - (ChildTrait2_tChildTrait2_t_ParentTrait2SelfInst).(ParentTrait2_tParentTrait2_t_U_clause_0).(WithTarget_tWithTarget_t_Target); + (ChildTrait2_tChildTrait2_t_ParentTrait2Inst).(ParentTrait2_tParentTrait2_t_U_clause_0).(WithTarget_tWithTarget_t_Target); }. Arguments mkChildTrait2_t { _ }. -Arguments ChildTrait2_tChildTrait2_t_ParentTrait2SelfInst { _ }. +Arguments ChildTrait2_tChildTrait2_t_ParentTrait2Inst { _ }. Arguments ChildTrait2_t_convert { _ }. (** Trait implementation: [traits::{(traits::WithTarget for u32)#11}] @@ -558,7 +554,7 @@ Definition childTrait2U32_convert (x : u32) : result u32 := (** Trait implementation: [traits::{(traits::ChildTrait2 for u32)#13}] Source: 'src/traits.rs', lines 272:0-272:24 *) Definition ChildTrait2U32 : ChildTrait2_t u32 := {| - ChildTrait2_tChildTrait2_t_ParentTrait2SelfInst := ParentTrait2U32; + ChildTrait2_tChildTrait2_t_ParentTrait2Inst := ParentTrait2U32; ChildTrait2_t_convert := childTrait2U32_convert; |}. @@ -576,26 +572,25 @@ Arguments CFnOnce_t_call_once { _ _ }. (** Trait declaration: [traits::CFnMut] Source: 'src/traits.rs', lines 292:0-292:37 *) Record CFnMut_t (Self Args : Type) := mkCFnMut_t { - CFnMut_tCFnMut_t_CFnOnceSelfArgsInst : CFnOnce_t Self Args; + CFnMut_tCFnMut_t_CFnOnceInst : CFnOnce_t Self Args; CFnMut_t_call_mut : Self -> Args -> result - ((CFnMut_tCFnMut_t_CFnOnceSelfArgsInst).(CFnOnce_tCFnOnce_t_Output) * - Self); + ((CFnMut_tCFnMut_t_CFnOnceInst).(CFnOnce_tCFnOnce_t_Output) * Self); }. Arguments mkCFnMut_t { _ _ }. -Arguments CFnMut_tCFnMut_t_CFnOnceSelfArgsInst { _ _ }. +Arguments CFnMut_tCFnMut_t_CFnOnceInst { _ _ }. Arguments CFnMut_t_call_mut { _ _ }. (** Trait declaration: [traits::CFn] Source: 'src/traits.rs', lines 296:0-296:33 *) Record CFn_t (Self Args : Type) := mkCFn_t { - CFn_tCFn_t_CFnMutSelfArgsInst : CFnMut_t Self Args; + CFn_tCFn_t_CFnMutInst : CFnMut_t Self Args; CFn_t_call : Self -> Args -> result - (CFn_tCFn_t_CFnMutSelfArgsInst).(CFnMut_tCFnMut_t_CFnOnceSelfArgsInst).(CFnOnce_tCFnOnce_t_Output); + (CFn_tCFn_t_CFnMutInst).(CFnMut_tCFnMut_t_CFnOnceInst).(CFnOnce_tCFnOnce_t_Output); }. Arguments mkCFn_t { _ _ }. -Arguments CFn_tCFn_t_CFnMutSelfArgsInst { _ _ }. +Arguments CFn_tCFn_t_CFnMutInst { _ _ }. Arguments CFn_t_call { _ _ }. (** Trait declaration: [traits::GetTrait] @@ -612,10 +607,10 @@ Arguments GetTrait_t_get_w { _ }. (** [traits::test_get_trait]: Source: 'src/traits.rs', lines 305:0-305:49 *) Definition test_get_trait - (T : Type) (getTraitTInst : GetTrait_t T) (x : T) : - result getTraitTInst.(GetTrait_tGetTrait_t_W) + (T : Type) (getTraitInst : GetTrait_t T) (x : T) : + result getTraitInst.(GetTrait_tGetTrait_t_W) := - getTraitTInst.(GetTrait_t_get_w) x + getTraitInst.(GetTrait_t_get_w) x . End Traits. diff --git a/tests/fstar/betree/BetreeMain.Clauses.Template.fst b/tests/fstar/betree/BetreeMain.Clauses.Template.fst index 537705c5..de56ba46 100644 --- a/tests/fstar/betree/BetreeMain.Clauses.Template.fst +++ b/tests/fstar/betree/BetreeMain.Clauses.Template.fst @@ -22,7 +22,7 @@ let betree_List_split_at_decreases (t : Type0) (self : betree_List_t t) (** [betree_main::betree::{betree_main::betree::List<(u64, T)>#2}::partition_at_pivot]: decreases clause Source: 'src/betree.rs', lines 339:4-339:73 *) unfold -let betree_ListTupleU64T_partition_at_pivot_decreases (t : Type0) +let betree_ListPairU64T_partition_at_pivot_decreases (t : Type0) (self : betree_List_t (u64 & t)) (pivot : u64) : nat = admit () diff --git a/tests/fstar/betree/BetreeMain.Clauses.fst b/tests/fstar/betree/BetreeMain.Clauses.fst index 21f953d1..ed5c5069 100644 --- a/tests/fstar/betree/BetreeMain.Clauses.fst +++ b/tests/fstar/betree/BetreeMain.Clauses.fst @@ -114,7 +114,7 @@ let betree_List_split_at_decreases (t : Type0) (self : betree_List_t t) (** [betree_main::betree::List::{2}::partition_at_pivot]: decreases clause *) unfold -let betree_ListTupleU64T_partition_at_pivot_decreases (t : Type0) +let betree_ListPairU64T_partition_at_pivot_decreases (t : Type0) (self : betree_List_t (u64 & t)) (pivot : u64) : betree_List_t (u64 & t) = self diff --git a/tests/fstar/betree/BetreeMain.Funs.fst b/tests/fstar/betree/BetreeMain.Funs.fst index 196f120c..ec042fb3 100644 --- a/tests/fstar/betree/BetreeMain.Funs.fst +++ b/tests/fstar/betree/BetreeMain.Funs.fst @@ -134,7 +134,7 @@ let betree_List_hd (t : Type0) (self : betree_List_t t) : result t = (** [betree_main::betree::{betree_main::betree::List<(u64, T)>#2}::head_has_key]: Source: 'src/betree.rs', lines 327:4-327:44 *) -let betree_ListTupleU64T_head_has_key +let betree_ListPairU64T_head_has_key (t : Type0) (self : betree_List_t (u64 & t)) (key : u64) : result bool = begin match self with | Betree_List_Cons hd _ -> let (i, _) = hd in Return (i = key) @@ -143,10 +143,10 @@ let betree_ListTupleU64T_head_has_key (** [betree_main::betree::{betree_main::betree::List<(u64, T)>#2}::partition_at_pivot]: Source: 'src/betree.rs', lines 339:4-339:73 *) -let rec betree_ListTupleU64T_partition_at_pivot +let rec betree_ListPairU64T_partition_at_pivot (t : Type0) (self : betree_List_t (u64 & t)) (pivot : u64) : Tot (result ((betree_List_t (u64 & t)) & (betree_List_t (u64 & t)))) - (decreases (betree_ListTupleU64T_partition_at_pivot_decreases t self pivot)) + (decreases (betree_ListPairU64T_partition_at_pivot_decreases t self pivot)) = begin match self with | Betree_List_Cons hd tl -> @@ -154,7 +154,7 @@ let rec betree_ListTupleU64T_partition_at_pivot if i >= pivot then Return (Betree_List_Nil, Betree_List_Cons (i, x) tl) else - let* p = betree_ListTupleU64T_partition_at_pivot t tl pivot in + let* p = betree_ListPairU64T_partition_at_pivot t tl pivot in let (ls0, ls1) = p in Return (Betree_List_Cons (i, x) ls0, ls1) | Betree_List_Nil -> Return (Betree_List_Nil, Betree_List_Nil) @@ -228,7 +228,7 @@ let rec betree_Node_apply_upserts Tot (result (state & (u64 & (betree_List_t (u64 & betree_Message_t))))) (decreases (betree_Node_apply_upserts_decreases msgs prev key st)) = - let* b = betree_ListTupleU64T_head_has_key betree_Message_t msgs key in + let* b = betree_ListPairU64T_head_has_key betree_Message_t msgs key in if b then let* (msg, l) = betree_List_pop_front (u64 & betree_Message_t) msgs in @@ -369,7 +369,7 @@ let betree_Node_apply_to_internal = let* (msgs1, lookup_first_message_for_key_back) = betree_Node_lookup_first_message_for_key key msgs in - let* b = betree_ListTupleU64T_head_has_key betree_Message_t msgs1 key in + let* b = betree_ListPairU64T_head_has_key betree_Message_t msgs1 key in if b then begin match new_msg with @@ -467,7 +467,7 @@ let betree_Node_apply_to_leaf = let* (bindings1, lookup_mut_in_bindings_back) = betree_Node_lookup_mut_in_bindings key bindings in - let* b = betree_ListTupleU64T_head_has_key u64 bindings1 key in + let* b = betree_ListPairU64T_head_has_key u64 bindings1 key in if b then let* (hd, l) = betree_List_pop_front (u64 & u64) bindings1 in @@ -522,7 +522,7 @@ let rec betree_Internal_flush betree_Internal_flush_decreases self params node_id_cnt content st)) = let* p = - betree_ListTupleU64T_partition_at_pivot betree_Message_t content self.pivot + betree_ListPairU64T_partition_at_pivot betree_Message_t content self.pivot in let (msgs_left, msgs_right) = p in let* len_left = betree_List_len (u64 & betree_Message_t) msgs_left in diff --git a/tests/fstar/betree_back_stateful/BetreeMain.Clauses.Template.fst b/tests/fstar/betree_back_stateful/BetreeMain.Clauses.Template.fst index 537705c5..de56ba46 100644 --- a/tests/fstar/betree_back_stateful/BetreeMain.Clauses.Template.fst +++ b/tests/fstar/betree_back_stateful/BetreeMain.Clauses.Template.fst @@ -22,7 +22,7 @@ let betree_List_split_at_decreases (t : Type0) (self : betree_List_t t) (** [betree_main::betree::{betree_main::betree::List<(u64, T)>#2}::partition_at_pivot]: decreases clause Source: 'src/betree.rs', lines 339:4-339:73 *) unfold -let betree_ListTupleU64T_partition_at_pivot_decreases (t : Type0) +let betree_ListPairU64T_partition_at_pivot_decreases (t : Type0) (self : betree_List_t (u64 & t)) (pivot : u64) : nat = admit () diff --git a/tests/fstar/betree_back_stateful/BetreeMain.Clauses.fst b/tests/fstar/betree_back_stateful/BetreeMain.Clauses.fst index 21f953d1..ed5c5069 100644 --- a/tests/fstar/betree_back_stateful/BetreeMain.Clauses.fst +++ b/tests/fstar/betree_back_stateful/BetreeMain.Clauses.fst @@ -114,7 +114,7 @@ let betree_List_split_at_decreases (t : Type0) (self : betree_List_t t) (** [betree_main::betree::List::{2}::partition_at_pivot]: decreases clause *) unfold -let betree_ListTupleU64T_partition_at_pivot_decreases (t : Type0) +let betree_ListPairU64T_partition_at_pivot_decreases (t : Type0) (self : betree_List_t (u64 & t)) (pivot : u64) : betree_List_t (u64 & t) = self diff --git a/tests/fstar/betree_back_stateful/BetreeMain.Funs.fst b/tests/fstar/betree_back_stateful/BetreeMain.Funs.fst index 196f120c..ec042fb3 100644 --- a/tests/fstar/betree_back_stateful/BetreeMain.Funs.fst +++ b/tests/fstar/betree_back_stateful/BetreeMain.Funs.fst @@ -134,7 +134,7 @@ let betree_List_hd (t : Type0) (self : betree_List_t t) : result t = (** [betree_main::betree::{betree_main::betree::List<(u64, T)>#2}::head_has_key]: Source: 'src/betree.rs', lines 327:4-327:44 *) -let betree_ListTupleU64T_head_has_key +let betree_ListPairU64T_head_has_key (t : Type0) (self : betree_List_t (u64 & t)) (key : u64) : result bool = begin match self with | Betree_List_Cons hd _ -> let (i, _) = hd in Return (i = key) @@ -143,10 +143,10 @@ let betree_ListTupleU64T_head_has_key (** [betree_main::betree::{betree_main::betree::List<(u64, T)>#2}::partition_at_pivot]: Source: 'src/betree.rs', lines 339:4-339:73 *) -let rec betree_ListTupleU64T_partition_at_pivot +let rec betree_ListPairU64T_partition_at_pivot (t : Type0) (self : betree_List_t (u64 & t)) (pivot : u64) : Tot (result ((betree_List_t (u64 & t)) & (betree_List_t (u64 & t)))) - (decreases (betree_ListTupleU64T_partition_at_pivot_decreases t self pivot)) + (decreases (betree_ListPairU64T_partition_at_pivot_decreases t self pivot)) = begin match self with | Betree_List_Cons hd tl -> @@ -154,7 +154,7 @@ let rec betree_ListTupleU64T_partition_at_pivot if i >= pivot then Return (Betree_List_Nil, Betree_List_Cons (i, x) tl) else - let* p = betree_ListTupleU64T_partition_at_pivot t tl pivot in + let* p = betree_ListPairU64T_partition_at_pivot t tl pivot in let (ls0, ls1) = p in Return (Betree_List_Cons (i, x) ls0, ls1) | Betree_List_Nil -> Return (Betree_List_Nil, Betree_List_Nil) @@ -228,7 +228,7 @@ let rec betree_Node_apply_upserts Tot (result (state & (u64 & (betree_List_t (u64 & betree_Message_t))))) (decreases (betree_Node_apply_upserts_decreases msgs prev key st)) = - let* b = betree_ListTupleU64T_head_has_key betree_Message_t msgs key in + let* b = betree_ListPairU64T_head_has_key betree_Message_t msgs key in if b then let* (msg, l) = betree_List_pop_front (u64 & betree_Message_t) msgs in @@ -369,7 +369,7 @@ let betree_Node_apply_to_internal = let* (msgs1, lookup_first_message_for_key_back) = betree_Node_lookup_first_message_for_key key msgs in - let* b = betree_ListTupleU64T_head_has_key betree_Message_t msgs1 key in + let* b = betree_ListPairU64T_head_has_key betree_Message_t msgs1 key in if b then begin match new_msg with @@ -467,7 +467,7 @@ let betree_Node_apply_to_leaf = let* (bindings1, lookup_mut_in_bindings_back) = betree_Node_lookup_mut_in_bindings key bindings in - let* b = betree_ListTupleU64T_head_has_key u64 bindings1 key in + let* b = betree_ListPairU64T_head_has_key u64 bindings1 key in if b then let* (hd, l) = betree_List_pop_front (u64 & u64) bindings1 in @@ -522,7 +522,7 @@ let rec betree_Internal_flush betree_Internal_flush_decreases self params node_id_cnt content st)) = let* p = - betree_ListTupleU64T_partition_at_pivot betree_Message_t content self.pivot + betree_ListPairU64T_partition_at_pivot betree_Message_t content self.pivot in let (msgs_left, msgs_right) = p in let* len_left = betree_List_len (u64 & betree_Message_t) msgs_left in diff --git a/tests/fstar/demo/Demo.fst b/tests/fstar/demo/Demo.fst index 22322ee7..d13d2ba3 100644 --- a/tests/fstar/demo/Demo.fst +++ b/tests/fstar/demo/Demo.fst @@ -133,6 +133,6 @@ let counterUsize : counter_t usize = { incr = counterUsize_incr; } (** [demo::use_counter]: Source: 'src/demo.rs', lines 95:0-95:59 *) let use_counter - (t : Type0) (counterTInst : counter_t t) (cnt : t) : result (usize & t) = - counterTInst.incr cnt + (t : Type0) (counterInst : counter_t t) (cnt : t) : result (usize & t) = + counterInst.incr cnt diff --git a/tests/fstar/traits/Traits.fst b/tests/fstar/traits/Traits.fst index b4a4e7bc..466fb482 100644 --- a/tests/fstar/traits/Traits.fst +++ b/tests/fstar/traits/Traits.fst @@ -34,29 +34,26 @@ let test_bool_trait_bool (x : bool) : result bool = (** [traits::{(traits::BoolTrait for core::option::Option<T>)#1}::get_bool]: Source: 'src/traits.rs', lines 23:4-23:30 *) -let boolTraitcoreoptionOptionT_get_bool - (t : Type0) (self : option t) : result bool = +let boolTraitOption_get_bool (t : Type0) (self : option t) : result bool = begin match self with | None -> Return false | Some _ -> Return true end (** Trait implementation: [traits::{(traits::BoolTrait for core::option::Option<T>)#1}] Source: 'src/traits.rs', lines 22:0-22:31 *) -let boolTraitcoreoptionOptionT (t : Type0) : boolTrait_t (option t) = { - get_bool = boolTraitcoreoptionOptionT_get_bool t; +let boolTraitOption (t : Type0) : boolTrait_t (option t) = { + get_bool = boolTraitOption_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 = boolTraitcoreoptionOptionT_get_bool t x in - if b - then boolTrait_ret_true (boolTraitcoreoptionOptionT t) x - else Return false + let* b = boolTraitOption_get_bool t x in + if b then boolTrait_ret_true (boolTraitOption t) x else Return false (** [traits::test_bool_trait]: Source: 'src/traits.rs', lines 35:0-35:50 *) let test_bool_trait - (t : Type0) (boolTraitTInst : boolTrait_t t) (x : t) : result bool = - boolTraitTInst.get_bool x + (t : Type0) (boolTraitInst : boolTrait_t t) (x : t) : result bool = + boolTraitInst.get_bool x (** Trait declaration: [traits::ToU64] Source: 'src/traits.rs', lines 39:0-39:15 *) @@ -74,22 +71,22 @@ let toU64U64 : toU64_t u64 = { to_u64 = toU64U64_to_u64; } (** [traits::{(traits::ToU64 for (A, A))#3}::to_u64]: Source: 'src/traits.rs', lines 50:4-50:26 *) let toU64Pair_to_u64 - (a : Type0) (toU64AInst : toU64_t a) (self : (a & a)) : result u64 = + (a : Type0) (toU64Inst : 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 + let* i = toU64Inst.to_u64 x in + let* i1 = toU64Inst.to_u64 x1 in u64_add i i1 (** Trait implementation: [traits::{(traits::ToU64 for (A, A))#3}] Source: 'src/traits.rs', lines 49:0-49:31 *) -let toU64Pair (a : Type0) (toU64AInst : toU64_t a) : toU64_t (a & a) = { - to_u64 = toU64Pair_to_u64 a toU64AInst; +let toU64Pair (a : Type0) (toU64Inst : toU64_t a) : toU64_t (a & a) = { + to_u64 = toU64Pair_to_u64 a toU64Inst; } (** [traits::f]: Source: 'src/traits.rs', lines 55:0-55:36 *) -let f (t : Type0) (toU64TInst : toU64_t t) (x : (t & t)) : result u64 = - toU64Pair_to_u64 t toU64TInst x +let f (t : Type0) (toU64Inst : toU64_t t) (x : (t & t)) : result u64 = + toU64Pair_to_u64 t toU64Inst x (** [traits::g]: Source: 'src/traits.rs', lines 59:0-61:18 *) @@ -108,26 +105,26 @@ type wrapper_t (t : Type0) = { x : t; } (** [traits::{(traits::ToU64 for traits::Wrapper<T>)#4}::to_u64]: Source: 'src/traits.rs', lines 75:4-75:26 *) -let toU64traitsWrapperT_to_u64 - (t : Type0) (toU64TInst : toU64_t t) (self : wrapper_t t) : result u64 = - toU64TInst.to_u64 self.x +let toU64traitsWrapper_to_u64 + (t : Type0) (toU64Inst : toU64_t t) (self : wrapper_t t) : result u64 = + toU64Inst.to_u64 self.x (** Trait implementation: [traits::{(traits::ToU64 for traits::Wrapper<T>)#4}] Source: 'src/traits.rs', lines 74:0-74:35 *) -let toU64traitsWrapperT (t : Type0) (toU64TInst : toU64_t t) : toU64_t - (wrapper_t t) = { - to_u64 = toU64traitsWrapperT_to_u64 t toU64TInst; +let toU64traitsWrapper (t : Type0) (toU64Inst : toU64_t t) : toU64_t (wrapper_t + t) = { + to_u64 = toU64traitsWrapper_to_u64 t toU64Inst; } (** [traits::h1]: Source: 'src/traits.rs', lines 80:0-80:33 *) let h1 (x : wrapper_t u64) : result u64 = - toU64traitsWrapperT_to_u64 u64 toU64U64 x + toU64traitsWrapper_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 = - toU64traitsWrapperT_to_u64 t toU64TInst x +let h2 (t : Type0) (toU64Inst : toU64_t t) (x : wrapper_t t) : result u64 = + toU64traitsWrapper_to_u64 t toU64Inst x (** Trait declaration: [traits::ToType] Source: 'src/traits.rs', lines 88:0-88:19 *) @@ -145,34 +142,33 @@ let toTypeU64Bool : toType_t u64 bool = { to_type = toTypeU64Bool_to_type; } (** Trait declaration: [traits::OfType] Source: 'src/traits.rs', lines 98:0-98:16 *) noeq type ofType_t (self : Type0) = { - of_type : (t : Type0) -> (toTypeTSelfInst : toType_t t self) -> t -> result - self; + of_type : (t : Type0) -> (toTypeInst : toType_t t self) -> t -> result self; } (** [traits::h3]: Source: 'src/traits.rs', lines 104:0-104:50 *) let h3 - (t1 t2 : Type0) (ofTypeT1Inst : ofType_t t1) (toTypeT2T1Inst : toType_t t2 - t1) (y : t2) : + (t1 t2 : Type0) (ofTypeInst : ofType_t t1) (toTypeInst : toType_t t2 t1) + (y : t2) : result t1 = - ofTypeT1Inst.of_type t2 toTypeT2T1Inst y + ofTypeInst.of_type t2 toTypeInst y (** Trait declaration: [traits::OfTypeBis] Source: 'src/traits.rs', lines 109:0-109:36 *) noeq type ofTypeBis_t (self t : Type0) = { - toTypeTSelfInst : toType_t t self; + toTypeInst : toType_t t self; of_type : t -> result self; } (** [traits::h4]: Source: 'src/traits.rs', lines 118:0-118:57 *) let h4 - (t1 t2 : Type0) (ofTypeBisT1T2Inst : ofTypeBis_t t1 t2) (toTypeT2T1Inst : - toType_t t2 t1) (y : t2) : + (t1 t2 : Type0) (ofTypeBisInst : ofTypeBis_t t1 t2) (toTypeInst : toType_t t2 + t1) (y : t2) : result t1 = - ofTypeBisT1T2Inst.of_type y + ofTypeBisInst.of_type y (** [traits::TestType] Source: 'src/traits.rs', lines 122:0-122:22 *) @@ -204,10 +200,10 @@ let testType_test_TestTraittraitsTestTypetestTestType1 : (** [traits::{traits::TestType<T>#6}::test]: Source: 'src/traits.rs', lines 126:4-126:36 *) let testType_test - (t : Type0) (toU64TInst : toU64_t t) (self : testType_t t) (x : t) : + (t : Type0) (toU64Inst : toU64_t t) (self : testType_t t) (x : t) : result bool = - let* x1 = toU64TInst.to_u64 x in + let* x1 = toU64Inst.to_u64 x in if x1 > 0 then testType_test_TestTraittraitsTestTypetestTestType1_test 0 else Return false @@ -273,16 +269,16 @@ let withConstTyBool32 : withConstTy_t bool 32 = { (** [traits::use_with_const_ty1]: Source: 'src/traits.rs', lines 183:0-183:75 *) let use_with_const_ty1 - (h : Type0) (len : usize) (withConstTyHLENInst : withConstTy_t h len) : + (h : Type0) (len : usize) (withConstTyInst : withConstTy_t h len) : result usize = - Return withConstTyHLENInst.cLEN1 + Return withConstTyInst.cLEN1 (** [traits::use_with_const_ty2]: Source: 'src/traits.rs', lines 187:0-187:73 *) let use_with_const_ty2 - (h : Type0) (len : usize) (withConstTyHLENInst : withConstTy_t h len) - (w : withConstTyHLENInst.tW) : + (h : Type0) (len : usize) (withConstTyInst : withConstTy_t h len) + (w : withConstTyInst.tW) : result unit = Return () @@ -290,11 +286,11 @@ let use_with_const_ty2 (** [traits::use_with_const_ty3]: Source: 'src/traits.rs', lines 189:0-189:80 *) let use_with_const_ty3 - (h : Type0) (len : usize) (withConstTyHLENInst : withConstTy_t h len) - (x : withConstTyHLENInst.tW) : + (h : Type0) (len : usize) (withConstTyInst : withConstTy_t h len) + (x : withConstTyInst.tW) : result u64 = - withConstTyHLENInst.tW_clause_0.to_u64 x + withConstTyInst.tW_clause_0.to_u64 x (** [traits::test_where1]: Source: 'src/traits.rs', lines 193:0-193:40 *) @@ -324,28 +320,28 @@ type parentTrait1_t (self : Type0) = unit (** Trait declaration: [traits::ChildTrait] Source: 'src/traits.rs', lines 206:0-206:49 *) noeq type childTrait_t (self : Type0) = { - parentTrait0SelfInst : parentTrait0_t self; - parentTrait1SelfInst : parentTrait1_t self; + parentTrait0Inst : parentTrait0_t self; + parentTrait1Inst : parentTrait1_t self; } (** [traits::test_child_trait1]: Source: 'src/traits.rs', lines 209:0-209:56 *) let test_child_trait1 - (t : Type0) (childTraitTInst : childTrait_t t) (x : t) : result string = - childTraitTInst.parentTrait0SelfInst.get_name x + (t : Type0) (childTraitInst : childTrait_t t) (x : t) : result string = + childTraitInst.parentTrait0Inst.get_name x (** [traits::test_child_trait2]: Source: 'src/traits.rs', lines 213:0-213:54 *) let test_child_trait2 - (t : Type0) (childTraitTInst : childTrait_t t) (x : t) : - result childTraitTInst.parentTrait0SelfInst.tW + (t : Type0) (childTraitInst : childTrait_t t) (x : t) : + result childTraitInst.parentTrait0Inst.tW = - childTraitTInst.parentTrait0SelfInst.get_w x + childTraitInst.parentTrait0Inst.get_w x (** [traits::order1]: Source: 'src/traits.rs', lines 219:0-219:59 *) let order1 - (t u : Type0) (parentTrait0TInst : parentTrait0_t t) (parentTrait0UInst : + (t u : Type0) (parentTrait0Inst : parentTrait0_t t) (parentTrait0Inst1 : parentTrait0_t u) : result unit = @@ -354,7 +350,7 @@ let order1 (** Trait declaration: [traits::ChildTrait1] Source: 'src/traits.rs', lines 222:0-222:35 *) noeq type childTrait1_t (self : Type0) = { - parentTrait1SelfInst : parentTrait1_t self; + parentTrait1Inst : parentTrait1_t self; } (** Trait implementation: [traits::{(traits::ParentTrait1 for usize)#9}] @@ -364,7 +360,7 @@ let parentTrait1Usize : parentTrait1_t usize = () (** Trait implementation: [traits::{(traits::ChildTrait1 for usize)#10}] Source: 'src/traits.rs', lines 225:0-225:26 *) let childTrait1Usize : childTrait1_t usize = { - parentTrait1SelfInst = parentTrait1Usize; + parentTrait1Inst = parentTrait1Usize; } (** Trait declaration: [traits::Iterator] @@ -388,7 +384,7 @@ type fromResidual_t (self t : Type0) = unit Source: 'src/traits.rs', lines 246:0-246:48 *) noeq type try_t (self : Type0) = { tResidual : Type0; - fromResidualSelftraitsTrySelfResidualInst : fromResidual_t self tResidual; + fromResidualSelftraitsTryResidualInst : fromResidual_t self tResidual; } (** Trait declaration: [traits::WithTarget] @@ -405,9 +401,8 @@ noeq type parentTrait2_t (self : Type0) = { (** Trait declaration: [traits::ChildTrait2] Source: 'src/traits.rs', lines 260:0-260:35 *) noeq type childTrait2_t (self : Type0) = { - parentTrait2SelfInst : parentTrait2_t self; - convert : parentTrait2SelfInst.tU -> result - parentTrait2SelfInst.tU_clause_0.tTarget; + parentTrait2Inst : parentTrait2_t self; + convert : parentTrait2Inst.tU -> result parentTrait2Inst.tU_clause_0.tTarget; } (** Trait implementation: [traits::{(traits::WithTarget for u32)#11}] @@ -429,7 +424,7 @@ let childTrait2U32_convert (x : u32) : result u32 = (** Trait implementation: [traits::{(traits::ChildTrait2 for u32)#13}] Source: 'src/traits.rs', lines 272:0-272:24 *) let childTrait2U32 : childTrait2_t u32 = { - parentTrait2SelfInst = parentTrait2U32; + parentTrait2Inst = parentTrait2U32; convert = childTrait2U32_convert; } @@ -443,15 +438,15 @@ noeq type cFnOnce_t (self args : Type0) = { (** Trait declaration: [traits::CFnMut] Source: 'src/traits.rs', lines 292:0-292:37 *) noeq type cFnMut_t (self args : Type0) = { - cFnOnceSelfArgsInst : cFnOnce_t self args; - call_mut : self -> args -> result (cFnOnceSelfArgsInst.tOutput & self); + cFnOnceInst : cFnOnce_t self args; + call_mut : self -> args -> result (cFnOnceInst.tOutput & self); } (** Trait declaration: [traits::CFn] Source: 'src/traits.rs', lines 296:0-296:33 *) noeq type cFn_t (self args : Type0) = { - cFnMutSelfArgsInst : cFnMut_t self args; - call : self -> args -> result cFnMutSelfArgsInst.cFnOnceSelfArgsInst.tOutput; + cFnMutInst : cFnMut_t self args; + call : self -> args -> result cFnMutInst.cFnOnceInst.tOutput; } (** Trait declaration: [traits::GetTrait] @@ -462,8 +457,6 @@ noeq type getTrait_t (self : Type0) = { tW : Type0; get_w : self -> result tW; (** [traits::test_get_trait]: Source: 'src/traits.rs', lines 305:0-305:49 *) let test_get_trait - (t : Type0) (getTraitTInst : getTrait_t t) (x : t) : - result getTraitTInst.tW - = - getTraitTInst.get_w x + (t : Type0) (getTraitInst : getTrait_t t) (x : t) : result getTraitInst.tW = + getTraitInst.get_w x diff --git a/tests/lean/BetreeMain/Funs.lean b/tests/lean/BetreeMain/Funs.lean index 96daa197..d6449b37 100644 --- a/tests/lean/BetreeMain/Funs.lean +++ b/tests/lean/BetreeMain/Funs.lean @@ -135,7 +135,7 @@ def betree.List.hd (T : Type) (self : betree.List T) : Result T := /- [betree_main::betree::{betree_main::betree::List<(u64, T)>#2}::head_has_key]: Source: 'src/betree.rs', lines 327:4-327:44 -/ -def betree.ListTupleU64T.head_has_key +def betree.ListPairU64T.head_has_key (T : Type) (self : betree.List (U64 × T)) (key : U64) : Result Bool := match self with | betree.List.Cons hd _ => let (i, _) := hd @@ -144,7 +144,7 @@ def betree.ListTupleU64T.head_has_key /- [betree_main::betree::{betree_main::betree::List<(u64, T)>#2}::partition_at_pivot]: Source: 'src/betree.rs', lines 339:4-339:73 -/ -divergent def betree.ListTupleU64T.partition_at_pivot +divergent def betree.ListPairU64T.partition_at_pivot (T : Type) (self : betree.List (U64 × T)) (pivot : U64) : Result ((betree.List (U64 × T)) × (betree.List (U64 × T))) := @@ -155,7 +155,7 @@ divergent def betree.ListTupleU64T.partition_at_pivot then Result.ret (betree.List.Nil, betree.List.Cons (i, t) tl) else do - let p ← betree.ListTupleU64T.partition_at_pivot T tl pivot + let p ← betree.ListPairU64T.partition_at_pivot T tl pivot let (ls0, ls1) := p Result.ret (betree.List.Cons (i, t) ls0, ls1) | betree.List.Nil => Result.ret (betree.List.Nil, betree.List.Nil) @@ -227,7 +227,7 @@ divergent def betree.Node.apply_upserts Result (State × (U64 × (betree.List (U64 × betree.Message)))) := do - let b ← betree.ListTupleU64T.head_has_key betree.Message msgs key + let b ← betree.ListPairU64T.head_has_key betree.Message msgs key if b then do @@ -387,7 +387,7 @@ def betree.Node.apply_to_internal do let (msgs1, lookup_first_message_for_key_back) ← betree.Node.lookup_first_message_for_key key msgs - let b ← betree.ListTupleU64T.head_has_key betree.Message msgs1 key + let b ← betree.ListPairU64T.head_has_key betree.Message msgs1 key if b then match new_msg with @@ -490,7 +490,7 @@ def betree.Node.apply_to_leaf do let (bindings1, lookup_mut_in_bindings_back) ← betree.Node.lookup_mut_in_bindings key bindings - let b ← betree.ListTupleU64T.head_has_key U64 bindings1 key + let b ← betree.ListPairU64T.head_has_key U64 bindings1 key if b then do @@ -546,7 +546,7 @@ mutual divergent def betree.Internal.flush := do let ⟨ i, i1, n, n1 ⟩ := self - let p ← betree.ListTupleU64T.partition_at_pivot betree.Message content i1 + let p ← betree.ListPairU64T.partition_at_pivot betree.Message content i1 let (msgs_left, msgs_right) := p let len_left ← betree.List.len (U64 × betree.Message) msgs_left if len_left >= params.min_flush_size diff --git a/tests/lean/Demo/Demo.lean b/tests/lean/Demo/Demo.lean index b6a4a797..854b4853 100644 --- a/tests/lean/Demo/Demo.lean +++ b/tests/lean/Demo/Demo.lean @@ -142,7 +142,7 @@ def CounterUsize : Counter Usize := { /- [demo::use_counter]: Source: 'src/demo.rs', lines 95:0-95:59 -/ def use_counter - (T : Type) (CounterTInst : Counter T) (cnt : T) : Result (Usize × T) := - CounterTInst.incr cnt + (T : Type) (CounterInst : Counter T) (cnt : T) : Result (Usize × T) := + CounterInst.incr cnt end demo diff --git a/tests/lean/Traits.lean b/tests/lean/Traits.lean index d74a4dbe..26dac252 100644 --- a/tests/lean/Traits.lean +++ b/tests/lean/Traits.lean @@ -38,32 +38,31 @@ def test_bool_trait_bool (x : Bool) : Result Bool := /- [traits::{(traits::BoolTrait for core::option::Option<T>)#1}::get_bool]: Source: 'src/traits.rs', lines 23:4-23:30 -/ -def BoolTraitcoreoptionOptionT.get_bool - (T : Type) (self : Option T) : Result Bool := +def BoolTraitOption.get_bool (T : Type) (self : Option T) : Result Bool := match self with | none => Result.ret false | some _ => Result.ret true /- Trait implementation: [traits::{(traits::BoolTrait for core::option::Option<T>)#1}] Source: 'src/traits.rs', lines 22:0-22:31 -/ -def BoolTraitcoreoptionOptionT (T : Type) : BoolTrait (Option T) := { - get_bool := BoolTraitcoreoptionOptionT.get_bool T +def BoolTraitOption (T : Type) : BoolTrait (Option T) := { + get_bool := BoolTraitOption.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 ← BoolTraitcoreoptionOptionT.get_bool T x + let b ← BoolTraitOption.get_bool T x if b - then BoolTrait.ret_true (BoolTraitcoreoptionOptionT T) x + then BoolTrait.ret_true (BoolTraitOption T) x else Result.ret false /- [traits::test_bool_trait]: Source: 'src/traits.rs', lines 35:0-35:50 -/ def test_bool_trait - (T : Type) (BoolTraitTInst : BoolTrait T) (x : T) : Result Bool := - BoolTraitTInst.get_bool x + (T : Type) (BoolTraitInst : BoolTrait T) (x : T) : Result Bool := + BoolTraitInst.get_bool x /- Trait declaration: [traits::ToU64] Source: 'src/traits.rs', lines 39:0-39:15 -/ @@ -84,23 +83,23 @@ def ToU64U64 : ToU64 U64 := { /- [traits::{(traits::ToU64 for (A, A))#3}::to_u64]: Source: 'src/traits.rs', lines 50:4-50:26 -/ def ToU64Pair.to_u64 - (A : Type) (ToU64AInst : ToU64 A) (self : (A × A)) : Result U64 := + (A : Type) (ToU64Inst : ToU64 A) (self : (A × A)) : Result U64 := do let (t, t1) := self - let i ← ToU64AInst.to_u64 t - let i1 ← ToU64AInst.to_u64 t1 + let i ← ToU64Inst.to_u64 t + let i1 ← ToU64Inst.to_u64 t1 i + i1 /- Trait implementation: [traits::{(traits::ToU64 for (A, A))#3}] Source: 'src/traits.rs', lines 49:0-49:31 -/ -def ToU64Pair (A : Type) (ToU64AInst : ToU64 A) : ToU64 (A × A) := { - to_u64 := ToU64Pair.to_u64 A ToU64AInst +def ToU64Pair (A : Type) (ToU64Inst : ToU64 A) : ToU64 (A × A) := { + to_u64 := ToU64Pair.to_u64 A ToU64Inst } /- [traits::f]: Source: 'src/traits.rs', lines 55:0-55:36 -/ -def f (T : Type) (ToU64TInst : ToU64 T) (x : (T × T)) : Result U64 := - ToU64Pair.to_u64 T ToU64TInst x +def f (T : Type) (ToU64Inst : ToU64 T) (x : (T × T)) : Result U64 := + ToU64Pair.to_u64 T ToU64Inst x /- [traits::g]: Source: 'src/traits.rs', lines 59:0-61:18 -/ @@ -120,26 +119,26 @@ structure Wrapper (T : Type) where /- [traits::{(traits::ToU64 for traits::Wrapper<T>)#4}::to_u64]: Source: 'src/traits.rs', lines 75:4-75:26 -/ -def ToU64traitsWrapperT.to_u64 - (T : Type) (ToU64TInst : ToU64 T) (self : Wrapper T) : Result U64 := - ToU64TInst.to_u64 self.x +def ToU64traitsWrapper.to_u64 + (T : Type) (ToU64Inst : ToU64 T) (self : Wrapper T) : Result U64 := + ToU64Inst.to_u64 self.x /- Trait implementation: [traits::{(traits::ToU64 for traits::Wrapper<T>)#4}] Source: 'src/traits.rs', lines 74:0-74:35 -/ -def ToU64traitsWrapperT (T : Type) (ToU64TInst : ToU64 T) : ToU64 (Wrapper T) +def ToU64traitsWrapper (T : Type) (ToU64Inst : ToU64 T) : ToU64 (Wrapper T) := { - to_u64 := ToU64traitsWrapperT.to_u64 T ToU64TInst + to_u64 := ToU64traitsWrapper.to_u64 T ToU64Inst } /- [traits::h1]: Source: 'src/traits.rs', lines 80:0-80:33 -/ def h1 (x : Wrapper U64) : Result U64 := - ToU64traitsWrapperT.to_u64 U64 ToU64U64 x + ToU64traitsWrapper.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 := - ToU64traitsWrapperT.to_u64 T ToU64TInst x +def h2 (T : Type) (ToU64Inst : ToU64 T) (x : Wrapper T) : Result U64 := + ToU64traitsWrapper.to_u64 T ToU64Inst x /- Trait declaration: [traits::ToType] Source: 'src/traits.rs', lines 88:0-88:19 -/ @@ -160,32 +159,31 @@ def ToTypeU64Bool : ToType U64 Bool := { /- Trait declaration: [traits::OfType] Source: 'src/traits.rs', lines 98:0-98:16 -/ structure OfType (Self : Type) where - of_type : forall (T : Type) (ToTypeTSelfInst : ToType T Self), T → Result - Self + of_type : forall (T : Type) (ToTypeInst : ToType T Self), T → Result Self /- [traits::h3]: Source: 'src/traits.rs', lines 104:0-104:50 -/ def h3 - (T1 T2 : Type) (OfTypeT1Inst : OfType T1) (ToTypeT2T1Inst : ToType T2 T1) + (T1 T2 : Type) (OfTypeInst : OfType T1) (ToTypeInst : ToType T2 T1) (y : T2) : Result T1 := - OfTypeT1Inst.of_type T2 ToTypeT2T1Inst y + OfTypeInst.of_type T2 ToTypeInst y /- Trait declaration: [traits::OfTypeBis] Source: 'src/traits.rs', lines 109:0-109:36 -/ structure OfTypeBis (Self T : Type) where - ToTypeTSelfInst : ToType T Self + ToTypeInst : ToType T Self of_type : T → Result Self /- [traits::h4]: Source: 'src/traits.rs', lines 118:0-118:57 -/ def h4 - (T1 T2 : Type) (OfTypeBisT1T2Inst : OfTypeBis T1 T2) (ToTypeT2T1Inst : ToType - T2 T1) (y : T2) : + (T1 T2 : Type) (OfTypeBisInst : OfTypeBis T1 T2) (ToTypeInst : ToType T2 T1) + (y : T2) : Result T1 := - OfTypeBisT1T2Inst.of_type y + OfTypeBisInst.of_type y /- [traits::TestType] Source: 'src/traits.rs', lines 122:0-122:22 -/ @@ -216,11 +214,9 @@ def TestType.test.TestTraittraitsTestTypetestTestType1 : /- [traits::{traits::TestType<T>#6}::test]: Source: 'src/traits.rs', lines 126:4-126:36 -/ def TestType.test - (T : Type) (ToU64TInst : ToU64 T) (self : TestType T) (x : T) : - Result Bool - := + (T : Type) (ToU64Inst : ToU64 T) (self : TestType T) (x : T) : Result Bool := do - let x1 ← ToU64TInst.to_u64 x + let x1 ← ToU64Inst.to_u64 x if x1 > 0#u64 then TestType.test.TestTraittraitsTestTypetestTestType1.test 0#u64 else Result.ret false @@ -284,16 +280,16 @@ def WithConstTyBool32 : WithConstTy Bool 32#usize := { /- [traits::use_with_const_ty1]: Source: 'src/traits.rs', lines 183:0-183:75 -/ def use_with_const_ty1 - (H : Type) (LEN : Usize) (WithConstTyHLENInst : WithConstTy H LEN) : + (H : Type) (LEN : Usize) (WithConstTyInst : WithConstTy H LEN) : Result Usize := - Result.ret WithConstTyHLENInst.LEN1 + Result.ret WithConstTyInst.LEN1 /- [traits::use_with_const_ty2]: Source: 'src/traits.rs', lines 187:0-187:73 -/ def use_with_const_ty2 - (H : Type) (LEN : Usize) (WithConstTyHLENInst : WithConstTy H LEN) - (w : WithConstTyHLENInst.W) : + (H : Type) (LEN : Usize) (WithConstTyInst : WithConstTy H LEN) + (w : WithConstTyInst.W) : Result Unit := Result.ret () @@ -301,11 +297,11 @@ def use_with_const_ty2 /- [traits::use_with_const_ty3]: Source: 'src/traits.rs', lines 189:0-189:80 -/ def use_with_const_ty3 - (H : Type) (LEN : Usize) (WithConstTyHLENInst : WithConstTy H LEN) - (x : WithConstTyHLENInst.W) : + (H : Type) (LEN : Usize) (WithConstTyInst : WithConstTy H LEN) + (x : WithConstTyInst.W) : Result U64 := - WithConstTyHLENInst.W_clause_0.to_u64 x + WithConstTyInst.W_clause_0.to_u64 x /- [traits::test_where1]: Source: 'src/traits.rs', lines 193:0-193:40 -/ @@ -334,27 +330,27 @@ structure ParentTrait1 (Self : Type) where /- Trait declaration: [traits::ChildTrait] Source: 'src/traits.rs', lines 206:0-206:49 -/ structure ChildTrait (Self : Type) where - ParentTrait0SelfInst : ParentTrait0 Self - ParentTrait1SelfInst : ParentTrait1 Self + ParentTrait0Inst : ParentTrait0 Self + ParentTrait1Inst : ParentTrait1 Self /- [traits::test_child_trait1]: Source: 'src/traits.rs', lines 209:0-209:56 -/ def test_child_trait1 - (T : Type) (ChildTraitTInst : ChildTrait T) (x : T) : Result String := - ChildTraitTInst.ParentTrait0SelfInst.get_name x + (T : Type) (ChildTraitInst : ChildTrait T) (x : T) : Result String := + ChildTraitInst.ParentTrait0Inst.get_name x /- [traits::test_child_trait2]: Source: 'src/traits.rs', lines 213:0-213:54 -/ def test_child_trait2 - (T : Type) (ChildTraitTInst : ChildTrait T) (x : T) : - Result ChildTraitTInst.ParentTrait0SelfInst.W + (T : Type) (ChildTraitInst : ChildTrait T) (x : T) : + Result ChildTraitInst.ParentTrait0Inst.W := - ChildTraitTInst.ParentTrait0SelfInst.get_w x + ChildTraitInst.ParentTrait0Inst.get_w x /- [traits::order1]: Source: 'src/traits.rs', lines 219:0-219:59 -/ def order1 - (T U : Type) (ParentTrait0TInst : ParentTrait0 T) (ParentTrait0UInst : + (T U : Type) (ParentTrait0Inst : ParentTrait0 T) (ParentTrait0Inst1 : ParentTrait0 U) : Result Unit := @@ -363,7 +359,7 @@ def order1 /- Trait declaration: [traits::ChildTrait1] Source: 'src/traits.rs', lines 222:0-222:35 -/ structure ChildTrait1 (Self : Type) where - ParentTrait1SelfInst : ParentTrait1 Self + ParentTrait1Inst : ParentTrait1 Self /- Trait implementation: [traits::{(traits::ParentTrait1 for usize)#9}] Source: 'src/traits.rs', lines 224:0-224:27 -/ @@ -373,7 +369,7 @@ def ParentTrait1Usize : ParentTrait1 Usize := { /- Trait implementation: [traits::{(traits::ChildTrait1 for usize)#10}] Source: 'src/traits.rs', lines 225:0-225:26 -/ def ChildTrait1Usize : ChildTrait1 Usize := { - ParentTrait1SelfInst := ParentTrait1Usize + ParentTrait1Inst := ParentTrait1Usize } /- Trait declaration: [traits::Iterator] @@ -397,7 +393,7 @@ structure FromResidual (Self T : Type) where Source: 'src/traits.rs', lines 246:0-246:48 -/ structure Try (Self : Type) where Residual : Type - FromResidualSelftraitsTrySelfResidualInst : FromResidual Self Residual + FromResidualSelftraitsTryResidualInst : FromResidual Self Residual /- Trait declaration: [traits::WithTarget] Source: 'src/traits.rs', lines 252:0-252:20 -/ @@ -413,9 +409,8 @@ structure ParentTrait2 (Self : Type) where /- Trait declaration: [traits::ChildTrait2] Source: 'src/traits.rs', lines 260:0-260:35 -/ structure ChildTrait2 (Self : Type) where - ParentTrait2SelfInst : ParentTrait2 Self - convert : ParentTrait2SelfInst.U → Result - ParentTrait2SelfInst.U_clause_0.Target + ParentTrait2Inst : ParentTrait2 Self + convert : ParentTrait2Inst.U → Result ParentTrait2Inst.U_clause_0.Target /- Trait implementation: [traits::{(traits::WithTarget for u32)#11}] Source: 'src/traits.rs', lines 264:0-264:23 -/ @@ -438,7 +433,7 @@ def ChildTrait2U32.convert (x : U32) : Result U32 := /- Trait implementation: [traits::{(traits::ChildTrait2 for u32)#13}] Source: 'src/traits.rs', lines 272:0-272:24 -/ def ChildTrait2U32 : ChildTrait2 U32 := { - ParentTrait2SelfInst := ParentTrait2U32 + ParentTrait2Inst := ParentTrait2U32 convert := ChildTrait2U32.convert } @@ -451,14 +446,14 @@ structure CFnOnce (Self Args : Type) where /- Trait declaration: [traits::CFnMut] Source: 'src/traits.rs', lines 292:0-292:37 -/ structure CFnMut (Self Args : Type) where - CFnOnceSelfArgsInst : CFnOnce Self Args - call_mut : Self → Args → Result (CFnOnceSelfArgsInst.Output × Self) + CFnOnceInst : CFnOnce Self Args + call_mut : Self → Args → Result (CFnOnceInst.Output × Self) /- Trait declaration: [traits::CFn] Source: 'src/traits.rs', lines 296:0-296:33 -/ structure CFn (Self Args : Type) where - CFnMutSelfArgsInst : CFnMut Self Args - call : Self → Args → Result CFnMutSelfArgsInst.CFnOnceSelfArgsInst.Output + CFnMutInst : CFnMut Self Args + call : Self → Args → Result CFnMutInst.CFnOnceInst.Output /- Trait declaration: [traits::GetTrait] Source: 'src/traits.rs', lines 300:0-300:18 -/ @@ -469,7 +464,7 @@ structure GetTrait (Self : Type) where /- [traits::test_get_trait]: Source: 'src/traits.rs', lines 305:0-305:49 -/ def test_get_trait - (T : Type) (GetTraitTInst : GetTrait T) (x : T) : Result GetTraitTInst.W := - GetTraitTInst.get_w x + (T : Type) (GetTraitInst : GetTrait T) (x : T) : Result GetTraitInst.W := + GetTraitInst.get_w x end traits |