Skip to content

Commit

Permalink
ensure statistics survive cancelation in tactics, fix propagation for…
Browse files Browse the repository at this point in the history
… smtfd

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Oct 19, 2019
1 parent 203ba12 commit 11736f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/solver/solver2tactic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,18 @@ class solver2tactic : public tactic {
ref<solver> local_solver = m_solver->translate(m, m_params);
local_solver->assert_expr(clauses);
TRACE("solver2tactic", tout << "clauses asserted\n";);
lbool r = local_solver->check_sat(assumptions.size(), assumptions.c_ptr());
lbool r;
try {
r = local_solver->check_sat(assumptions.size(), assumptions.c_ptr());
}
catch (...) {
local_solver->collect_statistics(m_st);
throw;
}
TRACE("solver2tactic", tout << "check sat result " << r << "\n";);
proof* pr = local_solver->get_proof();
if (pr) in->set(proof2proof_converter(m, pr));
local_solver->collect_statistics(m_st);
switch (r) {
case l_true:
if (in->models_enabled()) {
Expand Down Expand Up @@ -160,7 +168,6 @@ class solver2tactic : public tactic {
result.push_back(in.get());
break;
}
local_solver->collect_statistics(m_st);
}

void collect_statistics(statistics & st) const override {
Expand Down
8 changes: 6 additions & 2 deletions src/tactic/fd_solver/smtfd_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,8 @@ namespace smtfd {
m_pinned.reset();
m_tables.reset();
m_ast2table.reset();
m_values.reset();
m_model = nullptr;
}
};

Expand Down Expand Up @@ -875,7 +877,7 @@ namespace smtfd {
expr_ref val2 = eval_abs(stored_value);
// A[i] = v
if (val1 != val2) {
TRACE("smtfd", tout << "select/store: " << mk_pp(t, m) << "\n";);
TRACE("smtfd", tout << "select/store: " << mk_bounded_pp(t, m, 2) << "\n";);
add_lemma(m.mk_eq(sel, stored_value));
}
m_pinned.push_back(sel);
Expand Down Expand Up @@ -1080,6 +1082,7 @@ namespace smtfd {
{}

void check_term(expr* t, unsigned round) override {
TRACE("smtfd", tout << mk_bounded_pp(t, m, 2) << "\n";);
switch (round) {
case 0:
if (m_autil.is_select(t)) {
Expand Down Expand Up @@ -1797,8 +1800,8 @@ namespace smtfd {
lbool refine_core(expr_ref_vector & core) {
lbool r = l_true;
unsigned round = 0;
m_context.reset(m_model);
while (true) {
m_context.reset(m_model);
if (!m_context.add_theory_axioms(core, round)) {
break;
}
Expand All @@ -1822,6 +1825,7 @@ namespace smtfd {
case l_true:
m_fd_sat_solver->get_model(m_model);
m_model->set_model_completion(true);
m_context.reset(m_model);
break;
default:
return r;
Expand Down

0 comments on commit 11736f0

Please sign in to comment.