mirror of
https://github.com/Z3Prover/z3
synced 2025-06-19 04:13:38 +00:00
parent
a6fcdecfd7
commit
825fbf1832
5 changed files with 31 additions and 8 deletions
|
@ -678,10 +678,15 @@ void rewriter_tpl<Config>::update_binding_at(unsigned i, expr* binding) {
|
||||||
template<typename Config>
|
template<typename Config>
|
||||||
template<bool ProofGen>
|
template<bool ProofGen>
|
||||||
void rewriter_tpl<Config>::main_loop(expr * t, expr_ref & result, proof_ref & result_pr) {
|
void rewriter_tpl<Config>::main_loop(expr * t, expr_ref & result, proof_ref & result_pr) {
|
||||||
if (m_cancel_check && m().canceled()) {
|
if (m().canceled()) {
|
||||||
|
if (m_cancel_check) {
|
||||||
reset();
|
reset();
|
||||||
throw rewriter_exception(m().limit().get_cancel_msg());
|
throw rewriter_exception(m().limit().get_cancel_msg());
|
||||||
}
|
}
|
||||||
|
result = t;
|
||||||
|
result_pr = nullptr;
|
||||||
|
return;
|
||||||
|
}
|
||||||
SASSERT(!ProofGen || result_stack().size() == result_pr_stack().size());
|
SASSERT(!ProofGen || result_stack().size() == result_pr_stack().size());
|
||||||
SASSERT(not_rewriting());
|
SASSERT(not_rewriting());
|
||||||
m_root = t;
|
m_root = t;
|
||||||
|
@ -713,10 +718,12 @@ template<bool ProofGen>
|
||||||
void rewriter_tpl<Config>::resume_core(expr_ref & result, proof_ref & result_pr) {
|
void rewriter_tpl<Config>::resume_core(expr_ref & result, proof_ref & result_pr) {
|
||||||
SASSERT(!frame_stack().empty());
|
SASSERT(!frame_stack().empty());
|
||||||
while (!frame_stack().empty()) {
|
while (!frame_stack().empty()) {
|
||||||
if (m_cancel_check && m().canceled()) {
|
if (m().canceled()) {
|
||||||
|
if (m_cancel_check) {
|
||||||
reset();
|
reset();
|
||||||
throw rewriter_exception(m().limit().get_cancel_msg());
|
throw rewriter_exception(m().limit().get_cancel_msg());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
SASSERT(!ProofGen || result_stack().size() == result_pr_stack().size());
|
SASSERT(!ProofGen || result_stack().size() == result_pr_stack().size());
|
||||||
frame & fr = frame_stack().back();
|
frame & fr = frame_stack().back();
|
||||||
expr * t = fr.m_curr;
|
expr * t = fr.m_curr;
|
||||||
|
|
|
@ -196,9 +196,10 @@ lbool tactic2solver::check_sat_core2(unsigned num_assumptions, expr * const * as
|
||||||
}
|
}
|
||||||
TRACE("tactic",
|
TRACE("tactic",
|
||||||
if (m_mc) m_mc->display(tout << "mc:\n");
|
if (m_mc) m_mc->display(tout << "mc:\n");
|
||||||
if (g->mc()) g->mc()->display(tout << "\ng\n:");
|
if (g->mc()) g->mc()->display(tout << "\ng:\n");
|
||||||
if (md) tout << "\nmodel:\n" << *md.get() << "\n";
|
if (md) tout << "\nmodel:\n" << *md.get() << "\n";
|
||||||
);
|
);
|
||||||
|
//m_mc = concat(m_mc.get(), g->mc());
|
||||||
m_mc = concat(g->mc(), m_mc.get());
|
m_mc = concat(g->mc(), m_mc.get());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -393,6 +393,20 @@ void goal::display_with_dependencies(std::ostream & out) const {
|
||||||
out << "\n :precision " << prec() << " :depth " << depth() << ")" << std::endl;
|
out << "\n :precision " << prec() << " :depth " << depth() << ")" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void goal::display_with_proofs(std::ostream& out) const {
|
||||||
|
out << "(goal";
|
||||||
|
unsigned sz = size();
|
||||||
|
for (unsigned i = 0; i < sz; i++) {
|
||||||
|
out << "\n |-";
|
||||||
|
if (pr(i)) {
|
||||||
|
out << mk_ismt2_pp(pr(i), m(), 4);
|
||||||
|
}
|
||||||
|
out << "\n " << mk_ismt2_pp(form(i), m(), 2);
|
||||||
|
}
|
||||||
|
out << "\n :precision " << prec() << " :depth " << depth() << ")" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
void goal::display(ast_printer_context & ctx) const {
|
void goal::display(ast_printer_context & ctx) const {
|
||||||
display(ctx, ctx.regular_stream());
|
display(ctx, ctx.regular_stream());
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,6 +141,7 @@ public:
|
||||||
void display_with_dependencies(ast_printer & prn, std::ostream & out) const;
|
void display_with_dependencies(ast_printer & prn, std::ostream & out) const;
|
||||||
void display_with_dependencies(ast_printer_context & ctx) const;
|
void display_with_dependencies(ast_printer_context & ctx) const;
|
||||||
void display_with_dependencies(std::ostream & out) const;
|
void display_with_dependencies(std::ostream & out) const;
|
||||||
|
void display_with_proofs(std::ostream& out) const;
|
||||||
|
|
||||||
bool sat_preserved() const;
|
bool sat_preserved() const;
|
||||||
bool unsat_preserved() const;
|
bool unsat_preserved() const;
|
||||||
|
|
|
@ -34,7 +34,7 @@ struct tactic_report::imp {
|
||||||
m_goal(g),
|
m_goal(g),
|
||||||
m_start_memory(static_cast<double>(memory::get_allocation_size())/static_cast<double>(1024*1024)) {
|
m_start_memory(static_cast<double>(memory::get_allocation_size())/static_cast<double>(1024*1024)) {
|
||||||
m_watch.start();
|
m_watch.start();
|
||||||
TRACE("tactic", g.display(tout << id << "\n"););
|
TRACE("tactic", g.display_with_proofs(tout << id << "\n"););
|
||||||
}
|
}
|
||||||
|
|
||||||
~imp() {
|
~imp() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue