Skip to content

Commit a34c5a9

Browse files
committed
bail out on big rational numbers in nla monotone lemmas
Signed-off-by: Lev Nachmanson <[email protected]>
1 parent b81ab94 commit a34c5a9

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

src/math/lp/nla_core.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ lbool core::incremental_linearization(bool constraint_derived) {
12851285
SASSERT(elists_are_consistent(true));
12861286
if (search_level == 1) {
12871287
m_order.order_lemma();
1288-
} else { // search_level == 2
1288+
} else if (search_level == 2) {
12891289
m_monotone. monotonicity_lemma();
12901290
m_tangents.tangent_lemma();
12911291
}
@@ -1370,6 +1370,21 @@ void core::update_to_refine_of_var(lpvar j) {
13701370
}
13711371
}
13721372

1373+
bool core::var_is_big(lpvar j) const {
1374+
if (var_is_int(j))
1375+
return false;
1376+
return val(j).is_big();
1377+
}
1378+
1379+
bool core::has_big_num(const monic& m) const {
1380+
if (var_is_big(var(m)))
1381+
return true;
1382+
for (lpvar j : m.vars())
1383+
if (var_is_big(j))
1384+
return true;
1385+
return false;
1386+
}
1387+
13731388
bool core::patch_blocker(lpvar u, const monic& m) const {
13741389
SASSERT(m_to_refine.contains(m.var()));
13751390
if (var_is_used_in_a_correct_monic(u)) {

src/math/lp/nla_core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,8 @@ class core {
424424
bool try_to_patch(lpvar, const rational&, const monic&);
425425
bool to_refine_is_correct() const;
426426
bool patch_blocker(lpvar u, const monic& m) const;
427+
bool has_big_num(const monic&) const;
428+
bool var_is_big(lpvar) const;
427429
}; // end of core
428430

429431
struct pp_mon {

src/math/lp/nla_monotone_lemmas.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ void monotone::monotonicity_lemma(monic const& m) {
3737
SASSERT(!check_monic(m));
3838
if (c().mon_has_zero(m.vars()))
3939
return;
40+
if (c().has_big_num(m))
41+
return;
4042
const rational prod_val = abs(c().product_value(m));
4143
const rational m_val = abs(var_val(m));
4244
if (m_val < prod_val)

0 commit comments

Comments
 (0)