Skip to content

Commit

Permalink
throttle value smt -> sls
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Jan 26, 2025
1 parent d4100fc commit d3bf25c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/ast/sls/sat_ddfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ namespace sat {
for (unsigned i = 0; i < num_vars(); ++i)
m_model[i] = to_lbool(value(i));
save_priorities();
if (m_plugin && !m_in_external_flip && m_restart_count == 0)
if (m_plugin && !m_in_external_flip && m_restart_count == 0 && m_model_save_count++ % 10 == 0)
m_plugin->on_restart(); // import values if there are any updated ones.
if (m_plugin && !m_in_external_flip)
m_last_result = m_plugin->on_save_model();
Expand Down
1 change: 1 addition & 0 deletions src/ast/sls/sat_ddfw.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ namespace sat {
uint64_t m_last_flips_for_shift = 0;
unsigned m_num_non_binary_clauses = 0;
unsigned m_restart_count = 0, m_reinit_count = 0;
unsigned m_model_save_count = 0;
uint64_t m_restart_next = 0, m_reinit_next = 0;
uint64_t m_flips = 0, m_last_flips = 0, m_shifts = 0;
unsigned m_logs = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/ast/sls/sls_arith_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1571,8 +1571,8 @@ namespace sls {
todo.push_back(op.m_arg1);
todo.push_back(op.m_arg2);
}
if (m_vars[u].is_if_op()) {
auto const& ui = m_vars[u];
auto const& ui = m_vars[u];
if (ui.is_if_op()) {
expr* c = nullptr, * th = nullptr, * el = nullptr;
VERIFY(m.is_ite(ui.m_expr, c, th, el));
todo.push_back(mk_var(th));
Expand Down
6 changes: 4 additions & 2 deletions src/ast/sls/sls_smt_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ namespace sls {
m_sat_phase[v] = ctx.get_best_phase(v);
}

bool smt_plugin::export_to_sls() {
bool smt_plugin::export_to_sls() {
bool updated = false;
if (m_has_units) {
std::lock_guard<std::mutex> lock(m_mutex);
Expand Down Expand Up @@ -274,7 +274,7 @@ namespace sls {

void smt_plugin::smt_values_to_sls() {

if (ctx.parallel_mode()) {
if (true || ctx.parallel_mode()) {
std::scoped_lock lock(m_mutex);
m_sync_var_values.reset();
for (auto const& [t, t_sync] : m_smt2sync_uninterp) {
Expand Down Expand Up @@ -310,9 +310,11 @@ namespace sls {
void smt_plugin::sls_phase_to_smt() {
if (!m_has_new_sls_phase)
return;
#if 0
IF_VERBOSE(2, verbose_stream() << "SLS -> SMT phase. unsat size: " << m_min_unsat_size << "\n");
for (auto v : m_shared_bool_vars)
ctx.force_phase(sat::literal(v, !m_sls_phase[v]));
#endif
m_has_new_sls_phase = false;
}

Expand Down
5 changes: 0 additions & 5 deletions src/sat/smt/sls_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ namespace sls {
m_smt_plugin->add_unit(lit);
}
}
#if 0
if (ctx.has_new_best_phase())
m_smt_plugin->import_phase_from_smt();

#endif

m_smt_plugin->import_from_sls();
}
Expand Down

0 comments on commit d3bf25c

Please sign in to comment.