mirror of
https://github.com/Z3Prover/z3
synced 2025-04-28 11:25:51 +00:00
fixes in bound setting in cube, and in lar_solver
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
9cce01e632
commit
a80eb13420
3 changed files with 10 additions and 7 deletions
|
@ -1781,17 +1781,19 @@ void lar_solver::activate(constraint_index ci) {
|
|||
update_column_type_and_bound(c.column(), c.kind(), c.rhs(), ci);
|
||||
}
|
||||
|
||||
mpq lar_solver::adjust_bound_for_int(lpvar j, lconstraint_kind k, const mpq& bound) {
|
||||
mpq lar_solver::adjust_bound_for_int(lpvar j, lconstraint_kind& k, const mpq& bound) {
|
||||
if (!column_is_int(j))
|
||||
return bound;
|
||||
switch (k) {
|
||||
case LT:
|
||||
case LT:
|
||||
k = LE;
|
||||
case LE:
|
||||
return floor(bound);
|
||||
case GT:
|
||||
case GT:
|
||||
k = GE;
|
||||
case GE:
|
||||
return ceil(bound);
|
||||
case EQ:
|
||||
case EQ:
|
||||
return bound;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
|
@ -2193,13 +2195,13 @@ bool lar_solver::tighten_term_bounds_by_delta(unsigned term_index, const impq& d
|
|||
}
|
||||
TRACE("cube", tout << "can tighten";);
|
||||
if (slv.column_has_upper_bound(j)) {
|
||||
if (!is_zero(delta.y))
|
||||
if (!is_zero(delta.y) || !is_zero(slv.m_upper_bounds[j].y))
|
||||
add_var_bound(tj, lconstraint_kind::LT, slv.m_upper_bounds[j].x - delta.x);
|
||||
else
|
||||
add_var_bound(tj, lconstraint_kind::LE, slv.m_upper_bounds[j].x - delta.x);
|
||||
}
|
||||
if (slv.column_has_lower_bound(j)) {
|
||||
if (!is_zero(delta.y))
|
||||
if (!is_zero(delta.y) || !is_zero(slv.m_lower_bounds[j].y))
|
||||
add_var_bound(tj, lconstraint_kind::GT, slv.m_lower_bounds[j].x + delta.x);
|
||||
else
|
||||
add_var_bound(tj, lconstraint_kind::GE, slv.m_lower_bounds[j].x + delta.x);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue