diff --git a/src/ast/rewriter/rewriter_def.h b/src/ast/rewriter/rewriter_def.h index f228a216b..3f97cfefe 100644 --- a/src/ast/rewriter/rewriter_def.h +++ b/src/ast/rewriter/rewriter_def.h @@ -294,6 +294,8 @@ void rewriter_tpl::process_app(app * t, frame & fr) { tout << "st: " << st; if (m_r) tout << " --->\n" << mk_bounded_pp(m_r, m()); tout << "\n";); + if (st != BR_FAILED && m().get_sort(m_r) != m().get_sort(t)) + std::cout << mk_bounded_pp(t, m()) << "\n" << mk_bounded_pp(m_r, m()) << "\n"; SASSERT(st != BR_DONE || m().get_sort(m_r) == m().get_sort(t)); if (st != BR_FAILED) { result_stack().shrink(fr.m_spos); diff --git a/src/smt/smt_context.cpp b/src/smt/smt_context.cpp index b3273e699..fe9a2023c 100644 --- a/src/smt/smt_context.cpp +++ b/src/smt/smt_context.cpp @@ -515,6 +515,7 @@ namespace smt { TRACE("add_eq", tout << "assigning: #" << n1->get_owner_id() << " = #" << n2->get_owner_id() << "\n";); TRACE("add_eq_detail", tout << "assigning\n" << enode_pp(n1, *this) << "\n" << enode_pp(n2, *this) << "\n"; tout << "kind: " << js.get_kind() << "\n";); + SASSERT(m.get_sort(n1->get_owner()) == m.get_sort(n2->get_owner())); m_stats.m_num_add_eq++; enode * r1 = n1->get_root(); @@ -4469,8 +4470,7 @@ namespace smt { if (fcs == FC_DONE) { reset_model(); } - - return fcs == FC_DONE; + return false; } void context::mk_proto_model() { diff --git a/src/smt/smt_context.h b/src/smt/smt_context.h index c26a2a842..af1c4c21d 100644 --- a/src/smt/smt_context.h +++ b/src/smt/smt_context.h @@ -1029,6 +1029,7 @@ namespace smt { void push_eq(enode * lhs, enode * rhs, eq_justification const & js) { if (lhs->get_root() != rhs->get_root()) { + SASSERT(m.get_sort(lhs->get_owner()) == m.get_sort(rhs->get_owner())); m_eq_propagation_queue.push_back(new_eq(lhs, rhs, js)); } } diff --git a/src/smt/smt_model_generator.cpp b/src/smt/smt_model_generator.cpp index d49cd25b3..f22dcfca4 100644 --- a/src/smt/smt_model_generator.cpp +++ b/src/smt/smt_model_generator.cpp @@ -424,6 +424,7 @@ namespace smt { SASSERT(m_model->has_interpretation(f)); SASSERT(m_model->get_func_interp(f) == fi); // The entry must be new because n->get_cg() == n + SASSERT(f->get_range() == m.get_sort(result)); TRACE("model", tout << "insert new entry for:\n" << mk_ismt2_pp(n->get_owner(), m) << "\nargs: "; for (unsigned i = 0; i < num_args; i++) { diff --git a/src/smt/theory_lra.cpp b/src/smt/theory_lra.cpp index c38f8ebc7..a7979864d 100644 --- a/src/smt/theory_lra.cpp +++ b/src/smt/theory_lra.cpp @@ -3120,7 +3120,7 @@ public: void fixed_var_eh(theory_var v1, rational const& bound) { theory_var v2; value_sort_pair key(bound, is_int(v1)); - if (m_fixed_var_table.find(key, v2)) { + if (m_fixed_var_table.find(key, v2) && is_int(v1) == is_int(v2)) { if (static_cast(v2) < th.get_num_vars() && !is_equal(v1, v2)) { auto vi1 = register_theory_var_in_lar_solver(v1); auto vi2 = register_theory_var_in_lar_solver(v2); @@ -3377,7 +3377,7 @@ public: } else { rational r = get_value(v); - TRACE("arith", tout << "v" << v << " := " << r << "\n";); + TRACE("arith", tout << mk_pp(o, m) << " v" << v << " := " << r << "\n";); SASSERT("integer variables should have integer values: " && (!a.is_int(o) || r.is_int() || m.canceled())); if (a.is_int(o) && !r.is_int()) r = floor(r); return alloc(expr_wrapper_proc, m_factory->mk_value(r, m.get_sort(o)));