3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-21 05:13:39 +00:00
This commit is contained in:
Nikolaj Bjorner 2016-09-07 11:59:06 -07:00
commit 94b67412ec
2 changed files with 65 additions and 56 deletions

View file

@ -122,6 +122,13 @@ namespace z3 {
unsat, sat, unknown unsat, sat, unknown
}; };
inline check_result to_check_result(Z3_lbool l) {
if (l == Z3_L_TRUE) return sat;
else if (l == Z3_L_FALSE) return unsat;
return unknown;
}
/** /**
\brief A Context manages all other Z3 objects, global configuration options, etc. \brief A Context manages all other Z3 objects, global configuration options, etc.
*/ */
@ -1616,6 +1623,13 @@ namespace z3 {
return func_interp(ctx(), r); return func_interp(ctx(), r);
} }
// returns true iff the model contains an interpretation
// for function f.
bool has_interp(func_decl f) const {
check_context(*this, f);
return 0 != Z3_model_has_interp(ctx(), m_model, f);
}
friend std::ostream & operator<<(std::ostream & out, model const & m); friend std::ostream & operator<<(std::ostream & out, model const & m);
}; };
inline std::ostream & operator<<(std::ostream & out, model const & m) { out << Z3_model_to_string(m.ctx(), m); return out; } inline std::ostream & operator<<(std::ostream & out, model const & m) { out << Z3_model_to_string(m.ctx(), m); return out; }
@ -1657,11 +1671,6 @@ namespace z3 {
return out; return out;
} }
inline check_result to_check_result(Z3_lbool l) {
if (l == Z3_L_TRUE) return sat;
else if (l == Z3_L_FALSE) return unsat;
return unknown;
}
class solver : public object { class solver : public object {
Z3_solver m_solver; Z3_solver m_solver;

View file

@ -216,7 +216,7 @@ namespace smt {
void theory_arith<Ext>::propagate_cheap_eq(unsigned rid) { void theory_arith<Ext>::propagate_cheap_eq(unsigned rid) {
if (!propagate_eqs()) if (!propagate_eqs())
return; return;
TRACE("arith_eq", tout << "checking if row " << rid << " can propagate equality.\n"; TRACE("arith_eq_verbose", tout << "checking if row " << rid << " can propagate equality.\n";
display_row_info(tout, rid);); display_row_info(tout, rid););
row const & r = m_rows[rid]; row const & r = m_rows[rid];
theory_var x; theory_var x;