3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 20:18:18 +00:00

disable fixes for #2128 and related as it breaks model evaluation time in regressions, set longer delay for inprocessing in sat solver, report stats

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-02-09 16:06:02 -08:00
parent c7bd985fac
commit 24dfdfe9bc
9 changed files with 44 additions and 34 deletions

View file

@ -202,7 +202,8 @@ struct evaluator_cfg : public default_rewriter_cfg {
return BR_REWRITE1; return BR_REWRITE1;
} }
} }
if (st == BR_FAILED && num == 0 && m_ar.is_as_array(f)) { #if 0
if (st == BR_FAILED && num == 0 && m_ar.is_as_array(f) && m_model_completion) {
func_decl* g = nullptr; func_decl* g = nullptr;
VERIFY(m_ar.is_as_array(f, g)); VERIFY(m_ar.is_as_array(f, g));
expr* def = nullptr; expr* def = nullptr;
@ -221,6 +222,7 @@ struct evaluator_cfg : public default_rewriter_cfg {
return BR_DONE; return BR_DONE;
} }
} }
#endif
CTRACE("model_evaluator", st != BR_FAILED, tout << result << "\n";); CTRACE("model_evaluator", st != BR_FAILED, tout << result << "\n";);
return st; return st;

View file

@ -44,26 +44,32 @@ namespace sat {
unsigned m_elim_literals; unsigned m_elim_literals;
unsigned m_elim_learned_literals; unsigned m_elim_learned_literals;
unsigned m_tr; unsigned m_tr;
unsigned m_units;
report(asymm_branch & a): report(asymm_branch & a):
m_asymm_branch(a), m_asymm_branch(a),
m_elim_literals(a.m_elim_literals), m_elim_literals(a.m_elim_literals),
m_elim_learned_literals(a.m_elim_learned_literals), m_elim_learned_literals(a.m_elim_learned_literals),
m_tr(a.m_tr) { m_tr(a.m_tr),
m_units(a.s.init_trail_size()) {
m_watch.start(); m_watch.start();
} }
~report() { ~report() {
m_watch.stop(); m_watch.stop();
IF_VERBOSE(SAT_VB_LVL, IF_VERBOSE(2,
unsigned num_learned = (m_asymm_branch.m_elim_learned_literals - m_elim_learned_literals); unsigned num_learned = (m_asymm_branch.m_elim_learned_literals - m_elim_learned_literals);
unsigned num_total = (m_asymm_branch.m_elim_literals - m_elim_literals); unsigned num_total = (m_asymm_branch.m_elim_literals - m_elim_literals);
verbose_stream() unsigned num_units = (m_asymm_branch.s.init_trail_size() - m_units);
<< " (sat-asymm-branch :elim-literals " << (num_total - num_learned) unsigned elim_lits = (num_total - num_learned);
<< " :elim-learned-literals " << num_learned unsigned tr = (m_asymm_branch.m_tr - m_tr);
<< " :hte " << (m_asymm_branch.m_tr - m_tr) verbose_stream() << " (sat-asymm-branch";
<< " :cost " << m_asymm_branch.m_counter if (elim_lits > 0) verbose_stream() << " :elim-literals " << elim_lits;
<< mem_stat() if (num_learned > 0) verbose_stream() << " :elim-learned-literals " << num_learned;
<< " :time " << std::fixed << std::setprecision(2) << m_watch.get_seconds() << ")\n";); if (num_units > 0) verbose_stream() << " :units " << num_units;
if (tr > 0) verbose_stream() << " :hte " << tr;
verbose_stream() << " :cost " << m_asymm_branch.m_counter;
verbose_stream() << mem_stat();
verbose_stream() << m_watch << ")\n";);
} }
}; };
@ -84,11 +90,11 @@ namespace sat {
if (s.m_inconsistent) if (s.m_inconsistent)
break; break;
unsigned num_elim = m_elim_literals + m_tr - elim; unsigned num_elim = m_elim_literals + m_tr - elim;
IF_VERBOSE(2, verbose_stream() << "(sat-asymm-branch-step :elim " << num_elim << ")\n";); IF_VERBOSE(4, verbose_stream() << "(sat-asymm-branch-step :elim " << num_elim << ")\n";);
if (num_elim == 0) if (num_elim == 0)
break; break;
} }
IF_VERBOSE(2, if (m_elim_learned_literals > eliml0) IF_VERBOSE(4, if (m_elim_learned_literals > eliml0)
verbose_stream() << "(sat-asymm-branch :elim " << m_elim_learned_literals - eliml0 << ")\n";); verbose_stream() << "(sat-asymm-branch :elim " << m_elim_learned_literals - eliml0 << ")\n";);
return m_elim_literals > elim0; return m_elim_literals > elim0;
} }
@ -98,7 +104,7 @@ namespace sat {
unsigned elim = m_elim_literals; unsigned elim = m_elim_literals;
process(nullptr, s.m_clauses); process(nullptr, s.m_clauses);
s.propagate(false); s.propagate(false);
IF_VERBOSE(2, if (m_elim_learned_literals > eliml0) IF_VERBOSE(4, if (m_elim_learned_literals > eliml0)
verbose_stream() << "(sat-asymm-branch :elim " << m_elim_learned_literals - eliml0 << ")\n";); verbose_stream() << "(sat-asymm-branch :elim " << m_elim_learned_literals - eliml0 << ")\n";);
return m_elim_literals > elim; return m_elim_literals > elim;
} }

View file

