-
Notifications
You must be signed in to change notification settings - Fork 284
CONTRACTS: havoc all statics by default #6829
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
CONTRACTS: havoc all statics by default #6829
Conversation
16debbc to
38b0c73
Compare
38b0c73 to
4c509aa
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6829 +/- ##
===========================================
+ Coverage 77.04% 77.79% +0.74%
===========================================
Files 1594 1567 -27
Lines 185287 179719 -5568
===========================================
- Hits 142763 139809 -2954
+ Misses 42524 39910 -2614
Continue to review full report at Codecov.
|
tautschnig
left a comment
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.
Approving except for the one debug left-over.
4c509aa to
d3b4899
Compare
0bc5526 to
cbe9326
Compare
feliperodri
left a comment
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.
LGTM apart from some debug leftovers.
Now calling nondet_static from enforce_contracts and apply_loop_contracts. Reordered some imports to match the new clang-format rules.
cbe9326 to
f2935a3
Compare
|
Hi, I answered @feliperodri 's questions and fixed the missing newline, this should be good to go now. |
|
@chris-ryder @martin-cs @peterschrammel could you take a look at this PR? It's missing a code owner review. |
| : ns(goto_model.symbol_table), | ||
| goto_model(goto_model), | ||
| symbol_table(goto_model.symbol_table), | ||
| goto_functions(goto_model.goto_functions), |
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.
Having goto_model, symbol_table and goto_functions is redundant.
Either have goto_model or symbol_table+goto_functions. I'd prefer the former.
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.
Ah, ok, I see. You are just using them as shortcuts for the goto_model members. That's fine.
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.
But then I wonder: is it really useful to have these at class level?
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.
Yes, might still be confusing that changing one thing has side effects on the other.
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.
Hi! I had to add the goto_model as a class member because the nondet static call I needed to add requires a goto_model. I also think that exploding the goto_model into shortcuts to its members is confusing as it could make you think these members are disconnected in some way. But it also seems like this style of having shortcuts to the symbol table, namespace of function maps like this occurs in several places in the codebase.
Do you want me to do a cleanup pass and remove shortcuts ?
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.
Yes, I would suggest that we clean out these particular short cuts. Note that the situation is a bit different from the widespread use of a namespace member for there is no risk of confusion as to whether a namespace is different or the same as the member of another class member. (In other words: the current code raises the question whether .symbol_table is the same as .goto_model.symbol_table or not.)
For soundness, automatically havoc all statics as soon as loop or function contracts are checked (same effect as
--nondet-static). Variables can still be manually excluded using--nondet-static-exclude.Havocing is not activated if only
--replace-call-with-contractis used in an otherwise classic harness-based proof (we already automatically detect static variables modified by a function and havoc them during replacement).