diff --git a/src/smt/mam.cpp b/src/smt/mam.cpp index ea335b1dc..44a435041 100644 --- a/src/smt/mam.cpp +++ b/src/smt/mam.cpp @@ -2006,33 +2006,36 @@ namespace { m_backtrack_stack.resize(t->get_num_choices()); } - void execute(code_tree * t) { + bool execute(code_tree * t) { TRACE("trigger_bug", tout << "execute for code tree:\n"; t->display(tout);); init(t); +#define CLEANUP for (enode* app : t->get_candidates()) if (app->is_marked()) app->unset_mark(); if (t->filter_candidates()) { for (enode* app : t->get_candidates()) { TRACE("trigger_bug", tout << "candidate\n" << mk_ismt2_pp(app->get_expr(), m) << "\n";); if (!app->is_marked() && app->is_cgr()) { - if (m_context.resource_limits_exceeded() || !execute_core(t, app)) - return; + if (m_context.resource_limits_exceeded() || !execute_core(t, app)) { + CLEANUP; + return false; + } app->set_mark(); } } - for (enode* app : t->get_candidates()) { - if (app->is_marked()) - app->unset_mark(); - } + CLEANUP; + } else { for (enode* app : t->get_candidates()) { TRACE("trigger_bug", tout << "candidate\n" << mk_ismt2_pp(app->get_expr(), m) << "\n";); if (app->is_cgr()) { TRACE("trigger_bug", tout << "is_cgr\n";); + // scoped_suspend_rlimit susp(m.limit(), false); if (m_context.resource_limits_exceeded() || !execute_core(t, app)) - return; + return false; } } } + return true; } // init(t) must be invoked before execute_core @@ -3886,7 +3889,8 @@ namespace { TRACE("trigger_bug", tout << "match\n"; display(tout);); for (code_tree* t : m_to_match) { SASSERT(t->has_candidates()); - m_interpreter.execute(t); + if (!m_interpreter.execute(t)) + return; t->reset_candidates(); } m_to_match.reset(); diff --git a/src/smt/smt_context.cpp b/src/smt/smt_context.cpp index 1bae0ef86..84b4906ca 100644 --- a/src/smt/smt_context.cpp +++ b/src/smt/smt_context.cpp @@ -1723,7 +1723,7 @@ namespace smt { return false; } if (!get_cancel_flag()) { - scoped_suspend_rlimit _suspend_cancel(m.limit(), at_base_level()); +// scoped_suspend_rlimit _suspend_cancel(m.limit(), at_base_level()); m_qmanager->propagate(); } if (inconsistent())