Skip to content

Commit

Permalink
don't have bv-ackerman influence simplification
Browse files Browse the repository at this point in the history
previous scheme has Ackmerman module instrument main solver to backjump and simplify when reaching a threshold.
This destroys overall performance: simplification does many more things than invoking Ackerman axioms.
Having a dependency between simplification (in-processing) and depleting a priority queue of auxiliary axioms therefore hurts overall performance. It has to be decoupled. The current approach is now to empty the axiom queue on occasion.
It is still not ideal - it should be coupled with the search level - axioms don't survive higher levels where redundant clauses get garbage collected as they don't have a chance of being used.
  • Loading branch information
NikolajBjorner committed Aug 21, 2022
1 parent be0cd74 commit 17fc438
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/sat/sat_solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,6 @@ namespace sat {
//
// -----------------------
public:
void set_should_simplify() { m_next_simplify = m_conflicts_since_init; }
bool_var_vector const& get_vars_to_reinit() const { return m_vars_to_reinit; }
bool is_probing() const { return m_is_probing; }
bool is_free(bool_var v) const { return m_free_vars.contains(v); }
Expand Down
12 changes: 7 additions & 5 deletions src/sat/smt/bv_ackerman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ namespace bv {
remove(other);
add_cc(v1, v2);
}
else if (other->m_count > m_propagate_high_watermark)
s.s().set_should_simplify();
else if (other->m_count > 2*m_propagate_high_watermark)
propagate();
}

void ackerman::used_diseq_eh(euf::theory_var v1, euf::theory_var v2) {
Expand All @@ -76,8 +76,8 @@ namespace bv {
new_tmp();
gc();
}
if (other->m_count > m_propagate_high_watermark)
s.s().set_should_simplify();
if (other->m_count > 2*m_propagate_high_watermark)
propagate();
}

void ackerman::update_glue(vv& v) {
Expand Down Expand Up @@ -137,6 +137,9 @@ namespace bv {
if (m_num_propagations_since_last_gc <= s.get_config().m_dack_gc)
return;
m_num_propagations_since_last_gc = 0;

if (m_table.size() > m_gc_threshold)
propagate();

while (m_table.size() > m_gc_threshold)
remove(m_queue->prev());
Expand All @@ -147,7 +150,6 @@ namespace bv {
}

void ackerman::propagate() {
SASSERT(s.s().at_base_lvl());
auto* n = m_queue;
vv* k = nullptr;
unsigned num_prop = static_cast<unsigned>(s.s().get_stats().m_conflict * s.get_config().m_dack_factor);
Expand Down
12 changes: 6 additions & 6 deletions src/sat/smt/bv_ackerman.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ namespace bv {

solver& s;
table_t m_table;
vv* m_queue { nullptr };
vv* m_tmp_vv { nullptr };
vv* m_queue = nullptr;
vv* m_tmp_vv = nullptr;

unsigned m_gc_threshold { 100 };
unsigned m_propagate_high_watermark { 10000 };
unsigned m_propagate_low_watermark { 10 };
unsigned m_num_propagations_since_last_gc { 0 };
unsigned m_gc_threshold = 100;
unsigned m_propagate_high_watermark = 10000;
unsigned m_propagate_low_watermark = 10;
unsigned m_num_propagations_since_last_gc = 0;
bool_vector m_diff_levels;

void update_glue(vv& v);
Expand Down

0 comments on commit 17fc438

Please sign in to comment.