Skip to content

Add union_exprt encoding support in incremental smt2 decision procedure #7926

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 6 commits into from
Sep 28, 2023

Conversation

thomasspriggs
Copy link
Contributor

This PR is a follow-up to #7914 Like the previous PR, I am attempting to keep this relatively small for ease of review. This PR adds support for union_exprt and only tests this support via catch tests.

I am planning to add support for member_exprt applied to unions in a follow-up PR. At which point it should be possible to make more complete union regression tests pass.

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

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (99c5402) 78.56% compared to head (c78a2f6) 77.88%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7926      +/-   ##
===========================================
- Coverage    78.56%   77.88%   -0.68%     
===========================================
  Files         1699     1701       +2     
  Lines       195804   195932     +128     
===========================================
- Hits        153833   152604    -1229     
- Misses       41971    43328    +1357     
Files Coverage Δ
...solvers/smt2_incremental/encoding/nondet_padding.h 100.00% <100.00%> (ø)
...vers/smt2_incremental/encoding/struct_encoding.cpp 96.63% <100.00%> (+0.37%) ⬆️
...ncremental/smt2_incremental_decision_procedure.cpp 95.88% <100.00%> (+0.10%) ⬆️
..._incremental/smt2_incremental_decision_procedure.h 75.00% <ø> (ø)
...lvers/smt2_incremental/encoding/nondet_padding.cpp 100.00% <100.00%> (ø)
...vers/smt2_incremental/encoding/struct_encoding.cpp 100.00% <100.00%> (ø)
...ncremental/smt2_incremental_decision_procedure.cpp 98.92% <100.00%> (+0.05%) ⬆️

... and 84 files with indirect coverage changes

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

Copy link
Contributor

@esteffin esteffin left a comment

Choose a reason for hiding this comment

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

Looks good to me

class nondet_padding_exprt;
void validate_expr(const nondet_padding_exprt &padding);

const irep_idt ID_nondet_padding = "nondet_padding";
Copy link
Contributor

Choose a reason for hiding this comment

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

⛏️ Move ID_nondet_padding to a public static member of class nondet_padding_exprt

This data structure will be used to allow encoding/lowering passes
to insert padding bitvectors with non deteriministic values. Unlike the
SAT decision procedures, generating an SMT formula for nondet padding
will require a corresponding parameter-less function to be defined.
This placeholder expression is intended to be inserted in lowering
passes and then substituted at the point of term generation. Note that
it doesn't quite make sense to use symbols for this as the decision
procedure doesn't have mutable symbol table access and adding an extra
decision procedure symbol table would have other complications.
@thomasspriggs thomasspriggs merged commit a043228 into diffblue:develop Sep 28, 2023
@thomasspriggs thomasspriggs deleted the tas/smt_union_exprt branch September 28, 2023 15:27
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.

2 participants