Skip to content

Commit

Permalink
fix model return after shutdown, reported in #4532
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <[email protected]>
  • Loading branch information
NikolajBjorner committed Jul 28, 2020
1 parent b71a643 commit 8857a67
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/smt/smt_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4486,8 +4486,12 @@ namespace smt {
}

void context::get_model(model_ref & mdl) {
if (inconsistent() || !m.inc())
mdl = nullptr;
if (inconsistent())
mdl = nullptr;
else if (m_model.get())
mdl = m_model.get();
else if (!m.inc())
mdl = nullptr;
else {
mk_proto_model();
if (!m_model && m_proto_model) {
Expand Down
1 change: 1 addition & 0 deletions src/smt/smt_parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ namespace smt {
pctx.assert_expr(mk_not(mk_and(pctx.unsat_core())));
return;
}


bool first = false;
{
Expand Down
3 changes: 3 additions & 0 deletions src/solver/parallel_tactic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,9 @@ class parallel_tactic : public tactic {
}
m_models.push_back(mdl.get());
}
else if (m_models.empty()) {
m_has_undef = true;
}
if (!m_allsat) {
m_queue.shutdown();
}
Expand Down

0 comments on commit 8857a67

Please sign in to comment.