Skip to content

Adds support for range annotation in assigns clauses #5972

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

Closed
wants to merge 3 commits into from

Conversation

feliperodri
Copy link
Collaborator

We proposed an initial support for array ranges based on the ACSL language at #5538. As discussed at #5966, this might not be the correct approach to handle arrays in assigns clause. I'll keep this PR open until we agree on a proper design for assigns clauses moving forward.

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

We now support ranges on code contracts when specifiying
which portions of an array should or should not change.
We update the parser and type checking to support this
new annotations within assigns clauses.

Signed-off-by: Felipe R. Monteiro <[email protected]>
We expand assigns clause's support to also handle
array ranges (e.g. `myArr[5 .. lastIdx]`) similarly to ACSL.

Signed-off-by: Felipe R. Monteiro <[email protected]>
Code contracts properly supports assigns clause with array ranges.
So, we added regression tests to validate this capability.

Signed-off-by: Felipe R. Monteiro <[email protected]>
@feliperodri feliperodri added do not review aws Bugs or features of importance to AWS CBMC users Code Contracts Function and loop contracts labels Mar 24, 2021
@feliperodri feliperodri self-assigned this Mar 24, 2021
@codecov
Copy link

codecov bot commented Mar 24, 2021

Codecov Report

Merging #5972 (fd6cef4) into develop (2459a7a) will increase coverage by 0.02%.
The diff coverage is 76.10%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5972      +/-   ##
===========================================
+ Coverage    75.01%   75.04%   +0.02%     
===========================================
  Files         1431     1431              
  Lines       155609   155715     +106     
===========================================
+ Hits        116732   116855     +123     
+ Misses       38877    38860      -17     
Impacted Files Coverage Δ
src/ansi-c/c_typecheck_base.h 100.00% <ø> (ø)
src/ansi-c/parser.y 77.40% <60.71%> (-0.33%) ⬇️
src/goto-instrument/code_contracts.cpp 87.89% <74.60%> (+4.35%) ⬆️
src/ansi-c/c_typecheck_expr.cpp 75.52% <100.00%> (+0.23%) ⬆️
src/ansi-c/scanner.l 61.75% <100.00%> (+0.03%) ⬆️
src/util/std_expr.h 93.23% <100.00%> (+0.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f899754...fd6cef4. Read the comment docs.

@feliperodri
Copy link
Collaborator Author

We decided to not move forward with this range annotation.

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 Code Contracts Function and loop contracts do not review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant