3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-19 10:52:02 +00:00

fix missing parity propagation

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2022-12-17 19:08:40 -08:00
parent b581cbf062
commit 3c035daaa6

View file

@ -669,8 +669,7 @@ namespace polysat {
auto& m = s.var2pdd(x); auto& m = s.var2pdd(x);
unsigned N = m.power_of_2(); unsigned N = m.power_of_2();
pdd y = m.zero(); pdd y = m.zero();
pdd a = m.zero(); pdd a = y, b = y;
pdd b = m.zero();
pdd X = s.var(x); pdd X = s.var(x);
if (!is_AxB_eq_0(x, axb_l_y, a, b, y)) if (!is_AxB_eq_0(x, axb_l_y, a, b, y))
return false; return false;
@ -741,7 +740,7 @@ namespace polysat {
// //
// if b has at most b_parity, then a*x has at most b_parity // if b has at most b_parity, then a*x has at most b_parity
// //
else if (!is_forced_eq(b, 0)) { if (!is_forced_eq(b, 0)) {
unsigned b_parity = 1; unsigned b_parity = 1;
bool found = false; bool found = false;
for (; b_parity < N; ++b_parity) { for (; b_parity < N; ++b_parity) {
@ -767,9 +766,6 @@ namespace polysat {
} }
} }
} }
// verbose_stream() << "no propagation " << axb_l_y << " parity " << a_parity << "\n";
return false; return false;
} }
@ -783,7 +779,8 @@ namespace polysat {
auto& m = s.var2pdd(x); auto& m = s.var2pdd(x);
unsigned N = m.power_of_2(); unsigned N = m.power_of_2();
pdd y = m.zero(); pdd y = m.zero();
pdd a = y, b = y, X = y; pdd a = y, b = y;
pdd X = s.var(x);
if (!is_AxB_diseq_0(x, axb_l_y, a, b, y)) if (!is_AxB_diseq_0(x, axb_l_y, a, b, y))
return false; return false;
if (!is_forced_eq(b, 0)) if (!is_forced_eq(b, 0))
@ -926,7 +923,7 @@ namespace polysat {
rhs = b2 - a2*(b3 * a3_inv); rhs = b2 - a2*(b3 * a3_inv);
} }
if (!change) { if (!change) {
IF_VERBOSE(0, verbose_stream() << "missed factor equality " << c << " " << a_l_b << "\n"); IF_VERBOSE(1, verbose_stream() << "missed factor equality " << c << " " << a_l_b << "\n");
continue; continue;
} }
signed_constraint conseq = a_l_b.is_strict() ? s.ult(lhs, rhs) : s.ule(lhs, rhs); signed_constraint conseq = a_l_b.is_strict() ? s.ult(lhs, rhs) : s.ule(lhs, rhs);