3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-14 09:56:15 +00:00

revert arithmetic final check to original order

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2023-08-04 10:48:44 -07:00
parent f58b703ac5
commit b0055df4ab

View file

@ -1652,83 +1652,41 @@ public:
if (!lp().is_feasible() || lp().has_changed_columns()) { if (!lp().is_feasible() || lp().has_changed_columns()) {
is_sat = make_feasible(); is_sat = make_feasible();
} }
bool giveup = false;
final_check_status st = FC_DONE; final_check_status st = FC_DONE;
m_final_check_idx = 0; // remove to experiment.
unsigned old_idx = m_final_check_idx;
switch (is_sat) { switch (is_sat) {
case l_true: case l_true:
TRACE("arith", display(tout)); TRACE("arith", display(tout));
#if 0
m_dist.reset();
m_dist.push(0, 1);
m_dist.push(1, 1);
m_dist.push(2, 1);
for (auto idx : m_dist) { switch (check_lia()) {
if (!m.inc())
return FC_GIVEUP;
switch (idx) {
case 0:
if (assume_eqs())
st = FC_CONTINUE;
break;
case 1:
st = check_nla();
break;
case 2:
st = check_lia();
break;
default:
UNREACHABLE();
break;
}
switch (st) {
case FC_DONE: case FC_DONE:
break; break;
case FC_CONTINUE: case FC_CONTINUE:
return st; return FC_CONTINUE;
case FC_GIVEUP: case FC_GIVEUP:
giveup = true; TRACE("arith", tout << "check-lia giveup\n";);
break; if (ctx().get_fparams().m_arith_ignore_int)
}
}
#else
do {
if (!m.inc())
return FC_GIVEUP;
switch (m_final_check_idx) {
case 0:
if (assume_eqs())
st = FC_CONTINUE; st = FC_CONTINUE;
break; break;
case 1:
st = check_lia();
break;
case 2:
st = check_nla();
break;
} }
m_final_check_idx = (m_final_check_idx + 1) % 3;
switch (st) { switch (check_nla()) {
case FC_DONE: case FC_DONE:
break; break;
case FC_CONTINUE: case FC_CONTINUE:
return st; return FC_CONTINUE;
case FC_GIVEUP: case FC_GIVEUP:
giveup = true; TRACE("arith", tout << "check-nra giveup\n";);
verbose_stream() << "giveup nla\n";
st = FC_GIVEUP;
break; break;
} }
}
while (old_idx != m_final_check_idx);
#endif
if (giveup) if (assume_eqs()) {
return FC_GIVEUP; ++m_stats.m_assume_eqs;
return FC_CONTINUE;
}
for (expr* e : m_not_handled) { for (expr* e : m_not_handled) {
if (!ctx().is_relevant(e)) if (!ctx().is_relevant(e))
continue; continue;