diff --git a/src/math/lp/int_solver.cpp b/src/math/lp/int_solver.cpp index b75f7e9e6..7a6f75dfa 100644 --- a/src/math/lp/int_solver.cpp +++ b/src/math/lp/int_solver.cpp @@ -239,8 +239,11 @@ namespace lp { bool should_solve_dioph_eq() { bool ret = lia.settings().dio() && hit_period(settings().dio_calls_period()); - if (!ret && lia.settings().dio_calls_period() > m_initial_dio_calls_period) - lia.settings().dio_calls_period() --; + if (!ret && lia.settings().dio_calls_period() > m_initial_dio_calls_period) { + unsigned dec = settings().dio_calls_period_decrease(); + unsigned& period = lia.settings().dio_calls_period(); + period = period > m_initial_dio_calls_period + dec ? period - dec : m_initial_dio_calls_period; + } return ret; } diff --git a/src/math/lp/lp_params_helper.pyg b/src/math/lp/lp_params_helper.pyg index 9fc7bb31f..c3d109f80 100644 --- a/src/math/lp/lp_params_helper.pyg +++ b/src/math/lp/lp_params_helper.pyg @@ -8,6 +8,7 @@ def_module_params(module_name='lp', ('dio_cuts_enable_hnf', BOOL, True, 'enable hnf cuts together with Diophantine cuts, only relevant when dioph_eq is true'), ('dio_ignore_big_nums', BOOL, True, 'Ignore the terms with big numbers in the Diophantine handler, only relevant when dioph_eq is true'), ('dio_calls_period', UINT, 1, 'Period of calling the Diophantine handler in the final_check()'), + ('dio_calls_period_decrease', UINT, 2, 'Amount by which dio_calls_period is decreased on each final_check() call where the Diophantine handler is not triggered, until it returns to its initial value'), ('dio_run_gcd', BOOL, False, 'Run the GCD heuristic if dio is on, if dio is disabled the option is not used'), ('lcube', BOOL, True, 'use the largest cube test for integer feasibility'), ('lcube_flips', UINT, 16, 'maximal number of coordinate flips when repairing the rounded largest cube center, only relevant when lcube is true'), diff --git a/src/math/lp/lp_settings.cpp b/src/math/lp/lp_settings.cpp index 3b1cf14aa..9ffa9bb14 100644 --- a/src/math/lp/lp_settings.cpp +++ b/src/math/lp/lp_settings.cpp @@ -42,6 +42,7 @@ void lp::lp_settings::updt_params(params_ref const& _p) { m_dump_bound_lemmas = p.arith_dump_bound_lemmas(); m_dio_ignore_big_nums = lp_p.dio_ignore_big_nums(); m_dio_calls_period = lp_p.dio_calls_period(); + m_dio_calls_period_decrease = lp_p.dio_calls_period_decrease(); m_dio_run_gcd = lp_p.dio_run_gcd(); m_random_hammers = lp_p.random_hammers(); m_lcube = lp_p.lcube(); diff --git a/src/math/lp/lp_settings.h b/src/math/lp/lp_settings.h index 1744eafb0..a50c3ba8c 100644 --- a/src/math/lp/lp_settings.h +++ b/src/math/lp/lp_settings.h @@ -263,6 +263,7 @@ private: bool m_dump_bound_lemmas = false; bool m_dio_ignore_big_nums = false; unsigned m_dio_calls_period = 4; + unsigned m_dio_calls_period_decrease = 2; bool m_dio_run_gcd = true; bool m_random_hammers = true; bool m_lcube = true; @@ -272,6 +273,8 @@ public: unsigned lcube_flips() const { return m_lcube_flips; } unsigned dio_calls_period() const { return m_dio_calls_period; } unsigned & dio_calls_period() { return m_dio_calls_period; } + unsigned dio_calls_period_decrease() const { return m_dio_calls_period_decrease; } + unsigned & dio_calls_period_decrease() { return m_dio_calls_period_decrease; } bool random_hammers() const { return m_random_hammers; } bool & random_hammers() { return m_random_hammers; } bool print_external_var_name() const { return m_print_external_var_name; }