Skip to content

SYNTHESIZER: Conver do{ }while(0) to non-loop block #7744

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

Conversation

qinheping
Copy link
Collaborator

The following construct is common in C. It also appears in Kani compiled GOTO.

do {
  // loop body
} while (0)

However, the old contracts (non dfcc) doesn't support do/while loops. This PR as an ad hoc fix until we migrate the synthesizer to dfcc.

  • 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 changed the title SYNTHESIZERConver do{}while(0) to non-loop block SYNTHESIZER: Conver do{}while(0) to non-loop block May 31, 2023
@qinheping qinheping changed the title SYNTHESIZER: Conver do{}while(0) to non-loop block SYNTHESIZER: Conver do{ }while(0) to non-loop block May 31, 2023
@qinheping qinheping force-pushed the feature/do-while-loop-in-synthesizer branch from bf8f84e to 0f5e93e Compare May 31, 2023 17:00
@codecov
Copy link

codecov bot commented May 31, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.09 ⚠️

Comparison is base (0ca29d8) 78.55% compared to head (0f5e93e) 78.47%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7744      +/-   ##
===========================================
- Coverage    78.55%   78.47%   -0.09%     
===========================================
  Files         1691     1691              
  Lines       193132   193136       +4     
===========================================
- Hits        151714   151559     -155     
- Misses       41418    41577     +159     
Impacted Files Coverage Δ
...hesizer/enumerative_loop_contracts_synthesizer.cpp 96.27% <100.00%> (+0.07%) ⬆️

... and 13 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 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 Synthesis Invariant synthesis Code Contracts Function and loop contracts labels May 31, 2023
@tautschnig tautschnig merged commit 683b8ba into diffblue:develop Jun 1, 2023
@qinheping qinheping deleted the feature/do-while-loop-in-synthesizer branch October 18, 2023 21:58
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 Synthesis Invariant synthesis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants