forked from runtimeverification/verified-smart-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
imap.k
23 lines (20 loc) · 795 Bytes
/
imap.k
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module IMAP-SYNTAX
imports INT
syntax IMap [smt-prelude] // (define-sort IMap () (Array Int Int))
syntax IMap ::= IMap "[" Int "<-" Int "]" [function, klabel(store), smtlib(store), smt-prelude] //, hook(MAP.update)]
syntax Int ::= IMap "[" Int "]" [function, klabel(select), smtlib(select), smt-prelude] //, hook(MAP.lookup)]
syntax IMap ::= ".IMap"
endmodule
module IMAP-SYMBOLIC [symbolic]
imports IMAP-SYNTAX
rule M [ K0 <- V ] [ K ] => V requires K0 ==Int K
rule M [ K0 <- V ] [ K ] => M [ K ] requires K0 =/=Int K
// rule .IMap [ _ ] => 0
// syntax IntMap
// rule isInt( M:Map [ _ ] ) => isIntMap(M)
// rule isInt( M:Map [ _ <- V:Int ] ) => isIntMap(M)
endmodule
module IMAP
imports IMAP-SYNTAX
imports IMAP-SYMBOLIC
endmodule