-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Description
Not necessary for ERC20 verifier, small workaround works.
module ISSUE
imports COLLECTIONS
imports STRING
configuration <k> $PGM:KItem </k>
<theSet> .Set </theSet>
syntax KItem ::= #checkArg ( String )
| "#included"
| "#notIncluded"
rule <k> #checkArg(ARG) => #included ...</k>
<theSet> S </theSet>
requires ARG in S
rule <k> #checkArg(ARG) => #notIncluded ...</k>
<theSet> S </theSet>
requires notBool ARG in S
rule X in ((SetItem(A) REST:Set) #as S) => X ==K A orBool X in REST [simplification, symbolic(S)]
endmodule
module NOTINCLUDEDSET-SPEC
imports ISSUE
rule <k> #checkArg("foo") => #notIncluded </k>
<theSet> SetItem(A:KItem) </theSet>
requires A =/=K "foo"
endmodule
Result:
#Not ( {
A
#Equals
"foo"
} )
#And
<generatedTop>
<k>
#included
</k>
<theSet>
SetItem ( A )
</theSet>
</generatedTop>
#And
{
"foo" in SetItem ( A )
#Equals
true
}
Positive specs works:
module INCLUDEDSET-SPEC
imports ISSUE
rule <k> #checkArg("foo") => #included </k>
<theSet> SetItem("foo") SetItem(A:KItem) </theSet>
requires A =/=K "foo"
endmodule