Skip to content

Field sensitivity: using apply is now always safe #7259

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
Nov 3, 2022

Conversation

tautschnig
Copy link
Collaborator

With the changes from 6193534 it is safe to call apply even when doing field assignments: the right-hand side will not be a divisible compound (which we previously sought to protect from field expansion).

This makes field sensitivity stateless, and all methods are const. They are not static, however, as the constructor initialises configuration options (which would otherwise need to be passed to each call).

We can then also avoid a level of indirection through apply and call get_fields directly in two cases.

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

@codecov
Copy link

codecov bot commented Oct 20, 2022

Codecov Report

Base: 78.00% // Head: 78.01% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (aa3cbd8) compared to base (61577ae).
Patch coverage: 81.02% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7259   +/-   ##
========================================
  Coverage    78.00%   78.01%           
========================================
  Files         1621     1623    +2     
  Lines       187273   187299   +26     
========================================
+ Hits        146089   146113   +24     
- Misses       41184    41186    +2     
Impacted Files Coverage Δ
src/goto-symex/field_sensitivity.h 100.00% <ø> (ø)
src/solvers/smt2/smt2_conv.cpp 65.46% <66.66%> (-0.01%) ⬇️
src/cprover/solver_types.cpp 76.82% <76.82%> (ø)
src/cprover/inductiveness.cpp 81.17% <81.17%> (ø)
src/cprover/solver.cpp 97.61% <100.00%> (+16.08%) ⬆️
src/cprover/solver_types.h 92.00% <100.00%> (+3.11%) ⬆️
src/goto-instrument/unwind.cpp 100.00% <100.00%> (ø)
src/goto-symex/field_sensitivity.cpp 91.61% <100.00%> (+0.33%) ⬆️
src/ansi-c/expr2c.cpp 67.27% <0.00%> (-0.05%) ⬇️
... and 1 more

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 at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tautschnig tautschnig added aws Bugs or features of importance to AWS CBMC users aws-high labels Oct 21, 2022
With the changes from 6193534 it is safe to call `apply` even when
doing field assignments: the right-hand side will not be a divisible
compound (which we previously sought to protect from field expansion).

This makes field sensitivity stateless, and all methods are `const`.
They are not static, however, as the constructor initialises
configuration options (which would otherwise need to be passed to each
call).

We can then also avoid a level of indirection through `apply` and call
`get_fields` directly in two cases.
@tautschnig tautschnig force-pushed the cleanup/fs-stateless branch from 0186720 to aa3cbd8 Compare October 21, 2022 10:19
@tautschnig tautschnig merged commit e42ec8c into diffblue:develop Nov 3, 2022
@tautschnig tautschnig deleted the cleanup/fs-stateless branch November 3, 2022 18:46
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 aws-high blocker cleanup Symbolic Execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants