Skip to content

Commit

Permalink
deal with cancellation in qe for #6500
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Dec 19, 2022
1 parent ecf25a4 commit 603597a
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/qe/qe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1437,13 +1437,12 @@ namespace qe {
res = m_solver.check();
if (res == l_true && has_uninterpreted(m, m_fml))
res = l_undef;
if (res == l_true) {
if (res == l_true)
res = final_check();
if (res == l_true)
is_sat = true;
final_check();
}
else {
else
break;
}
}
if (res == l_undef) {
free_vars.append(num_vars, vars);
Expand Down Expand Up @@ -1501,30 +1500,33 @@ namespace qe {

private:

void final_check() {
model_ref model;
lbool final_check() {
model_ref model;
m_solver.get_model(model);
if (!model)
return l_undef;
scoped_ptr<model_evaluator> model_eval = alloc(model_evaluator, *model);

while (true) {
while (m.inc()) {
TRACE("qe", model_v2_pp(tout, *model););
while (can_propagate_assignment(*model_eval)) {
while (can_propagate_assignment(*model_eval))
propagate_assignment(*model_eval);
}
VERIFY(CHOOSE_VAR == update_current(*model_eval, true));
SASSERT(m_current->fml());
if (l_true != m_solver.check()) {
return;
return l_true;
}
m_solver.get_model(model);
model_eval = alloc(model_evaluator, *model);
search_tree* st = m_current;
update_current(*model_eval, false);
if (st == m_current) {
if (st == m_current)
break;
}
}
pop(*model_eval);
}
if (!m.inc())
return l_undef;
pop(*model_eval);
return l_true;
}

ast_manager& get_manager() override { return m; }
Expand Down

0 comments on commit 603597a

Please sign in to comment.