Skip to content

Satcheck need not implement hardness_collectort #5305

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

peterschrammel
Copy link
Member

Otherwise compilation fails for SAT solvers that don't implement hardness_collectort yet, e.g. Glucose.

  • Each commit message has a non-empty body, explaining why the change was made.
  • [n/a] Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • [n/a] The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • [n/a] 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).
  • [n/a] My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • [n/a] White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov-io
Copy link

codecov-io commented Apr 18, 2020

Codecov Report

Merging #5305 (ab1c041) into develop (1c4e0c4) will decrease coverage by 0.00%.
The diff coverage is 75.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5305      +/-   ##
===========================================
- Coverage    68.52%   68.52%   -0.01%     
===========================================
  Files         1187     1187              
  Lines        98265    98269       +4     
===========================================
+ Hits         67339    67341       +2     
- Misses       30926    30928       +2     
Flag Coverage Δ
cproversmt2 42.96% <0.00%> (-0.01%) ⬇️
regression 65.68% <75.00%> (-0.01%) ⬇️
unit 32.25% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/goto-checker/solver_factory.cpp 67.24% <75.00%> (-0.41%) ⬇️

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 1c4e0c4...ab1c041. Read the comment docs.

@@ -178,12 +178,16 @@ static std::unique_ptr<SatcheckT>
make_satcheck_prop(message_handlert &message_handler, const optionst &options)
{
auto satcheck = util_make_unique<SatcheckT>(message_handler);
if(options.is_set("write-solver-stats-to"))
if(auto hardness_collector = dynamic_cast<hardness_collectort *>(&*satcheck))

Choose a reason for hiding this comment

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

Hm, the idea was that satchecks that don't want to do hardness collection could just implement these functions as no-ops?

Copy link
Member Author

@peterschrammel peterschrammel May 15, 2020

Choose a reason for hiding this comment

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

Then you should have implemented it in all existing satchecks, which are broken now.
Besides, noop functions defeat the purpose of extension interfaces. Thus, I would rather merge this PR.

satcheck->with_solver_hardness([&options](solver_hardnesst &hardness) {
hardness.set_outfile(options.get_option("write-solver-stats-to"));
});
if(options.is_set("write-solver-stats-to"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should provide an error message to the user in case --write-solver-stats-to is used with a SAT solver that doesn't support hardness collection.

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

Seems reasonable and probably more intuitive than simply giving zero stats for all other solvers.

Otherwise compilation fails for SAT solvers that
don't implement hardness_collectort yet, e.g. Glucose.
@peterschrammel peterschrammel merged commit d14e078 into diffblue:develop Nov 9, 2020
@peterschrammel peterschrammel deleted the satcheck-no-hardness branch November 9, 2020 20:13
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