Skip to content

Introduce value-set supported simplifier for goto-symex #8642

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

tautschnig
Copy link
Collaborator

Move try_evaluate_pointer_comparison to a simplifier that can eventually support more cases than just equalities in GOTO conditions. The initial change does not alter behaviour (except that previously try_evaluate_pointer_comparison was even used when simplification was disabled).

A side-effect is that we can also clean up renamedt.

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

Copy link

codecov bot commented May 27, 2025

Codecov Report

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

Project coverage is 80.39%. Comparing base (f1faa61) to head (77d0e0e).

Files with missing lines Patch % Lines
src/goto-symex/simplify_expr_with_value_set.cpp 98.55% 2 Missing ⚠️
src/goto-symex/symex_clean_expr.cpp 77.77% 2 Missing ⚠️
src/goto-symex/symex_dereference.cpp 75.00% 1 Missing ⚠️
src/goto-symex/symex_other.cpp 66.66% 1 Missing ⚠️
unit/goto-symex/symex_assign.cpp 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8642      +/-   ##
===========================================
+ Coverage    80.37%   80.39%   +0.01%     
===========================================
  Files         1686     1688       +2     
  Lines       206889   206972      +83     
  Branches        73       73              
===========================================
+ Hits        166289   166388      +99     
+ Misses       40600    40584      -16     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Move `try_evaluate_pointer_comparison` to a simplifier that can
eventually support more cases than just equalities in GOTO conditions.
The initial change does not alter behaviour (except that previously
`try_evaluate_pointer_comparison` was even used when simplification was
disabled).

A side-effect is that we can also clean up renamedt.
value-set based simplifications may be helpful well outside just GOTO
conditions.
When all candidates in the value set have the same offset we can replace
a pointer_offset expression by the offset value found in the value set.
The value set can help us infer that, e.g., a particular pointer cannot
be among the ones assigned to __CPROVER_dead_object, whereby we can
simplify R_OK/W_OK expressions.
@tautschnig tautschnig marked this pull request as ready for review June 3, 2025 10:02
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants