Skip to content

Commit

Permalink
read laziness parameter modulo relvancy to avoid race conditions with…
Browse files Browse the repository at this point in the history
… setting relevancy = 0
  • Loading branch information
NikolajBjorner committed Dec 22, 2024
1 parent a214dc3 commit fb5bbb8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/smt/smt_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,6 @@ namespace smt {
// there are some other cases where relevancy propagation is harmful.
//
void setup::setup_relevancy(static_features& st) {
return;
if (st.m_has_bv && !st.m_has_fpa && st.m_num_quantifiers == 0)
m_params.m_relevancy_lvl = 0;
}
Expand Down
15 changes: 9 additions & 6 deletions src/smt/theory_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ namespace smt {
m_find(*this),
m_trail_stack(),
m_final_check_idx(0) {
if (!ctx.relevancy())
m_params.m_array_laziness = 0;
}

theory_array::~theory_array() {
std::for_each(m_var_data.begin(), m_var_data.end(), delete_proc<var_data>());
m_var_data.reset();
}

void theory_array::init_search_eh() {
m_final_check_idx = 0;
}

void theory_array::merge_eh(theory_var v1, theory_var v2, theory_var, theory_var) {
// v1 is the new root
TRACE("array",
Expand Down Expand Up @@ -77,7 +79,7 @@ namespace smt {
if (is_store(n))
d->m_stores.push_back(n);
ctx.attach_th_var(n, this, r);
if (m_params.m_array_laziness <= 1 && is_store(n))
if (laziness() <= 1 && is_store(n))
instantiate_axiom1(n);
return r;
}
Expand Down Expand Up @@ -238,6 +240,7 @@ namespace smt {
// Internalize the term. If it has already been internalized, return false.
//
bool theory_array::internalize_term_core(app * n) {

TRACE("array_bug", tout << mk_bounded_pp(n, m) << "\n";);
for (expr* arg : *n)
ctx.internalize(arg, false);
Expand Down Expand Up @@ -275,7 +278,7 @@ namespace smt {
mk_var(arg0);


if (m_params.m_array_laziness == 0) {
if (laziness() == 0) {
theory_var v_arg = arg0->get_th_var(get_id());

SASSERT(v_arg != null_theory_var);
Expand Down Expand Up @@ -320,7 +323,7 @@ namespace smt {
}

void theory_array::relevant_eh(app * n) {
if (m_params.m_array_laziness == 0)
if (laziness() == 0)
return;
if (m.is_ite(n)) {
TRACE("array", tout << "relevant ite " << mk_pp(n, m) << "\n";);
Expand All @@ -338,7 +341,7 @@ namespace smt {
}
else {
SASSERT(is_store(n));
if (m_params.m_array_laziness > 1)
if (laziness() > 1)
instantiate_axiom1(e);
add_parent_store(v_arg, e);
}
Expand Down
3 changes: 2 additions & 1 deletion src/smt/theory_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace smt {
};

class theory_array : public theory_array_base {
unsigned laziness() const { return ctx.relevancy()?m_params.m_array_laziness:0; }
protected:
typedef union_find<theory_array> th_union_find;

Expand Down Expand Up @@ -64,7 +65,7 @@ namespace smt {
void pop_scope_eh(unsigned num_scopes) override;
final_check_status final_check_eh() override;
void reset_eh() override;
void init_search_eh() override { m_final_check_idx = 0; }
void init_search_eh() override;

void set_prop_upward(theory_var v) override;
virtual void set_prop_upward(enode* n);
Expand Down

0 comments on commit fb5bbb8

Please sign in to comment.