}
poly::Rational rhsmult;
poly::Polynomial rhs = as_poly_polynomial(val, d_mapper, rhsmult);
- rhsmult = poly::Rational(1) / rhsmult;
// only correct up to a constant (denominator is thrown away!)
if (!veq_c.isNull())
{
rhsmult = poly_utils::toRational(veq_c.getConst<Rational>());
}
- Candidate res{lhs, rel, rhs, rhsmult, n, collectVariables(val)};
+ Candidate res{lhs, rel, rhs, poly::inverse(rhsmult), n, collectVariables(val)};
Trace("nl-icp") << "\tAdded " << res << " from " << n << std::endl;
result.emplace_back(res);
}
}
poly::Rational rhsmult;
poly::Polynomial rhs = as_poly_polynomial(val, d_mapper, rhsmult);
- rhsmult = poly::Rational(1) / rhsmult;
if (!veq_c.isNull())
{
rhsmult = poly_utils::toRational(veq_c.getConst<Rational>());
}
- Candidate res{lhs, rel, rhs, rhsmult, n, collectVariables(val)};
+ Candidate res{lhs, rel, rhs, poly::inverse(rhsmult), n, collectVariables(val)};
Trace("nl-icp") << "\tAdded " << res << " from " << n << std::endl;
result.emplace_back(res);
}
}
d_im.addPendingLemma(NodeManager::currentNM()->mkOr(mis),
InferenceId::ARITH_NL_ICP_CONFLICT);
- did_progress = true;
- progress = false;
- break;
+ return;
}
} while (progress);
if (did_progress)
const poly::Interval& res,
std::size_t size_threshold)
{
- Trace("nl-icp") << cur << " := " << cur << " intersected with " << res
+ Trace("nl-icp-debug") << cur << " := " << cur << " intersected with " << res
<< std::endl;
if (bitsize(get_lower(res)) > size_threshold
|| bitsize(get_upper(res)) > size_threshold)
{
- Trace("nl-icp") << "Reached bitsize threshold" << std::endl;
+ Trace("nl-icp-debug") << "Reached bitsize threshold" << std::endl;
return PropagationResult::NOT_CHANGED;
}
if (get_upper(res) < get_lower(cur))
{
// upper(res) at 1
- Trace("nl-icp") << "res < cur -> conflict" << std::endl;
+ Trace("nl-icp-debug") << "res < cur -> conflict" << std::endl;
return PropagationResult::CONFLICT;
}
if (get_upper(res) == get_lower(cur))
// upper(res) at 2
if (get_upper_open(res) || get_lower_open(cur))
{
- Trace("nl-icp") << "meet at lower, but one is open -> conflict"
+ Trace("nl-icp-debug") << "meet at lower, but one is open -> conflict"
<< std::endl;
return PropagationResult::CONFLICT;
}
if (!is_point(cur))
{
- Trace("nl-icp") << "contracts to point interval at lower" << std::endl;
+ Trace("nl-icp-debug") << "contracts to point interval at lower" << std::endl;
cur = poly::Interval(get_upper(res));
return PropagationResult::CONTRACTED;
}
if (get_lower(res) < get_lower(cur))
{
// lower(res) at 1
- Trace("nl-icp") << "lower(cur) .. upper(res)" << std::endl;
+ Trace("nl-icp-debug") << "lower(cur) .. upper(res)" << std::endl;
cur.set_upper(get_upper(res), get_upper_open(res));
return PropagationResult::CONTRACTED;
}
if (get_lower(res) == get_lower(cur))
{
// lower(res) at 2
- Trace("nl-icp") << "meet at lower, lower(cur) .. upper(res)" << std::endl;
+ Trace("nl-icp-debug") << "meet at lower, lower(cur) .. upper(res)" << std::endl;
cur = poly::Interval(get_lower(cur),
get_lower_open(cur) || get_lower_open(res),
get_upper(res),
Assert(get_lower(res) > get_lower(cur))
<< "Comparison operator does weird stuff.";
// lower(res) at 3
- Trace("nl-icp") << "cur covers res" << std::endl;
+ Trace("nl-icp-debug") << "cur covers res" << std::endl;
cur = res;
return PropagationResult::CONTRACTED_WITHOUT_CURRENT;
}
if (get_lower(res) < get_lower(cur))
{
// lower(res) at 1
- Trace("nl-icp") << "res covers cur but meet at upper" << std::endl;
+ Trace("nl-icp-debug") << "res covers cur but meet at upper" << std::endl;
if (get_upper_open(res) && !get_upper_open(cur))
{
cur.set_upper(get_upper(cur), true);
if (get_lower(res) == get_lower(cur))
{
// lower(res) at 2
- Trace("nl-icp") << "same bounds but check openness" << std::endl;
+ Trace("nl-icp-debug") << "same bounds but check openness" << std::endl;
bool changed = false;
if (get_lower_open(res) && !get_lower_open(cur))
{
Assert(get_lower(res) > get_lower(cur))
<< "Comparison operator does weird stuff.";
// lower(res) at 3
- Trace("nl-icp") << "cur covers res but meet at upper" << std::endl;
+ Trace("nl-icp-debug") << "cur covers res but meet at upper" << std::endl;
cur = poly::Interval(get_lower(res),
get_lower_open(res),
get_upper(res),
if (get_lower(res) < get_lower(cur))
{
// lower(res) at 1
- Trace("nl-icp") << "res covers cur" << std::endl;
+ Trace("nl-icp-debug") << "res covers cur" << std::endl;
return PropagationResult::NOT_CHANGED;
}
if (get_lower(res) == get_lower(cur))
{
// lower(res) at 2
- Trace("nl-icp") << "res covers cur but meet at lower" << std::endl;
+ Trace("nl-icp-debug") << "res covers cur but meet at lower" << std::endl;
if (get_lower_open(res) && is_point(cur))
{
return PropagationResult::CONFLICT;
if (get_lower(res) < get_upper(cur))
{
// lower(res) at 3
- Trace("nl-icp") << "lower(res) .. upper(cur)" << std::endl;
+ Trace("nl-icp-debug") << "lower(res) .. upper(cur)" << std::endl;
cur.set_lower(get_lower(res), get_lower_open(res));
return PropagationResult::CONTRACTED;
}
// lower(res) at 4
if (get_lower_open(res) || get_upper_open(cur))
{
- Trace("nl-icp") << "meet at upper, but one is open -> conflict"
+ Trace("nl-icp-debug") << "meet at upper, but one is open -> conflict"
<< std::endl;
return PropagationResult::CONFLICT;
}
if (!is_point(cur))
{
- Trace("nl-icp") << "contracts to point interval at upper" << std::endl;
+ Trace("nl-icp-debug") << "contracts to point interval at upper" << std::endl;
cur = poly::Interval(get_lower(res));
return PropagationResult::CONTRACTED;
}
Assert(get_lower(res) > get_upper(cur));
// lower(res) at 5
- Trace("nl-icp") << "res > cur -> conflict" << std::endl;
+ Trace("nl-icp-debug") << "res > cur -> conflict" << std::endl;
return PropagationResult::CONFLICT;
}