Skip to content

Commit

Permalink
proper fix to #6476
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Dec 4, 2022
1 parent 9b58135 commit b76ed6a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/ast/simplifiers/demodulator_simplifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ bool demodulator_simplifier::rewrite1(func_decl* f, expr_ref_vector const& args,
if (!m_index.find_fwd(f, set))
return false;

TRACE("demodulator", tout << "trying to rewrite: " << f->get_name() << " args:\n" << m_new_args << "\n";);
TRACE("demodulator", tout << "trying to rewrite: " << f->get_name() << " args:\n" << args << "\n";);

for (unsigned i : *set) {

Expand All @@ -115,7 +115,7 @@ bool demodulator_simplifier::rewrite1(func_decl* f, expr_ref_vector const& args,

SASSERT(lhs->get_decl() == f);

TRACE("demodulator", tout << "Matching with demodulator: " << mk_pp(d, m) << std::endl; );
TRACE("demodulator", tout << "Matching with demodulator: " << mk_pp(lhs, m) << std::endl; );

if (m_match_subst(lhs, rhs, args.data(), np)) {
TRACE("demodulator_bug", tout << "succeeded...\n" << mk_pp(rhs, m) << "\n===>\n" << np << "\n";);
Expand Down Expand Up @@ -154,7 +154,7 @@ void demodulator_simplifier::reschedule_demodulators(func_decl* f, expr* lhs) {
continue;
if (!m_match_subst.can_rewrite(fml(i), lhs))
continue;
func_decl* f = p.first->get_decl();
SASSERT(f == p.first->get_decl());
m_index.remove_fwd(f, i);
m_index.remove_bwd(fml(i), i);
m_todo.push_back(i);
Expand Down
7 changes: 2 additions & 5 deletions src/ast/substitution/demodulator_rewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,12 +847,9 @@ struct match_args_aux_proc {
SASSERT(r.get_offset() == 1);
throw no_match();
}
else {
m_subst.insert(n, 0, expr_offset(n, 1));
}
}
else
throw no_match();
else
m_subst.insert(n, 0, expr_offset(n, 1));
}
void operator()(quantifier * n) { throw no_match(); }
void operator()(app * n) {}
Expand Down
3 changes: 0 additions & 3 deletions src/ast/substitution/demodulator_rewriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ class demodulator_match_subst {
typedef std::pair<expr *, expr *> expr_pair;
typedef obj_pair_hashtable<expr, expr> cache;

void reset();

ast_manager & m;
substitution m_subst;
cache m_cache;
Expand Down Expand Up @@ -229,7 +227,6 @@ class demodulator_rewriter final {
void remove_bwd_idx(expr* q);
bool check_fwd_idx_consistency();
void show_fwd_idx(std::ostream & out);
bool can_rewrite(expr * n, expr * lhs);

expr * rewrite(expr * n);
bool rewrite1(func_decl * f, expr_ref_vector const & args, expr_ref & np);
Expand Down

0 comments on commit b76ed6a

Please sign in to comment.