@ -165,12 +165,11 @@ namespace sat {
} }
~report() { ~report() {
m_watch.stop(); m_watch.stop();
IF_VERBOSE(SAT_VB_LVL, IF_VERBOSE(2,
verbose_stream() << " (sat-cleaner :elim-literals " << (m_cleaner.m_elim_literals - m_elim_literals) verbose_stream() << " (sat-cleaner";
<< " :elim-clauses " << (m_cleaner.m_elim_clauses - m_elim_clauses) verbose_stream() << " :elim-literals " << (m_cleaner.m_elim_literals - m_elim_literals);
<< " :cost " << m_cleaner.m_cleanup_counter verbose_stream() << " :elim-clauses " << (m_cleaner.m_elim_clauses - m_elim_clauses);
<< mk_stat(m_cleaner.s) verbose_stream() << " :cost " << m_cleaner.m_cleanup_counter << m_watch << ")\n";);
<< " :time " << std::fixed << std::setprecision(2) << m_watch.get_seconds() << ")\n";);
} }
}; };

View file

@ -130,9 +130,9 @@ namespace sat {
} }
// These parameters are not exposed // These parameters are not exposed
m_next_simplify1 = _p.get_uint("next_simplify", 30000); m_next_simplify1 = _p.get_uint("next_simplify", 90000);
m_simplify_mult2 = _p.get_double("simplify_mult2", 1.5); m_simplify_mult2 = _p.get_double("simplify_mult2", 1.5);
m_simplify_max = _p.get_uint("simplify_max", 500000); m_simplify_max = _p.get_uint("simplify_max", 1000000);
// -------------------------------- // --------------------------------
m_simplify_delay = p.simplify_delay(); m_simplify_delay = p.simplify_delay();

View file

@ -167,7 +167,6 @@ namespace sat{
if (simp.cleanup_clause(c)) if (simp.cleanup_clause(c))
return; return;
if (v0 == 39063) IF_VERBOSE(0, verbose_stream() << "bdd: " << c << "\n");
switch (c.size()) { switch (c.size()) {
case 0: case 0:
s.set_conflict(justification()); s.set_conflict(justification());

View file

@ -185,12 +185,13 @@ namespace sat {
~report() { ~report() {
m_watch.stop(); m_watch.stop();
IF_VERBOSE(SAT_VB_LVL, unsigned units = (m_probing.m_num_assigned - m_num_assigned);
verbose_stream() << " (sat-probing :probing-assigned " IF_VERBOSE(2,
<< (m_probing.m_num_assigned - m_num_assigned) verbose_stream() << " (sat-probing";
<< " :cost " << m_probing.m_counter; if (units > 0) verbose_stream() << " :probing-assigned " << units;
verbose_stream() << " :cost " << m_probing.m_counter;
if (m_probing.m_stopped_at != 0) verbose_stream() << " :stopped-at " << m_probing.m_stopped_at; if (m_probing.m_stopped_at != 0) verbose_stream() << " :stopped-at " << m_probing.m_stopped_at;
verbose_stream() << mem_stat() << " :time " << std::fixed << std::setprecision(2) << m_watch.get_seconds() << ")\n";); verbose_stream() << mem_stat() << m_watch << ")\n";);
} }
}; };

View file

@ -56,11 +56,10 @@ namespace sat {
~report() { ~report() {
m_watch.stop(); m_watch.stop();
unsigned elim_bin = m_scc.m_num_elim_bin - m_num_elim_bin; unsigned elim_bin = m_scc.m_num_elim_bin - m_num_elim_bin;
IF_VERBOSE(SAT_VB_LVL, IF_VERBOSE(2,
verbose_stream() << " (sat-scc :elim-vars " << (m_scc.m_num_elim - m_num_elim); verbose_stream() << " (sat-scc :elim-vars " << (m_scc.m_num_elim - m_num_elim);
if (elim_bin > 0) verbose_stream() << " :elim-bin " << elim_bin; if (elim_bin > 0) verbose_stream() << " :elim-bin " << elim_bin;
verbose_stream() << mk_stat(m_scc.m_solver) verbose_stream() << m_watch << ")\n";);
<< " :time " << std::fixed << std::setprecision(2) << m_watch.get_seconds() << ")\n";);
} }
}; };

View file

@ -1721,7 +1721,6 @@ namespace sat {
m_next_simplify = m_conflicts_since_init + m_config.m_simplify_max; m_next_simplify = m_conflicts_since_init + m_config.m_simplify_max;
} }
if (m_par) m_par->set_phase(*this); if (m_par) m_par->set_phase(*this);
#if 0 #if 0
@ -1962,7 +1961,7 @@ namespace sat {
m_restart_next_out = 1; m_restart_next_out = 1;
} }
else { else {
m_restart_next_out = (3*m_restart_next_out)/2 + 1; m_restart_next_out = std::min(m_conflicts_since_init + 50000, (3*m_restart_next_out)/2 + 1);
} }
log_stats(); log_stats();
} }

View file

@ -26,6 +26,7 @@ Revision History:
#include "util/common_msgs.h" #include "util/common_msgs.h"
#include "util/vector.h" #include "util/vector.h"
#include "util/uint_set.h" #include "util/uint_set.h"
#include "util/stopwatch.h"
#include<iomanip> #include<iomanip>
namespace sat { namespace sat {
@ -223,6 +224,10 @@ namespace sat {
return out << std::fixed << std::setprecision(2) << mem; return out << std::fixed << std::setprecision(2) << mem;
} }
inline std::ostream& operator<<(std::ostream& out, stopwatch const& sw) {
return out << " :time " << std::fixed << std::setprecision(2) << sw.get_seconds();
}
struct dimacs_lit { struct dimacs_lit {
literal m_lit; literal m_lit;
dimacs_lit(literal l):m_lit(l) {} dimacs_lit(literal l):m_lit(l) {}