Skip to content

Conversation

@kroening
Copy link
Collaborator

@kroening kroening commented Dec 27, 2021

The solver_hardnesst class is inherently linked to goto-programs and goto-symex, and
introduces a surprising dependency on these corresponding includes into the
solver classes.

This commit moves the class into the goto-symex directory, removing the
dependency by introducing a base class for the callback.

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

@kroening kroening force-pushed the move_solver_hardness branch 7 times, most recently from 6fc9694 to 0dea53e Compare December 27, 2021 16:55
@codecov
Copy link

codecov bot commented Dec 27, 2021

Codecov Report

Merging #6549 (76cbf3e) into develop (e4c5999) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #6549   +/-   ##
========================================
  Coverage    75.98%   75.98%           
========================================
  Files         1578     1578           
  Lines       181058   181047   -11     
========================================
- Hits        137579   137573    -6     
+ Misses       43479    43474    -5     
Impacted Files Coverage Δ
src/goto-cc/gcc_cmdline.cpp 74.80% <ø> (ø)
src/goto-checker/multi_path_symex_checker.cpp 91.30% <ø> (ø)
src/goto-symex/solver_hardness.cpp 52.73% <ø> (ø)
src/goto-symex/symex_target_equation.cpp 95.06% <ø> (ø)
src/solvers/flattening/arrays.h 93.75% <ø> (ø)
src/solvers/flattening/boolbv.h 62.50% <ø> (ø)
src/solvers/flattening/boolbv_get.cpp 82.75% <ø> (ø)
src/solvers/flattening/boolbv_member.cpp 53.65% <ø> (ø)
src/solvers/flattening/boolbv_struct.cpp 100.00% <ø> (ø)
src/solvers/flattening/boolbv_typecast.cpp 50.67% <ø> (ø)
... 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 9b72a5c...76cbf3e. Read the comment docs.

Comment on lines +168 to +183
// FIXME I am wondering if there is a way to do this that is a bit less
// dynamically typed.
if(
auto prop_conv_solver =
dynamic_cast<prop_conv_solvert *>(&maybe_hardness_collector))
{
if(auto hardness_collector = prop_conv_solver->get_hardness_collector())
{
if(hardness_collector->solver_hardness)
{
auto &solver_hardness = static_cast<solver_hardnesst &>(
*(hardness_collector->solver_hardness));
handler(solver_hardness);
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This surely is better already, but don't we just need a Boolean function like virtual bool set_hardness_collector(solver_hardnesst *) { return false; } in prop_conv_solvert that will return true when the hardness collector was accepted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To make the above go away, you'd need a get_solver_hardness_collector, or the like, in decision_proceduret. I can't get myself to do that.

This class is inherently linked to goto-programs and goto-symex, and
introduces a surprising dependency on these corresponding includes into the
solver classes.

This commit moves these classes into the goto-symex directory, removing the
dependency by introducing a base class for the callback.
@kroening kroening force-pushed the move_solver_hardness branch from 0dea53e to 76cbf3e Compare January 4, 2022 22:54
@kroening kroening merged commit f4bda12 into develop Jan 12, 2022
@kroening kroening deleted the move_solver_hardness branch January 12, 2022 15:23
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.

5 participants