mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 09:34:08 +00:00
fix #4227
This commit is contained in:
parent
603b5552fa
commit
691759c9e2
|
@ -473,6 +473,14 @@ interval & interval::operator*=(interval const & other) {
|
|||
return *this;
|
||||
}
|
||||
|
||||
bool interval::empty() const {
|
||||
if (m_lower.is_infinite() || m_upper.is_infinite())
|
||||
return false;
|
||||
if (m_lower < m_upper)
|
||||
return false;
|
||||
return m_lower > m_upper || m_lower_open || m_upper_open;
|
||||
}
|
||||
|
||||
bool interval::contains_zero() const {
|
||||
TRACE("interval_zero_bug", tout << "contains_zero info: " << *this << "\n";
|
||||
tout << "m_lower.is_neg(): " << m_lower.is_neg() << "\n";
|
||||
|
|
|
@ -102,6 +102,7 @@ public:
|
|||
bool operator==(old_interval const & other) const { return m_lower == other.m_lower && m_upper == other.m_upper && m_lower_open == other.m_lower_open && m_upper_open == other.m_upper_open; }
|
||||
bool contains_zero() const;
|
||||
bool contains(rational const& v) const;
|
||||
bool empty() const;
|
||||
old_interval & inv();
|
||||
void expt(unsigned n);
|
||||
void neg();
|
||||
|
|
|
@ -226,23 +226,23 @@ interval theory_arith<Ext>::mk_interval_for(theory_var v) {
|
|||
}
|
||||
return interval(m_dep_manager,
|
||||
l->get_value().get_rational().to_rational(),
|
||||
!l->get_value().get_infinitesimal().to_rational().is_zero(),
|
||||
l->get_value().get_infinitesimal().to_rational().is_pos(),
|
||||
m_dep_manager.mk_leaf(l),
|
||||
u->get_value().get_rational().to_rational(),
|
||||
!u->get_value().get_infinitesimal().to_rational().is_zero(),
|
||||
u->get_value().get_infinitesimal().to_rational().is_neg(),
|
||||
m_dep_manager.mk_leaf(u));
|
||||
}
|
||||
else if (l) {
|
||||
return interval(m_dep_manager,
|
||||
l->get_value().get_rational().to_rational(),
|
||||
!l->get_value().get_infinitesimal().to_rational().is_zero(),
|
||||
l->get_value().get_infinitesimal().to_rational().is_pos(),
|
||||
true,
|
||||
m_dep_manager.mk_leaf(l));
|
||||
}
|
||||
else if (u) {
|
||||
return interval(m_dep_manager,
|
||||
u->get_value().get_rational().to_rational(),
|
||||
!u->get_value().get_infinitesimal().to_rational().is_zero(),
|
||||
u->get_value().get_infinitesimal().to_rational().is_neg(),
|
||||
false,
|
||||
m_dep_manager.mk_leaf(u));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue