diff options
Diffstat (limited to '')
-rw-r--r-- | tests/fstar/arrays/Arrays.Funs.fst | 10 | ||||
-rw-r--r-- | tests/fstar/betree/BetreeMain.Funs.fst | 141 | ||||
-rw-r--r-- | tests/fstar/betree_back_stateful/BetreeMain.Funs.fst | 141 | ||||
-rw-r--r-- | tests/fstar/demo/Demo.fst | 2 | ||||
-rw-r--r-- | tests/fstar/hashmap/Hashmap.Funs.fst | 24 | ||||
-rw-r--r-- | tests/fstar/hashmap_on_disk/HashmapMain.Funs.fst | 27 | ||||
-rw-r--r-- | tests/fstar/misc/External.Funs.fst | 4 | ||||
-rw-r--r-- | tests/fstar/misc/Loops.Clauses.Template.fst | 3 | ||||
-rw-r--r-- | tests/fstar/misc/Loops.Funs.fst | 24 | ||||
-rw-r--r-- | tests/fstar/misc/NoNestedBorrows.fst | 7 | ||||
-rw-r--r-- | tests/fstar/misc/Paper.fst | 2 |
11 files changed, 193 insertions, 192 deletions
diff --git a/tests/fstar/arrays/Arrays.Funs.fst b/tests/fstar/arrays/Arrays.Funs.fst index 15c82e93..731c7290 100644 --- a/tests/fstar/arrays/Arrays.Funs.fst +++ b/tests/fstar/arrays/Arrays.Funs.fst @@ -28,17 +28,17 @@ let array_to_mut_slice_ (** [arrays::array_len]: Source: 'src/arrays.rs', lines 25:0-25:40 *) let array_len (t : Type0) (s : array t 32) : result usize = - let* s1 = array_to_slice t 32 s in let i = slice_len t s1 in Return i + let* s1 = array_to_slice t 32 s in Return (slice_len t s1) (** [arrays::shared_array_len]: Source: 'src/arrays.rs', lines 29:0-29:48 *) let shared_array_len (t : Type0) (s : array t 32) : result usize = - let* s1 = array_to_slice t 32 s in let i = slice_len t s1 in Return i + let* s1 = array_to_slice t 32 s in Return (slice_len t s1) (** [arrays::shared_slice_len]: Source: 'src/arrays.rs', lines 33:0-33:44 *) let shared_slice_len (t : Type0) (s : slice t) : result usize = - let i = slice_len t s in Return i + Return (slice_len t s) (** [arrays::index_array_shared]: Source: 'src/arrays.rs', lines 37:0-37:57 *) @@ -268,8 +268,8 @@ let update_mut_slice (x : slice u32) : result (slice u32) = let update_all : result unit = let* _ = update_array (mk_array u32 2 [ 0; 0 ]) in let* _ = update_array (mk_array u32 2 [ 0; 0 ]) in - let* a = update_array_mut_borrow (mk_array u32 2 [ 0; 0 ]) in - let* (s, to_slice_mut_back) = array_to_slice_mut u32 2 a in + let* x = update_array_mut_borrow (mk_array u32 2 [ 0; 0 ]) in + let* (s, to_slice_mut_back) = array_to_slice_mut u32 2 x in let* s1 = update_mut_slice s in let* _ = to_slice_mut_back s1 in Return () diff --git a/tests/fstar/betree/BetreeMain.Funs.fst b/tests/fstar/betree/BetreeMain.Funs.fst index 74044961..2469f98c 100644 --- a/tests/fstar/betree/BetreeMain.Funs.fst +++ b/tests/fstar/betree/BetreeMain.Funs.fst @@ -170,13 +170,14 @@ let betree_Leaf_split let (content0, content1) = p in let* p1 = betree_List_hd (u64 & u64) content1 in let (pivot, _) = p1 in - let* (id0, nic) = betree_NodeIdCounter_fresh_id node_id_cnt in - let* (id1, nic1) = betree_NodeIdCounter_fresh_id nic in + let* (id0, node_id_cnt1) = betree_NodeIdCounter_fresh_id node_id_cnt in + let* (id1, node_id_cnt2) = betree_NodeIdCounter_fresh_id node_id_cnt1 in let* (st1, _) = betree_store_leaf_node id0 content0 st in let* (st2, _) = betree_store_leaf_node id1 content1 st1 in let n = Betree_Node_Leaf { id = id0; size = params.split_size } in let n1 = Betree_Node_Leaf { id = id1; size = params.split_size } in - Return (st2, ({ id = self.id; pivot = pivot; left = n; right = n1 }, nic1)) + Return (st2, ({ id = self.id; pivot = pivot; left = n; right = n1 }, + node_id_cnt2)) (** [betree_main::betree::{betree_main::betree::Node#5}::lookup_first_message_for_key]: Source: 'src/betree.rs', lines 789:4-792:34 *) @@ -229,21 +230,21 @@ let rec betree_Node_apply_upserts 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 + let* (msg, msgs1) = betree_List_pop_front (u64 & betree_Message_t) msgs in let (_, m) = msg in begin match m with | Betree_Message_Insert _ -> Fail Failure | Betree_Message_Delete -> Fail Failure | Betree_Message_Upsert s -> let* v = betree_upsert_update prev s in - betree_Node_apply_upserts l (Some v) key st + betree_Node_apply_upserts msgs1 (Some v) key st end else let* (st1, v) = core_option_Option_unwrap u64 prev st in - let* l = + let* msgs1 = betree_List_push_front (u64 & betree_Message_t) msgs (key, Betree_Message_Insert v) in - Return (st1, (v, l)) + Return (st1, (v, msgs1)) (** [betree_main::betree::{betree_main::betree::Internal#4}::lookup_in_children]: Source: 'src/betree.rs', lines 395:4-395:63 *) @@ -277,10 +278,11 @@ and betree_Node_lookup let (k, msg) = p in if k <> key then - let* (st2, (o, i)) = betree_Internal_lookup_in_children node key st1 in + let* (st2, (o, node1)) = + betree_Internal_lookup_in_children node key st1 in let* _ = lookup_first_message_for_key_back (Betree_List_Cons (k, msg) l) in - Return (st2, (o, Betree_Node_Internal i)) + Return (st2, (o, Betree_Node_Internal node1)) else begin match msg with | Betree_Message_Insert v -> @@ -294,19 +296,20 @@ and betree_Node_lookup Betree_Message_Delete) l) in Return (st1, (None, Betree_Node_Internal node)) | Betree_Message_Upsert ufs -> - let* (st2, (v, i)) = betree_Internal_lookup_in_children node key st1 - in - let* (st3, (v1, l1)) = + let* (st2, (v, node1)) = + betree_Internal_lookup_in_children node key st1 in + let* (st3, (v1, pending1)) = betree_Node_apply_upserts (Betree_List_Cons (k, Betree_Message_Upsert ufs) l) v key st2 in - let* msgs1 = lookup_first_message_for_key_back l1 in - let* (st4, _) = betree_store_internal_node i.id msgs1 st3 in - Return (st4, (Some v1, Betree_Node_Internal i)) + let* msgs1 = lookup_first_message_for_key_back pending1 in + let* (st4, _) = betree_store_internal_node node1.id msgs1 st3 in + Return (st4, (Some v1, Betree_Node_Internal node1)) end | Betree_List_Nil -> - let* (st2, (o, i)) = betree_Internal_lookup_in_children node key st1 in + let* (st2, (o, node1)) = betree_Internal_lookup_in_children node key st1 + in let* _ = lookup_first_message_for_key_back Betree_List_Nil in - Return (st2, (o, Betree_Node_Internal i)) + Return (st2, (o, Betree_Node_Internal node1)) end | Betree_Node_Leaf node -> let* (st1, bindings) = betree_load_leaf_node node.id st in @@ -326,10 +329,10 @@ let rec betree_Node_filter_messages_for_key let (k, m) = p in if k = key then - let* (_, l1) = + let* (_, msgs1) = betree_List_pop_front (u64 & betree_Message_t) (Betree_List_Cons (k, m) l) in - betree_Node_filter_messages_for_key key l1 + betree_Node_filter_messages_for_key key msgs1 else Return (Betree_List_Cons (k, m) l) | Betree_List_Nil -> Return Betree_List_Nil end @@ -372,49 +375,51 @@ let betree_Node_apply_to_internal then begin match new_msg with | Betree_Message_Insert i -> - let* l = betree_Node_filter_messages_for_key key msgs1 in - let* l1 = - betree_List_push_front (u64 & betree_Message_t) l (key, + let* msgs2 = betree_Node_filter_messages_for_key key msgs1 in + let* msgs3 = + betree_List_push_front (u64 & betree_Message_t) msgs2 (key, Betree_Message_Insert i) in - lookup_first_message_for_key_back l1 + lookup_first_message_for_key_back msgs3 | Betree_Message_Delete -> - let* l = betree_Node_filter_messages_for_key key msgs1 in - let* l1 = - betree_List_push_front (u64 & betree_Message_t) l (key, + let* msgs2 = betree_Node_filter_messages_for_key key msgs1 in + let* msgs3 = + betree_List_push_front (u64 & betree_Message_t) msgs2 (key, Betree_Message_Delete) in - lookup_first_message_for_key_back l1 + lookup_first_message_for_key_back msgs3 | Betree_Message_Upsert s -> let* p = betree_List_hd (u64 & betree_Message_t) msgs1 in let (_, m) = p in begin match m with | Betree_Message_Insert prev -> let* v = betree_upsert_update (Some prev) s in - let* (_, l) = betree_List_pop_front (u64 & betree_Message_t) msgs1 in - let* l1 = - betree_List_push_front (u64 & betree_Message_t) l (key, + let* (_, msgs2) = betree_List_pop_front (u64 & betree_Message_t) msgs1 + in + let* msgs3 = + betree_List_push_front (u64 & betree_Message_t) msgs2 (key, Betree_Message_Insert v) in - lookup_first_message_for_key_back l1 + lookup_first_message_for_key_back msgs3 | Betree_Message_Delete -> - let* (_, l) = betree_List_pop_front (u64 & betree_Message_t) msgs1 in + let* (_, msgs2) = betree_List_pop_front (u64 & betree_Message_t) msgs1 + in let* v = betree_upsert_update None s in - let* l1 = - betree_List_push_front (u64 & betree_Message_t) l (key, + let* msgs3 = + betree_List_push_front (u64 & betree_Message_t) msgs2 (key, Betree_Message_Insert v) in - lookup_first_message_for_key_back l1 + lookup_first_message_for_key_back msgs3 | Betree_Message_Upsert _ -> let* (msgs2, lookup_first_message_after_key_back) = betree_Node_lookup_first_message_after_key key msgs1 in - let* l = + let* msgs3 = betree_List_push_front (u64 & betree_Message_t) msgs2 (key, Betree_Message_Upsert s) in - let* msgs3 = lookup_first_message_after_key_back l in - lookup_first_message_for_key_back msgs3 + let* msgs4 = lookup_first_message_after_key_back msgs3 in + lookup_first_message_for_key_back msgs4 end end else - let* l = + let* msgs2 = betree_List_push_front (u64 & betree_Message_t) msgs1 (key, new_msg) in - lookup_first_message_for_key_back l + lookup_first_message_for_key_back msgs2 (** [betree_main::betree::{betree_main::betree::Node#5}::apply_messages_to_internal]: Source: 'src/betree.rs', lines 502:4-505:5 *) @@ -427,8 +432,8 @@ let rec betree_Node_apply_messages_to_internal begin match new_msgs with | Betree_List_Cons new_msg new_msgs_tl -> let (i, m) = new_msg in - let* l = betree_Node_apply_to_internal msgs i m in - betree_Node_apply_messages_to_internal l new_msgs_tl + let* msgs1 = betree_Node_apply_to_internal msgs i m in + betree_Node_apply_messages_to_internal msgs1 new_msgs_tl | Betree_List_Nil -> Return msgs end @@ -468,28 +473,28 @@ let betree_Node_apply_to_leaf 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 + let* (hd, bindings2) = betree_List_pop_front (u64 & u64) bindings1 in begin match new_msg with | Betree_Message_Insert v -> - let* l1 = betree_List_push_front (u64 & u64) l (key, v) in - lookup_mut_in_bindings_back l1 - | Betree_Message_Delete -> lookup_mut_in_bindings_back l + let* bindings3 = betree_List_push_front (u64 & u64) bindings2 (key, v) in + lookup_mut_in_bindings_back bindings3 + | Betree_Message_Delete -> lookup_mut_in_bindings_back bindings2 | Betree_Message_Upsert s -> let (_, i) = hd in let* v = betree_upsert_update (Some i) s in - let* l1 = betree_List_push_front (u64 & u64) l (key, v) in - lookup_mut_in_bindings_back l1 + let* bindings3 = betree_List_push_front (u64 & u64) bindings2 (key, v) in + lookup_mut_in_bindings_back bindings3 end else begin match new_msg with | Betree_Message_Insert v -> - let* l = betree_List_push_front (u64 & u64) bindings1 (key, v) in - lookup_mut_in_bindings_back l + let* bindings2 = betree_List_push_front (u64 & u64) bindings1 (key, v) in + lookup_mut_in_bindings_back bindings2 | Betree_Message_Delete -> lookup_mut_in_bindings_back bindings1 | Betree_Message_Upsert s -> let* v = betree_upsert_update None s in - let* l = betree_List_push_front (u64 & u64) bindings1 (key, v) in - lookup_mut_in_bindings_back l + let* bindings2 = betree_List_push_front (u64 & u64) bindings1 (key, v) in + lookup_mut_in_bindings_back bindings2 end (** [betree_main::betree::{betree_main::betree::Node#5}::apply_messages_to_leaf]: @@ -503,8 +508,8 @@ let rec betree_Node_apply_messages_to_leaf begin match new_msgs with | Betree_List_Cons new_msg new_msgs_tl -> let (i, m) = new_msg in - let* l = betree_Node_apply_to_leaf bindings i m in - betree_Node_apply_messages_to_leaf l new_msgs_tl + let* bindings1 = betree_Node_apply_to_leaf bindings i m in + betree_Node_apply_messages_to_leaf bindings1 new_msgs_tl | Betree_List_Nil -> Return bindings end @@ -558,31 +563,31 @@ and betree_Node_apply_messages begin match self with | Betree_Node_Internal node -> let* (st1, content) = betree_load_internal_node node.id st in - let* l = betree_Node_apply_messages_to_internal content msgs in - let* num_msgs = betree_List_len (u64 & betree_Message_t) l in + let* content1 = betree_Node_apply_messages_to_internal content msgs in + let* num_msgs = betree_List_len (u64 & betree_Message_t) content1 in if num_msgs >= params.min_flush_size then - let* (st2, (content1, p)) = - betree_Internal_flush node params node_id_cnt l st1 in + let* (st2, (content2, p)) = + betree_Internal_flush node params node_id_cnt content1 st1 in let (node1, node_id_cnt1) = p in - let* (st3, _) = betree_store_internal_node node1.id content1 st2 in + let* (st3, _) = betree_store_internal_node node1.id content2 st2 in Return (st3, (Betree_Node_Internal node1, node_id_cnt1)) else - let* (st2, _) = betree_store_internal_node node.id l st1 in + let* (st2, _) = betree_store_internal_node node.id content1 st1 in Return (st2, (Betree_Node_Internal node, node_id_cnt)) | Betree_Node_Leaf node -> let* (st1, content) = betree_load_leaf_node node.id st in - let* l = betree_Node_apply_messages_to_leaf content msgs in - let* len = betree_List_len (u64 & u64) l in + let* content1 = betree_Node_apply_messages_to_leaf content msgs in + let* len = betree_List_len (u64 & u64) content1 in let* i = u64_mul 2 params.split_size in if len >= i then - let* (st2, (new_node, nic)) = - betree_Leaf_split node l params node_id_cnt st1 in + let* (st2, (new_node, node_id_cnt1)) = + betree_Leaf_split node content1 params node_id_cnt st1 in let* (st3, _) = betree_store_leaf_node node.id Betree_List_Nil st2 in - Return (st3, (Betree_Node_Internal new_node, nic)) + Return (st3, (Betree_Node_Internal new_node, node_id_cnt1)) else - let* (st2, _) = betree_store_leaf_node node.id l st1 in + let* (st2, _) = betree_store_leaf_node node.id content1 st1 in Return (st2, (Betree_Node_Leaf { node with size = len }, node_id_cnt)) end @@ -607,12 +612,12 @@ let betree_BeTree_new result (state & betree_BeTree_t) = let* node_id_cnt = betree_NodeIdCounter_new in - let* (id, nic) = betree_NodeIdCounter_fresh_id node_id_cnt in + let* (id, node_id_cnt1) = betree_NodeIdCounter_fresh_id node_id_cnt in let* (st1, _) = betree_store_leaf_node id Betree_List_Nil st in Return (st1, { params = { min_flush_size = min_flush_size; split_size = split_size }; - node_id_cnt = nic; + node_id_cnt = node_id_cnt1; root = (Betree_Node_Leaf { id = id; size = 0 }) }) diff --git a/tests/fstar/betree_back_stateful/BetreeMain.Funs.fst b/tests/fstar/betree_back_stateful/BetreeMain.Funs.fst index 74044961..2469f98c 100644 --- a/tests/fstar/betree_back_stateful/BetreeMain.Funs.fst +++ b/tests/fstar/betree_back_stateful/BetreeMain.Funs.fst @@ -170,13 +170,14 @@ let betree_Leaf_split let (content0, content1) = p in let* p1 = betree_List_hd (u64 & u64) content1 in let (pivot, _) = p1 in - let* (id0, nic) = betree_NodeIdCounter_fresh_id node_id_cnt in - let* (id1, nic1) = betree_NodeIdCounter_fresh_id nic in + let* (id0, node_id_cnt1) = betree_NodeIdCounter_fresh_id node_id_cnt in + let* (id1, node_id_cnt2) = betree_NodeIdCounter_fresh_id node_id_cnt1 in let* (st1, _) = betree_store_leaf_node id0 content0 st in let* (st2, _) = betree_store_leaf_node id1 content1 st1 in let n = Betree_Node_Leaf { id = id0; size = params.split_size } in let n1 = Betree_Node_Leaf { id = id1; size = params.split_size } in - Return (st2, ({ id = self.id; pivot = pivot; left = n; right = n1 }, nic1)) + Return (st2, ({ id = self.id; pivot = pivot; left = n; right = n1 }, + node_id_cnt2)) (** [betree_main::betree::{betree_main::betree::Node#5}::lookup_first_message_for_key]: Source: 'src/betree.rs', lines 789:4-792:34 *) @@ -229,21 +230,21 @@ let rec betree_Node_apply_upserts 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 + let* (msg, msgs1) = betree_List_pop_front (u64 & betree_Message_t) msgs in let (_, m) = msg in begin match m with | Betree_Message_Insert _ -> Fail Failure | Betree_Message_Delete -> Fail Failure | Betree_Message_Upsert s -> let* v = betree_upsert_update prev s in - betree_Node_apply_upserts l (Some v) key st + betree_Node_apply_upserts msgs1 (Some v) key st end else let* (st1, v) = core_option_Option_unwrap u64 prev st in - let* l = + let* msgs1 = betree_List_push_front (u64 & betree_Message_t) msgs (key, Betree_Message_Insert v) in - Return (st1, (v, l)) + Return (st1, (v, msgs1)) (** [betree_main::betree::{betree_main::betree::Internal#4}::lookup_in_children]: Source: 'src/betree.rs', lines 395:4-395:63 *) @@ -277,10 +278,11 @@ and betree_Node_lookup let (k, msg) = p in if k <> key then - let* (st2, (o, i)) = betree_Internal_lookup_in_children node key st1 in + let* (st2, (o, node1)) = + betree_Internal_lookup_in_children node key st1 in let* _ = lookup_first_message_for_key_back (Betree_List_Cons (k, msg) l) in - Return (st2, (o, Betree_Node_Internal i)) + Return (st2, (o, Betree_Node_Internal node1)) else begin match msg with | Betree_Message_Insert v -> @@ -294,19 +296,20 @@ and betree_Node_lookup Betree_Message_Delete) l) in Return (st1, (None, Betree_Node_Internal node)) | Betree_Message_Upsert ufs -> - let* (st2, (v, i)) = betree_Internal_lookup_in_children node key st1 - in - let* (st3, (v1, l1)) = + let* (st2, (v, node1)) = + betree_Internal_lookup_in_children node key st1 in + let* (st3, (v1, pending1)) = betree_Node_apply_upserts (Betree_List_Cons (k, Betree_Message_Upsert ufs) l) v key st2 in - let* msgs1 = lookup_first_message_for_key_back l1 in - let* (st4, _) = betree_store_internal_node i.id msgs1 st3 in - Return (st4, (Some v1, Betree_Node_Internal i)) + let* msgs1 = lookup_first_message_for_key_back pending1 in + let* (st4, _) = betree_store_internal_node node1.id msgs1 st3 in + Return (st4, (Some v1, Betree_Node_Internal node1)) end | Betree_List_Nil -> - let* (st2, (o, i)) = betree_Internal_lookup_in_children node key st1 in + let* (st2, (o, node1)) = betree_Internal_lookup_in_children node key st1 + in let* _ = lookup_first_message_for_key_back Betree_List_Nil in - Return (st2, (o, Betree_Node_Internal i)) + Return (st2, (o, Betree_Node_Internal node1)) end | Betree_Node_Leaf node -> let* (st1, bindings) = betree_load_leaf_node node.id st in @@ -326,10 +329,10 @@ let rec betree_Node_filter_messages_for_key let (k, m) = p in if k = key then - let* (_, l1) = + let* (_, msgs1) = betree_List_pop_front (u64 & betree_Message_t) (Betree_List_Cons (k, m) l) in - betree_Node_filter_messages_for_key key l1 + betree_Node_filter_messages_for_key key msgs1 else Return (Betree_List_Cons (k, m) l) | Betree_List_Nil -> Return Betree_List_Nil end @@ -372,49 +375,51 @@ let betree_Node_apply_to_internal then begin match new_msg with | Betree_Message_Insert i -> - let* l = betree_Node_filter_messages_for_key key msgs1 in - let* l1 = - betree_List_push_front (u64 & betree_Message_t) l (key, + let* msgs2 = betree_Node_filter_messages_for_key key msgs1 in + let* msgs3 = + betree_List_push_front (u64 & betree_Message_t) msgs2 (key, Betree_Message_Insert i) in - lookup_first_message_for_key_back l1 + lookup_first_message_for_key_back msgs3 | Betree_Message_Delete -> - let* l = betree_Node_filter_messages_for_key key msgs1 in - let* l1 = - betree_List_push_front (u64 & betree_Message_t) l (key, + let* msgs2 = betree_Node_filter_messages_for_key key msgs1 in + let* msgs3 = + betree_List_push_front (u64 & betree_Message_t) msgs2 (key, Betree_Message_Delete) in - lookup_first_message_for_key_back l1 + lookup_first_message_for_key_back msgs3 | Betree_Message_Upsert s -> let* p = betree_List_hd (u64 & betree_Message_t) msgs1 in let (_, m) = p in begin match m with | Betree_Message_Insert prev -> let* v = betree_upsert_update (Some prev) s in - let* (_, l) = betree_List_pop_front (u64 & betree_Message_t) msgs1 in - let* l1 = - betree_List_push_front (u64 & betree_Message_t) l (key, + let* (_, msgs2) = betree_List_pop_front (u64 & betree_Message_t) msgs1 + in + let* msgs3 = + betree_List_push_front (u64 & betree_Message_t) msgs2 (key, Betree_Message_Insert v) in - lookup_first_message_for_key_back l1 + lookup_first_message_for_key_back msgs3 | Betree_Message_Delete -> - let* (_, l) = betree_List_pop_front (u64 & betree_Message_t) msgs1 in + let* (_, msgs2) = betree_List_pop_front (u64 & betree_Message_t) msgs1 + in let* v = betree_upsert_update None s in - let* l1 = - betree_List_push_front (u64 & betree_Message_t) l (key, + let* msgs3 = + betree_List_push_front (u64 & betree_Message_t) msgs2 (key, Betree_Message_Insert v) in - lookup_first_message_for_key_back l1 + lookup_first_message_for_key_back msgs3 | Betree_Message_Upsert _ -> let* (msgs2, lookup_first_message_after_key_back) = betree_Node_lookup_first_message_after_key key msgs1 in - let* l = + let* msgs3 = betree_List_push_front (u64 & betree_Message_t) msgs2 (key, Betree_Message_Upsert s) in - let* msgs3 = lookup_first_message_after_key_back l in - lookup_first_message_for_key_back msgs3 + let* msgs4 = lookup_first_message_after_key_back msgs3 in + lookup_first_message_for_key_back msgs4 end end else - let* l = + let* msgs2 = betree_List_push_front (u64 & betree_Message_t) msgs1 (key, new_msg) in - lookup_first_message_for_key_back l + lookup_first_message_for_key_back msgs2 (** [betree_main::betree::{betree_main::betree::Node#5}::apply_messages_to_internal]: Source: 'src/betree.rs', lines 502:4-505:5 *) @@ -427,8 +432,8 @@ let rec betree_Node_apply_messages_to_internal begin match new_msgs with | Betree_List_Cons new_msg new_msgs_tl -> let (i, m) = new_msg in - let* l = betree_Node_apply_to_internal msgs i m in - betree_Node_apply_messages_to_internal l new_msgs_tl + let* msgs1 = betree_Node_apply_to_internal msgs i m in + betree_Node_apply_messages_to_internal msgs1 new_msgs_tl | Betree_List_Nil -> Return msgs end @@ -468,28 +473,28 @@ let betree_Node_apply_to_leaf 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 + let* (hd, bindings2) = betree_List_pop_front (u64 & u64) bindings1 in begin match new_msg with | Betree_Message_Insert v -> - let* l1 = betree_List_push_front (u64 & u64) l (key, v) in - lookup_mut_in_bindings_back l1 - | Betree_Message_Delete -> lookup_mut_in_bindings_back l + let* bindings3 = betree_List_push_front (u64 & u64) bindings2 (key, v) in + lookup_mut_in_bindings_back bindings3 + | Betree_Message_Delete -> lookup_mut_in_bindings_back bindings2 | Betree_Message_Upsert s -> let (_, i) = hd in let* v = betree_upsert_update (Some i) s in - let* l1 = betree_List_push_front (u64 & u64) l (key, v) in - lookup_mut_in_bindings_back l1 + let* bindings3 = betree_List_push_front (u64 & u64) bindings2 (key, v) in + lookup_mut_in_bindings_back bindings3 end else begin match new_msg with | Betree_Message_Insert v -> - let* l = betree_List_push_front (u64 & u64) bindings1 (key, v) in - lookup_mut_in_bindings_back l + let* bindings2 = betree_List_push_front (u64 & u64) bindings1 (key, v) in + lookup_mut_in_bindings_back bindings2 | Betree_Message_Delete -> lookup_mut_in_bindings_back bindings1 | Betree_Message_Upsert s -> let* v = betree_upsert_update None s in - let* l = betree_List_push_front (u64 & u64) bindings1 (key, v) in - lookup_mut_in_bindings_back l + let* bindings2 = betree_List_push_front (u64 & u64) bindings1 (key, v) in + lookup_mut_in_bindings_back bindings2 end (** [betree_main::betree::{betree_main::betree::Node#5}::apply_messages_to_leaf]: @@ -503,8 +508,8 @@ let rec betree_Node_apply_messages_to_leaf begin match new_msgs with | Betree_List_Cons new_msg new_msgs_tl -> let (i, m) = new_msg in - let* l = betree_Node_apply_to_leaf bindings i m in - betree_Node_apply_messages_to_leaf l new_msgs_tl + let* bindings1 = betree_Node_apply_to_leaf bindings i m in + betree_Node_apply_messages_to_leaf bindings1 new_msgs_tl | Betree_List_Nil -> Return bindings end @@ -558,31 +563,31 @@ and betree_Node_apply_messages begin match self with | Betree_Node_Internal node -> let* (st1, content) = betree_load_internal_node node.id st in - let* l = betree_Node_apply_messages_to_internal content msgs in - let* num_msgs = betree_List_len (u64 & betree_Message_t) l in + let* content1 = betree_Node_apply_messages_to_internal content msgs in + let* num_msgs = betree_List_len (u64 & betree_Message_t) content1 in if num_msgs >= params.min_flush_size then - let* (st2, (content1, p)) = - betree_Internal_flush node params node_id_cnt l st1 in + let* (st2, (content2, p)) = + betree_Internal_flush node params node_id_cnt content1 st1 in let (node1, node_id_cnt1) = p in - let* (st3, _) = betree_store_internal_node node1.id content1 st2 in + let* (st3, _) = betree_store_internal_node node1.id content2 st2 in Return (st3, (Betree_Node_Internal node1, node_id_cnt1)) else - let* (st2, _) = betree_store_internal_node node.id l st1 in + let* (st2, _) = betree_store_internal_node node.id content1 st1 in Return (st2, (Betree_Node_Internal node, node_id_cnt)) | Betree_Node_Leaf node -> let* (st1, content) = betree_load_leaf_node node.id st in - let* l = betree_Node_apply_messages_to_leaf content msgs in - let* len = betree_List_len (u64 & u64) l in + let* content1 = betree_Node_apply_messages_to_leaf content msgs in + let* len = betree_List_len (u64 & u64) content1 in let* i = u64_mul 2 params.split_size in if len >= i then - let* (st2, (new_node, nic)) = - betree_Leaf_split node l params node_id_cnt st1 in + let* (st2, (new_node, node_id_cnt1)) = + betree_Leaf_split node content1 params node_id_cnt st1 in let* (st3, _) = betree_store_leaf_node node.id Betree_List_Nil st2 in - Return (st3, (Betree_Node_Internal new_node, nic)) + Return (st3, (Betree_Node_Internal new_node, node_id_cnt1)) else - let* (st2, _) = betree_store_leaf_node node.id l st1 in + let* (st2, _) = betree_store_leaf_node node.id content1 st1 in Return (st2, (Betree_Node_Leaf { node with size = len }, node_id_cnt)) end @@ -607,12 +612,12 @@ let betree_BeTree_new result (state & betree_BeTree_t) = let* node_id_cnt = betree_NodeIdCounter_new in - let* (id, nic) = betree_NodeIdCounter_fresh_id node_id_cnt in + let* (id, node_id_cnt1) = betree_NodeIdCounter_fresh_id node_id_cnt in let* (st1, _) = betree_store_leaf_node id Betree_List_Nil st in Return (st1, { params = { min_flush_size = min_flush_size; split_size = split_size }; - node_id_cnt = nic; + node_id_cnt = node_id_cnt1; root = (Betree_Node_Leaf { id = id; size = 0 }) }) diff --git a/tests/fstar/demo/Demo.fst b/tests/fstar/demo/Demo.fst index 4ad7cb65..d93bc847 100644 --- a/tests/fstar/demo/Demo.fst +++ b/tests/fstar/demo/Demo.fst @@ -31,7 +31,7 @@ let incr (x : u32) : result u32 = (** [demo::use_incr]: Source: 'src/demo.rs', lines 25:0-25:17 *) let use_incr : result unit = - let* i = incr 0 in let* i1 = incr i in let* _ = incr i1 in Return () + let* x = incr 0 in let* x1 = incr x in let* _ = incr x1 in Return () (** [demo::CList] Source: 'src/demo.rs', lines 34:0-34:17 *) diff --git a/tests/fstar/hashmap/Hashmap.Funs.fst b/tests/fstar/hashmap/Hashmap.Funs.fst index 7ca8b9c1..fba711f1 100644 --- a/tests/fstar/hashmap/Hashmap.Funs.fst +++ b/tests/fstar/hashmap/Hashmap.Funs.fst @@ -21,9 +21,9 @@ let rec hashMap_allocate_slots_loop = if n > 0 then - let* v = alloc_vec_Vec_push (list_t t) slots List_Nil in + let* slots1 = alloc_vec_Vec_push (list_t t) slots List_Nil in let* n1 = usize_sub n 1 in - hashMap_allocate_slots_loop t v n1 + hashMap_allocate_slots_loop t slots1 n1 else Return slots (** [hashmap::{hashmap::HashMap<T>}::allocate_slots]: @@ -142,8 +142,8 @@ let rec hashMap_move_elements_from_list_loop = begin match ls with | List_Cons k v tl -> - let* hm = hashMap_insert_no_resize t ntable k v in - hashMap_move_elements_from_list_loop t hm tl + let* ntable1 = hashMap_insert_no_resize t ntable k v in + hashMap_move_elements_from_list_loop t ntable1 tl | List_Nil -> Return ntable end @@ -168,12 +168,10 @@ let rec hashMap_move_elements_loop alloc_vec_Vec_index_mut (list_t t) usize (core_slice_index_SliceIndexUsizeSliceTInst (list_t t)) slots i in let (ls, l1) = core_mem_replace (list_t t) l List_Nil in - let* hm = hashMap_move_elements_from_list t ntable ls in + let* ntable1 = hashMap_move_elements_from_list t ntable ls in let* i2 = usize_add i 1 in let* slots1 = index_mut_back l1 in - let* back_'a = hashMap_move_elements_loop t hm slots1 i2 in - let (hm1, v) = back_'a in - Return (hm1, v) + hashMap_move_elements_loop t ntable1 slots1 i2 else Return (ntable, slots) (** [hashmap::{hashmap::HashMap<T>}::move_elements]: @@ -183,9 +181,7 @@ let hashMap_move_elements (i : usize) : result ((hashMap_t t) & (alloc_vec_Vec (list_t t))) = - let* back_'a = hashMap_move_elements_loop t ntable slots i in - let (hm, v) = back_'a in - Return (hm, v) + hashMap_move_elements_loop t ntable slots i (** [hashmap::{hashmap::HashMap<T>}::try_resize]: Source: 'src/hashmap.rs', lines 140:4-140:28 *) @@ -213,9 +209,9 @@ let hashMap_insert (t : Type0) (self : hashMap_t t) (key : usize) (value : t) : result (hashMap_t t) = - let* hm = hashMap_insert_no_resize t self key value in - let* i = hashMap_len t hm in - if i > hm.max_load then hashMap_try_resize t hm else Return hm + let* self1 = hashMap_insert_no_resize t self key value in + let* i = hashMap_len t self1 in + if i > self1.max_load then hashMap_try_resize t self1 else Return self1 (** [hashmap::{hashmap::HashMap<T>}::contains_key_in_list]: loop 0: Source: 'src/hashmap.rs', lines 206:4-219:5 *) diff --git a/tests/fstar/hashmap_on_disk/HashmapMain.Funs.fst b/tests/fstar/hashmap_on_disk/HashmapMain.Funs.fst index 9b5baaeb..97f4151f 100644 --- a/tests/fstar/hashmap_on_disk/HashmapMain.Funs.fst +++ b/tests/fstar/hashmap_on_disk/HashmapMain.Funs.fst @@ -22,9 +22,10 @@ let rec hashmap_HashMap_allocate_slots_loop = if n > 0 then - let* v = alloc_vec_Vec_push (hashmap_List_t t) slots Hashmap_List_Nil in + let* slots1 = alloc_vec_Vec_push (hashmap_List_t t) slots Hashmap_List_Nil + in let* n1 = usize_sub n 1 in - hashmap_HashMap_allocate_slots_loop t v n1 + hashmap_HashMap_allocate_slots_loop t slots1 n1 else Return slots (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap<T>}::allocate_slots]: @@ -149,8 +150,8 @@ let rec hashmap_HashMap_move_elements_from_list_loop = begin match ls with | Hashmap_List_Cons k v tl -> - let* hm = hashmap_HashMap_insert_no_resize t ntable k v in - hashmap_HashMap_move_elements_from_list_loop t hm tl + let* ntable1 = hashmap_HashMap_insert_no_resize t ntable k v in + hashmap_HashMap_move_elements_from_list_loop t ntable1 tl | Hashmap_List_Nil -> Return ntable end @@ -178,12 +179,10 @@ let rec hashmap_HashMap_move_elements_loop (core_slice_index_SliceIndexUsizeSliceTInst (hashmap_List_t t)) slots i in let (ls, l1) = core_mem_replace (hashmap_List_t t) l Hashmap_List_Nil in - let* hm = hashmap_HashMap_move_elements_from_list t ntable ls in + let* ntable1 = hashmap_HashMap_move_elements_from_list t ntable ls in let* i2 = usize_add i 1 in let* slots1 = index_mut_back l1 in - let* back_'a = hashmap_HashMap_move_elements_loop t hm slots1 i2 in - let (hm1, v) = back_'a in - Return (hm1, v) + hashmap_HashMap_move_elements_loop t ntable1 slots1 i2 else Return (ntable, slots) (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap<T>}::move_elements]: @@ -193,9 +192,7 @@ let hashmap_HashMap_move_elements (slots : alloc_vec_Vec (hashmap_List_t t)) (i : usize) : result ((hashmap_HashMap_t t) & (alloc_vec_Vec (hashmap_List_t t))) = - let* back_'a = hashmap_HashMap_move_elements_loop t ntable slots i in - let (hm, v) = back_'a in - Return (hm, v) + hashmap_HashMap_move_elements_loop t ntable slots i (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap<T>}::try_resize]: Source: 'src/hashmap.rs', lines 140:4-140:28 *) @@ -223,9 +220,11 @@ let hashmap_HashMap_insert (t : Type0) (self : hashmap_HashMap_t t) (key : usize) (value : t) : result (hashmap_HashMap_t t) = - let* hm = hashmap_HashMap_insert_no_resize t self key value in - let* i = hashmap_HashMap_len t hm in - if i > hm.max_load then hashmap_HashMap_try_resize t hm else Return hm + let* self1 = hashmap_HashMap_insert_no_resize t self key value in + let* i = hashmap_HashMap_len t self1 in + if i > self1.max_load + then hashmap_HashMap_try_resize t self1 + else Return self1 (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap<T>}::contains_key_in_list]: loop 0: Source: 'src/hashmap.rs', lines 206:4-219:5 *) diff --git a/tests/fstar/misc/External.Funs.fst b/tests/fstar/misc/External.Funs.fst index 6672b523..3ba20022 100644 --- a/tests/fstar/misc/External.Funs.fst +++ b/tests/fstar/misc/External.Funs.fst @@ -33,8 +33,8 @@ let custom_swap (t : Type0) (x : t) (y : t) (st : state) : result (state & (t & (t -> state -> result (state & (t & t))))) = - let* (st1, (x1, x2)) = core_mem_swap t x y st in - let back_'a = fun ret st2 -> Return (st2, (ret, x2)) in + let* (st1, (x1, y1)) = core_mem_swap t x y st in + let back_'a = fun ret st2 -> Return (st2, (ret, y1)) in Return (st1, (x1, back_'a)) (** [external::test_custom_swap]: diff --git a/tests/fstar/misc/Loops.Clauses.Template.fst b/tests/fstar/misc/Loops.Clauses.Template.fst index c8ed16f4..e43f8170 100644 --- a/tests/fstar/misc/Loops.Clauses.Template.fst +++ b/tests/fstar/misc/Loops.Clauses.Template.fst @@ -13,8 +13,7 @@ unfold let sum_loop_decreases (max : u32) (i : u32) (s : u32) : nat = admit () (** [loops::sum_with_mut_borrows]: decreases clause Source: 'src/loops.rs', lines 19:0-31:1 *) unfold -let sum_with_mut_borrows_loop_decreases (max : u32) (mi : u32) (ms : u32) : nat - = +let sum_with_mut_borrows_loop_decreases (max : u32) (i : u32) (s : u32) : nat = admit () (** [loops::sum_with_shared_borrows]: decreases clause diff --git a/tests/fstar/misc/Loops.Funs.fst b/tests/fstar/misc/Loops.Funs.fst index c87f693b..7c099da2 100644 --- a/tests/fstar/misc/Loops.Funs.fst +++ b/tests/fstar/misc/Loops.Funs.fst @@ -25,15 +25,15 @@ let sum (max : u32) : result u32 = (** [loops::sum_with_mut_borrows]: loop 0: Source: 'src/loops.rs', lines 19:0-31:1 *) let rec sum_with_mut_borrows_loop - (max : u32) (mi : u32) (ms : u32) : - Tot (result u32) (decreases (sum_with_mut_borrows_loop_decreases max mi ms)) + (max : u32) (i : u32) (s : u32) : + Tot (result u32) (decreases (sum_with_mut_borrows_loop_decreases max i s)) = - if mi < max + if i < max then - let* ms1 = u32_add ms mi in - let* mi1 = u32_add mi 1 in - sum_with_mut_borrows_loop max mi1 ms1 - else u32_mul ms 2 + let* ms = u32_add s i in + let* mi = u32_add i 1 in + sum_with_mut_borrows_loop max mi ms + else u32_mul s 2 (** [loops::sum_with_mut_borrows]: Source: 'src/loops.rs', lines 19:0-19:44 *) @@ -185,11 +185,11 @@ let get_elem_mut (slots : alloc_vec_Vec (list_t usize)) (x : usize) : result (usize & (usize -> result (alloc_vec_Vec (list_t usize)))) = - let* (l, index_mut_back) = + let* (ls, index_mut_back) = alloc_vec_Vec_index_mut (list_t usize) usize (core_slice_index_SliceIndexUsizeSliceTInst (list_t usize)) slots 0 in - let* (i, back) = get_elem_mut_loop x l in - let back1 = fun ret -> let* l1 = back ret in index_mut_back l1 in + let* (i, back) = get_elem_mut_loop x ls in + let back1 = fun ret -> let* l = back ret in index_mut_back l in Return (i, back1) (** [loops::get_elem_shared]: loop 0: @@ -207,10 +207,10 @@ let rec get_elem_shared_loop Source: 'src/loops.rs', lines 129:0-129:68 *) let get_elem_shared (slots : alloc_vec_Vec (list_t usize)) (x : usize) : result usize = - let* l = + let* ls = alloc_vec_Vec_index (list_t usize) usize (core_slice_index_SliceIndexUsizeSliceTInst (list_t usize)) slots 0 in - get_elem_shared_loop x l + get_elem_shared_loop x ls (** [loops::id_mut]: Source: 'src/loops.rs', lines 145:0-145:50 *) diff --git a/tests/fstar/misc/NoNestedBorrows.fst b/tests/fstar/misc/NoNestedBorrows.fst index c71f8dbb..db63eb0d 100644 --- a/tests/fstar/misc/NoNestedBorrows.fst +++ b/tests/fstar/misc/NoNestedBorrows.fst @@ -425,8 +425,7 @@ let id_mut_pair1 (t1 t2 : Type0) (x : t1) (y : t2) : result ((t1 & t2) & ((t1 & t2) -> result (t1 & t2))) = - let back_'a = fun ret -> let (x1, x2) = ret in Return (x1, x2) in - Return ((x, y), back_'a) + Return ((x, y), Return) (** [no_nested_borrows::id_mut_pair2]: Source: 'src/no_nested_borrows.rs', lines 418:0-418:88 *) @@ -434,9 +433,7 @@ let id_mut_pair2 (t1 t2 : Type0) (p : (t1 & t2)) : result ((t1 & t2) & ((t1 & t2) -> result (t1 & t2))) = - let (x, x1) = p in - let back_'a = fun ret -> let (x2, x3) = ret in Return (x2, x3) in - Return ((x, x1), back_'a) + let (x, x1) = p in Return ((x, x1), Return) (** [no_nested_borrows::id_mut_pair3]: Source: 'src/no_nested_borrows.rs', lines 422:0-422:93 *) diff --git a/tests/fstar/misc/Paper.fst b/tests/fstar/misc/Paper.fst index cf4dc454..ddc5e7a8 100644 --- a/tests/fstar/misc/Paper.fst +++ b/tests/fstar/misc/Paper.fst @@ -13,7 +13,7 @@ let ref_incr (x : i32) : result i32 = (** [paper::test_incr]: Source: 'src/paper.rs', lines 8:0-8:18 *) let test_incr : result unit = - let* i = ref_incr 0 in if not (i = 1) then Fail Failure else Return () + let* x = ref_incr 0 in if not (x = 1) then Fail Failure else Return () (** Unit test for [paper::test_incr] *) let _ = assert_norm (test_incr = Return ()) |