mirror of
https://github.com/Z3Prover/z3
synced 2025-06-07 14:43:23 +00:00
parent
8c35b2092d
commit
ccbc4a4943
1 changed files with 17 additions and 8 deletions
|
@ -1619,13 +1619,22 @@ void context_t<C>::propagate_monomial_downward(var x, node * n, unsigned j) {
|
||||||
im().power(y, m->degree(i), yk);
|
im().power(y, m->degree(i), yk);
|
||||||
if (first)
|
if (first)
|
||||||
im().set(d, yk);
|
im().set(d, yk);
|
||||||
else
|
else {
|
||||||
im().mul(d, yk, r);
|
im().mul(d, yk, r);
|
||||||
|
im().set(d, r);
|
||||||
|
first = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (im().contains_zero(d)) {
|
||||||
|
im().reset_lower(r);
|
||||||
|
im().reset_upper(r);
|
||||||
|
}
|
||||||
|
else {
|
||||||
interval& aux = m_i_tmp2;
|
interval& aux = m_i_tmp2;
|
||||||
aux.set_constant(n, x);
|
aux.set_constant(n, x);
|
||||||
im().div(aux, d, r);
|
im().div(aux, d, r);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
SASSERT(sz == 1);
|
SASSERT(sz == 1);
|
||||||
SASSERT(j == 0);
|
SASSERT(j == 0);
|
||||||
|
@ -1633,11 +1642,11 @@ void context_t<C>::propagate_monomial_downward(var x, node * n, unsigned j) {
|
||||||
aux.set_constant(n, x);
|
aux.set_constant(n, x);
|
||||||
im().set(r, aux);
|
im().set(r, aux);
|
||||||
}
|
}
|
||||||
unsigned d = m->degree(j);
|
unsigned deg = m->degree(j);
|
||||||
if (d > 1) {
|
if (deg > 1) {
|
||||||
if (d % 2 == 0 && im().lower_is_neg(r))
|
if (deg % 2 == 0 && im().lower_is_neg(r))
|
||||||
return; // If d is even, we can't take the nth-root when lower(r) is negative.
|
return; // If d is even, we can't take the nth-root when lower(r) is negative.
|
||||||
im().xn_eq_y(r, d, m_nth_root_prec, r);
|
im().xn_eq_y(r, deg, m_nth_root_prec, r);
|
||||||
}
|
}
|
||||||
var y = m->x(j);
|
var y = m->x(j);
|
||||||
// r contains the new bounds for y
|
// r contains the new bounds for y
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue