Skip to content

Commit

Permalink
fix #3955
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Apr 14, 2020
1 parent f564c32 commit b8c069c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/smt/theory_datatype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ namespace smt {
}

theory_datatype::final_check_st::~final_check_st() {
unmark_enodes(th->m_to_unmark.size(), th->m_to_unmark.c_ptr());
unmark_enodes2(th->m_to_unmark2.size(), th->m_to_unmark2.c_ptr());
th->m_to_unmark.reset();
th->m_to_unmark2.reset();
th->m_used_eqs.reset();
th->m_stack.reset();
th->m_parent.reset();
}
th->clear_mark();
}

void theory_datatype::clear_mark() {
unmark_enodes(m_to_unmark.size(), m_to_unmark.c_ptr());
unmark_enodes2(m_to_unmark2.size(), m_to_unmark2.c_ptr());
m_to_unmark.reset();
m_to_unmark2.reset();
m_used_eqs.reset();
m_stack.reset();
m_parent.reset();
}

void theory_datatype::oc_mark_on_stack(enode * n) {
n = n->get_root();
Expand Down Expand Up @@ -210,6 +214,7 @@ namespace smt {
SASSERT(ctx.get_assignment(l) == l_true);
enode_pair p(c, r->get_arg(0));
region & reg = ctx.get_region();
clear_mark();
ctx.set_conflict(ctx.mk_justification(ext_theory_conflict_justification(get_id(), reg, 1, &l, 1, &p)));
}

Expand Down Expand Up @@ -476,7 +481,7 @@ namespace smt {
final_check_status theory_datatype::final_check_eh() {
int num_vars = get_num_vars();
final_check_status r = FC_DONE;
final_check_st _guard(this); // RAII for managing state
final_check_st _guard(this);
for (int v = 0; v < num_vars; v++) {
if (v == static_cast<int>(m_find.find(v))) {
enode * node = get_enode(v);
Expand All @@ -489,6 +494,7 @@ namespace smt {
// using lazy case splits...
var_data * d = m_var_data[v];
if (d->m_constructor == nullptr) {
clear_mark();
mk_split(v);
r = FC_CONTINUE;
}
Expand Down Expand Up @@ -668,6 +674,7 @@ namespace smt {
// m_used_eqs should contain conflict
context & ctx = get_context();
region & r = ctx.get_region();
clear_mark();
ctx.set_conflict(ctx.mk_justification(ext_theory_conflict_justification(get_id(), r, 0, nullptr, m_used_eqs.size(), m_used_eqs.c_ptr())));
}
return res;
Expand Down
2 changes: 2 additions & 0 deletions src/smt/theory_datatype.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ namespace smt {
parent_tbl m_parent; // parent explanation for occurs_check
svector<stack_entry> m_stack; // stack for DFS for occurs_check

void clear_mark();

void oc_mark_on_stack(enode * n);
bool oc_on_stack(enode * n) const { return n->get_root()->is_marked(); }

Expand Down

0 comments on commit b8c069c

Please sign in to comment.