3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00

use u_map in lar_term

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2019-12-30 17:58:56 -08:00 committed by Nikolaj Bjorner
parent f5c7b9fb2f
commit 1fff7bb51d
5 changed files with 70 additions and 60 deletions

View file

@ -2708,21 +2708,21 @@ public:
lp::var_index vi = m_theory_var2var_index[v];
SASSERT(m_solver->is_term(vi));
lp::lar_term const& term = m_solver->get_term(vi);
for (auto const & coeff : term.m_coeffs) {
lp::var_index wi = coeff.first;
for (auto const mono : term) {
lp::var_index wi = mono.var();
lp::constraint_index ci;
rational value;
bool is_strict;
if (m_solver->is_term(wi)) {
return false;
}
if (coeff.second.is_neg() == is_lub) {
if (mono.coeff().is_neg() == is_lub) {
// -3*x ... <= lub based on lower bound for x.
if (!m_solver->has_lower_bound(wi, ci, value, is_strict)) {
return false;
}
if (is_strict) {
r += inf_rational(rational::zero(), coeff.second.is_pos());
r += inf_rational(rational::zero(), mono.coeff().is_pos());
}
}
else {
@ -2730,10 +2730,10 @@ public:
return false;
}
if (is_strict) {
r += inf_rational(rational::zero(), coeff.second.is_pos());
r += inf_rational(rational::zero(), mono.coeff().is_pos());
}
}
r += value * coeff.second;
r += value * mono.coeff();
set_evidence(ci);
}
TRACE("arith_verbose", tout << (is_lub?"lub":"glb") << " is " << r << "\n";);