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

SYNTHESIZER: Use only symbols from the original goto as terminals #7970

Merged

Conversation

qinheping
Copy link
Collaborator

Collecting variables from trace will also collect those variables added during loop transformation, such as the car variables. Those variables should not appear in the loop contracts. This commit erases them from the terminals of the enumerating grammar used by the synthesizer.

  • 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 added Synthesis Invariant synthesis aws Bugs or features of importance to AWS CBMC users labels Oct 19, 2023
Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

Is it possible to include a test that demonstrates what difference this change makes?

Comment on lines 259 to 262
auto tmp = it;
tmp++;
result.erase(it);
it = tmp;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it = result.erase(it); be sufficient here?

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2bab0b3) 78.83% compared to head (535bf95) 78.59%.
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7970      +/-   ##
===========================================
- Coverage    78.83%   78.59%   -0.24%     
===========================================
  Files         1701     1701              
  Lines       196265   196270       +5     
===========================================
- Hits        154729   154264     -465     
- Misses       41536    42006     +470     
Files Coverage Δ
...hesizer/enumerative_loop_contracts_synthesizer.cpp 96.34% <100.00%> (+0.06%) ⬆️
...nthesizer/enumerative_loop_contracts_synthesizer.h 100.00% <100.00%> (ø)

... and 45 files with indirect coverage changes

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

@qinheping
Copy link
Collaborator Author

qinheping commented Oct 20, 2023

Is it possible to include a test that demonstrates what difference this change makes?

The only difference is the performance of the enumeration. For example, it took 38 seconds to run the benchmark synthesizer_04
https://github.com/diffblue/cbmc/actions/runs/6506277751/job/17671527177?pr=7946#step:13:10913.
With this PR, the running time goes down to 2 seconds: https://github.com/diffblue/cbmc/actions/runs/6580619258/job/17878990179?pr=7970#step:13:10787.

Collecting variables from trace will also collect those variables added during loop transformation, such as the car variables.
Such variables should not appear in the loop contracts.
This commit erases them from the terminals of the enumearting grammar used by the synthesizer.
@qinheping qinheping force-pushed the features/better-terminals-in-synthesizer branch from 62e3062 to 535bf95 Compare October 20, 2023 19:38
@qinheping qinheping enabled auto-merge October 20, 2023 19:39
@qinheping qinheping merged commit a010865 into diffblue:develop Oct 20, 2023
@qinheping qinheping deleted the features/better-terminals-in-synthesizer branch October 20, 2023 20:40
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 Synthesis Invariant synthesis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants