Skip to content

Simplify array size expressions #7622

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

tautschnig
Copy link
Collaborator

Symbolic execution may be able to replace symbolic sizes by constants, but even the symbolic size might include a type cast (for examples, ones arising from uses of havoc_slice). Simplify those expressions to avoid appearance of almost-a-constant expressions.

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

Symbolic execution may be able to replace symbolic sizes by constants,
but even the symbolic size might include a type cast (for examples, ones
arising from uses of havoc_slice). Simplify those expressions to avoid
appearance of almost-a-constant expressions.
@codecov
Copy link

codecov bot commented Mar 27, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.37 🎉

Comparison is base (d921808) 78.13% compared to head (5a65118) 78.51%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7622      +/-   ##
===========================================
+ Coverage    78.13%   78.51%   +0.37%     
===========================================
  Files         1671     1671              
  Lines       191845   191851       +6     
===========================================
+ Hits        149905   150624     +719     
+ Misses       41940    41227     -713     
Impacted Files Coverage Δ
src/util/simplify_expr.cpp 85.41% <100.00%> (+0.05%) ⬆️

... and 34 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@peterschrammel peterschrammel removed their assignment Mar 28, 2023
Copy link
Member

@peterschrammel peterschrammel left a comment

Choose a reason for hiding this comment

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

Can this be observed (tested?) somehow?

@tautschnig tautschnig assigned tautschnig and unassigned kroening Mar 31, 2023
@tautschnig
Copy link
Collaborator Author

Can this be observed (tested?) somehow?

It seems that regression/cbmc/byte_update17 does exercise this already.

@tautschnig tautschnig merged commit 40401ce into diffblue:develop Apr 18, 2023
@tautschnig tautschnig deleted the features/simplify-array-size branch April 18, 2023 10:23
tautschnig added a commit to tautschnig/cbmc that referenced this pull request May 4, 2023
With diffblue#7622 we may have syntactically changed the type on the right-hand
side via simplification. To maintain syntactic type equality we need to
apply simplifications on the left-hand side as well. See
https://github.com/awslabs/aws-c-common/actions/runs/4822448417 for an
example where this failed after diffblue#7622.
@tautschnig tautschnig mentioned this pull request May 4, 2023
3 tasks
tautschnig added a commit to tautschnig/cbmc that referenced this pull request May 8, 2023
With diffblue#7622 we may have syntactically changed the type on the right-hand
side via simplification. To maintain syntactic type equality we need to
apply simplifications on the left-hand side as well. See
https://github.com/awslabs/aws-c-common/actions/runs/4822448417 for an
example where this failed after diffblue#7622.
tautschnig added a commit to tautschnig/cbmc that referenced this pull request May 8, 2023
With diffblue#7622 we may have syntactically changed the type on the right-hand
side via simplification. To maintain syntactic type equality we need to
apply simplifications on the left-hand side as well. See
https://github.com/awslabs/aws-c-common/actions/runs/4822448417 for an
example where this failed after diffblue#7622.
qinheping pushed a commit to remi-delmas-3000/cbmc that referenced this pull request May 19, 2023
With diffblue#7622 we may have syntactically changed the type on the right-hand
side via simplification. To maintain syntactic type equality we need to
apply simplifications on the left-hand side as well. See
https://github.com/awslabs/aws-c-common/actions/runs/4822448417 for an
example where this failed after diffblue#7622.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants