Skip to content

Commit

Permalink
fix(contractor/contractor_ibex.cpp): remove ibex::EmptyBoxException
Browse files Browse the repository at this point in the history
close dreal#88
  • Loading branch information
soonhokong committed May 4, 2015
1 parent 2170622 commit 1fb8416
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions src/contractor/contractor_ibex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,12 @@ box contractor_ibex_fwdbwd::prune(box b, SMTConfig & config) const {
DREAL_LOG_DEBUG << m_var_array[i].name << " = " << iv[i];
}
// Prune on iv
try {
DREAL_LOG_DEBUG << "Before pruning using ibex_fwdbwd(" << *m_numctr << ")";
DREAL_LOG_DEBUG << b;
DREAL_LOG_DEBUG << "ibex interval = " << iv << " (before)";
DREAL_LOG_DEBUG << "function = " << m_ctc->f;
DREAL_LOG_DEBUG << "domain = " << m_ctc->d;
m_ctc->contract(iv);
} catch(ibex::EmptyBoxException& e) {
// Do nothing
// TODO(soonhok): we will remove this try-catch block once
// IBEX-team eliminate EmptyBoxException
}
DREAL_LOG_DEBUG << "Before pruning using ibex_fwdbwd(" << *m_numctr << ")";
DREAL_LOG_DEBUG << b;
DREAL_LOG_DEBUG << "ibex interval = " << iv << " (before)";
DREAL_LOG_DEBUG << "function = " << m_ctc->f;
DREAL_LOG_DEBUG << "domain = " << m_ctc->d;
m_ctc->contract(iv);
DREAL_LOG_DEBUG << "ibex interval = " << iv << " (after)";
if (iv.is_empty()) {
b.set_empty();
Expand Down Expand Up @@ -272,14 +266,8 @@ box contractor_ibex_polytope::prune(box b, SMTConfig & config) const {
if (!m_ctc) { init(b); }
thread_local static box old_box(b);
old_box = b;
try {
m_ctc->contract(b.get_values());
} catch(ibex::EmptyBoxException&) {
// Do nothing
// TODO(soonhok): we will remove this try-catch block once
// IBEX-team eliminate EmptyBoxException
assert(b.is_empty());
}
m_ctc->contract(b.get_values());

// setup output
vector<bool> diff_dims = b.diff_dims(old_box);
m_output = ibex::BitSet::empty(old_box.size());
Expand Down

0 comments on commit 1fb8416

Please sign in to comment.