Skip to content

Commit 58e64ea

Browse files
committed
try exponential delay in grobner
Signed-off-by: Lev Nachmanson <[email protected]>
1 parent 2bf1cc7 commit 58e64ea

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/math/lp/nla_grobner.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,22 @@ namespace nla {
4747
if (m_quota == 0)
4848
m_quota = c().params().arith_nl_gr_q();
4949

50+
bool const use_exp_delay = c().params().arith_nl_grobner_exp_delay();
51+
5052
if (m_quota == 1) {
51-
m_delay_base++;
52-
m_delay = m_delay_base;
53+
if (use_exp_delay) {
54+
constexpr unsigned delay_cap = 1000000;
55+
if (m_delay_base == 0)
56+
m_delay_base = 1;
57+
else if (m_delay_base < delay_cap) {
58+
m_delay_base *= 2;
59+
if (m_delay_base > delay_cap)
60+
m_delay_base = delay_cap;
61+
}
62+
m_delay = m_delay_base;
63+
}
64+
else
65+
m_delay = ++m_delay_base;
5366
m_quota = c().params().arith_nl_gr_q();
5467
}
5568

src/params/smt_params_helper.pyg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def_module_params(module_name='smt',
8080
('arith.nl.grobner_cnfl_to_report', UINT, 1, 'grobner\'s maximum number of conflicts to report'),
8181
('arith.nl.grobner_propagate_quotients', BOOL, True, 'detect conflicts x*y + z = 0 where x doesn\'t divide z'),
8282
('arith.nl.grobner_gcd_test', BOOL, True, 'detect gcd conflicts for polynomial powers x^k - y = 0'),
83+
('arith.nl.grobner_exp_delay', BOOL, False, 'use exponential delay between grobner basis attempts'),
8384
('arith.nl.gr_q', UINT, 10, 'grobner\'s quota'),
8485
('arith.nl.grobner_subs_fixed', UINT, 1, '0 - no subs, 1 - substitute, 2 - substitute fixed zeros only'),
8586
('arith.nl.grobner_expand_terms', BOOL, True, 'expand terms before computing grobner basis'),
@@ -138,4 +139,3 @@ def_module_params(module_name='smt',
138139
('dt_lazy_splits', UINT, 1, 'How lazy datatype splits are performed: 0- eager, 1- lazy for infinite types, 2- lazy'),
139140
('qsat_use_qel', BOOL, True, 'Use QEL for lite quantifier elimination and model-based projection in QSAT')
140141
))
141-

0 commit comments

Comments
 (0)