mirror of
https://github.com/Z3Prover/z3
synced 2025-09-06 09:51:09 +00:00
merge with master
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
commit
03ed33ac02
30 changed files with 129 additions and 76 deletions
|
@ -39,7 +39,6 @@ class smt_tactic : public tactic {
|
|||
smt_params m_params;
|
||||
params_ref m_params_ref;
|
||||
statistics m_stats;
|
||||
std::string m_failure;
|
||||
smt::kernel * m_ctx;
|
||||
symbol m_logic;
|
||||
progress_callback * m_callback;
|
||||
|
@ -259,7 +258,7 @@ public:
|
|||
if (m_fail_if_inconclusive && !m_candidate_models) {
|
||||
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());
|
||||
throw tactic_exception(strm.str());
|
||||
}
|
||||
result.push_back(in.get());
|
||||
if (m_candidate_models) {
|
||||
|
@ -281,8 +280,7 @@ public:
|
|||
break;
|
||||
}
|
||||
}
|
||||
m_failure = m_ctx->last_failure_as_string();
|
||||
throw tactic_exception(m_failure.c_str());
|
||||
throw tactic_exception(m_ctx->last_failure_as_string());
|
||||
}
|
||||
}
|
||||
catch (rewriter_exception & ex) {
|
||||
|
|
|
@ -752,9 +752,10 @@ namespace smt {
|
|||
class theory_pb::card_justification : public justification {
|
||||
card& m_card;
|
||||
family_id m_fid;
|
||||
literal m_lit;
|
||||
public:
|
||||
card_justification(card& c, family_id fid)
|
||||
: justification(true), m_card(c), m_fid(fid) {}
|
||||
card_justification(card& c, literal lit, family_id fid)
|
||||
: justification(true), m_card(c), m_fid(fid), m_lit(lit) {}
|
||||
|
||||
card& get_card() { return m_card; }
|
||||
|
||||
|
@ -769,7 +770,28 @@ namespace smt {
|
|||
return m_fid;
|
||||
}
|
||||
|
||||
virtual proof* mk_proof(smt::conflict_resolution& cr) { return 0; }
|
||||
virtual proof* mk_proof(smt::conflict_resolution& cr) {
|
||||
ptr_buffer<proof> prs;
|
||||
ast_manager& m = cr.get_context().get_manager();
|
||||
expr_ref fact(m);
|
||||
cr.get_context().literal2expr(m_lit, fact);
|
||||
bool all_valid = true;
|
||||
proof* pr = nullptr;
|
||||
pr = cr.get_proof(m_card.lit());
|
||||
all_valid &= pr != nullptr;
|
||||
prs.push_back(pr);
|
||||
for (unsigned i = m_card.k(); i < m_card.size(); ++i) {
|
||||
pr = cr.get_proof(~m_card.lit(i));
|
||||
all_valid &= pr != nullptr;
|
||||
prs.push_back(pr);
|
||||
}
|
||||
if (!all_valid) {
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
return m.mk_th_lemma(m_fid, fact, prs.size(), prs.c_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
@ -959,7 +981,7 @@ namespace smt {
|
|||
m_stats.m_num_propagations++;
|
||||
TRACE("pb", tout << "#prop: " << c.num_propagations() << " - " << c.lit() << " => " << l << "\n";);
|
||||
SASSERT(validate_unit_propagation(c));
|
||||
ctx.assign(l, ctx.mk_justification(card_justification(c, get_id())));
|
||||
ctx.assign(l, ctx.mk_justification(card_justification(c, l, get_id())));
|
||||
}
|
||||
|
||||
void theory_pb::clear_watch(card& c) {
|
||||
|
|
|
@ -5036,7 +5036,7 @@ expr* theory_seq::coalesce_chars(expr* const& e) {
|
|||
if (bvu.is_bv(s)) {
|
||||
expr_ref result(m);
|
||||
expr * args[1] = {s};
|
||||
if (m_seq_rewrite.mk_app_core(to_app(e)->get_decl(), 1, args, result)) {
|
||||
if (BR_FAILED != m_seq_rewrite.mk_app_core(to_app(e)->get_decl(), 1, args, result)) {
|
||||
if (!ctx.e_internalized(result))
|
||||
ctx.internalize(result, false);
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue