3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-27 05:26:01 +00:00

add n-ary disjunction and conjunction

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-07-01 08:15:50 -07:00
parent e518d4a5fe
commit 4c786c5f70
7 changed files with 35 additions and 6 deletions

View file

@ -2996,6 +2996,8 @@ namespace smt {
// in a consistent context.
if (inconsistent())
return;
if (get_cancel_flag())
return;
push_scope();
for (unsigned i = 0; i < num_assumptions; i++) {
expr * curr_assumption = assumptions[i];
@ -3337,6 +3339,7 @@ namespace smt {
break;
}
if (cmr == quantifier_manager::UNKNOWN) {
IF_VERBOSE(1, verbose_stream() << "(smt.giveup quantifiers)\n";);
// giving up
m_last_search_failure = QUANTIFIERS;
status = l_undef;
@ -3487,6 +3490,7 @@ namespace smt {
}
if (resource_limits_exceeded() && !inconsistent()) {
m_last_search_failure = RESOURCE_LIMIT;
return l_undef;
}
}
@ -4109,7 +4113,7 @@ namespace smt {
m_fingerprints.display(tout);
);
failure fl = get_last_search_failure();
if (fl == MEMOUT || fl == CANCELED || fl == TIMEOUT || fl == NUM_CONFLICTS) {
if (fl == MEMOUT || fl == CANCELED || fl == TIMEOUT || fl == NUM_CONFLICTS || fl == RESOURCE_LIMIT) {
return;
}

View file

@ -39,6 +39,8 @@ namespace smt {
return out << "CANCELED";
case NUM_CONFLICTS:
return out << "NUM_CONFLICTS";
case RESOURCE_LIMIT:
return out << "RESOURCE_LIMIT";
case THEORY:
if (!m_incomplete_theories.empty()) {
ptr_vector<theory>::const_iterator it = m_incomplete_theories.begin();
@ -78,6 +80,7 @@ namespace smt {
r += "))";
break;
}
case RESOURCE_LIMIT: r = "(resource limits reached)"; break;
case QUANTIFIERS: r = "(incomplete quantifiers)"; break;
case UNKNOWN: r = m_unknown; break;
}

View file

@ -32,6 +32,7 @@ namespace smt {
CANCELED, //!< External cancel flag was set
NUM_CONFLICTS, //!< Maximum number of conflicts was reached
THEORY, //!< Theory is incomplete
RESOURCE_LIMIT,
QUANTIFIERS //!< Logical context contains universal quantifiers.
};

View file

@ -112,7 +112,6 @@ namespace smt {
if (!m_curr_model->eval(q->get_expr(), tmp, true)) {
return;
}
//std::cout << tmp << "\n";
TRACE("model_checker", tout << "q after applying interpretation:\n" << mk_ismt2_pp(tmp, m) << "\n";);
ptr_buffer<expr> subst_args;
unsigned num_decls = q->get_num_decls();
@ -373,7 +372,8 @@ namespace smt {
return true;
if (m_iteration_idx >= m_params.m_mbqi_max_iterations) {
IF_VERBOSE(10, verbose_stream() << "(smt.mbqi \"max instantiations reached \")" << m_iteration_idx << "\n";);
IF_VERBOSE(1, verbose_stream() << "(smt.mbqi \"max instantiations " << m_iteration_idx << " reached\")\n";);
m_context->set_reason_unknown("max mbqi instantiations reached");
return false;
}

View file

@ -293,8 +293,11 @@ public:
if (m_ctx->canceled()) {
throw tactic_exception(Z3_CANCELED_MSG);
}
if (m_fail_if_inconclusive)
throw tactic_exception("smt tactic failed to show goal to be sat/unsat");
if (m_fail_if_inconclusive) {
std::stringstream strm;
strm << "smt tactic failed to show goal to be sat/unsat " << m_ctx->last_failure_as_string();
throw tactic_exception(strm.str().c_str());
}
result.push_back(in.get());
if (m_candidate_models) {
switch (m_ctx->last_failure()) {