Skip to content

Address incremental SMT2 related code review comments from PR6357 #6388

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 4 commits into from
Oct 13, 2021

Conversation

thomasspriggs
Copy link
Contributor

This PR addresses incremental SMT2 related code review comments from
#6357. Some of the outstanding comments on this PR were not blocking and the PR was therefore merged without addressing them. This is the follow up PR which cleans this up.

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

There are 2 simplifications here.
1) A swap to a normal string literal, rather that a raw string literal,
as there is only a single character which needs escaping. 2) A change to
remove the `^` and `$` for matching the start and end of the string.
These were redundant, because `std::regex_match` already requires the
regex to match the full string rather than a partial sub-match.

This simplification is already tested by the "smt_identifier_termt
construction" test in the smt_terms unit tests.
Because the purpose of this INVARIANT was not neccessarily apparent
without reading the doxygen in the header file.
In order to make it more explict that this function has side-effects on
the stack of expressions to be defined.
@codecov
Copy link

codecov bot commented Oct 11, 2021

Codecov Report

Merging #6388 (200500c) into develop (ea13baf) will not change coverage.
The diff coverage is 90.62%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #6388   +/-   ##
========================================
  Coverage    75.97%   75.97%           
========================================
  Files         1523     1523           
  Lines       164194   164194           
========================================
  Hits        124750   124750           
  Misses       39444    39444           
Impacted Files Coverage Δ
src/goto-instrument/contracts/contracts.h 100.00% <ø> (ø)
src/solvers/smt2_incremental/smt_responses.h 0.00% <0.00%> (ø)
...rc/solvers/smt2_incremental/smt_solver_process.cpp 25.00% <25.00%> (ø)
src/goto-checker/solver_factory.cpp 76.49% <66.66%> (ø)
src/solvers/smt2_incremental/smt_solver_process.h 66.66% <66.66%> (ø)
...ncremental/smt2_incremental_decision_procedure.cpp 78.43% <93.82%> (ø)
src/goto-instrument/contracts/contracts.cpp 95.78% <95.23%> (ø)
...ncremental/smt2_incremental_decision_procedure.cpp 96.00% <96.00%> (ø)
src/goto-instrument/contracts/assigns.cpp 96.47% <100.00%> (ø)
...c/solvers/smt2_incremental/convert_expr_to_smt.cpp 36.33% <100.00%> (ø)
... and 13 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 a80fe1f...200500c. Read the comment docs.

@@ -49,7 +49,7 @@ void smt2_incremental_decision_proceduret::define_dependent_functions(
return expr_identifier.first;
});
std::stack<exprt> to_be_defined;
const auto dependencies_needed = [&](const exprt &expr) {
const auto push_dependencies_needed = [&](const exprt &expr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the type of the return value of the lambda also be defined there? -> bool - because it made it surprising to see a lambda named push-* in a context that demands a predicate without it having an explicit book return value.

@TGWDB TGWDB merged commit 6253e8c into diffblue:develop Oct 13, 2021
@thomasspriggs thomasspriggs deleted the tas/comment-regex branch October 18, 2021 10:10
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