Skip to content

Add construction of value exprts from smt terms. #6519

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 3 commits into from
Dec 9, 2021

Conversation

thomasspriggs
Copy link
Contributor

This PR adds construction of value exprts from smt terms.

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

Macros are used in order to make the duplications in the test inputs
manageable. However clang-format needs to be off for these macros as
the way clang-format formats them makes them less readable.
@codecov
Copy link

codecov bot commented Dec 8, 2021

Codecov Report

Merging #6519 (3055754) into develop (3d6021f) will decrease coverage by 0.12%.
The diff coverage is 82.79%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6519      +/-   ##
===========================================
- Coverage    76.11%   75.98%   -0.13%     
===========================================
  Files         1548     1578      +30     
  Lines       166308   180897   +14589     
===========================================
+ Hits        126589   137460   +10871     
- Misses       39719    43437    +3718     
Impacted Files Coverage Δ
jbmc/src/jdiff/jdiff_parse_options.h 100.00% <ø> (ø)
src/ansi-c/expr2c.cpp 66.39% <0.00%> (+0.04%) ⬆️
...-checker/single_loop_incremental_symex_checker.cpp 90.82% <ø> (+0.34%) ⬆️
src/goto-checker/single_path_symex_only_checker.h 100.00% <ø> (ø)
src/goto-checker/symex_bmc.h 100.00% <ø> (ø)
...rc/goto-checker/symex_bmc_incremental_one_loop.cpp 94.54% <ø> (+0.20%) ⬆️
src/goto-checker/symex_bmc_incremental_one_loop.h 0.00% <ø> (ø)
src/goto-diff/goto_diff_parse_options.h 100.00% <ø> (ø)
src/goto-programs/restrict_function_pointers.h 100.00% <ø> (ø)
src/util/format_expr.cpp 86.87% <0.00%> (-2.65%) ⬇️
... and 1149 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3719e3...3055754. Read the comment docs.

Copy link
Contributor

@NlightNFotis NlightNFotis left a comment

Choose a reason for hiding this comment

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

Good stuff 👍🏻

TEST_CASE("Value expr construction from smt.", "[core][smt2_incremental]")
{
optionalt<smt_termt> input_term;
optionalt<exprt> expected_result;

using rowt = std::pair<smt_termt, exprt>;

// clang-format off
#define UNSIGNED_BIT_VECTOR_TESTS(bits) \
Copy link
Contributor

Choose a reason for hiding this comment

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

Ohh, I like that. 👍🏻

Better for self-documenting code than the comment based approach we had.

@thomasspriggs thomasspriggs merged commit 0af5559 into diffblue:develop Dec 9, 2021
@thomasspriggs thomasspriggs deleted the tas/smt_to_expr branch December 9, 2021 10:30
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