We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For some cases model checker unrolls a loop even after it should complete.
run compiler with --model-checker-engine bmc --model-checker-bmc-loop-iterations 5 --model-checker-solvers z3 on the following contract:
--model-checker-engine bmc --model-checker-bmc-loop-iterations 5 --model-checker-solvers z3
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.0; contract C { uint x; uint y; function condition() private returns(bool) { x = (x + 1) % 2; return (x == 1); } function f() public { require(x == 0); require(y == 0); for (; condition();) { ++y; } assert(y == 1); } }
I expect the assertion y == 1 to hold but it fails, y > 1 holds and it shouldn't. There is a similar bug in while and do while loops.
y == 1
y > 1
while
do while
The text was updated successfully, but these errors were encountered:
hi can anyone assign me this? I can look into it!
Sorry, something went wrong.
Hi @agnxsh. There is already a PR fixing this: #14448
sure
pgebal
Successfully merging a pull request may close this issue.
Description
For some cases model checker unrolls a loop even after it should complete.
Environment
Steps to Reproduce
run compiler with
--model-checker-engine bmc --model-checker-bmc-loop-iterations 5 --model-checker-solvers z3
on the following contract:I expect the assertion
y == 1
to hold but it fails,y > 1
holds and it shouldn't.There is a similar bug in
while
anddo while
loops.The text was updated successfully, but these errors were encountered: