summaryrefslogtreecommitdiff
path: root/tests/lean/Hashmap
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lean/Hashmap')
-rw-r--r--tests/lean/Hashmap/Funs.lean6
-rw-r--r--tests/lean/Hashmap/Properties.lean8
2 files changed, 4 insertions, 10 deletions
diff --git a/tests/lean/Hashmap/Funs.lean b/tests/lean/Hashmap/Funs.lean
index 30b30e0b..01c61de4 100644
--- a/tests/lean/Hashmap/Funs.lean
+++ b/tests/lean/Hashmap/Funs.lean
@@ -132,10 +132,6 @@ def HashMap.insert_no_resize
let v ← Vec.index_mut_back (List T) self.slots hash_mod l0
Result.ret { self with slots := v }
-/- [core::num::u32::{8}::MAX] -/
-def core_num_u32_max_body : Result U32 := Result.ret (U32.ofInt 4294967295)
-def core_num_u32_max_c : U32 := eval_global core_num_u32_max_body (by simp)
-
/- [hashmap::HashMap::{0}::move_elements_from_list]: loop 0: merged forward/backward function
(there is a single backward function, and the forward function returns ()) -/
divergent def HashMap.move_elements_from_list_loop
@@ -184,7 +180,7 @@ def HashMap.move_elements
(there is a single backward function, and the forward function returns ()) -/
def HashMap.try_resize (T : Type) (self : HashMap T) : Result (HashMap T) :=
do
- let max_usize ← Scalar.cast .Usize core_num_u32_max_c
+ let max_usize ← Scalar.cast .Usize core_u32_max
let capacity := Vec.len (List T) self.slots
let n1 ← max_usize / (Usize.ofInt 2)
let (i, i0) := self.max_load_factor
diff --git a/tests/lean/Hashmap/Properties.lean b/tests/lean/Hashmap/Properties.lean
index fe00ab14..4db54316 100644
--- a/tests/lean/Hashmap/Properties.lean
+++ b/tests/lean/Hashmap/Properties.lean
@@ -303,19 +303,17 @@ theorem insert_no_resize_spec {α : Type} (hm : HashMap α) (key : Usize) (value
| some _ => nhm.len_s = hm.len_s) := by
rw [insert_no_resize]
simp only [hash_key, bind_tc_ret] -- TODO: annoying
- have _ : (Vec.len (List α) hm.slots).val ≠ 0 := by checkpoint
+ have _ : (Vec.len (List α) hm.slots).val ≠ 0 := by
intro
simp_all [inv]
- progress keep _ as ⟨ hash_mod, hhm ⟩
- have _ : 0 ≤ hash_mod.val := by checkpoint scalar_tac
+ progress as ⟨ hash_mod, hhm ⟩
+ have _ : 0 ≤ hash_mod.val := by scalar_tac
have _ : hash_mod.val < Vec.length hm.slots := by
have : 0 < hm.slots.val.len := by
simp [inv] at hinv
simp [hinv]
-- TODO: we want to automate that
simp [*, Int.emod_lt_of_pos]
- -- TODO: change the spec of Vec.index_mut to introduce a let-binding.
- -- or: make progress introduce the let-binding by itself (this is clearer)
progress as ⟨ l, h_leq ⟩
-- TODO: make progress use the names written in the goal
progress as ⟨ inserted ⟩