-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Labels
Description
#lookupMemory implementation:
syntax Int ::= #lookupMemory ( Map , Int ) [function, functional, smtlib(lookupMemory)]
rule [#lookupMemory.some]: #lookupMemory( (KEY |-> VAL:Int) _M, KEY ) => VAL modInt 256
rule [#lookupMemory.none]: #lookupMemory( M, KEY ) => 0 requires notBool KEY in_keys(M)
//Impossible case, for completeness
rule [#lookupMemory.notInt]: #lookupMemory( (KEY |-> VAL ) _M, KEY ) => 0 requires notBool isInt(VAL)
Test:
rule <k> runLemma ( #lookupMemory((KEY |-> 33), KEY') ) => doneLemma ( 0 ) ... </k> requires notBool KEY' in_keys(KEY |-> 33)
Result:
#Not ( {
#lookupMemory ( KEY |-> 33 , KEY' )
#Equals
0
} )
#And
#Not ( {
KEY
#Equals
KEY':Int
} )
#And
<kevm>
<k>
doneLemma ( #lookupMemory ( KEY |-> 33 , KEY' ) ) ~> DotVar2 ~> .
</k>
...