-
Notifications
You must be signed in to change notification settings - Fork 277
Check inferred loop assigns clauses instead of blindly trusting them #6509
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
Check inferred loop assigns clauses instead of blindly trusting them #6509
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #6509 +/- ##
========================================
Coverage 75.98% 75.98%
========================================
Files 1578 1578
Lines 180910 180920 +10
========================================
+ Hits 137467 137477 +10
Misses 43443 43443
Continue to review full report at Codecov.
|
ff2ddce
to
245edcf
Compare
// TODO: Should we add the automatically detected local static variables | ||
// too ? (they are present in loop_assigns but not in assigns_clause, and | ||
// they are not necessarily touched by the loop). |
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.
Who might be able to answer that question, or how would we find out the answer?
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 should track this in a Github issue as well.
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 needs careful analysis, keeping it here.
One question about the PR note:
Can you provide more details on this? |
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.
Only minor comments.
// TODO: Should we add the automatically detected local static variables | ||
// too ? (they are present in loop_assigns but not in assigns_clause, and | ||
// they are not necessarily touched by the loop). |
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 should track this in a Github issue as well.
It seems that instrumenting the body of the loop adds a lot of extra complexity that the SMT backend cannot handle combined with the quantifier (arithmetic and pointer reasoning) (had to ctrl-c the analysis after 20+ minutes). I reduced the MAX_ARRAY_SIZE to make it pass. |
245edcf
to
ef52bb9
Compare
When no assigns clause is specified by the user for a loop, we infer one by inspecting assignment present in the loop body.
These inferred targets were havocked but not checked for correctness. This PR uses the inferred targets to instrument the loop as if it were user-provided.
regression/contracts/quantifiers-loop-02
;