-
Notifications
You must be signed in to change notification settings - Fork 273
Unwinding should use assertions as break condition #2101
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
Comments
I'd refer to #88 and #2031, where in particular the latter has interesting input from @martin-cs: it is perfectly conceivable for |
hmm.... interesting. That's one reason why I have in Yosys |
Assorted thoughts: *. See #2031 for discussion of the two possible semantics for ASSERT. From your description I would interpret your "assert" and "cover" to be each of these. *. See *. Yes, we could use ASSUME (the recommended way of getting the other semantics) in unwinding but there is always the question of how far we should go with this. Whatever loop unwinding check you do, short of using the solver (see path-wise support, unwinding assertions and incremental BMC), you will wind up with "obvious" things that it doesn't get. So, how far down this road should we go? I wouldn't recommend solely using ASSUMEs though. HTH |
@clairexen do you have further thoughts on this issue? |
Consider the following code:
cbmc will unwind that loop forever.
Adding the following (unreachable) return will fix unwinding and cbmc will correctly verify the assertion:
I think
assert(x);
should be treated likeif (!x) return;
for the purpose of loop unwinding. There is nothing to gain from unwinding a loop beyond a failed assertion.The text was updated successfully, but these errors were encountered: