Skip to content

Commit

Permalink
always reduce macro expansions in model evaluation #4588
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <[email protected]>
  • Loading branch information
NikolajBjorner committed Aug 14, 2020
1 parent 094e41d commit 9729db1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ast/rewriter/rewriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ struct default_rewriter_cfg {
}
bool reduce_var(var * t, expr_ref & result, proof_ref & result_pr) { return false; }
bool get_macro(func_decl * d, expr * & def, quantifier * & q, proof * & def_pr) { return false; }
bool reduce_macro() { return false; }
bool get_subst(expr * s, expr * & t, proof * & t_pr) { return false; }
void reset() {}
void cleanup() {}
Expand Down
2 changes: 1 addition & 1 deletion src/ast/rewriter/rewriter_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ void rewriter_tpl<Config>::process_app(app * t, frame & fr) {
SASSERT(!f->is_associative() || !flat_assoc(f));
SASSERT(new_num_args == t->get_num_args());
SASSERT(m().get_sort(def) == m().get_sort(t));
if (is_ground(def)) {
if (is_ground(def) && !m_cfg.reduce_macro()) {
m_r = def;
if (ProofGen) {
m_pr = m().mk_transitivity(m_pr, def_pr);
Expand Down
2 changes: 2 additions & 0 deletions src/model/model_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ struct evaluator_cfg : public default_rewriter_cfg {
}
}

bool reduce_macro() { return true; }

bool get_macro(func_decl * f, expr * & def, quantifier * & , proof * &) {
func_interp * fi = m_model.get_func_interp(f);
def = nullptr;
Expand Down

0 comments on commit 9729db1

Please sign in to comment.