Skip to content

Commit

Permalink
Fixed problem with registering bitvector functions (#5923)
Browse files Browse the repository at this point in the history
  • Loading branch information
CEisenhofer authored Mar 27, 2022
1 parent 3828130 commit 7bb969a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/smt/smt_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ namespace smt {
ast_translation tr(src_ctx.m, m, false);
for (unsigned i = 0; i < src_ctx.m_user_propagator->get_num_vars(); ++i) {
app* e = src_ctx.m_user_propagator->get_expr(i);
m_user_propagator->add_expr(tr(e));
m_user_propagator->add_expr(tr(e), true);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/smt/smt_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ namespace smt {
void user_propagate_register_expr(expr* e) {
if (!m_user_propagator)
throw default_exception("user propagator must be initialized");
m_user_propagator->add_expr(e);
m_user_propagator->add_expr(e, true);
}

void user_propagate_register_created(user_propagator::created_eh_t& r) {
Expand Down
8 changes: 4 additions & 4 deletions src/smt/theory_user_propagator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void theory_user_propagator::force_push() {
}
}

void theory_user_propagator::add_expr(expr* term) {
void theory_user_propagator::add_expr(expr* term, bool ensure_enode) {
force_push();
expr_ref r(m);
expr* e = term;
Expand All @@ -52,7 +52,7 @@ void theory_user_propagator::add_expr(expr* term) {
e = r;
ctx.mark_as_relevant(eq.get());
}
enode* n = ensure_enode(e);
enode* n = ensure_enode ? this->ensure_enode(e) : ctx.get_enode(e);
if (is_attached_to_var(n))
return;

Expand Down Expand Up @@ -90,7 +90,7 @@ void theory_user_propagator::propagate_cb(
}

void theory_user_propagator::register_cb(expr* e) {
add_expr(e);
add_expr(e, true);
}

theory * theory_user_propagator::mk_fresh(context * new_ctx) {
Expand Down Expand Up @@ -243,7 +243,7 @@ bool theory_user_propagator::internalize_term(app* term) {
if (term->get_family_id() == get_id() && !ctx.e_internalized(term))
ctx.mk_enode(term, true, false, true);

add_expr(term);
add_expr(term, false);

if (!m_created_eh)
throw default_exception("You have to register a created event handler for new terms if you track them");
Expand Down
2 changes: 1 addition & 1 deletion src/smt/theory_user_propagator.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace smt {
m_fresh_eh = fresh_eh;
}

void add_expr(expr* e);
void add_expr(expr* e, bool ensure_enode);

void register_final(user_propagator::final_eh_t& final_eh) { m_final_eh = final_eh; }
void register_fixed(user_propagator::fixed_eh_t& fixed_eh) { m_fixed_eh = fixed_eh; }
Expand Down

0 comments on commit 7bb969a

Please sign in to comment.