Skip to content

use simplify_not instead of boolean_negate #4990

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
Aug 13, 2019
Merged

Conversation

kroening
Copy link
Member

@kroening kroening commented Aug 6, 2019

This is follow-up on a discussion in #4982. boolean_negate performs some,
but not all, of the simplifications done by simplify_not. This PR avoids
this redundancy by calling simplify_not(not_exprt(x)) instead of
simplify_node(boolean_negate(x)).

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a 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.

This is follow-up on a discussion in #4982.  boolean_negate performs some,
but not all, of the simplifications done by simplify_not.  This PR avoids
this redundancy by calling simplify_not(not_exprt(x)) instead of
simplify_node(boolean_negate(x)).
@codecov-io
Copy link

Codecov Report

Merging #4990 into develop will decrease coverage by <.01%.
The diff coverage is 85.71%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4990      +/-   ##
===========================================
- Coverage    69.26%   69.26%   -0.01%     
===========================================
  Files         1309     1309              
  Lines       108424   108415       -9     
===========================================
- Hits         75104    75095       -9     
  Misses       33320    33320
Impacted Files Coverage Δ
src/util/simplify_expr_if.cpp 34.23% <100%> (-1.17%) ⬇️
src/util/simplify_expr_boolean.cpp 88.73% <66.66%> (ø) ⬆️
src/util/simplify_expr_int.cpp 80.3% <87.5%> (-0.2%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7662ed0...c9b7fd2. Read the comment docs.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: c9b7fd2).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/122170679

@allredj
Copy link
Contributor

allredj commented Aug 13, 2019

Adding simplification steps in sensitive areas always makes me anxious. I wonder if we should be running a benchmark on this one, to check we're not taking a performance hit.

@kroening kroening merged commit b1e748a into develop Aug 13, 2019
@kroening kroening deleted the boolean_negate branch August 13, 2019 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants