summaryrefslogtreecommitdiff
path: root/tests/lean/Hashmap
diff options
context:
space:
mode:
authorNadrieril2024-05-24 15:48:27 +0200
committerNadrieril2024-05-24 16:11:59 +0200
commit37e8a0f5ff7d964eb9525fef765b38e44f79302b (patch)
tree1a45ea3fdd5f462cf57c5dcc07b988c62749c7cd /tests/lean/Hashmap
parent4d3778bea3112168645efc03308056ec341abb5f (diff)
Update test outputs
Diffstat (limited to 'tests/lean/Hashmap')
-rw-r--r--tests/lean/Hashmap/Funs.lean60
-rw-r--r--tests/lean/Hashmap/Types.lean4
2 files changed, 32 insertions, 32 deletions
diff --git a/tests/lean/Hashmap/Funs.lean b/tests/lean/Hashmap/Funs.lean
index cb11e5cf..4f05fbc8 100644
--- a/tests/lean/Hashmap/Funs.lean
+++ b/tests/lean/Hashmap/Funs.lean
@@ -7,12 +7,12 @@ open Primitives
namespace hashmap
/- [hashmap::hash_key]:
- Source: 'tests/src/hashmap.rs', lines 27:0-27:32 -/
+ Source: 'tests/src/hashmap.rs', lines 35:0-35:32 -/
def hash_key (k : Usize) : Result Usize :=
Result.ok k
/- [hashmap::{hashmap::HashMap<T>}::allocate_slots]: loop 0:
- Source: 'tests/src/hashmap.rs', lines 50:4-56:5 -/
+ Source: 'tests/src/hashmap.rs', lines 58:4-64:5 -/
divergent def HashMap.allocate_slots_loop
(T : Type) (slots : alloc.vec.Vec (List T)) (n : Usize) :
Result (alloc.vec.Vec (List T))
@@ -26,7 +26,7 @@ divergent def HashMap.allocate_slots_loop
else Result.ok slots
/- [hashmap::{hashmap::HashMap<T>}::allocate_slots]:
- Source: 'tests/src/hashmap.rs', lines 50:4-50:76 -/
+ Source: 'tests/src/hashmap.rs', lines 58:4-58:76 -/
def HashMap.allocate_slots
(T : Type) (slots : alloc.vec.Vec (List T)) (n : Usize) :
Result (alloc.vec.Vec (List T))
@@ -34,7 +34,7 @@ def HashMap.allocate_slots
HashMap.allocate_slots_loop T slots n
/- [hashmap::{hashmap::HashMap<T>}::new_with_capacity]:
- Source: 'tests/src/hashmap.rs', lines 59:4-63:13 -/
+ Source: 'tests/src/hashmap.rs', lines 67:4-71:13 -/
def HashMap.new_with_capacity
(T : Type) (capacity : Usize) (max_load_dividend : Usize)
(max_load_divisor : Usize) :
@@ -53,12 +53,12 @@ def HashMap.new_with_capacity
}
/- [hashmap::{hashmap::HashMap<T>}::new]:
- Source: 'tests/src/hashmap.rs', lines 75:4-75:24 -/
+ Source: 'tests/src/hashmap.rs', lines 83:4-83:24 -/
def HashMap.new (T : Type) : Result (HashMap T) :=
HashMap.new_with_capacity T 32#usize 4#usize 5#usize
/- [hashmap::{hashmap::HashMap<T>}::clear]: loop 0:
- Source: 'tests/src/hashmap.rs', lines 80:4-88:5 -/
+ Source: 'tests/src/hashmap.rs', lines 88:4-96:5 -/
divergent def HashMap.clear_loop
(T : Type) (slots : alloc.vec.Vec (List T)) (i : Usize) :
Result (alloc.vec.Vec (List T))
@@ -76,19 +76,19 @@ divergent def HashMap.clear_loop
else Result.ok slots
/- [hashmap::{hashmap::HashMap<T>}::clear]:
- Source: 'tests/src/hashmap.rs', lines 80:4-80:27 -/
+ Source: 'tests/src/hashmap.rs', lines 88:4-88:27 -/
def HashMap.clear (T : Type) (self : HashMap T) : Result (HashMap T) :=
do
let hm ← HashMap.clear_loop T self.slots 0#usize
Result.ok { self with num_entries := 0#usize, slots := hm }
/- [hashmap::{hashmap::HashMap<T>}::len]:
- Source: 'tests/src/hashmap.rs', lines 90:4-90:30 -/
+ Source: 'tests/src/hashmap.rs', lines 98:4-98:30 -/
def HashMap.len (T : Type) (self : HashMap T) : Result Usize :=
Result.ok self.num_entries
/- [hashmap::{hashmap::HashMap<T>}::insert_in_list]: loop 0:
- Source: 'tests/src/hashmap.rs', lines 97:4-114:5 -/
+ Source: 'tests/src/hashmap.rs', lines 105:4-122:5 -/
divergent def HashMap.insert_in_list_loop
(T : Type) (key : Usize) (value : T) (ls : List T) :
Result (Bool × (List T))
@@ -104,7 +104,7 @@ divergent def HashMap.insert_in_list_loop
| List.Nil => Result.ok (true, List.Cons key value List.Nil)
/- [hashmap::{hashmap::HashMap<T>}::insert_in_list]:
- Source: 'tests/src/hashmap.rs', lines 97:4-97:71 -/
+ Source: 'tests/src/hashmap.rs', lines 105:4-105:71 -/
def HashMap.insert_in_list
(T : Type) (key : Usize) (value : T) (ls : List T) :
Result (Bool × (List T))
@@ -112,7 +112,7 @@ def HashMap.insert_in_list
HashMap.insert_in_list_loop T key value ls
/- [hashmap::{hashmap::HashMap<T>}::insert_no_resize]:
- Source: 'tests/src/hashmap.rs', lines 117:4-117:54 -/
+ Source: 'tests/src/hashmap.rs', lines 125:4-125:54 -/
def HashMap.insert_no_resize
(T : Type) (self : HashMap T) (key : Usize) (value : T) :
Result (HashMap T)
@@ -136,7 +136,7 @@ def HashMap.insert_no_resize
Result.ok { self with slots := v }
/- [hashmap::{hashmap::HashMap<T>}::move_elements_from_list]: loop 0:
- Source: 'tests/src/hashmap.rs', lines 183:4-196:5 -/
+ Source: 'tests/src/hashmap.rs', lines 191:4-204:5 -/
divergent def HashMap.move_elements_from_list_loop
(T : Type) (ntable : HashMap T) (ls : List T) : Result (HashMap T) :=
match ls with
@@ -147,13 +147,13 @@ divergent def HashMap.move_elements_from_list_loop
| List.Nil => Result.ok ntable
/- [hashmap::{hashmap::HashMap<T>}::move_elements_from_list]:
- Source: 'tests/src/hashmap.rs', lines 183:4-183:72 -/
+ Source: 'tests/src/hashmap.rs', lines 191:4-191:72 -/
def HashMap.move_elements_from_list
(T : Type) (ntable : HashMap T) (ls : List T) : Result (HashMap T) :=
HashMap.move_elements_from_list_loop T ntable ls
/- [hashmap::{hashmap::HashMap<T>}::move_elements]: loop 0:
- Source: 'tests/src/hashmap.rs', lines 171:4-180:5 -/
+ Source: 'tests/src/hashmap.rs', lines 179:4-188:5 -/
divergent def HashMap.move_elements_loop
(T : Type) (ntable : HashMap T) (slots : alloc.vec.Vec (List T)) (i : Usize)
:
@@ -174,7 +174,7 @@ divergent def HashMap.move_elements_loop
else Result.ok (ntable, slots)
/- [hashmap::{hashmap::HashMap<T>}::move_elements]:
- Source: 'tests/src/hashmap.rs', lines 171:4-171:95 -/
+ Source: 'tests/src/hashmap.rs', lines 179:4-179:95 -/
def HashMap.move_elements
(T : Type) (ntable : HashMap T) (slots : alloc.vec.Vec (List T)) (i : Usize)
:
@@ -183,7 +183,7 @@ def HashMap.move_elements
HashMap.move_elements_loop T ntable slots i
/- [hashmap::{hashmap::HashMap<T>}::try_resize]:
- Source: 'tests/src/hashmap.rs', lines 140:4-140:28 -/
+ Source: 'tests/src/hashmap.rs', lines 148:4-148:28 -/
def HashMap.try_resize (T : Type) (self : HashMap T) : Result (HashMap T) :=
do
let max_usize ← Scalar.cast .Usize core_u32_max
@@ -207,7 +207,7 @@ def HashMap.try_resize (T : Type) (self : HashMap T) : Result (HashMap T) :=
else Result.ok { self with max_load_factor := (i, i1) }
/- [hashmap::{hashmap::HashMap<T>}::insert]:
- Source: 'tests/src/hashmap.rs', lines 129:4-129:48 -/
+ Source: 'tests/src/hashmap.rs', lines 137:4-137:48 -/
def HashMap.insert
(T : Type) (self : HashMap T) (key : Usize) (value : T) :
Result (HashMap T)
@@ -220,7 +220,7 @@ def HashMap.insert
else Result.ok self1
/- [hashmap::{hashmap::HashMap<T>}::contains_key_in_list]: loop 0:
- Source: 'tests/src/hashmap.rs', lines 206:4-219:5 -/
+ Source: 'tests/src/hashmap.rs', lines 214:4-227:5 -/
divergent def HashMap.contains_key_in_list_loop
(T : Type) (key : Usize) (ls : List T) : Result Bool :=
match ls with
@@ -231,13 +231,13 @@ divergent def HashMap.contains_key_in_list_loop
| List.Nil => Result.ok false
/- [hashmap::{hashmap::HashMap<T>}::contains_key_in_list]:
- Source: 'tests/src/hashmap.rs', lines 206:4-206:68 -/
+ Source: 'tests/src/hashmap.rs', lines 214:4-214:68 -/
def HashMap.contains_key_in_list
(T : Type) (key : Usize) (ls : List T) : Result Bool :=
HashMap.contains_key_in_list_loop T key ls
/- [hashmap::{hashmap::HashMap<T>}::contains_key]:
- Source: 'tests/src/hashmap.rs', lines 199:4-199:49 -/
+ Source: 'tests/src/hashmap.rs', lines 207:4-207:49 -/
def HashMap.contains_key
(T : Type) (self : HashMap T) (key : Usize) : Result Bool :=
do
@@ -250,7 +250,7 @@ def HashMap.contains_key
HashMap.contains_key_in_list T key l
/- [hashmap::{hashmap::HashMap<T>}::get_in_list]: loop 0:
- Source: 'tests/src/hashmap.rs', lines 224:4-237:5 -/
+ Source: 'tests/src/hashmap.rs', lines 232:4-245:5 -/
divergent def HashMap.get_in_list_loop
(T : Type) (key : Usize) (ls : List T) : Result T :=
match ls with
@@ -261,12 +261,12 @@ divergent def HashMap.get_in_list_loop
| List.Nil => Result.fail .panic
/- [hashmap::{hashmap::HashMap<T>}::get_in_list]:
- Source: 'tests/src/hashmap.rs', lines 224:4-224:70 -/
+ Source: 'tests/src/hashmap.rs', lines 232:4-232:70 -/
def HashMap.get_in_list (T : Type) (key : Usize) (ls : List T) : Result T :=
HashMap.get_in_list_loop T key ls
/- [hashmap::{hashmap::HashMap<T>}::get]:
- Source: 'tests/src/hashmap.rs', lines 239:4-239:55 -/
+ Source: 'tests/src/hashmap.rs', lines 247:4-247:55 -/
def HashMap.get (T : Type) (self : HashMap T) (key : Usize) : Result T :=
do
let hash ← hash_key key
@@ -278,7 +278,7 @@ def HashMap.get (T : Type) (self : HashMap T) (key : Usize) : Result T :=
HashMap.get_in_list T key l
/- [hashmap::{hashmap::HashMap<T>}::get_mut_in_list]: loop 0:
- Source: 'tests/src/hashmap.rs', lines 245:4-254:5 -/
+ Source: 'tests/src/hashmap.rs', lines 253:4-262:5 -/
divergent def HashMap.get_mut_in_list_loop
(T : Type) (ls : List T) (key : Usize) :
Result (T × (T → Result (List T)))
@@ -301,7 +301,7 @@ divergent def HashMap.get_mut_in_list_loop
| List.Nil => Result.fail .panic
/- [hashmap::{hashmap::HashMap<T>}::get_mut_in_list]:
- Source: 'tests/src/hashmap.rs', lines 245:4-245:86 -/
+ Source: 'tests/src/hashmap.rs', lines 253:4-253:86 -/
def HashMap.get_mut_in_list
(T : Type) (ls : List T) (key : Usize) :
Result (T × (T → Result (List T)))
@@ -309,7 +309,7 @@ def HashMap.get_mut_in_list
HashMap.get_mut_in_list_loop T ls key
/- [hashmap::{hashmap::HashMap<T>}::get_mut]:
- Source: 'tests/src/hashmap.rs', lines 257:4-257:67 -/
+ Source: 'tests/src/hashmap.rs', lines 265:4-265:67 -/
def HashMap.get_mut
(T : Type) (self : HashMap T) (key : Usize) :
Result (T × (T → Result (HashMap T)))
@@ -331,7 +331,7 @@ def HashMap.get_mut
Result.ok (t, back)
/- [hashmap::{hashmap::HashMap<T>}::remove_from_list]: loop 0:
- Source: 'tests/src/hashmap.rs', lines 265:4-291:5 -/
+ Source: 'tests/src/hashmap.rs', lines 273:4-299:5 -/
divergent def HashMap.remove_from_list_loop
(T : Type) (key : Usize) (ls : List T) : Result ((Option T) × (List T)) :=
match ls with
@@ -350,13 +350,13 @@ divergent def HashMap.remove_from_list_loop
| List.Nil => Result.ok (none, List.Nil)
/- [hashmap::{hashmap::HashMap<T>}::remove_from_list]:
- Source: 'tests/src/hashmap.rs', lines 265:4-265:69 -/
+ Source: 'tests/src/hashmap.rs', lines 273:4-273:69 -/
def HashMap.remove_from_list
(T : Type) (key : Usize) (ls : List T) : Result ((Option T) × (List T)) :=
HashMap.remove_from_list_loop T key ls
/- [hashmap::{hashmap::HashMap<T>}::remove]:
- Source: 'tests/src/hashmap.rs', lines 294:4-294:52 -/
+ Source: 'tests/src/hashmap.rs', lines 302:4-302:52 -/
def HashMap.remove
(T : Type) (self : HashMap T) (key : Usize) :
Result ((Option T) × (HashMap T))
@@ -381,7 +381,7 @@ def HashMap.remove
Result.ok (some x1, { self with num_entries := i1, slots := v })
/- [hashmap::test1]:
- Source: 'tests/src/hashmap.rs', lines 315:0-315:10 -/
+ Source: 'tests/src/hashmap.rs', lines 323:0-323:10 -/
def test1 : Result Unit :=
do
let hm ← HashMap.new U64
diff --git a/tests/lean/Hashmap/Types.lean b/tests/lean/Hashmap/Types.lean
index c99ba8d0..a98b972f 100644
--- a/tests/lean/Hashmap/Types.lean
+++ b/tests/lean/Hashmap/Types.lean
@@ -6,13 +6,13 @@ open Primitives
namespace hashmap
/- [hashmap::List]
- Source: 'tests/src/hashmap.rs', lines 19:0-19:16 -/
+ Source: 'tests/src/hashmap.rs', lines 27:0-27:16 -/
inductive List (T : Type) :=
| Cons : Usize → T → List T → List T
| Nil : List T
/- [hashmap::HashMap]
- Source: 'tests/src/hashmap.rs', lines 35:0-35:21 -/
+ Source: 'tests/src/hashmap.rs', lines 43:0-43:21 -/
structure HashMap (T : Type) where
num_entries : Usize
max_load_factor : (Usize × Usize)