mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 20:18:18 +00:00
resurrect old bounds propagation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
a39d4adf5b
commit
5619ed0586
|
@ -161,19 +161,29 @@ namespace nla {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rational(dep.upper(range)).root(p, r) && (p % 2 == 1 || c().has_upper_bound(v))) {
|
if (rational(dep.upper(range)).root(p, r)) {
|
||||||
SASSERT(p % 2 == 1 || c().get_upper_bound(v) >= 0);
|
|
||||||
// v = -2, [-4,-3]^3 < v^3 -> add bound v <= -3
|
// v = -2, [-4,-3]^3 < v^3 -> add bound v <= -3
|
||||||
// v = -2, [-1,+1]^2 < v^2 -> add bound v >= -1
|
// v = -2, [-1,+1]^2 < v^2 -> add bound v >= -1
|
||||||
|
|
||||||
|
if ((p % 2 == 1) || c().val(v).is_pos()) {
|
||||||
++c().lra.settings().stats().m_nla_propagate_bounds;
|
++c().lra.settings().stats().m_nla_propagate_bounds;
|
||||||
auto le = dep.upper_is_open(range) ? llc::LT : llc::LE;
|
auto le = dep.upper_is_open(range) ? llc::LT : llc::LE;
|
||||||
new_lemma lemma(c(), "propagate value - root case - upper bound of range is below value");
|
new_lemma lemma(c(), "propagate value - root case - upper bound of range is below value");
|
||||||
lemma &= ex;
|
lemma &= ex;
|
||||||
if (p % 2 == 0)
|
|
||||||
lemma.explain_existing_upper_bound(v);
|
|
||||||
lemma |= ineq(v, le, r);
|
lemma |= ineq(v, le, r);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p % 2 == 0 && c().val(v).is_neg()) {
|
||||||
|
++c().lra.settings().stats().m_nla_propagate_bounds;
|
||||||
|
SASSERT(!r.is_neg());
|
||||||
|
auto ge = dep.upper_is_open(range) ? llc::GT : llc::GE;
|
||||||
|
new_lemma lemma(c(), "propagate value - root case - upper bound of range is below negative value");
|
||||||
|
lemma &= ex;
|
||||||
|
lemma |= ineq(v, ge, -r);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (should_propagate_lower(range, v, p)) { // v.lower^p < range.lower
|
if (should_propagate_lower(range, v, p)) { // v.lower^p < range.lower
|
||||||
|
|
Loading…
Reference in a new issue