HEVM: support boolean storage variables in equivalence checking #175
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Opening as a draft because I'm not quite sure what to do here, but equivalence checking currently fails for specs involving boolean storage variables. The following two should (I think) be equivalent:
But are reported as non equivalent by act. I think this is because of two reasons:
0
or1
We currently do not account for either when running our equivalence checks in act. The first seems relatively easy to deal with by asserting that bool values in calldata are either
0
or1
when constructing ourExpr
for the positive equivalence checkThe second I'm not really sure what to do. The final storage expression we get from hevm is:
whereas we generate:
I'm not sure what we should generate here. I also have the feeling that blindly matching the solidity semantics here might get us into trouble later down the road if we want to verify other languages...
@zoep very interested to hear your thoughts here?