Skip to content

Fix SMT encoding of structs which contain a single struct field #7951

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

thomasspriggs
Copy link
Contributor

@thomasspriggs thomasspriggs commented Oct 11, 2023

This PR fixes SMT encoding of structs which contain a single struct field.

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

In the case where a struct contains a single struct typed field, then
the construction of the outer class is encoded into the construction of
the inner class which then itself needs to be encoded. Therefore the
result of the encoding itself may need encoding. This general solution
will also avoid further variations on the same issue such as
constructing unions containing structs, or selecting struct fields from
a union etc.
@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (a42b439) 79.03% compared to head (7eab7ac) 79.09%.
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7951      +/-   ##
===========================================
+ Coverage    79.03%   79.09%   +0.05%     
===========================================
  Files         1701     1701              
  Lines       196204   196220      +16     
===========================================
+ Hits        155064   155192     +128     
+ Misses       41140    41028     -112     
Files Coverage Δ
...vers/smt2_incremental/encoding/struct_encoding.cpp 96.77% <100.00%> (+0.13%) ⬆️
...vers/smt2_incremental/encoding/struct_encoding.cpp 100.00% <100.00%> (ø)

... and 9 files with indirect coverage changes

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

@thomasspriggs thomasspriggs merged commit 79ece0b into diffblue:develop Oct 12, 2023
@thomasspriggs thomasspriggs deleted the tas/smt_struct_of_struct branch October 12, 2023 10:50
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.

3 participants