-
Notifications
You must be signed in to change notification settings - Fork 71
SymEx: Always require postcondition in verify* methods #900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7c99d64 to
f2412c2
Compare
msooseth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I added a comment, more as a reminder than anything else :)
| exploreContract :: forall m . App m | ||
| => SolverGroup | ||
| -> Maybe Fetch.Session | ||
| -> ByteString | ||
| -> Maybe Sig | ||
| -> [String] | ||
| -> VeriOpts | ||
| -> Maybe (Precondition RealWorld) | ||
| -> Maybe (Postcondition RealWorld) | ||
| -> m (Expr End, [VerifyResult]) | ||
| verifyContractWithSession solvers sess theCode signature' concreteArgs opts maybepre maybepost = do | ||
| -> m (Expr End) | ||
| exploreContract solvers theCode signature' concreteArgs opts maybepre = do | ||
| calldata <- mkCalldata signature' concreteArgs | ||
| preState <- liftIO $ stToIO $ abstractVM calldata theCode maybepre False | ||
| let fetcher = Fetch.oracle solvers sess opts.rpcInfo | ||
| verify solvers fetcher opts preState maybepost | ||
| let fetcher = Fetch.oracle solvers Nothing opts.rpcInfo | ||
| executeVM fetcher opts.iterConf preState | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is only used in one test. It will also need to be removed when we return an [Expr End], rather than an Expr End with a bunch of ITE's in it. So we can also remove it now, if you like, along with the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can keep it for now and remove/adjust later.
|
I guess I should add a changelog entry, since we are changing the signature of a function exposed to the outside world. |
I think we should always add a changelog entry unless it's a trivial PR :) But yeah. And then we can merge :) |
To make the core method simpler we always require postcondition to be given. If there is no postcondition, we are not really "verifying". However, there is a use case where we don't want to verify anything, we just want to explore a contract. For such use case, we provide a new helper method to do exactly that. `exploreContract` executes the contract symbolically, and returns its Expr representation.
f2412c2 to
dbc6476
Compare
Description
To make the core method simpler we always require postcondition to be given.
If there is no postcondition, we are not really "verifying". However, there is a use case where we don't want to verify anything, we just want to explore a contract.
For such use case, we provide a new helper method to do exactly that.
exploreContractexecutes the contract symbolically, and returns its Expr representation.Checklist