diff options
Diffstat (limited to 'tests/lean/hashmap_on_disk/HashmapMain/Clauses')
-rw-r--r-- | tests/lean/hashmap_on_disk/HashmapMain/Clauses/Clauses.lean | 111 | ||||
-rw-r--r-- | tests/lean/hashmap_on_disk/HashmapMain/Clauses/Template.lean | 9 |
2 files changed, 115 insertions, 5 deletions
diff --git a/tests/lean/hashmap_on_disk/HashmapMain/Clauses/Clauses.lean b/tests/lean/hashmap_on_disk/HashmapMain/Clauses/Clauses.lean new file mode 100644 index 00000000..16a4ea4c --- /dev/null +++ b/tests/lean/hashmap_on_disk/HashmapMain/Clauses/Clauses.lean @@ -0,0 +1,111 @@ +-- [hashmap_main]: decreases clauses +import Base.Primitives +import HashmapMain.Types + +/- [hashmap_main::hashmap::HashMap::{0}::allocate_slots]: termination measure -/ +@[simp] +def hashmap_hash_map_allocate_slots_loop_terminates (T : Type) + (slots : vec (hashmap_list_t T)) (n : USize) := + (slots, n) + +syntax "hashmap_hash_map_allocate_slots_loop_decreases" term+ : tactic + +macro_rules +| `(tactic| hashmap_hash_map_allocate_slots_loop_decreases $slots $n) => + `(tactic| sorry) + +/- [hashmap_main::hashmap::HashMap::{0}::clear]: termination measure -/ +@[simp] +def hashmap_hash_map_clear_loop_terminates (T : Type) + (slots : vec (hashmap_list_t T)) (i : USize) := + (slots, i) + +syntax "hashmap_hash_map_clear_loop_decreases" term+ : tactic + +macro_rules +| `(tactic| hashmap_hash_map_clear_loop_decreases $slots $i) =>`(tactic| sorry) + +/- [hashmap_main::hashmap::HashMap::{0}::insert_in_list]: termination measure -/ +@[simp] +def hashmap_hash_map_insert_in_list_loop_terminates (T : Type) (key : USize) + (value : T) (ls : hashmap_list_t T) := + (key, value, ls) + +syntax "hashmap_hash_map_insert_in_list_loop_decreases" term+ : tactic + +macro_rules +| `(tactic| hashmap_hash_map_insert_in_list_loop_decreases $key $value $ls) => + `(tactic| sorry) + +/- [hashmap_main::hashmap::HashMap::{0}::move_elements_from_list]: termination measure -/ +@[simp] +def hashmap_hash_map_move_elements_from_list_loop_terminates (T : Type) + (ntable : hashmap_hash_map_t T) (ls : hashmap_list_t T) := + (ntable, ls) + +syntax "hashmap_hash_map_move_elements_from_list_loop_decreases" term+ : tactic + +macro_rules +| `(tactic| hashmap_hash_map_move_elements_from_list_loop_decreases $ntable +$ls) =>`(tactic| sorry) + +/- [hashmap_main::hashmap::HashMap::{0}::move_elements]: termination measure -/ +@[simp] +def hashmap_hash_map_move_elements_loop_terminates (T : Type) + (ntable : hashmap_hash_map_t T) (slots : vec (hashmap_list_t T)) (i : USize) + := + (ntable, slots, i) + +syntax "hashmap_hash_map_move_elements_loop_decreases" term+ : tactic + +macro_rules +| `(tactic| hashmap_hash_map_move_elements_loop_decreases $ntable $slots $i) => + `(tactic| sorry) + +/- [hashmap_main::hashmap::HashMap::{0}::contains_key_in_list]: termination measure -/ +@[simp] +def hashmap_hash_map_contains_key_in_list_loop_terminates (T : Type) + (key : USize) (ls : hashmap_list_t T) := + (key, ls) + +syntax "hashmap_hash_map_contains_key_in_list_loop_decreases" term+ : tactic + +macro_rules +| `(tactic| hashmap_hash_map_contains_key_in_list_loop_decreases $key $ls) => + `(tactic| sorry) + +/- [hashmap_main::hashmap::HashMap::{0}::get_in_list]: termination measure -/ +@[simp] +def hashmap_hash_map_get_in_list_loop_terminates (T : Type) (key : USize) + (ls : hashmap_list_t T) := + (key, ls) + +syntax "hashmap_hash_map_get_in_list_loop_decreases" term+ : tactic + +macro_rules +| `(tactic| hashmap_hash_map_get_in_list_loop_decreases $key $ls) =>`(tactic| sorry) + +/- [hashmap_main::hashmap::HashMap::{0}::get_mut_in_list]: termination measure -/ +@[simp] +def hashmap_hash_map_get_mut_in_list_loop_terminates (T : Type) + (ls : hashmap_list_t T) (key : USize) := + (ls, key) + +syntax "hashmap_hash_map_get_mut_in_list_loop_decreases" term+ : tactic + +macro_rules +| `(tactic| hashmap_hash_map_get_mut_in_list_loop_decreases $ls $key) => + `(tactic| sorry) + +/- [hashmap_main::hashmap::HashMap::{0}::remove_from_list]: termination measure -/ +@[simp] +def hashmap_hash_map_remove_from_list_loop_terminates (T : Type) (key : USize) + (ls : hashmap_list_t T) := + (key, ls) + +syntax "hashmap_hash_map_remove_from_list_loop_decreases" term+ : tactic + +macro_rules +| `(tactic| hashmap_hash_map_remove_from_list_loop_decreases $key $ls) => + `(tactic| sorry) + diff --git a/tests/lean/hashmap_on_disk/HashmapMain/Clauses/Template.lean b/tests/lean/hashmap_on_disk/HashmapMain/Clauses/Template.lean index bf331d6e..3466e7e0 100644 --- a/tests/lean/hashmap_on_disk/HashmapMain/Clauses/Template.lean +++ b/tests/lean/hashmap_on_disk/HashmapMain/Clauses/Template.lean @@ -15,17 +15,16 @@ macro_rules | `(tactic| hashmap_hash_map_allocate_slots_loop_decreases $slots $n) => `(tactic| sorry) -/- [hashmap_main::hashmap::HashMap::{0}::clear_slots]: termination measure -/ +/- [hashmap_main::hashmap::HashMap::{0}::clear]: termination measure -/ @[simp] -def hashmap_hash_map_clear_slots_loop_terminates (T : Type) +def hashmap_hash_map_clear_loop_terminates (T : Type) (slots : vec (hashmap_list_t T)) (i : USize) := (slots, i) -syntax "hashmap_hash_map_clear_slots_loop_decreases" term+ : tactic +syntax "hashmap_hash_map_clear_loop_decreases" term+ : tactic macro_rules -| `(tactic| hashmap_hash_map_clear_slots_loop_decreases $slots $i) => - `(tactic| sorry) +| `(tactic| hashmap_hash_map_clear_loop_decreases $slots $i) =>`(tactic| sorry) /- [hashmap_main::hashmap::HashMap::{0}::insert_in_list]: termination measure -/ @[simp] |