-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathfloat_delete_spec.k
50 lines (46 loc) · 1 KB
/
float_delete_spec.k
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
require "../patterns/tree_float/js-verifier.k"
module BST-SPEC
imports JS-VERIFIER
rule
<envs>...
ENVS:Bag
(.Bag => ?_:Bag)
...</envs>
<objs>...
tree(O)(T:FloatTree)
OBJS:Bag
(.Bag => ?_:Bag)
...</objs>
<k>
Call(
// %var("find_min"),
@o(2),
Undefined,
@Cons(O:Oid, @Nil))
=>
?M:Float{exponent(11), significand(53)}
...</k>
requires bst(T)
ensures (?M inFloatSet tree_keys(T)) andBool ({ ?M } <=FloatSet tree_keys(T)) andBool (notBool isNaN(?M))
rule
<envs>...
ENVS:Bag
(.Bag => ?_:Bag)
...</envs>
<objs>...
(tree(O1)(T1:FloatTree) => tree(?O2)(?T2:FloatTree))
OBJS:Bag
(.Bag => ?_:Bag)
...</objs>
<k>
Call(
// %var("remove"),
@o(4),
Undefined,
@Cons(V:Float{exponent(11), significand(53)}, @Cons(O1:NullableObject, @Nil)))
=>
?O2:NullableObject
...</k>
requires bst(T1) andBool (notBool isNaN(V))
ensures bst(?T2) andBool tree_keys(?T2) ==K tree_keys(T1) -FloatSet { V }
endmodule