Skip to content

[CONTRACTS] Allow loop contracts annotated to goto statement #8281

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 1 commit into from
Jun 17, 2024

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.

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This PR now only allow loop contracts annotated to GOTO. Check for side effect will be in another PR.

@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

All modified and coverable lines are covered by tests ✅

Project coverage is 78.37%. Comparing base (8646bfa) to head (d2f185f).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8281      +/-   ##
===========================================
- Coverage    78.37%   78.37%   -0.01%     
===========================================
  Files         1726     1726              
  Lines       188322   188324       +2     
  Branches     18460    18484      +24     
===========================================
+ Hits        147606   147607       +1     
- Misses       40716    40717       +1     

☔ 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
@qinheping qinheping force-pushed the loop_contracts_in_goto_code branch 2 times, most recently from 75ceb8b to a9ab3af Compare June 17, 2024 06:05
@qinheping qinheping marked this pull request as ready for review June 17, 2024 06:08
@tautschnig tautschnig force-pushed the loop_contracts_in_goto_code branch from a9ab3af to 0a1bb6f Compare June 17, 2024 10:12
@tautschnig tautschnig enabled auto-merge June 17, 2024 11:52
@qinheping qinheping disabled auto-merge June 17, 2024 16:18
@qinheping qinheping enabled auto-merge June 17, 2024 16:18
@tautschnig tautschnig force-pushed the loop_contracts_in_goto_code branch from 0a1bb6f to d2f185f Compare June 17, 2024 21:32
@qinheping qinheping merged commit 521dbf0 into diffblue:develop Jun 17, 2024
40 checks passed
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.

3 participants