-
Notifications
You must be signed in to change notification settings - Fork 269
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
Adding CPROVER_assigns statement changes result #8527
Comments
Hi, The set of locations declared in the assigns clause is resolved once and for all upon loop entry, so when you write Since the loop assigns several cells within the array, an assigns clause that would work for this loop is rather: __CPROVER_assigns(i, idx, __CPROVER_object_whole(idx)) This is what is inferred automatically by
However, Does this help ? |
OK, great, thanks. Another related question: is there a way to tell cbmc that functions used in loop invariants are side-effect free? The option to disable this check seems to have been disabled in develop. goto-cc says that this loop invariant is not side-effect free, which isn't right?
|
Hi, I'd encourage you to use the latest version of Now for some background explanation:
|
CBMC version: 5.90.0 (cbmc-5.90.0-21-g6590981c4a
Operating system: MacOS 14.6.1
Exact command line resulting in the issue:
This is the file used:
These are the commands run
What behaviour did you expect:
I expect i, idx and *idx to be assignable (which they are, according to the results obtained using the inferred loop assigns statement). I also would not expect adding an explicit __CPROVER_assigns statement, which includes the same set of variables, to change the result.
What happened instead:
If you run the commands on the file above, 15 properties pass, including two that say:
If you add the __CPROVER_assigns statement, one of the check *idx is assignable properties fails:
The text was updated successfully, but these errors were encountered: