mirror of
https://github.com/Z3Prover/z3
synced 2025-04-16 05:48:44 +00:00
fixes in get_lower,get_upper of theory_lra
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
342feeff03
commit
4d88818560
|
@ -2613,10 +2613,13 @@ public:
|
||||||
|
|
||||||
bool get_lower(enode* n, expr_ref& r) {
|
bool get_lower(enode* n, expr_ref& r) {
|
||||||
theory_var v = n->get_th_var(get_id());
|
theory_var v = n->get_th_var(get_id());
|
||||||
|
if (!can_get_value(v))
|
||||||
|
return false;
|
||||||
|
lp::var_index vi = m_theory_var2var_index[v];
|
||||||
lp::constraint_index ci;
|
lp::constraint_index ci;
|
||||||
rational val;
|
rational val;
|
||||||
bool is_strict;
|
bool is_strict;
|
||||||
if (m_solver->has_lower_bound(v, ci, val, is_strict)) {
|
if (m_solver->has_lower_bound(vi, ci, val, is_strict)) {
|
||||||
r = a.mk_numeral(val, is_int(n));
|
r = a.mk_numeral(val, is_int(n));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2625,10 +2628,13 @@ public:
|
||||||
|
|
||||||
bool get_upper(enode* n, expr_ref& r) {
|
bool get_upper(enode* n, expr_ref& r) {
|
||||||
theory_var v = n->get_th_var(get_id());
|
theory_var v = n->get_th_var(get_id());
|
||||||
|
if (!can_get_value(v))
|
||||||
|
return false;
|
||||||
|
lp::var_index vi = m_theory_var2var_index[v];
|
||||||
lp::constraint_index ci;
|
lp::constraint_index ci;
|
||||||
rational val;
|
rational val;
|
||||||
bool is_strict;
|
bool is_strict;
|
||||||
if (m_solver->has_upper_bound(v, ci, val, is_strict)) {
|
if (m_solver->has_upper_bound(vi, ci, val, is_strict)) {
|
||||||
r = a.mk_numeral(val, is_int(n));
|
r = a.mk_numeral(val, is_int(n));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue