From b57754483028edfbb5f6f769469254dc2b847e13 Mon Sep 17 00:00:00 2001 From: Lev Nachmanson Date: Fri, 10 Jan 2020 20:08:20 -0800 Subject: [PATCH] make grobner quota a parameter Signed-off-by: Lev Nachmanson --- src/math/lp/nla_core.cpp | 7 ++----- src/math/lp/nla_core.h | 3 +-- src/math/lp/nla_params.pyg | 1 + src/smt/theory_lra.cpp | 1 + 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/math/lp/nla_core.cpp b/src/math/lp/nla_core.cpp index 89146b5b3..7ded80ae5 100644 --- a/src/math/lp/nla_core.cpp +++ b/src/math/lp/nla_core.cpp @@ -1397,7 +1397,7 @@ std::ostream& core::print_term( const lp::lar_term& t, std::ostream& out) const void core::run_grobner() { - static unsigned quota = 8; + unsigned& quota = m_grobner_quota; if (quota == 0) { return; } @@ -1418,10 +1418,7 @@ void core::run_grobner() { IF_VERBOSE(2, verbose_stream() << "grobner conflict\n"); } else { - if (quota == 1) - quota = 0; - else - quota /= 2; + quota >>= 1; IF_VERBOSE(2, verbose_stream() << "grobner miss, quota " << quota << "\n"); IF_VERBOSE(4, diagnose_pdd_miss(verbose_stream())); } diff --git a/src/math/lp/nla_core.h b/src/math/lp/nla_core.h index 7cccfb2b8..b032de5b3 100644 --- a/src/math/lp/nla_core.h +++ b/src/math/lp/nla_core.h @@ -96,14 +96,13 @@ public: nla_settings m_nla_settings; dd::pdd_manager m_pdd_manager; dd::solver m_pdd_grobner; - private: emonics m_emons; svector m_add_buffer; mutable lp::int_set m_active_var_set; lp::int_set m_rows; - public: + unsigned m_grobner_quota; reslimit m_reslim; diff --git a/src/math/lp/nla_params.pyg b/src/math/lp/nla_params.pyg index 005b738be..1098bd586 100644 --- a/src/math/lp/nla_params.pyg +++ b/src/math/lp/nla_params.pyg @@ -13,6 +13,7 @@ def_module_params('nla', ('grobner_expr_degree_growth', UINT, 2, 'grobner\'s maximum expr degree growth'), ('grobner_max_simplified', UINT, 10000, 'grobner\'s maximum number of simplifications'), ('grobner_cnfl_to_report', UINT, 1, 'grobner\'s maximum number of conflicts to report'), + ('gr_q', UINT, 8, 'grobner\'s quota'), ('grobner_subs_fixed', BOOL, False, 'substitute fixed variables by constants') )) diff --git a/src/smt/theory_lra.cpp b/src/smt/theory_lra.cpp index d491f42ad..a756b8477 100644 --- a/src/smt/theory_lra.cpp +++ b/src/smt/theory_lra.cpp @@ -461,6 +461,7 @@ class theory_lra::imp { m_nla->get_core()->m_nla_settings.grobner_expr_degree_growth() = nla.grobner_expr_degree_growth(); m_nla->get_core()->m_nla_settings.grobner_max_simplified() = nla.grobner_max_simplified(); m_nla->get_core()->m_nla_settings.grobner_number_of_conflicts_to_report() = nla.grobner_cnfl_to_report(); + m_nla->get_core()->m_grobner_quota = nla.gr_q(); } }