diff --git a/src/ast/rewriter/poly_rewriter.h b/src/ast/rewriter/poly_rewriter.h index 5269f25a8..8cbc7f864 100644 --- a/src/ast/rewriter/poly_rewriter.h +++ b/src/ast/rewriter/poly_rewriter.h @@ -112,6 +112,7 @@ public: bool is_mul(func_decl * f) const { return is_decl_of(f, get_fid(), mul_decl_kind()); } bool is_times_minus_one(expr * n, expr*& r) const; bool is_var_plus_ground(expr * n, bool & inv, var * & v, expr_ref & t); + bool is_zero(expr* e) const; br_status mk_mul_core(unsigned num_args, expr * const * args, expr_ref & result) { diff --git a/src/ast/rewriter/poly_rewriter_def.h b/src/ast/rewriter/poly_rewriter_def.h index 6b747756c..731a0538a 100644 --- a/src/ast/rewriter/poly_rewriter_def.h +++ b/src/ast/rewriter/poly_rewriter_def.h @@ -64,6 +64,13 @@ expr * poly_rewriter::get_power_body(expr * t, rational & k) { return t; } +template +bool poly_rewriter::is_zero(expr* e) const { + rational v; + return is_numeral(e, v) && v.is_zero(); +} + + template expr * poly_rewriter::mk_mul_app(unsigned num_args, expr * const * args) { switch (num_args) { diff --git a/src/smt/proto_model/proto_model.cpp b/src/smt/proto_model/proto_model.cpp index 9b218037e..725c9fc51 100644 --- a/src/smt/proto_model/proto_model.cpp +++ b/src/smt/proto_model/proto_model.cpp @@ -161,8 +161,10 @@ void proto_model::cleanup_func_interp(func_interp * fi, func_decl_set & found_au continue; } func_decl * f = t->get_decl(); - if (m_aux_decls.contains(f)) + if (m_aux_decls.contains(f)) { + TRACE("model_bug", tout << f->get_name() << "\n";); found_aux_fs.insert(f); + } expr_ref new_t(m_manager); new_t = m_rewrite.mk_app(f, args.size(), args.c_ptr()); if (t != new_t.get()) @@ -180,9 +182,7 @@ void proto_model::cleanup_func_interp(func_interp * fi, func_decl_set & found_au } } - if (!cache.find(fi_else, a)) { - UNREACHABLE(); - } + VERIFY(cache.find(fi_else, a)); fi->set_else(a); } diff --git a/src/smt/smt_model_generator.cpp b/src/smt/smt_model_generator.cpp index 49e9083f2..953afd4b7 100644 --- a/src/smt/smt_model_generator.cpp +++ b/src/smt/smt_model_generator.cpp @@ -17,14 +17,14 @@ Revision History: --*/ -#include "smt/smt_context.h" -#include "smt/smt_model_generator.h" -#include "smt/proto_model/proto_model.h" #include "util/ref_util.h" #include "ast/for_each_expr.h" #include "ast/ast_ll_pp.h" #include "ast/ast_pp.h" #include "ast/ast_smt2_pp.h" +#include "smt/smt_context.h" +#include "smt/smt_model_generator.h" +#include "smt/proto_model/proto_model.h" namespace smt {