3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-19 20:33:38 +00:00

rewind qhead to ensure re-propagation after cancellation

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-10-27 16:23:33 -07:00
parent 41deae52c6
commit 7d7e03e377
3 changed files with 8 additions and 2 deletions

View file

@ -258,6 +258,7 @@ namespace smt {
TRACE("context", tout << is_sat << "\n";); TRACE("context", tout << is_sat << "\n";);
return is_sat; return is_sat;
} }
obj_map<expr, expr*> var2val; obj_map<expr, expr*> var2val;
index_set _assumptions; index_set _assumptions;
for (unsigned i = 0; i < assumptions.size(); ++i) { for (unsigned i = 0; i < assumptions.size(); ++i) {

View file

@ -1749,8 +1749,10 @@ namespace smt {
unsigned qhead = m_qhead; unsigned qhead = m_qhead;
if (!bcp()) if (!bcp())
return false; return false;
if (get_cancel_flag()) if (get_cancel_flag()) {
m_qhead = qhead;
return true; return true;
}
SASSERT(!inconsistent()); SASSERT(!inconsistent());
propagate_relevancy(qhead); propagate_relevancy(qhead);
if (inconsistent()) if (inconsistent())
@ -1768,8 +1770,10 @@ namespace smt {
m_qmanager->propagate(); m_qmanager->propagate();
if (inconsistent()) if (inconsistent())
return false; return false;
if (resource_limits_exceeded()) if (resource_limits_exceeded()) {
m_qhead = qhead;
return true; return true;
}
if (!can_propagate()) { if (!can_propagate()) {
CASSERT("diseq_bug", inconsistent() || check_missing_diseq_conflict()); CASSERT("diseq_bug", inconsistent() || check_missing_diseq_conflict());
CASSERT("eqc_bool", check_eqc_bool_assignment()); CASSERT("eqc_bool", check_eqc_bool_assignment());

View file

@ -29,6 +29,7 @@ uint64 reslimit::count() const {
return m_count; return m_count;
} }
bool reslimit::inc() { bool reslimit::inc() {
++m_count; ++m_count;
return m_cancel == 0 && (m_limit == 0 || m_count <= m_limit); return m_cancel == 0 && (m_limit == 0 || m_count <= m_limit);