From 2334ed5b6652e44b078a4ff9ca7d5607bcb99848 Mon Sep 17 00:00:00 2001 From: Lev Nachmanson Date: Tue, 31 Dec 2019 14:32:49 -0800 Subject: [PATCH] disable nex grobner Signed-off-by: Lev Nachmanson --- src/math/lp/nla_core.cpp | 20 ++------------------ src/math/lp/nla_params.pyg | 2 +- src/math/lp/nla_settings.h | 12 ++++-------- src/smt/theory_lra.cpp | 2 +- 4 files changed, 8 insertions(+), 28 deletions(-) diff --git a/src/math/lp/nla_core.cpp b/src/math/lp/nla_core.cpp index 93c2caf83..50d2cc8f8 100644 --- a/src/math/lp/nla_core.cpp +++ b/src/math/lp/nla_core.cpp @@ -1288,25 +1288,9 @@ lbool core::inner_check(bool constraint_derived) { if (need_to_call_algebraic_methods()) if (!m_horner.horner_lemmas()) { clear_and_resize_active_var_set(); - find_nl_cluster(); - switch(m_nla_settings.run_grobner()) { - case nla_settings::NEX_AND_BDD_GROBNER: - init_nex_grobner(m_nex_grobner.get_nex_creator()); - m_nex_grobner.grobner_lemmas(); + if (m_nla_settings.run_grobner()) { + find_nl_cluster(); run_pdd_grobner(); - break; - case nla_settings::NEX_GROBNER: - init_nex_grobner(m_nex_grobner.get_nex_creator()); - m_nex_grobner.grobner_lemmas(); - break; - case nla_settings::PDD_GROBNER: - run_pdd_grobner(); - break; - case nla_settings::NO_GROBNER: - break; - default: - UNREACHABLE(); - break; } } if (done()) { diff --git a/src/math/lp/nla_params.pyg b/src/math/lp/nla_params.pyg index 21a5ab596..0bd061ef4 100644 --- a/src/math/lp/nla_params.pyg +++ b/src/math/lp/nla_params.pyg @@ -6,7 +6,7 @@ def_module_params('nla', ('horner', BOOL, True, 'run horner\'s heuristic'), ('horner_frequency', UINT, 4, 'horner\'s call frequency'), ('horner_row_length_limit', UINT, 10, 'row is disregarded by the heuristic if its length is longer than the value'), - ('grobner', UINT, 1, '1 - grobner nex, 2 - grobner pdd, 3 - both, 0 - none'), + ('grobner', BOOL, True, 'run grobner\'s basis heuristic'), ('grobner_frequency', UINT, 5, 'grobner\'s call frequency'), ('grobner_eqs_threshold', UINT, 512, 'grobner\'s maximum number of equalities') )) diff --git a/src/math/lp/nla_settings.h b/src/math/lp/nla_settings.h index 700d1cf9a..8f75466f8 100644 --- a/src/math/lp/nla_settings.h +++ b/src/math/lp/nla_settings.h @@ -21,10 +21,6 @@ Revision History: #pragma once namespace nla { class nla_settings { -public: - enum run_grobner_enum { - NO_GROBNER, NEX_GROBNER, PDD_GROBNER, NEX_AND_BDD_GROBNER }; -private: bool m_run_order; bool m_run_tangents; bool m_run_horner; @@ -32,7 +28,7 @@ private: unsigned m_horner_frequency; unsigned m_horner_row_length_limit; // grobner fields - run_grobner_enum m_run_grobner; + bool m_run_grobner; unsigned m_grobner_frequency; unsigned m_grobner_eqs_threshold; unsigned m_grobner_row_length_limit; @@ -44,7 +40,7 @@ public: m_run_horner(true), m_horner_frequency(4), m_horner_row_length_limit(10), - m_run_grobner(NEX_GROBNER), + m_run_grobner(true), m_grobner_frequency(5), m_grobner_eqs_threshold(512), m_grobner_row_length_limit(10), @@ -68,8 +64,8 @@ public: unsigned horner_row_length_limit() const { return m_horner_row_length_limit; } unsigned& horner_row_length_limit() { return m_horner_row_length_limit; } - run_grobner_enum run_grobner() const { return m_run_grobner; } - run_grobner_enum& run_grobner() { return m_run_grobner; } + bool run_grobner() const { return m_run_grobner; } + bool& run_grobner() { return m_run_grobner; } unsigned grobner_row_length_limit() const { return m_grobner_row_length_limit; } unsigned grobner_expr_size_limit() const { return m_grobner_expr_size_limit; } diff --git a/src/smt/theory_lra.cpp b/src/smt/theory_lra.cpp index 96f7e05ae..89341a7f1 100644 --- a/src/smt/theory_lra.cpp +++ b/src/smt/theory_lra.cpp @@ -452,7 +452,7 @@ class theory_lra::imp { m_nla->get_core()->m_nla_settings.run_horner() = nla.horner(); m_nla->get_core()->m_nla_settings.horner_frequency() = nla.horner_frequency(); m_nla->get_core()->m_nla_settings.horner_row_length_limit() = nla.horner_row_length_limit(); - m_nla->get_core()->m_nla_settings.run_grobner() = static_cast(nla.grobner()); + m_nla->get_core()->m_nla_settings.run_grobner() = nla.grobner(); m_nla->get_core()->m_nla_settings.grobner_eqs_threshold() = nla.grobner_eqs_threshold(); } }