3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-24 03:57:51 +00:00

forbidden intervals for strict inequalities

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2022-01-22 11:14:53 +01:00
parent 82798863ba
commit 417a5320c7
5 changed files with 95 additions and 19 deletions

View file

@ -125,7 +125,9 @@ namespace polysat {
auto p = lhs().subst_val(s.assignment());
auto q = rhs().subst_val(s.assignment());
LOG_H3("Narrowing " << *this);
signed_constraint sc(this, is_positive);
LOG_H3("Narrowing " << sc);
LOG("Assignment: " << assignments_pp(s));
LOG("Substituted LHS: " << lhs() << " := " << p);
LOG("Substituted RHS: " << rhs() << " := " << q);
@ -141,26 +143,32 @@ namespace polysat {
}
pvar v = null_var;
bool first = true;
if (p.is_unilinear())
v = p.var();
else if (q.is_unilinear())
v = q.var();
v = q.var(), first = false;
else
return;
signed_constraint sc(this, is_positive);
if (!s.m_viable.intersect(v, sc))
return;
rational val;
switch (s.m_viable.find_viable(v, val)) {
case dd::find_t::singleton:
s.propagate(v, val, sc); // TBD why is sc used as justification? It should be all of viable
break;
case dd::find_t::empty:
s.set_conflict(v);
break;
default:
break;
try_viable:
if (s.m_viable.intersect(v, sc)) {
rational val;
switch (s.m_viable.find_viable(v, val)) {
case dd::find_t::singleton:
s.propagate(v, val, sc); // TBD why is sc used as justification? It should be all of viable
break;
case dd::find_t::empty:
s.set_conflict(v);
return;
default:
break;
}
}
if (first && q.is_unilinear() && q.var() != v) {
v = q.var();
first = false;
goto try_viable;
}
}