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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions src/goto-checker/solver_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,22 @@ 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"))
{
satcheck->enable_hardness_collection();
satcheck->with_solver_hardness([&options](solver_hardnesst &hardness) {
hardness.set_outfile(options.get_option("write-solver-stats-to"));
});
if(
auto hardness_collector = dynamic_cast<hardness_collectort *>(&*satcheck))
{
hardness_collector->enable_hardness_collection();
hardness_collector->with_solver_hardness(
[&options](solver_hardnesst &hardness) {
hardness.set_outfile(options.get_option("write-solver-stats-to"));
});
}
else
{
messaget log(message_handler);
log.warning()
<< "Configured solver does not support --write-solver-stats-to. "
<< "Solver stats will not be written." << messaget::eom;
}
}
return satcheck;
}
Expand Down