summaryrefslogtreecommitdiff
path: root/tests/hashmap/Hashmap.Funs.fst
diff options
context:
space:
mode:
authorSidney Congard2022-08-10 18:56:25 +0200
committerSidney Congard2022-08-10 18:56:25 +0200
commitcd754eabe3af025ca3465c5fc6d8cb48da66a1ae (patch)
tree34d1af8d8413d3e28ae779b2ff5c9e911f573e93 /tests/hashmap/Hashmap.Funs.fst
parent3c5fb260012ee8bb8b9fd90bc4624d893ac7678a (diff)
Corrected translation without using functions, remaining bug in hashmap translation
Diffstat (limited to 'tests/hashmap/Hashmap.Funs.fst')
-rw-r--r--tests/hashmap/Hashmap.Funs.fst19
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/hashmap/Hashmap.Funs.fst b/tests/hashmap/Hashmap.Funs.fst
index 921ed142..397ee720 100644
--- a/tests/hashmap/Hashmap.Funs.fst
+++ b/tests/hashmap/Hashmap.Funs.fst
@@ -248,24 +248,23 @@ let rec hash_map_move_elements_fwd_back
(** [hashmap::HashMap::{0}::try_resize] *)
let hash_map_try_resize_fwd_back
(t : Type0) (self : hash_map_t t) : result (hash_map_t t) =
- let i = core_num_u32_max_c in
- begin match scalar_cast U32 Usize i with
+ begin match scalar_cast U32 Usize core_num_u32_max_c with
| Fail -> Fail
| Return max_usize ->
let capacity = vec_len (list_t t) self.hash_map_slots in
begin match usize_div max_usize 2 with
| Fail -> Fail
| Return n1 ->
- let (i0, i1) = self.hash_map_max_load_factor in
- begin match usize_div n1 i0 with
+ let (i, i0) = self.hash_map_max_load_factor in
+ begin match usize_div n1 i with
| Fail -> Fail
- | Return i2 ->
- if capacity <= i2
+ | Return i1 ->
+ if capacity <= i1
then
begin match usize_mul capacity 2 with
| Fail -> Fail
- | Return i3 ->
- begin match hash_map_new_with_capacity_fwd t i3 i0 i1 with
+ | Return i2 ->
+ begin match hash_map_new_with_capacity_fwd t i2 i i0 with
| Fail -> Fail
| Return ntable ->
begin match
@@ -273,13 +272,13 @@ let hash_map_try_resize_fwd_back
with
| Fail -> Fail
| Return (ntable0, _) ->
- Return (Mkhash_map_t self.hash_map_num_entries (i0, i1)
+ Return (Mkhash_map_t self.hash_map_num_entries (i, i0)
ntable0.hash_map_max_load ntable0.hash_map_slots)
end
end
end
else
- Return (Mkhash_map_t self.hash_map_num_entries (i0, i1)
+ Return (Mkhash_map_t self.hash_map_num_entries (i, i0)
self.hash_map_max_load self.hash_map_slots)
end
end