-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathstring_delete_spec.k
More file actions
50 lines (46 loc) · 938 Bytes
/
string_delete_spec.k
File metadata and controls
50 lines (46 loc) · 938 Bytes
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_string/js-verifier.k"
module BST-SPEC
imports JS-VERIFIER
rule
<envs>...
ENVS:Bag
(.Bag => ?_:Bag)
...</envs>
<objs>...
tree(O)(T:StringTree)(P:Oid)
OBJS:Bag
(.Bag => ?_:Bag)
...</objs>
<k>
Call(
// %var("find_min"),
@o(1),
Undefined,
@Cons(O:Oid, @Nil))
=>
?M:String
...</k>
requires bst(T)
ensures (?M inStringSet tree_keys(T)) andBool ({ ?M } <=StringSet tree_keys(T))
rule
<envs>...
ENVS:Bag
(.Bag => ?_:Bag)
...</envs>
<objs>...
(tree(O1)(T1:StringTree)(P:Oid) => tree(?O2)(?T2:StringTree)(P:Oid))
OBJS:Bag
(.Bag => ?_:Bag)
...</objs>
<k>
Call(
// %var("remove"),
@o(3),
Undefined,
@Cons(V:String, @Cons(O1:NullableObject, @Nil)))
=>
?O2:NullableObject
...</k>
requires bst(T1)
ensures bst(?T2) andBool tree_keys(?T2) ==K tree_keys(T1) -StringSet { V }
endmodule