3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +00:00

toward fetching existing terms intervals from lar_solver

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2019-08-05 12:04:27 -07:00
parent 3c5b1086a1
commit dfe0e85629
7 changed files with 199 additions and 42 deletions

View file

@ -185,7 +185,46 @@ public:
m_config.add_deps(a, b, deps, i);
}
bool is_tighter_on_lower(const interval& a, const interval& b) const {
if (lower_is_inf(a))
return false;
if (lower_is_inf(b))
return true;
if (rational(lower(a)) < rational(lower(b)))
return true;
if (lower(a) > lower(b))
return false;
if (!a.m_lower_open)
return false;
if (b.m_lower_open)
return false;
return true;
}
bool is_tighter_on_upper(const interval& a, const interval& b) const {
if (upper_is_inf(a))
return false;
if (upper_is_inf(b))
return true;
if (rational(upper(a)) > rational(upper(b)))
return true;
if (rational(upper(a)) < rational(upper(b)))
return false;
if (!a.m_upper_open)
return false;
if (b.m_upper_open)
return false;
return true;
}
bool is_tighter(const interval& a, const interval& b) const {
return (is_tighter_on_lower(a, b) && !is_tighter_on_upper(b, a)) ||
(is_tighter_on_upper(a, b) && is_tighter_on_lower(b, a));
}
bool upper_is_inf(const interval& a) const { return m_config.upper_is_inf(a); }
bool lower_is_inf(const interval& a) const { return m_config.lower_is_inf(a); }