Skip to content

Commit 5b51606

Browse files
Register goal constraints in solver hardness
Fixes a bug in the --write-solver-stats-to option. Assertions are translated in two steps: 1. symex_target_equationt::convert_assertions creates handles for the assertions. Solver hardness recording already works there. 2. The handles are then disjoined in goto_symex_property_decidert::add_constraint_from_goals. Solver hardness was missing. The clauses resulting from this disjunction were not recorded. We now add them into the solver_hardness.assertion_stats bucket initialized by 1.
1 parent 2227a3c commit 5b51606

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/goto-checker/goto_symex_property_decider.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Author: Daniel Kroening, Peter Schrammel
1313

1414
#include <util/ui_message.h>
1515

16+
#include <goto-symex/solver_hardness.h>
1617
#include <solvers/prop/prop.h> // IWYU pragma: keep
1718

1819
goto_symex_property_decidert::goto_symex_property_decidert(
@@ -83,6 +84,7 @@ void goto_symex_property_decidert::add_constraint_from_goals(
8384
std::function<bool(const irep_idt &)> select_property)
8485
{
8586
exprt::operandst disjuncts;
87+
decision_proceduret &decision_procedure = solver->decision_procedure();
8688

8789
for(const auto &goal_pair : goal_map)
8890
{
@@ -95,7 +97,16 @@ void goto_symex_property_decidert::add_constraint_from_goals(
9597
}
9698

9799
// this is 'false' if there are no disjuncts
98-
solver->decision_procedure().set_to_true(disjunction(disjuncts));
100+
exprt goal_disjunction = disjunction(disjuncts);
101+
decision_procedure.set_to_true(goal_disjunction);
102+
103+
with_solver_hardness(decision_procedure, [](solver_hardnesst &hardness) {
104+
// SSA expr and involved steps have already been collected
105+
// in symex_target_equationt::convert_assertions
106+
exprt ssa_expr_unused;
107+
std::vector<goto_programt::const_targett> involved_steps_unused;
108+
hardness.register_assertion_ssas(ssa_expr_unused, involved_steps_unused);
109+
});
99110
}
100111

101112
decision_proceduret::resultt goto_symex_property_decidert::solve()

0 commit comments

Comments
 (0)