Skip to content
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: class to instrument a single loop #7672

Conversation

remi-delmas-3000
Copy link
Collaborator

The first commit is from #7671, do not review.

The second commit adds a class that applies loop contract transformation to a single loop in a goto program.

The PR is extracted from the larger PR #7541 and will be tested once all features have been merged.

  • 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.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • 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).
  • 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.

@remi-delmas-3000 remi-delmas-3000 self-assigned this Apr 18, 2023
@remi-delmas-3000 remi-delmas-3000 added aws Bugs or features of importance to AWS CBMC users aws-high Code Contracts Function and loop contracts labels Apr 18, 2023
@codecov
Copy link

codecov bot commented Apr 18, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.06 🎉

Comparison is base (abad42b) 78.44% compared to head (c9f2932) 78.50%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7672      +/-   ##
===========================================
+ Coverage    78.44%   78.50%   +0.06%     
===========================================
  Files         1674     1674              
  Lines       191946   191954       +8     
===========================================
+ Hits        150567   150698     +131     
+ Misses       41379    41256     -123     
Impacted Files Coverage Δ
...strument/contracts/dynamic-frames/dfcc_library.cpp 91.01% <0.00%> (-2.64%) ⬇️

... and 18 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@remi-delmas-3000 remi-delmas-3000 changed the title Contracts instrument loop CONTRACTS: class to instrument a single loop Apr 18, 2023
@remi-delmas-3000 remi-delmas-3000 force-pushed the contracts-instrument-loop branch 2 times, most recently from 08dfebc to 6143154 Compare April 20, 2023 19:37
Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

Some preliminary comments, more reviewing to be done.

Comment on lines 98 to 102
const auto old_decreases_var =
new_tmp_symbol(clause.type(), head_location, language_mode, symbol_table)
.symbol_expr();
old_decreases_vars.push_back(old_decreases_var);
// new
const auto new_decreases_var =
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think the names of those temporaries add a lot of value, could you please just do old_decreases_vars.push_back(new_tmp_symbol... and new_decreases_vars.push_back(new_tmp_symbol...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

proper naming helps a lot for debugging

@tautschnig tautschnig removed their assignment Apr 24, 2023
@remi-delmas-3000 remi-delmas-3000 force-pushed the contracts-instrument-loop branch 2 times, most recently from d08a0e7 to 9a0c7d8 Compare May 2, 2023 16:41
Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

Just some minor suggestions.

Co-authored-by: Qinheping Hu <qinhh@amazon.com>"
@remi-delmas-3000 remi-delmas-3000 merged commit cafbcc4 into diffblue:develop May 5, 2023
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