Skip to content

CONTRACTS: look for dirty symbols in OTHER instructions. #7085

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

Merged

Conversation

remi-delmas-3000
Copy link
Collaborator

Traverse OTHER instructions subexpressions when the statement is ID_array_* or ID_havoc_object, which
dirtyt does not do and is needed for assigns clause checking when array operations are involved.
Array ops are not supported in the current contract implementation so there is no impact on tests or performance.
This feature will be used in the upcoming dynamic frame condition checking PR.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • [n/a] The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • [n/a] Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • [n/a] My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Traverse `OTHER` instructions subexpressions
when the `statement` is `ID_array_*` or
`ID_havoc_object`.
@codecov
Copy link

codecov bot commented Aug 25, 2022

Codecov Report

Merging #7085 (f4d92f2) into develop (9bbce17) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop    #7085   +/-   ##
========================================
  Coverage    77.85%   77.85%           
========================================
  Files         1574     1574           
  Lines       181235   181245   +10     
========================================
+ Hits        141099   141109   +10     
  Misses       40136    40136           
Impacted Files Coverage Δ
...c/solvers/smt2_incremental/convert_expr_to_smt.cpp 82.35% <ø> (ø)
..._incremental/smt2_incremental_decision_procedure.h 75.00% <ø> (ø)
src/goto-instrument/contracts/cfg_info.h 87.67% <100.00%> (+2.67%) ⬆️
...ncremental/smt2_incremental_decision_procedure.cpp 95.98% <100.00%> (ø)
...ncremental/smt2_incremental_decision_procedure.cpp 98.00% <100.00%> (ø)
src/analyses/dirty.h 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@feliperodri feliperodri added aws Bugs or features of importance to AWS CBMC users aws-high Code Contracts Function and loop contracts labels Aug 29, 2022
Comment on lines +57 to +76
void collect_other(const goto_functiont &goto_function)
{
for(const auto &i : goto_function.body.instructions)
{
if(i.is_other())
{
auto &statement = i.get_other().get_statement();
if(
statement == ID_array_set || statement == ID_array_copy ||
statement == ID_array_replace || statement == ID_array_equal ||
statement == ID_havoc_object)
{
for(const auto &op : i.get_other().operands())
{
find_dirty(op);
}
}
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but why not incorporate this change into dirtyt class itself?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modifying dirtyt could have wide-ranging repercussions since many other analyses depend on it.

@remi-delmas-3000 remi-delmas-3000 merged commit e448fd4 into diffblue:develop Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Bugs or features of importance to AWS CBMC users aws-high Code Contracts Function and loop contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants