mirror of
https://github.com/Z3Prover/z3
synced 2025-05-02 13:27:01 +00:00
saved params work
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
c3055207ed
commit
cf28cbab0a
130 changed files with 1469 additions and 948 deletions
|
@ -70,8 +70,8 @@ class add_bounds_tactic : public tactic {
|
|||
}
|
||||
|
||||
void updt_params(params_ref const & p) {
|
||||
m_lower = p.get_rat(":add-bound-lower", rational(-2));
|
||||
m_upper = p.get_rat(":add-bound-upper", rational(2));
|
||||
m_lower = p.get_rat("add_bound_lower", rational(-2));
|
||||
m_upper = p.get_rat("add_bound_upper", rational(2));
|
||||
}
|
||||
|
||||
void set_cancel(bool f) {
|
||||
|
@ -159,8 +159,8 @@ public:
|
|||
}
|
||||
|
||||
virtual void collect_param_descrs(param_descrs & r) {
|
||||
r.insert(":add-bound-lower", CPK_NUMERAL, "(default: -2) lower bound to be added to unbounded variables.");
|
||||
r.insert(":add-bound-upper", CPK_NUMERAL, "(default: 2) upper bound to be added to unbounded variables.");
|
||||
r.insert("add_bound_lower", CPK_NUMERAL, "(default: -2) lower bound to be added to unbounded variables.");
|
||||
r.insert("add_bound_upper", CPK_NUMERAL, "(default: 2) upper bound to be added to unbounded variables.");
|
||||
}
|
||||
|
||||
virtual void operator()(goal_ref const & g,
|
||||
|
|
|
@ -116,15 +116,15 @@ void bound_propagator::del_constraint(constraint & c) {
|
|||
}
|
||||
|
||||
void bound_propagator::updt_params(params_ref const & p) {
|
||||
m_max_refinements = p.get_uint(":bound-max-refinements", 16);
|
||||
m_threshold = p.get_double(":bound-threshold", 0.05);
|
||||
m_small_interval = p.get_double(":bound-small-interval", 128);
|
||||
m_strict2double = p.get_double(":strict2double", 0.00001);
|
||||
m_max_refinements = p.get_uint("bound_max_refinements", 16);
|
||||
m_threshold = p.get_double("bound_threshold", 0.05);
|
||||
m_small_interval = p.get_double("bound_small_interval", 128);
|
||||
m_strict2double = p.get_double("strict2double", 0.00001);
|
||||
}
|
||||
|
||||
void bound_propagator::get_param_descrs(param_descrs & r) {
|
||||
r.insert(":bound-max-refinements", CPK_UINT, "(default: 16) maximum number of bound refinements (per round) for unbounded variables.");
|
||||
r.insert(":bound-threshold", CPK_DOUBLE, "(default: 0.05) bound propagation improvement threshold ratio.");
|
||||
r.insert("bound_max_refinements", CPK_UINT, "(default: 16) maximum number of bound refinements (per round) for unbounded variables.");
|
||||
r.insert("bound_threshold", CPK_DOUBLE, "(default: 0.05) bound propagation improvement threshold ratio.");
|
||||
}
|
||||
|
||||
void bound_propagator::collect_statistics(statistics & st) const {
|
||||
|
|
|
@ -21,7 +21,7 @@ Notes:
|
|||
#include "ast_pp.h"
|
||||
|
||||
void bv2int_rewriter_ctx::update_params(params_ref const& p) {
|
||||
m_max_size = p.get_uint(":max-bv-size", UINT_MAX);
|
||||
m_max_size = p.get_uint("max_bv_size", UINT_MAX);
|
||||
}
|
||||
|
||||
struct lt_rational {
|
||||
|
|
|
@ -62,7 +62,7 @@ class diff_neq_tactic : public tactic {
|
|||
}
|
||||
|
||||
void updt_params(params_ref const & p) {
|
||||
m_max_k = rational(p.get_uint(":diff-neq-max-k", 1024));
|
||||
m_max_k = rational(p.get_uint("diff_neq_max_k", 1024));
|
||||
m_max_neg_k = -m_max_k;
|
||||
if (m_max_k >= rational(INT_MAX/2))
|
||||
m_max_k = rational(INT_MAX/2);
|
||||
|
@ -374,7 +374,7 @@ public:
|
|||
}
|
||||
|
||||
virtual void collect_param_descrs(param_descrs & r) {
|
||||
r.insert(":diff-neq-max-k", CPK_UINT, "(default: 1024) maximum variable upper bound for diff neq solver.");
|
||||
r.insert("diff_neq_max_k", CPK_UINT, "(default: 1024) maximum variable upper bound for diff neq solver.");
|
||||
}
|
||||
|
||||
virtual void collect_statistics(statistics & st) const {
|
||||
|
|
|
@ -40,7 +40,7 @@ class factor_tactic : public tactic {
|
|||
}
|
||||
|
||||
void updt_params(params_ref const & p) {
|
||||
m_split_factors = p.get_bool(":split-factors", true);
|
||||
m_split_factors = p.get_bool("split_factors", true);
|
||||
m_fparams.updt_params(p);
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ public:
|
|||
}
|
||||
|
||||
virtual void collect_param_descrs(param_descrs & r) {
|
||||
r.insert(":split-factors", CPK_BOOL,
|
||||
r.insert("split_factors", CPK_BOOL,
|
||||
"(default: true) apply simplifications such as (= (* p1 p2) 0) --> (or (= p1 0) (= p2 0)).");
|
||||
polynomial::factor_params::get_param_descrs(r);
|
||||
}
|
||||
|
|
|
@ -792,13 +792,13 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
|
||||
void updt_params(params_ref const & p) {
|
||||
m_max_memory = megabytes_to_bytes(p.get_uint(":max-memory", UINT_MAX));
|
||||
m_fm_real_only = p.get_bool(":fm-real-only", true);
|
||||
m_fm_limit = p.get_uint(":fm-limit", 5000000);
|
||||
m_fm_cutoff1 = p.get_uint(":fm-cutoff1", 8);
|
||||
m_fm_cutoff2 = p.get_uint(":fm-cutoff2", 256);
|
||||
m_fm_extra = p.get_uint(":fm-extra", 0);
|
||||
m_fm_occ = p.get_bool(":fm-occ", false);
|
||||
m_max_memory = megabytes_to_bytes(p.get_uint("max_memory", UINT_MAX));
|
||||
m_fm_real_only = p.get_bool("fm_real_only", true);
|
||||
m_fm_limit = p.get_uint("fm_limit", 5000000);
|
||||
m_fm_cutoff1 = p.get_uint("fm_cutoff1", 8);
|
||||
m_fm_cutoff2 = p.get_uint("fm_cutoff2", 256);
|
||||
m_fm_extra = p.get_uint("fm_extra", 0);
|
||||
m_fm_occ = p.get_bool("fm_occ", false);
|
||||
}
|
||||
|
||||
void set_cancel(bool f) {
|
||||
|
@ -1668,12 +1668,12 @@ public:
|
|||
virtual void collect_param_descrs(param_descrs & r) {
|
||||
insert_produce_models(r);
|
||||
insert_max_memory(r);
|
||||
r.insert(":fm-real-only", CPK_BOOL, "(default: true) consider only real variables for fourier-motzkin elimination.");
|
||||
r.insert(":fm-occ", CPK_BOOL, "(default: false) consider inequalities occurring in clauses for FM.");
|
||||
r.insert(":fm-limit", CPK_UINT, "(default: 5000000) maximum number of constraints, monomials, clauses visited during FM.");
|
||||
r.insert(":fm-cutoff1", CPK_UINT, "(default: 8) first cutoff for FM based on maximum number of lower/upper occurrences.");
|
||||
r.insert(":fm-cutoff2", CPK_UINT, "(default: 256) second cutoff for FM based on num_lower * num_upper occurrences.");
|
||||
r.insert(":fm-extra", CPK_UINT, "(default: 0) max. increase on the number of inequalities for each FM variable elimination step.");
|
||||
r.insert("fm_real_only", CPK_BOOL, "(default: true) consider only real variables for fourier-motzkin elimination.");
|
||||
r.insert("fm_occ", CPK_BOOL, "(default: false) consider inequalities occurring in clauses for FM.");
|
||||
r.insert("fm_limit", CPK_UINT, "(default: 5000000) maximum number of constraints, monomials, clauses visited during FM.");
|
||||
r.insert("fm_cutoff1", CPK_UINT, "(default: 8) first cutoff for FM based on maximum number of lower/upper occurrences.");
|
||||
r.insert("fm_cutoff2", CPK_UINT, "(default: 256) second cutoff for FM based on num_lower * num_upper occurrences.");
|
||||
r.insert("fm_extra", CPK_UINT, "(default: 0) max. increase on the number of inequalities for each FM variable elimination step.");
|
||||
}
|
||||
|
||||
virtual void set_cancel(bool f) {
|
||||
|
@ -1707,9 +1707,9 @@ public:
|
|||
|
||||
tactic * mk_fm_tactic(ast_manager & m, params_ref const & p) {
|
||||
params_ref s_p = p;
|
||||
s_p.set_bool(":arith-lhs", true);
|
||||
s_p.set_bool(":elim-and", true);
|
||||
s_p.set_bool(":som", true);
|
||||
s_p.set_bool("arith_lhs", true);
|
||||
s_p.set_bool("elim_and", true);
|
||||
s_p.set_bool("som", true);
|
||||
return and_then(using_params(mk_simplify_tactic(m, s_p), s_p),
|
||||
clean(alloc(fm_tactic, m, p)));
|
||||
}
|
||||
|
|
|
@ -50,9 +50,9 @@ class lia2pb_tactic : public tactic {
|
|||
}
|
||||
|
||||
void updt_params_core(params_ref const & p) {
|
||||
m_partial_lia2pb = p.get_bool(":lia2pb-partial", false);
|
||||
m_max_bits = p.get_uint(":lia2pb-max-bits", 32);
|
||||
m_total_bits = p.get_uint(":lia2pb-total-bits", 2048);
|
||||
m_partial_lia2pb = p.get_bool("lia2pb_partial", false);
|
||||
m_max_bits = p.get_uint("lia2pb_max_bits", 32);
|
||||
m_total_bits = p.get_uint("lia2pb_total_bits", 2048);
|
||||
}
|
||||
|
||||
void updt_params(params_ref const & p) {
|
||||
|
@ -325,9 +325,9 @@ public:
|
|||
}
|
||||
|
||||
virtual void collect_param_descrs(param_descrs & r) {
|
||||
r.insert(":lia2pb-partial", CPK_BOOL, "(default: false) partial lia2pb conversion.");
|
||||
r.insert(":lia2pb-max-bits", CPK_UINT, "(default: 32) maximum number of bits to be used (per variable) in lia2pb.");
|
||||
r.insert(":lia2pb-total-bits", CPK_UINT, "(default: 2048) total number of bits to be used (per problem) in lia2pb.");
|
||||
r.insert("lia2pb_partial", CPK_BOOL, "(default: false) partial lia2pb conversion.");
|
||||
r.insert("lia2pb_max_bits", CPK_UINT, "(default: 32) maximum number of bits to be used (per variable) in lia2pb.");
|
||||
r.insert("lia2pb_total_bits", CPK_UINT, "(default: 2048) total number of bits to be used (per problem) in lia2pb.");
|
||||
}
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
|
|
|
@ -68,7 +68,7 @@ class nla2bv_tactic : public tactic {
|
|||
m_is_sat_preserving(true),
|
||||
m_arith(m),
|
||||
m_bv(m),
|
||||
m_bv2real(m, rational(p.get_uint(":nla2bv-root",2)), rational(p.get_uint(":nla2bv-divisor",2)), p.get_uint(":nla2bv-max-bv-size", UINT_MAX)),
|
||||
m_bv2real(m, rational(p.get_uint("nla2bv_root",2)), rational(p.get_uint("nla2bv_divisor",2)), p.get_uint("nla2bv_max_bv_size", UINT_MAX)),
|
||||
m_bv2int_ctx(m, p),
|
||||
m_bounds(m),
|
||||
m_subst(m),
|
||||
|
@ -76,7 +76,7 @@ class nla2bv_tactic : public tactic {
|
|||
m_defs(m),
|
||||
m_trail(m),
|
||||
m_fmc(0) {
|
||||
m_default_bv_size = m_num_bits = p.get_uint(":nla2bv-bv-size", 4);
|
||||
m_default_bv_size = m_num_bits = p.get_uint("nla2bv_bv_size", 4);
|
||||
}
|
||||
|
||||
~imp() {}
|
||||
|
@ -436,10 +436,10 @@ public:
|
|||
}
|
||||
|
||||
virtual void collect_param_descrs(param_descrs & r) {
|
||||
r.insert(":nla2bv-max-bv-size", CPK_UINT, "(default: inf) maximum bit-vector size used by nla2bv tactic");
|
||||
r.insert(":nla2bv-bv-size", CPK_UINT, "(default: 4) default bit-vector size used by nla2bv tactic.");
|
||||
r.insert(":nla2bv-root", CPK_UINT, "(default: 2) nla2bv tactic encodes reals into bit-vectors using expressions of the form a+b*sqrt(c), this parameter sets the value of c used in the encoding.");
|
||||
r.insert(":nla2bv-divisor", CPK_UINT, "(default: 2) nla2bv tactic parameter.");
|
||||
r.insert("nla2bv_max_bv_size", CPK_UINT, "(default: inf) maximum bit-vector size used by nla2bv tactic");
|
||||
r.insert("nla2bv_bv_size", CPK_UINT, "(default: 4) default bit-vector size used by nla2bv tactic.");
|
||||
r.insert("nla2bv_root", CPK_UINT, "(default: 2) nla2bv tactic encodes reals into bit-vectors using expressions of the form a+b*sqrt(c), this parameter sets the value of c used in the encoding.");
|
||||
r.insert("nla2bv_divisor", CPK_UINT, "(default: 2) nla2bv tactic parameter.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,7 +44,7 @@ class normalize_bounds_tactic : public tactic {
|
|||
}
|
||||
|
||||
void updt_params_core(params_ref const & p) {
|
||||
m_normalize_int_only = p.get_bool(":norm-int-only", true);
|
||||
m_normalize_int_only = p.get_bool("norm_int_only", true);
|
||||
}
|
||||
|
||||
void updt_params(params_ref const & p) {
|
||||
|
@ -173,7 +173,7 @@ public:
|
|||
|
||||
virtual void collect_param_descrs(param_descrs & r) {
|
||||
insert_produce_models(r);
|
||||
r.insert(":norm-int-only", CPK_BOOL, "(default: true) normalize only the bounds of integer constants.");
|
||||
r.insert("norm_int_only", CPK_BOOL, "(default: true) normalize only the bounds of integer constants.");
|
||||
}
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
|
|
|
@ -863,15 +863,15 @@ private:
|
|||
}
|
||||
|
||||
void updt_params(params_ref const & p) {
|
||||
m_max_memory = megabytes_to_bytes(p.get_uint(":max-memory", UINT_MAX));
|
||||
m_all_clauses_limit = p.get_uint(":pb2bv-all-clauses-limit", 8);
|
||||
m_cardinality_limit = p.get_uint(":pb2bv-cardinality-limit", UINT_MAX);
|
||||
m_max_memory = megabytes_to_bytes(p.get_uint("max_memory", UINT_MAX));
|
||||
m_all_clauses_limit = p.get_uint("pb2bv_all_clauses_limit", 8);
|
||||
m_cardinality_limit = p.get_uint("pb2bv_cardinality_limit", UINT_MAX);
|
||||
}
|
||||
|
||||
void collect_param_descrs(param_descrs & r) {
|
||||
insert_max_memory(r);
|
||||
r.insert(":pb2bv-all-clauses-limit", CPK_UINT, "(default: 8) maximum number of literals for using equivalent CNF encoding of PB constraint.");
|
||||
r.insert(":pb2bv-cardinality-limit", CPK_UINT, "(default: inf) limit for using arc-consistent cardinality constraint encoding.");
|
||||
r.insert("pb2bv_all_clauses_limit", CPK_UINT, "(default: 8) maximum number of literals for using equivalent CNF encoding of PB constraint.");
|
||||
r.insert("pb2bv_cardinality_limit", CPK_UINT, "(default: inf) limit for using arc-consistent cardinality constraint encoding.");
|
||||
}
|
||||
|
||||
void set_cancel(bool f) {
|
||||
|
|
|
@ -856,11 +856,11 @@ public:
|
|||
}
|
||||
|
||||
virtual void collect_param_descrs(param_descrs & r) {
|
||||
r.insert(":complete", CPK_BOOL,
|
||||
r.insert("complete", CPK_BOOL,
|
||||
"(default: true) add constraints to make sure that any interpretation of a underspecified arithmetic operators is a functio. The result will include additional uninterpreted functions/constants: /0, div0, mod0, 0^0, neg-root");
|
||||
r.insert(":elim-root-objects", CPK_BOOL,
|
||||
r.insert("elim_root_objects", CPK_BOOL,
|
||||
"(default: true) eliminate root objects.");
|
||||
r.insert(":elim-inverses", CPK_BOOL,
|
||||
r.insert("elim_inverses", CPK_BOOL,
|
||||
"(default: true) eliminate inverse trigonometric functions (asin, acos, atan).");
|
||||
th_rewriter::get_param_descrs(r);
|
||||
}
|
||||
|
@ -876,9 +876,9 @@ public:
|
|||
tactic_report report("purify-arith", *g);
|
||||
bool produce_proofs = g->proofs_enabled();
|
||||
bool produce_models = g->models_enabled();
|
||||
bool elim_root_objs = m_params.get_bool(":elim-root-objects", true);
|
||||
bool elim_inverses = m_params.get_bool(":elim-inverses", true);
|
||||
bool complete = m_params.get_bool(":complete", true);
|
||||
bool elim_root_objs = m_params.get_bool("elim_root_objects", true);
|
||||
bool elim_inverses = m_params.get_bool("elim_inverses", true);
|
||||
bool complete = m_params.get_bool("complete", true);
|
||||
purify_arith_proc proc(m_util, m_aux_decls, produce_proofs, elim_root_objs, elim_inverses, complete);
|
||||
|
||||
proc(*(g.get()), mc, produce_models);
|
||||
|
@ -902,10 +902,10 @@ public:
|
|||
|
||||
tactic * mk_purify_arith_tactic(ast_manager & m, params_ref const & p) {
|
||||
params_ref elim_rem_p = p;
|
||||
elim_rem_p.set_bool(":elim-rem", true);
|
||||
elim_rem_p.set_bool("elim-rem", true);
|
||||
|
||||
params_ref skolemize_p;
|
||||
skolemize_p.set_bool(":skolemize", false);
|
||||
skolemize_p.set_bool("skolemize", false);
|
||||
|
||||
return and_then(using_params(mk_snf_tactic(m, skolemize_p), skolemize_p),
|
||||
using_params(mk_simplify_tactic(m, elim_rem_p), elim_rem_p),
|
||||
|
|
|
@ -58,7 +58,7 @@ class recover_01_tactic : public tactic {
|
|||
}
|
||||
|
||||
void updt_params_core(params_ref const & p) {
|
||||
m_cls_max_size = p.get_uint(":recover-01-max-bits", 10);
|
||||
m_cls_max_size = p.get_uint("recover_01_max_bits", 10);
|
||||
}
|
||||
|
||||
void updt_params(params_ref const & p) {
|
||||
|
@ -408,7 +408,7 @@ public:
|
|||
|
||||
virtual void collect_param_descrs(param_descrs & r) {
|
||||
th_rewriter::get_param_descrs(r);
|
||||
r.insert(":recover-01-max-bits", CPK_UINT, "(default: 10) maximum number of bits to consider in a clause.");
|
||||
r.insert("recover_01_max_bits", CPK_UINT, "(default: 10) maximum number of bits to consider in a clause.");
|
||||
}
|
||||
|
||||
void operator()(goal_ref const & g,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue