Skip to content

CONTRACTS: Allow ID_index expressions in history variables #7060

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
merged 2 commits into from
Aug 19, 2022

Conversation

SaswatPadhi
Copy link
Contributor

Although ID_dereference expressions were previously allowed within history variables, ID_index expressions were not. This PR adds support for ID_index expressions as well.

In addition, this PR also adds a compilation check for history variable parameters. Previously they were only checked during instrumentation, and bad parameters were silently accepted during compilation.

  • 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/
  • 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.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@SaswatPadhi SaswatPadhi added enhancement aws Bugs or features of importance to AWS CBMC users Code Contracts Function and loop contracts labels Aug 5, 2022
@SaswatPadhi SaswatPadhi self-assigned this Aug 5, 2022
@codecov
Copy link

codecov bot commented Aug 6, 2022

Codecov Report

Merging #7060 (87a8ddb) into develop (12fae74) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop    #7060   +/-   ##
========================================
  Coverage    77.84%   77.84%           
========================================
  Files         1574     1574           
  Lines       181181   181191   +10     
========================================
+ Hits        141045   141055   +10     
  Misses       40136    40136           
Impacted Files Coverage Δ
src/ansi-c/c_typecheck_expr.cpp 77.35% <100.00%> (+0.09%) ⬆️
src/goto-instrument/contracts/contracts.cpp 94.31% <100.00%> (+<0.01%) ⬆️

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

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.

@SaswatPadhi Good catch! Only a few minor questions before approval. Could you also add CONTRACTS: as a prefix in the title of the PR?

@SaswatPadhi SaswatPadhi force-pushed the history-vars-fix branch 2 times, most recently from 49bcbdb to da4ead6 Compare August 19, 2022 17:17
@SaswatPadhi SaswatPadhi changed the title Allow ID_index expressions in history variables CONTRACTS: Allow ID_index expressions in history variables Aug 19, 2022
@SaswatPadhi SaswatPadhi merged commit 5c83574 into diffblue:develop Aug 19, 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 Code Contracts Function and loop contracts enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants