summaryrefslogtreecommitdiff
path: root/tests/lean/hashmap/Hashmap/Clauses/Template.lean
blob: 2bc92153133b8d610da27d38cf75683fb90ef160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
-- THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS
-- [hashmap]: templates for the decreases clauses
import Base.Primitives
import Hashmap.Types

/- [hashmap::HashMap::{0}::allocate_slots]: termination measure -/
@[simp]
def hash_map_allocate_slots_loop_terminates (T : Type) (slots : vec (list_t T))
  (n : USize) :=
  (slots, n)

syntax "hash_map_allocate_slots_loop_decreases" term+ : tactic

macro_rules
| `(tactic| hash_map_allocate_slots_loop_decreases $slots $n) =>`(tactic| sorry)

/- [hashmap::HashMap::{0}::clear]: termination measure -/
@[simp]
def hash_map_clear_loop_terminates (T : Type) (slots : vec (list_t T))
  (i : USize) :=
  (slots, i)

syntax "hash_map_clear_loop_decreases" term+ : tactic

macro_rules
| `(tactic| hash_map_clear_loop_decreases $slots $i) =>`(tactic| sorry)

/- [hashmap::HashMap::{0}::insert_in_list]: termination measure -/
@[simp]
def hash_map_insert_in_list_loop_terminates (T : Type) (key : USize)
  (value : T) (ls : list_t T) :=
  (key, value, ls)

syntax "hash_map_insert_in_list_loop_decreases" term+ : tactic

macro_rules
| `(tactic| hash_map_insert_in_list_loop_decreases $key $value $ls) =>
  `(tactic| sorry)

/- [hashmap::HashMap::{0}::move_elements_from_list]: termination measure -/
@[simp]
def hash_map_move_elements_from_list_loop_terminates (T : Type)
  (ntable : hash_map_t T) (ls : list_t T) :=
  (ntable, ls)

syntax "hash_map_move_elements_from_list_loop_decreases" term+ : tactic

macro_rules
| `(tactic| hash_map_move_elements_from_list_loop_decreases $ntable $ls) =>
  `(tactic| sorry)

/- [hashmap::HashMap::{0}::move_elements]: termination measure -/
@[simp]
def hash_map_move_elements_loop_terminates (T : Type) (ntable : hash_map_t T)
  (slots : vec (list_t T)) (i : USize) :=
  (ntable, slots, i)

syntax "hash_map_move_elements_loop_decreases" term+ : tactic

macro_rules
| `(tactic| hash_map_move_elements_loop_decreases $ntable $slots $i) =>
  `(tactic| sorry)

/- [hashmap::HashMap::{0}::contains_key_in_list]: termination measure -/
@[simp]
def hash_map_contains_key_in_list_loop_terminates (T : Type) (key : USize)
  (ls : list_t T) :=
  (key, ls)

syntax "hash_map_contains_key_in_list_loop_decreases" term+ : tactic

macro_rules
| `(tactic| hash_map_contains_key_in_list_loop_decreases $key $ls) =>
  `(tactic| sorry)

/- [hashmap::HashMap::{0}::get_in_list]: termination measure -/
@[simp]
def hash_map_get_in_list_loop_terminates (T : Type) (key : USize)
  (ls : list_t T) :=
  (key, ls)

syntax "hash_map_get_in_list_loop_decreases" term+ : tactic

macro_rules
| `(tactic| hash_map_get_in_list_loop_decreases $key $ls) =>`(tactic| sorry)

/- [hashmap::HashMap::{0}::get_mut_in_list]: termination measure -/
@[simp]
def hash_map_get_mut_in_list_loop_terminates (T : Type) (ls : list_t T)
  (key : USize) :=
  (ls, key)

syntax "hash_map_get_mut_in_list_loop_decreases" term+ : tactic

macro_rules
| `(tactic| hash_map_get_mut_in_list_loop_decreases $ls $key) =>`(tactic| sorry)

/- [hashmap::HashMap::{0}::remove_from_list]: termination measure -/
@[simp]
def hash_map_remove_from_list_loop_terminates (T : Type) (key : USize)
  (ls : list_t T) :=
  (key, ls)

syntax "hash_map_remove_from_list_loop_decreases" term+ : tactic

macro_rules
| `(tactic| hash_map_remove_from_list_loop_decreases $key $ls) =>`(tactic| sorry)