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: Support slice targets in loop assigns clauses #7127

Merged

Conversation

remi-delmas-3000
Copy link
Collaborator

@remi-delmas-3000 remi-delmas-3000 commented Sep 13, 2022

Depends on #7086 (first two commits).
Fixes #6979.

Drop support for __CPROVER_POINTER_OBJECT in function contract and loop assigns clauses. Extend support for __CPROVER_typed_target, __CPROVER_assignable, __CPROVER_object_whole, __CPROVER_object_from, __CPROVER_object_upto to loop contracts.

  • 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.

@codecov
Copy link

codecov bot commented Sep 13, 2022

Codecov Report

Base: 78.31% // Head: 78.49% // Increases project coverage by +0.17% 🎉

Coverage data is based on head (a3a10cb) compared to base (42d5ce2).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head a3a10cb differs from pull request most recent head 39118f4. Consider uploading reports for the commit 39118f4 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7127      +/-   ##
===========================================
+ Coverage    78.31%   78.49%   +0.17%     
===========================================
  Files         1667     1667              
  Lines       191475   191516      +41     
===========================================
+ Hits        149958   150330     +372     
+ Misses       41517    41186     -331     
Impacted Files Coverage Δ
src/ansi-c/c_typecheck_code.cpp 80.06% <ø> (-0.11%) ⬇️
src/goto-instrument/havoc_utils.cpp 100.00% <ø> (ø)
src/goto-instrument/havoc_utils.h 100.00% <ø> (ø)
src/goto-instrument/contracts/contracts.cpp 95.55% <100.00%> (+<0.01%) ⬆️
src/goto-instrument/contracts/utils.cpp 93.08% <100.00%> (+1.38%) ⬆️
src/goto-instrument/contracts/utils.h 100.00% <100.00%> (ø)
src/util/std_expr.h 93.15% <0.00%> (+0.17%) ⬆️
src/util/bitvector_expr.h 97.41% <0.00%> (+0.23%) ⬆️
src/solvers/flattening/boolbv_typecast.cpp 49.00% <0.00%> (+0.33%) ⬆️
... and 20 more

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

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

@feliperodri feliperodri added aws Bugs or features of importance to AWS CBMC users Code Contracts Function and loop contracts labels Sep 15, 2022
@feliperodri feliperodri changed the title CONTRACTS: support slice targets in loop assigns clauses CONTRACTS: Support slice targets in loop assigns clauses Oct 7, 2022
@jimgrundy
Copy link
Collaborator

@remi-delmas-3000 Is the "dependent-do-not-merge" tag still appropriate for this? Looks like the dependency was merged. Is it time to rebase and wake up the reviewers on this one?

src/ansi-c/c_typecheck_code.cpp Outdated Show resolved Hide resolved
src/ansi-c/c_typecheck_code.cpp Outdated Show resolved Hide resolved
@remi-delmas-3000
Copy link
Collaborator Author

@feliperodri @qinheping @tautschnig can I get a quick review of this one ? It is needed for #7541

@remi-delmas-3000 remi-delmas-3000 force-pushed the assigns-slice-loop-contracts branch 2 times, most recently from 5eee562 to 2411dec Compare February 15, 2023 22:41
src/goto-instrument/contracts/utils.cpp Outdated Show resolved Hide resolved
src/goto-instrument/contracts/utils.h Outdated Show resolved Hide resolved
@remi-delmas-3000 remi-delmas-3000 force-pushed the assigns-slice-loop-contracts branch 2 times, most recently from f578d92 to a3a10cb Compare February 15, 2023 23:12
Copy link
Collaborator

@feliperodri feliperodri left a comment

Choose a reason for hiding this comment

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

LGTM modulo Michael's comments.

Changes:
- Drop support for __CPROVER_POINTER_OBJECT
  in assigns clauses in the front-end
- Add methods to havoc __CPROVER_assignable,
  __CPROVER_object_whole, __CPROVER_object_from,
  __CPROVER_object_upto in havoc_assigns_targett.
- update tests
- add new tests
@remi-delmas-3000 remi-delmas-3000 force-pushed the assigns-slice-loop-contracts branch from a3a10cb to 39118f4 Compare February 16, 2023 14:45
@tautschnig tautschnig merged commit 5cb6441 into diffblue:develop Feb 16, 2023
@remi-delmas-3000 remi-delmas-3000 deleted the assigns-slice-loop-contracts branch February 21, 2023 16:29
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.

__CPROVER_object_slice and __CPROVER_object_from are used in the loop specification and have some problems.
4 participants