mirror of
https://github.com/Z3Prover/z3
synced 2025-05-11 09:44:43 +00:00
exposed sat params
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
773f82a44c
commit
0934cb06d8
8 changed files with 111 additions and 87 deletions
|
@ -18,6 +18,7 @@ Revision History:
|
|||
--*/
|
||||
#include"sat_config.h"
|
||||
#include"sat_types.h"
|
||||
#include"sat_params.hpp"
|
||||
|
||||
namespace sat {
|
||||
|
||||
|
@ -36,10 +37,11 @@ namespace sat {
|
|||
updt_params(p);
|
||||
}
|
||||
|
||||
void config::updt_params(params_ref const & p) {
|
||||
m_max_memory = megabytes_to_bytes(p.get_uint("max_memory", UINT_MAX));
|
||||
void config::updt_params(params_ref const & _p) {
|
||||
sat_params p(_p);
|
||||
m_max_memory = megabytes_to_bytes(p.max_memory());
|
||||
|
||||
symbol s = p.get_sym("restart", m_luby);
|
||||
symbol s = p.restart();
|
||||
if (s == m_luby)
|
||||
m_restart = RS_LUBY;
|
||||
else if (s == m_geometric)
|
||||
|
@ -47,7 +49,7 @@ namespace sat {
|
|||
else
|
||||
throw sat_param_exception("invalid restart strategy");
|
||||
|
||||
s = p.get_sym("phase", m_caching);
|
||||
s = p.phase();
|
||||
if (s == m_always_false)
|
||||
m_phase = PS_ALWAYS_FALSE;
|
||||
else if (s == m_always_true)
|
||||
|
@ -59,29 +61,31 @@ namespace sat {
|
|||
else
|
||||
throw sat_param_exception("invalid phase selection strategy");
|
||||
|
||||
m_phase_caching_on = p.get_uint("phase_caching_on", 400);
|
||||
m_phase_caching_off = p.get_uint("phase_caching_off", 100);
|
||||
m_phase_caching_on = p.phase_caching_on();
|
||||
m_phase_caching_off = p.phase_caching_off();
|
||||
|
||||
m_restart_initial = p.get_uint("restart_initial", 100);
|
||||
m_restart_factor = p.get_double("restart_factor", 1.5);
|
||||
m_restart_initial = p.restart_initial();
|
||||
m_restart_factor = p.restart_factor();
|
||||
|
||||
m_random_freq = p.get_double("random_freq", 0.01);
|
||||
m_random_freq = p.random_freq();
|
||||
|
||||
m_burst_search = p.get_uint("burst_search", 100);
|
||||
m_burst_search = p.burst_search();
|
||||
|
||||
m_max_conflicts = p.get_uint("max_conflicts", UINT_MAX);
|
||||
m_max_conflicts = p.max_conflicts();
|
||||
|
||||
// These parameters are not exposed
|
||||
m_simplify_mult1 = _p.get_uint("simplify_mult1", 300);
|
||||
m_simplify_mult2 = _p.get_double("simplify_mult2", 1.5);
|
||||
m_simplify_max = _p.get_uint("simplify_max", 500000);
|
||||
// --------------------------------
|
||||
|
||||
m_simplify_mult1 = p.get_uint("simplify_mult1", 300);
|
||||
m_simplify_mult2 = p.get_double("simplify_mult2", 1.5);
|
||||
m_simplify_max = p.get_uint("simplify_max", 500000);
|
||||
|
||||
s = p.get_sym("gc_strategy", m_glue_psm);
|
||||
s = p.gc();
|
||||
if (s == m_dyn_psm) {
|
||||
m_gc_strategy = GC_DYN_PSM;
|
||||
m_gc_initial = p.get_uint("gc_initial", 500);
|
||||
m_gc_increment = p.get_uint("gc_increment", 100);
|
||||
m_gc_small_lbd = p.get_uint("gc_small_lbd", 3);
|
||||
m_gc_k = p.get_uint("gc_k", 7);
|
||||
m_gc_initial = p.gc_initial();
|
||||
m_gc_increment = p.gc_increment();
|
||||
m_gc_small_lbd = p.gc_small_lbd();
|
||||
m_gc_k = p.gc_k();
|
||||
if (m_gc_k > 255)
|
||||
m_gc_k = 255;
|
||||
}
|
||||
|
@ -96,31 +100,15 @@ namespace sat {
|
|||
m_gc_strategy = GC_PSM_GLUE;
|
||||
else
|
||||
throw sat_param_exception("invalid gc strategy");
|
||||
m_gc_initial = p.get_uint("gc_initial", 20000);
|
||||
m_gc_increment = p.get_uint("gc_increment", 500);
|
||||
m_gc_initial = p.gc_initial();
|
||||
m_gc_increment = p.gc_increment();
|
||||
}
|
||||
m_minimize_lemmas = p.get_bool("minimize_lemmas", true);
|
||||
m_dyn_sub_res = p.get_bool("dyn_sub_res", true);
|
||||
m_minimize_lemmas = p.minimize_lemmas();
|
||||
m_dyn_sub_res = p.dyn_sub_res();
|
||||
}
|
||||
|
||||
void config::collect_param_descrs(param_descrs & r) {
|
||||
insert_max_memory(r);
|
||||
r.insert("phase", CPK_SYMBOL, "(default: caching) phase selection strategy: always_false, always_true, caching, random.");
|
||||
r.insert("phase_caching_on", CPK_UINT, "(default: 400)");
|
||||
r.insert("phase_caching_off", CPK_UINT, "(default: 100)");
|
||||
r.insert("restart", CPK_SYMBOL, "(default: luby) restart strategy: luby or geometric.");
|
||||
r.insert("restart_initial", CPK_UINT, "(default: 100) initial restart (number of conflicts).");
|
||||
r.insert("restart_factor", CPK_DOUBLE, "(default: 1.5) restart increment factor for geometric strategy.");
|
||||
r.insert("random_freq", CPK_DOUBLE, "(default: 0.01) frequency of random case splits.");
|
||||
r.insert("burst_search", CPK_UINT, "(default: 100) number of conflicts before first global simplification.");
|
||||
r.insert("max_conflicts", CPK_UINT, "(default: inf) maximum number of conflicts.");
|
||||
r.insert("gc_strategy", CPK_SYMBOL, "(default: glue_psm) garbage collection strategy: psm, glue, glue_psm, dyn_psm.");
|
||||
r.insert("gc_initial", CPK_UINT, "(default: 20000) learned clauses garbage collection frequence.");
|
||||
r.insert("gc_increment", CPK_UINT, "(default: 500) increment to the garbage collection threshold.");
|
||||
r.insert("gc_small_lbd", CPK_UINT, "(default: 3) learned clauses with small LBD are never deleted (only used in dyn_psm).");
|
||||
r.insert("gc_k", CPK_UINT, "(default: 7) learned clauses that are inactive for k gc rounds are permanently deleted (only used in dyn_psm).");
|
||||
r.insert("minimize_lemmas", CPK_BOOL, "(default: true) minimize learned clauses.");
|
||||
r.insert("dyn_sub_res", CPK_BOOL, "(default: true) dynamic subsumption resolution for minimizing learned clauses.");
|
||||
sat_params::collect_param_descrs(r);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue