From b455f94c841b2423898f39bc9b6a4c35a3db56e3 Mon Sep 17 00:00:00 2001 From: Son Ho Date: Thu, 4 Apr 2024 16:20:20 +0200 Subject: Regenerate the test files --- tests/fstar/hashmap_on_disk/HashmapMain.Funs.fst | 70 +++++++++++------------- 1 file changed, 32 insertions(+), 38 deletions(-) (limited to 'tests/fstar/hashmap_on_disk/HashmapMain.Funs.fst') diff --git a/tests/fstar/hashmap_on_disk/HashmapMain.Funs.fst b/tests/fstar/hashmap_on_disk/HashmapMain.Funs.fst index e0005c81..ff86e087 100644 --- a/tests/fstar/hashmap_on_disk/HashmapMain.Funs.fst +++ b/tests/fstar/hashmap_on_disk/HashmapMain.Funs.fst @@ -11,7 +11,7 @@ include HashmapMain.Clauses (** [hashmap_main::hashmap::hash_key]: Source: 'src/hashmap.rs', lines 27:0-27:32 *) let hashmap_hash_key (k : usize) : result usize = - Return k + Ok k (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::allocate_slots]: loop 0: Source: 'src/hashmap.rs', lines 50:4-56:5 *) @@ -26,7 +26,7 @@ let rec hashmap_HashMap_allocate_slots_loop in let* n1 = usize_sub n 1 in hashmap_HashMap_allocate_slots_loop t slots1 n1 - else Return slots + else Ok slots (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::allocate_slots]: Source: 'src/hashmap.rs', lines 50:4-50:76 *) @@ -48,7 +48,7 @@ let hashmap_HashMap_new_with_capacity capacity in let* i = usize_mul capacity max_load_dividend in let* i1 = usize_div i max_load_divisor in - Return + Ok { num_entries = 0; max_load_factor = (max_load_dividend, max_load_divisor); @@ -78,20 +78,20 @@ let rec hashmap_HashMap_clear_loop let* i2 = usize_add i 1 in let* slots1 = index_mut_back Hashmap_List_Nil in hashmap_HashMap_clear_loop t slots1 i2 - else Return slots + else Ok slots (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::clear]: Source: 'src/hashmap.rs', lines 80:4-80:27 *) let hashmap_HashMap_clear (t : Type0) (self : hashmap_HashMap_t t) : result (hashmap_HashMap_t t) = let* hm = hashmap_HashMap_clear_loop t self.slots 0 in - Return { self with num_entries = 0; slots = hm } + Ok { self with num_entries = 0; slots = hm } (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::len]: Source: 'src/hashmap.rs', lines 90:4-90:30 *) let hashmap_HashMap_len (t : Type0) (self : hashmap_HashMap_t t) : result usize = - Return self.num_entries + Ok self.num_entries (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::insert_in_list]: loop 0: Source: 'src/hashmap.rs', lines 97:4-114:5 *) @@ -103,12 +103,11 @@ let rec hashmap_HashMap_insert_in_list_loop begin match ls with | Hashmap_List_Cons ckey cvalue tl -> if ckey = key - then Return (false, Hashmap_List_Cons ckey value tl) + then Ok (false, Hashmap_List_Cons ckey value tl) else let* (b, tl1) = hashmap_HashMap_insert_in_list_loop t key value tl in - Return (b, Hashmap_List_Cons ckey cvalue tl1) - | Hashmap_List_Nil -> - Return (true, Hashmap_List_Cons key value Hashmap_List_Nil) + Ok (b, Hashmap_List_Cons ckey cvalue tl1) + | Hashmap_List_Nil -> Ok (true, Hashmap_List_Cons key value Hashmap_List_Nil) end (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::insert_in_list]: @@ -137,8 +136,8 @@ let hashmap_HashMap_insert_no_resize then let* i1 = usize_add self.num_entries 1 in let* v = index_mut_back l1 in - Return { self with num_entries = i1; slots = v } - else let* v = index_mut_back l1 in Return { self with slots = v } + Ok { self with num_entries = i1; slots = v } + else let* v = index_mut_back l1 in Ok { self with slots = v } (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::move_elements_from_list]: loop 0: Source: 'src/hashmap.rs', lines 183:4-196:5 *) @@ -152,7 +151,7 @@ let rec hashmap_HashMap_move_elements_from_list_loop | Hashmap_List_Cons k v 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 + | Hashmap_List_Nil -> Ok ntable end (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::move_elements_from_list]: @@ -183,7 +182,7 @@ let rec hashmap_HashMap_move_elements_loop let* i2 = usize_add i 1 in let* slots1 = index_mut_back l1 in hashmap_HashMap_move_elements_loop t ntable1 slots1 i2 - else Return (ntable, slots) + else Ok (ntable, slots) (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::move_elements]: Source: 'src/hashmap.rs', lines 171:4-171:95 *) @@ -209,10 +208,10 @@ let hashmap_HashMap_try_resize let* ntable = hashmap_HashMap_new_with_capacity t i3 i i1 in let* p = hashmap_HashMap_move_elements t ntable self.slots 0 in let (ntable1, _) = p in - Return + Ok { ntable1 with num_entries = self.num_entries; max_load_factor = (i, i1) } - else Return { self with max_load_factor = (i, i1) } + else Ok { self with max_load_factor = (i, i1) } (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::insert]: Source: 'src/hashmap.rs', lines 129:4-129:48 *) @@ -222,9 +221,7 @@ let hashmap_HashMap_insert = 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 + if i > self1.max_load then hashmap_HashMap_try_resize t self1 else Ok self1 (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::contains_key_in_list]: loop 0: Source: 'src/hashmap.rs', lines 206:4-219:5 *) @@ -236,9 +233,9 @@ let rec hashmap_HashMap_contains_key_in_list_loop begin match ls with | Hashmap_List_Cons ckey _ tl -> if ckey = key - then Return true + then Ok true else hashmap_HashMap_contains_key_in_list_loop t key tl - | Hashmap_List_Nil -> Return false + | Hashmap_List_Nil -> Ok false end (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::contains_key_in_list]: @@ -269,9 +266,7 @@ let rec hashmap_HashMap_get_in_list_loop = begin match ls with | Hashmap_List_Cons ckey cvalue tl -> - if ckey = key - then Return cvalue - else hashmap_HashMap_get_in_list_loop t key tl + if ckey = key then Ok cvalue else hashmap_HashMap_get_in_list_loop t key tl | Hashmap_List_Nil -> Fail Failure end @@ -305,14 +300,14 @@ let rec hashmap_HashMap_get_mut_in_list_loop | Hashmap_List_Cons ckey cvalue tl -> if ckey = key then - let back = fun ret -> Return (Hashmap_List_Cons ckey ret tl) in - Return (cvalue, back) + let back = fun ret -> Ok (Hashmap_List_Cons ckey ret tl) in + Ok (cvalue, back) else let* (x, back) = hashmap_HashMap_get_mut_in_list_loop t tl key in let back1 = fun ret -> - let* tl1 = back ret in Return (Hashmap_List_Cons ckey cvalue tl1) in - Return (x, back1) + let* tl1 = back ret in Ok (Hashmap_List_Cons ckey cvalue tl1) in + Ok (x, back1) | Hashmap_List_Nil -> Fail Failure end @@ -342,8 +337,8 @@ let hashmap_HashMap_get_mut fun ret -> let* l1 = get_mut_in_list_back ret in let* v = index_mut_back l1 in - Return { self with slots = v } in - Return (x, back) + Ok { self with slots = v } in + Ok (x, back) (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::remove_from_list]: loop 0: Source: 'src/hashmap.rs', lines 265:4-291:5 *) @@ -360,13 +355,13 @@ let rec hashmap_HashMap_remove_from_list_loop core_mem_replace (hashmap_List_t t) (Hashmap_List_Cons ckey x tl) Hashmap_List_Nil in begin match mv_ls with - | Hashmap_List_Cons _ cvalue tl1 -> Return (Some cvalue, tl1) + | Hashmap_List_Cons _ cvalue tl1 -> Ok (Some cvalue, tl1) | Hashmap_List_Nil -> Fail Failure end else let* (o, tl1) = hashmap_HashMap_remove_from_list_loop t key tl in - Return (o, Hashmap_List_Cons ckey x tl1) - | Hashmap_List_Nil -> Return (None, Hashmap_List_Nil) + Ok (o, Hashmap_List_Cons ckey x tl1) + | Hashmap_List_Nil -> Ok (None, Hashmap_List_Nil) end (** [hashmap_main::hashmap::{hashmap_main::hashmap::HashMap}::remove_from_list]: @@ -392,12 +387,11 @@ let hashmap_HashMap_remove self.slots hash_mod in let* (x, l1) = hashmap_HashMap_remove_from_list t key l in begin match x with - | None -> - let* v = index_mut_back l1 in Return (None, { self with slots = v }) + | None -> let* v = index_mut_back l1 in Ok (None, { self with slots = v }) | Some x1 -> let* i1 = usize_sub self.num_entries 1 in let* v = index_mut_back l1 in - Return (Some x1, { self with num_entries = i1; slots = v }) + Ok (Some x1, { self with num_entries = i1; slots = v }) end (** [hashmap_main::hashmap::test1]: @@ -434,7 +428,7 @@ let hashmap_test1 : result unit = then Fail Failure else let* i4 = hashmap_HashMap_get u64 hm6 1056 in - if not (i4 = 256) then Fail Failure else Return () + if not (i4 = 256) then Fail Failure else Ok () end (** [hashmap_main::insert_on_disk]: @@ -448,5 +442,5 @@ let insert_on_disk (** [hashmap_main::main]: Source: 'src/hashmap_main.rs', lines 16:0-16:13 *) let main : result unit = - Return () + Ok () -- cgit v1.2.3