mirror of
https://github.com/Z3Prover/z3
synced 2025-06-29 09:28:45 +00:00
try_ugt_eq restores 6800
This commit is contained in:
parent
b4902f374b
commit
8a8afcdcb8
2 changed files with 29 additions and 0 deletions
|
@ -76,6 +76,8 @@ namespace polysat {
|
||||||
return false;
|
return false;
|
||||||
if (try_nonzero_upper_extract(v, core, i))
|
if (try_nonzero_upper_extract(v, core, i))
|
||||||
prop = true;
|
prop = true;
|
||||||
|
if (try_ugt_eq(v, core, i))
|
||||||
|
prop = true;
|
||||||
if (try_mul_bounds(v, core, i))
|
if (try_mul_bounds(v, core, i))
|
||||||
prop = true;
|
prop = true;
|
||||||
if (try_parity(v, core, i))
|
if (try_parity(v, core, i))
|
||||||
|
@ -109,6 +111,31 @@ namespace polysat {
|
||||||
return prop;
|
return prop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool saturation::try_ugt_eq(pvar x, conflict& core, inequality const& i) {
|
||||||
|
set_rule("egraph(x == y) & p(x,y) > q(x,y) ==> p(y,y) > q(y,y)");
|
||||||
|
if (!i.is_strict())
|
||||||
|
return false;
|
||||||
|
// if (!core.vars().contains(x))
|
||||||
|
// return false;
|
||||||
|
if (!i.as_signed_constraint().contains_var(x))
|
||||||
|
return false;
|
||||||
|
for (pvar y : s.m_slicing.equivalent_vars(x)) {
|
||||||
|
if (!core.vars().contains(y))
|
||||||
|
continue;
|
||||||
|
if (!i.as_signed_constraint().contains_var(y))
|
||||||
|
continue;
|
||||||
|
// does inequality become false by plugging in x = y?
|
||||||
|
pdd const lhs = i.lhs().subst_pdd(x, s.var(y));
|
||||||
|
pdd const rhs = i.rhs().subst_pdd(x, s.var(y));
|
||||||
|
signed_constraint c = ineq(true, lhs, rhs);
|
||||||
|
m_lemma.reset();
|
||||||
|
s.m_slicing.explain_equal(x, y, [&](sat::literal lit) { m_lemma.insert(~lit); });
|
||||||
|
if (propagate(x, core, i, c))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool saturation::try_nonzero_upper_extract(pvar y, conflict& core, inequality const& i) {
|
bool saturation::try_nonzero_upper_extract(pvar y, conflict& core, inequality const& i) {
|
||||||
set_rule("y = x[h:l] & y != 0 ==> x >= 2^l");
|
set_rule("y = x[h:l] & y != 0 ==> x >= 2^l");
|
||||||
if (!s.m_justification[y].is_propagation_by_slicing())
|
if (!s.m_justification[y].is_propagation_by_slicing())
|
||||||
|
|
|
@ -122,6 +122,8 @@ namespace polysat {
|
||||||
bool try_div_monotonicity(conflict& core);
|
bool try_div_monotonicity(conflict& core);
|
||||||
|
|
||||||
bool try_nonzero_upper_extract(pvar v, conflict& core, inequality const& i);
|
bool try_nonzero_upper_extract(pvar v, conflict& core, inequality const& i);
|
||||||
|
bool try_ugt_eq(pvar v, conflict& core, inequality const& i);
|
||||||
|
|
||||||
|
|
||||||
rational round(rational const& M, rational const& x);
|
rational round(rational const& M, rational const& x);
|
||||||
bool eval_round(rational const& M, pdd const& p, rational& r);
|
bool eval_round(rational const& M, pdd const& p, rational& r);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue