3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 03:45:51 +00:00

saved params work

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-11-29 17:19:12 -08:00
parent c3055207ed
commit cf28cbab0a
130 changed files with 1469 additions and 948 deletions

View file

@ -474,7 +474,7 @@ void context_t<C>::del(interval & a) {
template<typename C>
void context_t<C>::updt_params(params_ref const & p) {
unsigned epsilon = p.get_uint(":epsilon", 20);
unsigned epsilon = p.get_uint("epsilon", 20);
if (epsilon != 0) {
nm().set(m_epsilon, static_cast<int>(epsilon));
nm().inv(m_epsilon);
@ -485,18 +485,18 @@ void context_t<C>::updt_params(params_ref const & p) {
m_zero_epsilon = true;
}
unsigned max_power = p.get_uint(":max-bound", 10);
unsigned max_power = p.get_uint("max_bound", 10);
nm().set(m_max_bound, 10);
nm().power(m_max_bound, max_power, m_max_bound);
nm().set(m_minus_max_bound, m_max_bound);
nm().neg(m_minus_max_bound);
m_max_depth = p.get_uint(":max-depth", 128);
m_max_nodes = p.get_uint(":max-nodes", 8192);
m_max_depth = p.get_uint("max_depth", 128);
m_max_nodes = p.get_uint("max_nodes", 8192);
m_max_memory = megabytes_to_bytes(p.get_uint(":max-memory", UINT_MAX));
m_max_memory = megabytes_to_bytes(p.get_uint("max_memory", UINT_MAX));
unsigned prec = p.get_uint(":nth-root-precision", 8192);
unsigned prec = p.get_uint("nth_root_precision", 8192);
if (prec == 0)
prec = 1;
nm().set(m_nth_root_prec, static_cast<int>(prec));
@ -505,20 +505,20 @@ void context_t<C>::updt_params(params_ref const & p) {
template<typename C>
void context_t<C>::collect_param_descrs(param_descrs & d) {
d.insert(":max-nodes", CPK_UINT, "(default: 8192) maximum number of nodes in the subpaving tree.");
d.insert(":max-depth", CPK_UINT, "(default: 128) maximum depth of the subpaving tree.");
d.insert(":epsilon", CPK_UINT, "(default: 20) value k s.t. a new lower (upper) bound for x is propagated only new-lower(x) > lower(k) + 1/k * max(min(upper(x) - lower(x), |lower|), 1) (new-upper(x) < upper(x) - 1/k * max(min(upper(x) - lower(x), |lower|), 1)). If k = 0, then this restriction is ignored.");
d.insert(":max-bound", CPK_UINT, "(default 10) value k s.t. a new upper (lower) bound for x is propagated only if upper(x) > -10^k or lower(x) = -oo (lower(x) < 10^k or upper(x) = oo)");
d.insert(":nth-root-precision", CPK_UINT, "(default 8192) value k s.t. 1/k is the precision for computing the nth root in the subpaving module.");
d.insert("max_nodes", CPK_UINT, "(default: 8192) maximum number of nodes in the subpaving tree.");
d.insert("max_depth", CPK_UINT, "(default: 128) maximum depth of the subpaving tree.");
d.insert("epsilon", CPK_UINT, "(default: 20) value k s.t. a new lower (upper) bound for x is propagated only new-lower(x) > lower(k) + 1/k * max(min(upper(x) - lower(x), |lower|), 1) (new-upper(x) < upper(x) - 1/k * max(min(upper(x) - lower(x), |lower|), 1)). If k = 0, then this restriction is ignored.");
d.insert("max_bound", CPK_UINT, "(default 10) value k s.t. a new upper (lower) bound for x is propagated only if upper(x) > -10^k or lower(x) = -oo (lower(x) < 10^k or upper(x) = oo)");
d.insert("nth_root_precision", CPK_UINT, "(default 8192) value k s.t. 1/k is the precision for computing the nth root in the subpaving module.");
}
template<typename C>
void context_t<C>::display_params(std::ostream & out) const {
out << ":max-nodes " << m_max_nodes << "\n";
out << ":max-depth " << m_max_depth << "\n";
out << ":epsilon " << nm().to_rational_string(m_epsilon) << "\n";
out << ":max-bound " << nm().to_rational_string(m_max_bound) << "\n";
out << ":max-memory " << m_max_memory << "\n";
out << "max_nodes " << m_max_nodes << "\n";
out << "max_depth " << m_max_depth << "\n";
out << "epsilon " << nm().to_rational_string(m_epsilon) << "\n";
out << "max_bound " << nm().to_rational_string(m_max_bound) << "\n";
out << "max_memory " << m_max_memory << "\n";
}
template<typename C>

View file

@ -81,14 +81,14 @@ class subpaving_tactic : public tactic {
void collect_param_descrs(param_descrs & r) {
m_ctx->collect_param_descrs(r);
// #ifndef _EXTERNAL_RELEASE
r.insert(":numeral", CPK_SYMBOL, "(default: mpq) options: mpq, mpf, hwf, mpff, mpfx.");
r.insert(":print-nodes", CPK_BOOL, "(default: false) display subpaving tree leaves.");
r.insert("numeral", CPK_SYMBOL, "(default: mpq) options: mpq, mpf, hwf, mpff, mpfx.");
r.insert("print_nodes", CPK_BOOL, "(default: false) display subpaving tree leaves.");
// #endif
}
void updt_params(params_ref const & p) {
m_display = p.get_bool(":print-nodes", false);
symbol engine = p.get_sym(":numeral", symbol("mpq"));
m_display = p.get_bool("print_nodes", false);
symbol engine = p.get_sym("numeral", symbol("mpq"));
engine_kind new_kind;
if (engine == "mpq")
new_kind = MPQ;
@ -293,16 +293,16 @@ tactic * mk_subpaving_tactic_core(ast_manager & m, params_ref const & p) {
tactic * mk_subpaving_tactic(ast_manager & m, params_ref const & p) {
params_ref simp_p = p;
simp_p.set_bool(":arith-lhs", true);
simp_p.set_bool(":expand-power", true);
simp_p.set_uint(":max-power", UINT_MAX);
simp_p.set_bool(":som", true);
simp_p.set_bool(":eq2ineq", true);
simp_p.set_bool(":elim-and", true);
simp_p.set_bool(":blast-distinct", true);
simp_p.set_bool("arith_lhs", true);
simp_p.set_bool("expand_power", true);
simp_p.set_uint("max_power", UINT_MAX);
simp_p.set_bool("som", true);
simp_p.set_bool("eq2ineq", true);
simp_p.set_bool("elim_and", true);
simp_p.set_bool("blast_distinct", true);
params_ref simp2_p = p;
simp2_p.set_bool(":mul-to-power", true);
simp2_p.set_bool("mul_to_power", true);
return and_then(using_params(mk_simplify_tactic(m, p),
simp_p),