-
Notifications
You must be signed in to change notification settings - Fork 262
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
Clarify usage of history variables in error messages #8456
base: develop
Are you sure you want to change the base?
Conversation
d5b6966
to
14a76a0
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8456 +/- ##
===========================================
- Coverage 78.38% 78.26% -0.13%
===========================================
Files 1726 1727 +1
Lines 188616 190082 +1466
Branches 18295 18526 +231
===========================================
+ Hits 147855 148773 +918
- Misses 40761 41309 +548 ☔ View full report in Codecov by Sentry. |
19dc6a3
to
698c22c
Compare
@@ -2476,6 +2476,18 @@ void smt2_convt::convert_expr(const exprt &expr) | |||
out << ')'; | |||
} | |||
} | |||
else if(expr.id() == ID_old) |
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.
Can't we detect this much earlier, e.g., in the C front-end during type checking? We actually already do some such checking, I think we just need to do more of it.
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't detect this during type checking as we can't distinguish expressions in loop invariants and in __CPROVER_assert
at that stage.
CBMC warned that it would ignore __CPROVER_loop_entry
in assertions during prop_conv when using SAT backend. However, when using SMT backend, CBMC would throw exception without notifying that the cause is invalid usage of loop_entry.
This PR patches the case of using SMT backend and clarify the correct usage of loop_entry when exception thrown.
698c22c
to
365924b
Compare
365924b
to
83f5c48
Compare
@tautschnig Any thoughts on this? |
I still believe we should identify this problem during parsing or type checking stages, even if it requires much larger changes. For the time being I'll re-assign to solver code owners. |
This problem should be identified and reported in a way that gives the clearest, understandable and actionable error message to the user. |
Resolve: #8453
loop_entry
expressions are only supported in loop contracts.old
expressions are only supported in function contracts. Using them in expressions in other places such as assertions may lead to conversion error.