Skip to content

Add incremental SMT2 sort checked construction of bit vector predicate application and application of core theory functions #6256

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 Jul 28, 2021

Add incremental SMT2 sort checked construction of bit vector predicate application and application of core theory functions.

  • 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 Jul 28, 2021

Codecov Report

Merging #6256 (686ba37) into develop (ccfbaee) will increase coverage by 0.02%.
The diff coverage is 97.83%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6256      +/-   ##
===========================================
+ Coverage    76.18%   76.21%   +0.02%     
===========================================
  Files         1484     1490       +6     
  Lines       162092   162500     +408     
===========================================
+ Hits        123495   123844     +349     
- Misses       38597    38656      +59     
Impacted Files Coverage Δ
src/solvers/smt2_incremental/smt_sorts.cpp 94.11% <ø> (ø)
src/solvers/smt2_incremental/smt_sorts.h 100.00% <ø> (ø)
src/solvers/smt2_incremental/smt_terms.cpp 94.44% <ø> (-0.56%) ⬇️
src/solvers/smt2_incremental/smt_terms.def 100.00% <ø> (ø)
...rc/solvers/smt2_incremental/smt_to_smt2_string.cpp 92.24% <ø> (-0.14%) ⬇️
...it/solvers/smt2_incremental/smt_to_smt2_string.cpp 100.00% <ø> (ø)
src/solvers/smt2_incremental/smt_commands.cpp 87.37% <66.66%> (-6.30%) ⬇️
...solvers/smt2_incremental/smt_bit_vector_theory.cpp 100.00% <100.00%> (ø)
...solvers/smt2_incremental/smt_bit_vector_theory.def 100.00% <100.00%> (ø)
src/solvers/smt2_incremental/smt_commands.h 100.00% <100.00%> (ø)
... and 41 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 9e3edf7...686ba37. Read the comment docs.

@thomasspriggs
Copy link
Contributor Author

This PR relates to #6134

Copy link
Contributor

@TGWDB TGWDB left a comment

Choose a reason for hiding this comment

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

There are a lot of tests for different operators, but they all use the same factory code. Is there significant value in having them all?

@thomasspriggs thomasspriggs force-pushed the tas/smt_function_factories branch from 3f670cc to d9fd299 Compare July 29, 2021 14:37
For checking parameterised sorts.
@thomasspriggs thomasspriggs force-pushed the tas/smt_function_factories branch from c878207 to 652ca69 Compare July 30, 2021 09:56
@thomasspriggs thomasspriggs marked this pull request as ready for review July 30, 2021 09:58
@thomasspriggs thomasspriggs changed the title Add incremental SMT2 sort checked construction of bit vector predicate application Add incremental SMT2 sort checked construction of bit vector predicate application and application of core theory functions Jul 30, 2021
@thomasspriggs thomasspriggs force-pushed the tas/smt_function_factories branch 2 times, most recently from 2061d96 to d46aaab Compare July 30, 2021 14:51
{
INVARIANT(
parameter_sorts.size() == arguments.size(),
"Number of parameters and number of arguments must the the same.");
Copy link
Contributor

Choose a reason for hiding this comment

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

"must the the same" => "must be the same"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -94,3 +95,15 @@ TEST_CASE("smt_set_option_commandt getter", "[core][smt2_incremental]")
CHECK(smt_set_option_commandt{models_on}.option() == models_on);
CHECK(smt_set_option_commandt{models_off}.option() == models_off);
}

TEST_CASE("SMT2 function application factory tests", "[core][smt2_incremental]")
Copy link
Contributor

Choose a reason for hiding this comment

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

No CHECKs in this test? Whats its purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The checks were missing because I got distracted adding other functionality to this PR, before I finished writing this test. Thanks for spotting this oversight. I have now added some checks.

So that function specific INVARIANTS can be checked.
For consistency with how the functions for the bit vector theory are
defined. Note that the factory is called `make_not` rather than `not`,
because not is a keyword in C++ which is equivalent to the `!` operator.
To prevent construction of function application without checking that
the given arguments are valid for the given function.
@thomasspriggs thomasspriggs force-pushed the tas/smt_function_factories branch from d46aaab to 686ba37 Compare July 30, 2021 18:23
@thomasspriggs thomasspriggs merged commit d3dc560 into diffblue:develop Aug 4, 2021
@thomasspriggs thomasspriggs deleted the tas/smt_function_factories branch August 4, 2021 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants