mirror of
https://github.com/Z3Prover/z3
synced 2026-06-19 15:16:29 +00:00
lp: rename cut_period_random to random_period
The toggle also gates the cube heuristics (find_cube, lcube), not just cuts, so 'cut' in the name was misleading. random_period covers all the periodic integer heuristic gates (find_cube, lcube, hnf, gomory, dio). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
74899eeb93
commit
17de82a963
4 changed files with 11 additions and 11 deletions
|
|
@ -195,15 +195,15 @@ namespace lp {
|
|||
lp_settings& settings() { return lra.settings(); }
|
||||
|
||||
// Decide whether a periodic heuristic fires on this call. When
|
||||
// cut_period_random is enabled the gate is drawn at random with the
|
||||
// same 1/period expected rate instead of a deterministic "every k-th
|
||||
// call" modulus: a deterministic period can phase-lock with the search
|
||||
// on some families and drown the solver in conflicts while another
|
||||
// handler is starved; randomizing the gate breaks that resonance.
|
||||
// random_period is enabled the gate is drawn at random with the same
|
||||
// 1/period expected rate instead of a deterministic "every k-th call"
|
||||
// modulus: a deterministic period can phase-lock with the search on
|
||||
// some families and drown the solver in conflicts while another handler
|
||||
// is starved; randomizing the gate breaks that resonance.
|
||||
bool hit_period(unsigned period) {
|
||||
if (period <= 1)
|
||||
return true;
|
||||
if (settings().cut_period_random())
|
||||
if (settings().random_period())
|
||||
return settings().random_next(period) == 0;
|
||||
return m_number_of_calls % period == 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@ def_module_params(module_name='lp',
|
|||
('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'),
|
||||
('cut_period', UINT, 4, 'period (in final_check calls) for the integer cut/cube heuristics (find_cube, hnf, gomory); a smaller value calls them more often'),
|
||||
('cut_period_random', BOOL, True, 'draw the integer cut/cube heuristic gates (find_cube, lcube, hnf, gomory, dio) at random with the same 1/period rate instead of a deterministic every-k-th-call modulus'),
|
||||
('random_period', BOOL, True, 'draw the periodic integer heuristic gates (find_cube, lcube, hnf, gomory, dio) at random with the same 1/period rate instead of a deterministic every-k-th-call modulus'),
|
||||
))
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ void lp::lp_settings::updt_params(params_ref const& _p) {
|
|||
m_dio_ignore_big_nums = lp_p.dio_ignore_big_nums();
|
||||
m_dio_calls_period = lp_p.dio_calls_period();
|
||||
m_dio_run_gcd = lp_p.dio_run_gcd();
|
||||
m_cut_period_random = lp_p.cut_period_random();
|
||||
m_random_period = lp_p.random_period();
|
||||
m_lcube = lp_p.lcube();
|
||||
m_lcube_flips = lp_p.lcube_flips();
|
||||
unsigned cut_period = lp_p.cut_period();
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ private:
|
|||
bool m_dio_ignore_big_nums = false;
|
||||
unsigned m_dio_calls_period = 4;
|
||||
bool m_dio_run_gcd = true;
|
||||
bool m_cut_period_random = true;
|
||||
bool m_random_period = true;
|
||||
bool m_lcube = true;
|
||||
unsigned m_lcube_flips = 16;
|
||||
public:
|
||||
|
|
@ -272,8 +272,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; }
|
||||
bool cut_period_random() const { return m_cut_period_random; }
|
||||
bool & cut_period_random() { return m_cut_period_random; }
|
||||
bool random_period() const { return m_random_period; }
|
||||
bool & random_period() { return m_random_period; }
|
||||
bool print_external_var_name() const { return m_print_external_var_name; }
|
||||
bool propagate_eqs() const { return m_propagate_eqs;}
|
||||
unsigned hnf_cut_period() const { return m_hnf_cut_period; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue