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] Allow loop contracts annotated to goto statement #8281

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

qinheping
Copy link
Collaborator

This PR enable loop contracts annotated to goto statement, which is we we do in Kani generated GOTO program.

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

@qinheping qinheping force-pushed the loop_contracts_in_goto_code branch from 8462c9f to 7de1747 Compare May 10, 2024 00:05
Comment on lines +1031 to +1032
warning().source_location = code.find_source_location();
warning() << "Loop invariants is not side-effect-free." << eom;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nobody reads warnings. Can you describe the scenario where side effects would be ok?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

According to the offline discussion. I will move all the checks and throw to contracts component. They should not be in the converter.

@qinheping qinheping changed the title [CONCTRACTS] Allow loop contracts annotated to goto statement [CONTRACTS] Allow loop contracts annotated to goto statement May 10, 2024
Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 58.82353% with 7 lines in your changes missing coverage. Please review.

Project coverage is 77.49%. Comparing base (f18b509) to head (7de1747).
Report is 32 commits behind head on develop.

Files Patch % Lines
src/ansi-c/goto-conversion/goto_convert.cpp 58.82% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8281      +/-   ##
===========================================
- Coverage    77.55%   77.49%   -0.07%     
===========================================
  Files         1721     1721              
  Lines       190128   190281     +153     
  Branches     18438    18371      -67     
===========================================
+ Hits        147448   147450       +2     
- Misses       42680    42831     +151     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@qinheping qinheping marked this pull request as draft May 29, 2024 16:07
@feliperodri feliperodri added aws Bugs or features of importance to AWS CBMC users Code Contracts Function and loop contracts labels Jun 8, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants