mirror of
https://github.com/Z3Prover/z3
synced 2025-07-20 03:12:03 +00:00
handle monomial_bounds::unit_propagate()
This commit is contained in:
parent
ff3268e636
commit
5509b468e9
3 changed files with 12 additions and 11 deletions
|
@ -283,7 +283,7 @@ namespace nla {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lemma |= ineq(m.var(), lp::lconstraint_kind::EQ, 0);
|
lemma |= ineq(m.var(), lp::lconstraint_kind::NE, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (auto v : m)
|
for (auto v : m)
|
||||||
|
@ -291,12 +291,14 @@ namespace nla {
|
||||||
lemma.explain_fixed(v);
|
lemma.explain_fixed(v);
|
||||||
|
|
||||||
lpvar w = non_fixed_var(m);
|
lpvar w = non_fixed_var(m);
|
||||||
SASSERT(w != null_lpvar);
|
if (w != null_lpvar) {
|
||||||
|
|
||||||
lp::lar_term term;
|
lp::lar_term term;
|
||||||
term.add_monomial(-m.rat_sign(), m.var());
|
term.add_var(m.var());
|
||||||
term.add_monomial(k, w);
|
term.add_monomial(-k, w);
|
||||||
lemma |= ineq(term, lp::lconstraint_kind::EQ, 0);
|
lemma |= ineq(term, lp::lconstraint_kind::NE, 0);
|
||||||
|
} else {
|
||||||
|
lemma |= ineq(m.var(), lp::lconstraint_kind::NE, k);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1812,9 +1812,7 @@ bool core::improve_bounds() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void core::propagate(vector<lemma>& lemmas) {
|
void core::propagate(vector<lemma>& lemmas) {
|
||||||
// disable for now
|
// propagate linear monomials, those that have all, or all but one, variables fixed
|
||||||
return;
|
|
||||||
// propagate linear monomials
|
|
||||||
lemmas.reset();
|
lemmas.reset();
|
||||||
m_lemma_vec = &lemmas;
|
m_lemma_vec = &lemmas;
|
||||||
|
|
||||||
|
|
|
@ -2150,9 +2150,10 @@ public:
|
||||||
case l_true:
|
case l_true:
|
||||||
propagate_basic_bounds();
|
propagate_basic_bounds();
|
||||||
propagate_bounds_with_lp_solver();
|
propagate_bounds_with_lp_solver();
|
||||||
|
propagate_nla();
|
||||||
break;
|
break;
|
||||||
case l_undef:
|
case l_undef:
|
||||||
propagate_nla();
|
UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue