mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
4f988595c7
commit
58f5531cff
|
@ -1664,6 +1664,7 @@ namespace sat {
|
||||||
if (m_conflicts_since_init < m_next_simplify) {
|
if (m_conflicts_since_init < m_next_simplify) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
log_stats();
|
||||||
m_simplifications++;
|
m_simplifications++;
|
||||||
IF_VERBOSE(2, verbose_stream() << "(sat.simplify :simplifications " << m_simplifications << ")\n";);
|
IF_VERBOSE(2, verbose_stream() << "(sat.simplify :simplifications " << m_simplifications << ")\n";);
|
||||||
|
|
||||||
|
@ -1890,17 +1891,8 @@ namespace sat {
|
||||||
m_config.m_restart_margin * m_slow_glue_avg <= m_fast_glue_avg;
|
m_config.m_restart_margin * m_slow_glue_avg <= m_fast_glue_avg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void solver::restart(bool to_base) {
|
void solver::log_stats() {
|
||||||
m_stats.m_restart++;
|
|
||||||
m_restarts++;
|
|
||||||
if (m_conflicts_since_init >= m_restart_next_out && get_verbosity_level() >= 1) {
|
|
||||||
m_restart_logs++;
|
m_restart_logs++;
|
||||||
if (0 == m_restart_next_out) {
|
|
||||||
m_restart_next_out = 1;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
m_restart_next_out = (3*m_restart_next_out)/2 + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::stringstream strm;
|
std::stringstream strm;
|
||||||
strm << "(sat.stats " << std::setw(6) << m_stats.m_conflict << " "
|
strm << "(sat.stats " << std::setw(6) << m_stats.m_conflict << " "
|
||||||
|
@ -1924,7 +1916,9 @@ namespace sat {
|
||||||
if (m_last_positions[i] > nums[i]) diff += m_last_positions[i] - nums[i];
|
if (m_last_positions[i] > nums[i]) diff += m_last_positions[i] - nums[i];
|
||||||
if (m_last_positions[i] < nums[i]) diff += nums[i] - m_last_positions[i];
|
if (m_last_positions[i] < nums[i]) diff += nums[i] - m_last_positions[i];
|
||||||
}
|
}
|
||||||
if (m_last_positions.empty() || m_restart_logs >= 20 + m_last_position_log || (m_restart_logs >= 6 + m_last_position_log && (!same || diff > 3))) {
|
if (m_last_positions.empty() ||
|
||||||
|
m_restart_logs >= 20 + m_last_position_log ||
|
||||||
|
(m_restart_logs >= 6 + m_last_position_log && (!same || diff > 3))) {
|
||||||
m_last_position_log = m_restart_logs;
|
m_last_position_log = m_restart_logs;
|
||||||
// conflicts restarts learned gc time
|
// conflicts restarts learned gc time
|
||||||
// decisions clauses units memory
|
// decisions clauses units memory
|
||||||
|
@ -1960,6 +1954,19 @@ namespace sat {
|
||||||
}
|
}
|
||||||
IF_VERBOSE(1, verbose_stream() << str);
|
IF_VERBOSE(1, verbose_stream() << str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void solver::restart(bool to_base) {
|
||||||
|
m_stats.m_restart++;
|
||||||
|
m_restarts++;
|
||||||
|
if (m_conflicts_since_init >= m_restart_next_out && get_verbosity_level() >= 1) {
|
||||||
|
if (0 == m_restart_next_out) {
|
||||||
|
m_restart_next_out = 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_restart_next_out = (3*m_restart_next_out)/2 + 1;
|
||||||
|
}
|
||||||
|
log_stats();
|
||||||
|
}
|
||||||
IF_VERBOSE(30, display_status(verbose_stream()););
|
IF_VERBOSE(30, display_status(verbose_stream()););
|
||||||
pop_reinit(restart_level(to_base));
|
pop_reinit(restart_level(to_base));
|
||||||
set_next_restart();
|
set_next_restart();
|
||||||
|
|
|
@ -425,6 +425,7 @@ namespace sat {
|
||||||
unsigned m_last_position_log;
|
unsigned m_last_position_log;
|
||||||
unsigned m_restart_logs;
|
unsigned m_restart_logs;
|
||||||
unsigned restart_level(bool to_base);
|
unsigned restart_level(bool to_base);
|
||||||
|
void log_stats();
|
||||||
bool should_restart() const;
|
bool should_restart() const;
|
||||||
void set_next_restart();
|
void set_next_restart();
|
||||||
bool reached_max_conflicts();
|
bool reached_max_conflicts();
|
||||||
|
|
|
@ -338,8 +338,11 @@ lbool solver::check_sat(unsigned num_assumptions, expr * const * assumptions) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void solver::dump_state(unsigned sz, expr* const* assumptions) {
|
void solver::dump_state(unsigned sz, expr* const* assumptions) {
|
||||||
|
if ((symbol::null != m_cancel_backup_file) &&
|
||||||
|
!m_cancel_backup_file.is_numerical() &&
|
||||||
|
m_cancel_backup_file.c_ptr() &&
|
||||||
|
m_cancel_backup_file.bare_str()[0]) {
|
||||||
std::string file = m_cancel_backup_file.str();
|
std::string file = m_cancel_backup_file.str();
|
||||||
if (file != "") {
|
|
||||||
std::ofstream ous(file);
|
std::ofstream ous(file);
|
||||||
display(ous, sz, assumptions);
|
display(ous, sz, assumptions);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue