3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-21 05:13:39 +00:00

remove also cores as arguments to tactics

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-11-19 12:18:50 -08:00
parent 4bbece6616
commit 2f218b0bdc
90 changed files with 326 additions and 565 deletions

View file

@ -29,9 +29,7 @@ public:
virtual ~ackermannize_bv_tactic() { } virtual ~ackermannize_bv_tactic() { }
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g, goal_ref_buffer & result) {
goal_ref_buffer & result,
expr_dependency_ref & core) {
tactic_report report("ackermannize", *g); tactic_report report("ackermannize", *g);
fail_if_unsat_core_generation("ackermannize", g); fail_if_unsat_core_generation("ackermannize", g);
fail_if_proof_generation("ackermannize", g); fail_if_proof_generation("ackermannize", g);
@ -49,7 +47,6 @@ public:
TRACE("ackermannize", tout << "ackermannize not run due to limit" << std::endl;); TRACE("ackermannize", tout << "ackermannize not run due to limit" << std::endl;);
result.reset(); result.reset();
result.push_back(g.get()); result.push_back(g.get());
core = 0;
return; return;
} }
result.push_back(resg.get()); result.push_back(resg.get());

View file

@ -25,7 +25,7 @@ Revision History:
#include "util/cancel_eh.h" #include "util/cancel_eh.h"
#include "util/scoped_timer.h" #include "util/scoped_timer.h"
Z3_apply_result_ref::Z3_apply_result_ref(api::context& c, ast_manager & m): api::object(c), m_core(m) { Z3_apply_result_ref::Z3_apply_result_ref(api::context& c, ast_manager & m): api::object(c) {
} }
extern "C" { extern "C" {
@ -418,7 +418,7 @@ extern "C" {
scoped_ctrl_c ctrlc(eh, false, use_ctrl_c); scoped_ctrl_c ctrlc(eh, false, use_ctrl_c);
scoped_timer timer(timeout, &eh); scoped_timer timer(timeout, &eh);
try { try {
exec(*to_tactic_ref(t), new_goal, ref->m_subgoals, ref->m_core); exec(*to_tactic_ref(t), new_goal, ref->m_subgoals);
ref->m_pc = new_goal->pc(); ref->m_pc = new_goal->pc();
ref->m_mc = new_goal->mc(); ref->m_mc = new_goal->mc();
return of_apply_result(ref); return of_apply_result(ref);

View file

@ -50,7 +50,6 @@ struct Z3_apply_result_ref : public api::object {
goal_ref_buffer m_subgoals; goal_ref_buffer m_subgoals;
model_converter_ref m_mc; model_converter_ref m_mc;
proof_converter_ref m_pc; proof_converter_ref m_pc;
expr_dependency_ref m_core;
Z3_apply_result_ref(api::context& c, ast_manager & m); Z3_apply_result_ref(api::context& c, ast_manager & m);
virtual ~Z3_apply_result_ref() {} virtual ~Z3_apply_result_ref() {}
}; };

View file

@ -28,15 +28,14 @@ public:
echo_tactic(cmd_context & ctx, char const * msg, bool newline):m_ctx(ctx), m_msg(msg), m_newline(newline) {} echo_tactic(cmd_context & ctx, char const * msg, bool newline):m_ctx(ctx), m_msg(msg), m_newline(newline) {}
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
#pragma omp critical (echo_tactic) #pragma omp critical (echo_tactic)
{ {
m_ctx.regular_stream() << m_msg; m_ctx.regular_stream() << m_msg;
if (m_newline) if (m_newline)
m_ctx.regular_stream() << std::endl; m_ctx.regular_stream() << std::endl;
} }
skip_tactic::operator()(in, result, core); skip_tactic::operator()(in, result);
} }
}; };
@ -60,8 +59,7 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
double val = (*m_p)(*(in.get())).get_value(); double val = (*m_p)(*(in.get())).get_value();
#pragma omp critical (probe_value_tactic) #pragma omp critical (probe_value_tactic)
{ {
@ -71,7 +69,7 @@ public:
if (m_newline) if (m_newline)
m_ctx.diagnostic_stream() << std::endl; m_ctx.diagnostic_stream() << std::endl;
} }
skip_tactic::operator()(in, result, core); skip_tactic::operator()(in, result);
} }
}; };

View file

@ -326,7 +326,6 @@ public:
unsigned rlimit = p.get_uint("rlimit", ctx.params().m_rlimit); unsigned rlimit = p.get_uint("rlimit", ctx.params().m_rlimit);
goal_ref_buffer result_goals; goal_ref_buffer result_goals;
expr_dependency_ref core(m);
std::string reason_unknown; std::string reason_unknown;
bool failed = false; bool failed = false;
@ -337,7 +336,7 @@ public:
scoped_timer timer(timeout, &eh); scoped_timer timer(timeout, &eh);
cmd_context::scoped_watch sw(ctx); cmd_context::scoped_watch sw(ctx);
try { try {
exec(t, g, result_goals, core); exec(t, g, result_goals);
} }
catch (tactic_exception & ex) { catch (tactic_exception & ex) {
ctx.regular_stream() << "(error \"tactic failed: " << ex.msg() << "\")" << std::endl; ctx.regular_stream() << "(error \"tactic failed: " << ex.msg() << "\")" << std::endl;

View file

@ -242,14 +242,12 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
try { try {
m_imp->process(*in); m_imp->process(*in);
m_imp->collect_statistics(m_stats); m_imp->collect_statistics(m_stats);
result.reset(); result.reset();
result.push_back(in.get()); result.push_back(in.get());
core = 0;
} }
catch (z3_exception & ex) { catch (z3_exception & ex) {
// convert all Z3 exceptions into tactic exceptions // convert all Z3 exceptions into tactic exceptions

View file

@ -177,10 +177,8 @@ class horn_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("horn", *g); tactic_report report("horn", *g);
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();
@ -386,9 +384,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
virtual void collect_statistics(statistics & st) const { virtual void collect_statistics(statistics & st) const {

View file

@ -202,9 +202,8 @@ namespace pdr {
void pred_transformer::simplify_formulas(tactic& tac, expr_ref_vector& v) { void pred_transformer::simplify_formulas(tactic& tac, expr_ref_vector& v) {
goal_ref g(alloc(goal, m, false, false, false)); goal_ref g(alloc(goal, m, false, false, false));
for (unsigned j = 0; j < v.size(); ++j) g->assert_expr(v[j].get()); for (unsigned j = 0; j < v.size(); ++j) g->assert_expr(v[j].get());
expr_dependency_ref core(m);
goal_ref_buffer result; goal_ref_buffer result;
tac(g, result, core); tac(g, result);
SASSERT(result.size() == 1); SASSERT(result.size() == 1);
goal* r = result[0]; goal* r = result[0];
v.reset(); v.reset();

View file

@ -520,10 +520,9 @@ namespace pdr {
g->assert_expr(lemmas[i].get()); g->assert_expr(lemmas[i].get());
} }
expr_ref tmp(m); expr_ref tmp(m);
expr_dependency_ref core(m);
goal_ref_buffer result; goal_ref_buffer result;
tactic_ref simplifier = mk_arith_bounds_tactic(m); tactic_ref simplifier = mk_arith_bounds_tactic(m);
(*simplifier)(g, result, core); (*simplifier)(g, result);
lemmas.reset(); lemmas.reset();
SASSERT(result.size() == 1); SASSERT(result.size() == 1);
goal* r = result[0]; goal* r = result[0];

View file

@ -1367,7 +1367,6 @@ void pred_transformer::frames::simplify_formulas ()
// normalize level // normalize level
unsigned level = i < m_size ? i : infty_level (); unsigned level = i < m_size ? i : infty_level ();
expr_dependency_ref core(m);
goal_ref_buffer result; goal_ref_buffer result;
// simplify lemmas of the current level // simplify lemmas of the current level
@ -1393,7 +1392,7 @@ void pred_transformer::frames::simplify_formulas ()
} }
// more than one lemma at current level. simplify. // more than one lemma at current level. simplify.
(*simplifier)(g, result, core); (*simplifier)(g, result);
SASSERT(result.size () == 1); SASSERT(result.size () == 1);
goal *r = result[0]; goal *r = result[0];

View file

@ -46,9 +46,8 @@ void pred_transformer::legacy_frames::simplify_formulas(tactic& tac,
ast_manager &m = m_pt.get_ast_manager(); ast_manager &m = m_pt.get_ast_manager();
goal_ref g(alloc(goal, m, false, false, false)); goal_ref g(alloc(goal, m, false, false, false));
for (unsigned j = 0; j < v.size(); ++j) { g->assert_expr(v[j].get()); } for (unsigned j = 0; j < v.size(); ++j) { g->assert_expr(v[j].get()); }
expr_dependency_ref core(m);
goal_ref_buffer result; goal_ref_buffer result;
tac(g, result, core); tac(g, result);
SASSERT(result.size() == 1); SASSERT(result.size() == 1);
goal* r = result[0]; goal* r = result[0];
v.reset(); v.reset();

View file

@ -929,10 +929,9 @@ void simplify_bounds_old(expr_ref_vector& cube) {
} }
expr_ref tmp(m); expr_ref tmp(m);
expr_dependency_ref core(m);
goal_ref_buffer result; goal_ref_buffer result;
tactic_ref simplifier = mk_arith_bounds_tactic(m); tactic_ref simplifier = mk_arith_bounds_tactic(m);
(*simplifier)(g, result, core); (*simplifier)(g, result);
SASSERT(result.size() == 1); SASSERT(result.size() == 1);
goal* r = result[0]; goal* r = result[0];
@ -953,13 +952,12 @@ void simplify_bounds_new (expr_ref_vector &cube) {
g->assert_expr(cube.get(i)); g->assert_expr(cube.get(i));
} }
expr_dependency_ref dep(m);
goal_ref_buffer goals; goal_ref_buffer goals;
tactic_ref prop_values = mk_propagate_values_tactic(m); tactic_ref prop_values = mk_propagate_values_tactic(m);
tactic_ref prop_bounds = mk_propagate_ineqs_tactic(m); tactic_ref prop_bounds = mk_propagate_ineqs_tactic(m);
tactic_ref t = and_then(prop_values.get(), prop_bounds.get()); tactic_ref t = and_then(prop_values.get(), prop_bounds.get());
(*t)(g, goals, dep); (*t)(g, goals);
SASSERT(goals.size() == 1); SASSERT(goals.size() == 1);
g = goals[0]; g = goals[0];

View file

@ -129,10 +129,8 @@ class nlsat_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("nlsat", *g); tactic_report report("nlsat", *g);
if (g->is_decided()) { if (g->is_decided()) {
@ -233,12 +231,11 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
try { try {
imp local_imp(in->m(), m_params); imp local_imp(in->m(), m_params);
scoped_set_imp setter(*this, local_imp); scoped_set_imp setter(*this, local_imp);
local_imp(in, result, core); local_imp(in, result);
} }
catch (z3_error & ex) { catch (z3_error & ex) {
throw ex; throw ex;

View file

@ -745,9 +745,8 @@ namespace opt {
else { else {
set_simplify(tac0.get()); set_simplify(tac0.get());
} }
expr_dependency_ref core(m);
goal_ref_buffer result; goal_ref_buffer result;
(*m_simplify)(g, result, core); (*m_simplify)(g, result);
SASSERT(result.size() == 1); SASSERT(result.size() == 1);
goal* r = result[0]; goal* r = result[0];
m_model_converter = r->mc(); m_model_converter = r->mc();

View file

@ -660,7 +660,7 @@ namespace qe {
g->assert_expr(fml); g->assert_expr(fml);
expr_dependency_ref core(m); expr_dependency_ref core(m);
goal_ref_buffer result; goal_ref_buffer result;
(*m_nftactic)(g, result, core); (*m_nftactic)(g, result);
SASSERT(result.size() == 1); SASSERT(result.size() == 1);
TRACE("qe", result[0]->display(tout);); TRACE("qe", result[0]->display(tout););
g2s(*result[0], m_params, m_solver, m_a2b, m_t2x); g2s(*result[0], m_params, m_solver, m_a2b, m_t2x);
@ -810,14 +810,12 @@ namespace qe {
void operator()(/* in */ goal_ref const & in, void operator()(/* in */ goal_ref const & in,
/* out */ goal_ref_buffer & result, /* out */ goal_ref_buffer & result) {
/* out */ expr_dependency_ref & core) {
tactic_report report("nlqsat-tactic", *in); tactic_report report("nlqsat-tactic", *in);
ptr_vector<expr> fmls; ptr_vector<expr> fmls;
expr_ref fml(m); expr_ref fml(m);
core = 0;
in->get_formulas(fmls); in->get_formulas(fmls);
fml = mk_and(m, fmls.size(), fmls.c_ptr()); fml = mk_and(m, fmls.size(), fmls.c_ptr());
if (m_mode == elim_t) { if (m_mode == elim_t) {

View file

@ -2532,10 +2532,8 @@ class qe_lite_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("qe-lite", *g); tactic_report report("qe-lite", *g);
proof_ref new_pr(m); proof_ref new_pr(m);
expr_ref new_f(m); expr_ref new_f(m);
@ -2601,9 +2599,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }

View file

@ -233,8 +233,7 @@ namespace qe {
virtual void operator()( virtual void operator()(
goal_ref const& goal, goal_ref const& goal,
goal_ref_buffer& result, goal_ref_buffer& result)
expr_dependency_ref& core)
{ {
try { try {
checkpoint(); checkpoint();

View file

@ -50,10 +50,8 @@ class qe_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("qe", *g); tactic_report report("qe", *g);
m_fparams.m_model = g->models_enabled(); m_fparams.m_model = g->models_enabled();
proof_ref new_pr(m); proof_ref new_pr(m);
@ -119,9 +117,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
m_st.reset(); m_st.reset();
m_imp->collect_statistics(m_st); m_imp->collect_statistics(m_st);

View file

@ -1211,16 +1211,12 @@ namespace qe {
void operator()(/* in */ goal_ref const & in, void operator()(/* in */ goal_ref const & in,
/* out */ goal_ref_buffer & result, /* out */ goal_ref_buffer & result) {
/* out */ expr_dependency_ref & core) {
tactic_report report("qsat-tactic", *in); tactic_report report("qsat-tactic", *in);
ptr_vector<expr> fmls; ptr_vector<expr> fmls;
expr_ref_vector defs(m); expr_ref_vector defs(m);
expr_ref fml(m); expr_ref fml(m);
core = 0;
in->get_formulas(fmls); in->get_formulas(fmls);
fml = mk_and(m, fmls.size(), fmls.c_ptr()); fml = mk_and(m, fmls.size(), fmls.c_ptr());
// for now: // for now:

View file

@ -61,7 +61,6 @@ class inc_sat_solver : public solver {
model_converter_ref m_mc; model_converter_ref m_mc;
model_converter_ref m_mc0; model_converter_ref m_mc0;
model_converter_ref m_sat_mc; model_converter_ref m_sat_mc;
expr_dependency_ref m_dep_core;
svector<double> m_weights; svector<double> m_weights;
std::string m_unknown; std::string m_unknown;
// access formulas after they have been pre-processed and handled by the sat solver. // access formulas after they have been pre-processed and handled by the sat solver.
@ -82,7 +81,6 @@ public:
m_core(m), m_core(m),
m_map(m), m_map(m),
m_num_scopes(0), m_num_scopes(0),
m_dep_core(m),
m_unknown("no reason given"), m_unknown("no reason given"),
m_internalized(false), m_internalized(false),
m_internalized_converted(false), m_internalized_converted(false),
@ -495,7 +493,6 @@ private:
lbool internalize_goal(goal_ref& g, dep2asm_t& dep2asm, bool is_lemma) { lbool internalize_goal(goal_ref& g, dep2asm_t& dep2asm, bool is_lemma) {
m_mc.reset(); m_mc.reset();
m_pc.reset(); m_pc.reset();
m_dep_core.reset();
m_subgoals.reset(); m_subgoals.reset();
init_preprocess(); init_preprocess();
SASSERT(g->models_enabled()); SASSERT(g->models_enabled());
@ -505,7 +502,7 @@ private:
SASSERT(!g->proofs_enabled()); SASSERT(!g->proofs_enabled());
TRACE("sat", g->display(tout);); TRACE("sat", g->display(tout););
try { try {
(*m_preprocess)(g, m_subgoals, m_dep_core); (*m_preprocess)(g, m_subgoals);
} }
catch (tactic_exception & ex) { catch (tactic_exception & ex) {
IF_VERBOSE(0, verbose_stream() << "exception in tactic " << ex.msg() << "\n";); IF_VERBOSE(0, verbose_stream() << "exception in tactic " << ex.msg() << "\n";);

View file

@ -39,9 +39,7 @@ class sat_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
core = 0;
fail_if_proof_generation("sat", g); fail_if_proof_generation("sat", g);
bool produce_models = g->models_enabled(); bool produce_models = g->models_enabled();
bool produce_core = g->unsat_core_enabled(); bool produce_core = g->unsat_core_enabled();
@ -175,12 +173,11 @@ public:
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
imp proc(g->m(), m_params); imp proc(g->m(), m_params);
scoped_set_imp set(this, &proc); scoped_set_imp set(this, &proc);
try { try {
proc(g, result, core); proc(g, result);
proc.m_solver.collect_statistics(m_stats); proc.m_solver.collect_statistics(m_stats);
} }
catch (sat::solver_exception & ex) { catch (sat::solver_exception & ex) {

View file

@ -70,10 +70,8 @@ public:
virtual void reset_statistics() { m_num_steps = 0; } virtual void reset_statistics() { m_num_steps = 0; }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
core = 0;
reduce(*(in.get())); reduce(*(in.get()));
in->inc_depth(); in->inc_depth();
result.push_back(in.get()); result.push_back(in.get());

View file

@ -145,11 +145,9 @@ public:
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
try { try {
IF_VERBOSE(10, verbose_stream() << "(smt.tactic start)\n";); IF_VERBOSE(10, verbose_stream() << "(smt.tactic start)\n";);
core = 0;
SASSERT(in->is_well_sorted()); SASSERT(in->is_well_sorted());
ast_manager & m = in->m(); ast_manager & m = in->m();
TRACE("smt_tactic", tout << this << "\nAUTO_CONFIG: " << fparams().m_auto_config << " HIDIV0: " << fparams().m_hi_div0 << " " TRACE("smt_tactic", tout << this << "\nAUTO_CONFIG: " << fparams().m_auto_config << " HIDIV0: " << fparams().m_hi_div0 << " "

View file

@ -40,8 +40,7 @@ struct unit_subsumption_tactic : public tactic {
void cleanup() {} void cleanup() {}
virtual void operator()(/* in */ goal_ref const & in, virtual void operator()(/* in */ goal_ref const & in,
/* out */ goal_ref_buffer & result, /* out */ goal_ref_buffer & result) {
/* out */ expr_dependency_ref & core) {
reduce_core(in, result); reduce_core(in, result);
} }

View file

@ -102,9 +102,7 @@ public:
} }
virtual void operator()(/* in */ goal_ref const & in, virtual void operator()(/* in */ goal_ref const & in,
/* out */ goal_ref_buffer & result, /* out */ goal_ref_buffer & result) {
/* out */ expr_dependency_ref & core) {
core = 0;
expr_ref_vector clauses(m); expr_ref_vector clauses(m);
expr2expr_map bool2dep; expr2expr_map bool2dep;
ptr_vector<expr> assumptions; ptr_vector<expr> assumptions;
@ -130,7 +128,7 @@ public:
case l_false: { case l_false: {
in->reset(); in->reset();
proof* pr = 0; proof* pr = 0;
expr_dependency* lcore = 0; expr_dependency_ref lcore(m);
if (in->proofs_enabled()) { if (in->proofs_enabled()) {
pr = local_solver->get_proof(); pr = local_solver->get_proof();
in->set(proof2proof_converter(m, pr)); in->set(proof2proof_converter(m, pr));
@ -138,13 +136,13 @@ public:
if (in->unsat_core_enabled()) { if (in->unsat_core_enabled()) {
ptr_vector<expr> core; ptr_vector<expr> core;
local_solver->get_unsat_core(core); local_solver->get_unsat_core(core);
for (unsigned i = 0; i < core.size(); ++i) { for (expr* c : core) {
lcore = m.mk_join(lcore, m.mk_leaf(bool2dep.find(core[i]))); lcore = m.mk_join(lcore, m.mk_leaf(bool2dep.find(c)));
} }
} }
in->assert_expr(m.mk_false(), pr, lcore); in->assert_expr(m.mk_false(), pr, lcore);
result.push_back(in.get()); result.push_back(in.get());
core = lcore; in->set(dependency_converter::unit(lcore));
break; break;
} }
case l_undef: case l_undef:

View file

@ -1,5 +1,6 @@
z3_add_component(tactic z3_add_component(tactic
SOURCES SOURCES
dependency_converter.cpp
equiv_proof_converter.cpp equiv_proof_converter.cpp
generic_model_converter.cpp generic_model_converter.cpp
goal.cpp goal.cpp

View file

@ -90,11 +90,8 @@ public:
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
} }
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g, goal_ref_buffer & result) {
goal_ref_buffer & result,
expr_dependency_ref & core) {
fail_if_proof_generation("aig", g); fail_if_proof_generation("aig", g);
core = 0;
operator()(g); operator()(g);
g->inc_depth(); g->inc_depth();
result.push_back(g.get()); result.push_back(g.get());

View file

@ -111,9 +111,7 @@ class add_bounds_tactic : public tactic {
}; };
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
core = 0;
tactic_report report("add-bounds", *g); tactic_report report("add-bounds", *g);
bound_manager bm(m); bound_manager bm(m);
expr_fast_mark1 visited; expr_fast_mark1 visited;
@ -159,9 +157,8 @@ public:
} }
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(g, result);
(*m_imp)(g, result, core);
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -24,8 +24,7 @@ struct arith_bounds_tactic : public tactic {
virtual void operator()(/* in */ goal_ref const & in, virtual void operator()(/* in */ goal_ref const & in,
/* out */ goal_ref_buffer & result, /* out */ goal_ref_buffer & result) {
/* out */ expr_dependency_ref & core) {
bounds_arith_subsumption(in, result); bounds_arith_subsumption(in, result);
} }

View file

@ -53,11 +53,10 @@ public:
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
TRACE("card2bv-before", g->display(tout);); TRACE("card2bv-before", g->display(tout););
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0; result.reset(); result.reset();
tactic_report report("card2bv", *g); tactic_report report("card2bv", *g);
th_rewriter rw1(m, m_params); th_rewriter rw1(m, m_params);
pb2bv_rewriter rw2(m, m_params); pb2bv_rewriter rw2(m, m_params);

View file

@ -223,10 +223,8 @@ class degree_shift_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
m_produce_proofs = g->proofs_enabled(); m_produce_proofs = g->proofs_enabled();
m_produce_models = g->models_enabled(); m_produce_models = g->models_enabled();
tactic_report report("degree_shift", *g); tactic_report report("degree_shift", *g);
@ -291,9 +289,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -313,11 +313,10 @@ class diff_neq_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
m_produce_models = g->models_enabled(); m_produce_models = g->models_enabled();
core = 0; result.reset(); result.reset();
tactic_report report("diff-neq", *g); tactic_report report("diff-neq", *g);
fail_if_proof_generation("diff-neq", g); fail_if_proof_generation("diff-neq", g);
fail_if_unsat_core_generation("diff-neq", g); fail_if_unsat_core_generation("diff-neq", g);
@ -383,9 +382,8 @@ public:
If s is not really in the difference logic fragment, then this is a NOOP. If s is not really in the difference logic fragment, then this is a NOOP.
*/ */
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -152,10 +152,8 @@ public:
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("elim01", *g); tactic_report report("elim01", *g);

View file

@ -149,12 +149,8 @@ public:
void updt_params(params_ref const & p) { void updt_params(params_ref const & p) {
} }
virtual void operator()( virtual void operator()(goal_ref const & g, goal_ref_buffer & result) {
goal_ref const & g,
goal_ref_buffer & result,
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
m_trail.reset(); m_trail.reset();
m_fd.reset(); m_fd.reset();
m_max.reset(); m_max.reset();

View file

@ -257,10 +257,8 @@ class factor_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("factor", *g); tactic_report report("factor", *g);
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();
@ -311,10 +309,9 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
try { try {
(*m_imp)(in, result, core); (*m_imp)(in, result);
} }
catch (z3_error & ex) { catch (z3_error & ex) {
throw ex; throw ex;

View file

@ -249,10 +249,8 @@ class fix_dl_var_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("fix-dl-var", *g); tactic_report report("fix-dl-var", *g);
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();
m_produce_models = g->models_enabled(); m_produce_models = g->models_enabled();
@ -319,10 +317,9 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
try { try {
(*m_imp)(in, result, core); (*m_imp)(in, result);
} }
catch (rewriter_exception & ex) { catch (rewriter_exception & ex) {
throw tactic_exception(ex.msg()); throw tactic_exception(ex.msg());

View file

@ -1550,10 +1550,8 @@ class fm_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("fm", *g); tactic_report report("fm", *g);
fail_if_proof_generation("fm", g); fail_if_proof_generation("fm", g);
m_produce_models = g->models_enabled(); m_produce_models = g->models_enabled();
@ -1673,9 +1671,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
}; };

View file

@ -159,10 +159,8 @@ public:
} }
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
m_01s->reset(); m_01s->reset();
tactic_report report("cardinality-intro", *g); tactic_report report("cardinality-intro", *g);

View file

@ -188,13 +188,12 @@ class lia2pb_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
fail_if_proof_generation("lia2pb", g); fail_if_proof_generation("lia2pb", g);
m_produce_models = g->models_enabled(); m_produce_models = g->models_enabled();
m_produce_unsat_cores = g->unsat_core_enabled(); m_produce_unsat_cores = g->unsat_core_enabled();
core = 0; result.reset(); result.reset();
tactic_report report("lia2pb", *g); tactic_report report("lia2pb", *g);
m_bm.reset(); m_rw.reset(); m_new_deps.reset(); m_bm.reset(); m_rw.reset(); m_new_deps.reset();
@ -328,10 +327,9 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
try { try {
(*m_imp)(in, result, core); (*m_imp)(in, result);
} }
catch (rewriter_exception & ex) { catch (rewriter_exception & ex) {
throw tactic_exception(ex.msg()); throw tactic_exception(ex.msg());

View file

@ -440,12 +440,11 @@ public:
\return false if transformation is not possible. \return false if transformation is not possible.
*/ */
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
fail_if_proof_generation("nla2bv", g); fail_if_proof_generation("nla2bv", g);
fail_if_unsat_core_generation("nla2bv", g); fail_if_unsat_core_generation("nla2bv", g);
core = 0; result.reset(); result.reset();
imp proc(g->m(), m_params); imp proc(g->m(), m_params);
scoped_set_imp setter(*this, proc); scoped_set_imp setter(*this, proc);

View file

@ -79,10 +79,7 @@ class normalize_bounds_tactic : public tactic {
return false; return false;
} }
void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer & result) {
goal_ref_buffer & result,
expr_dependency_ref & core) {
core = 0;
bool produce_models = in->models_enabled(); bool produce_models = in->models_enabled();
bool produce_proofs = in->proofs_enabled(); bool produce_proofs = in->proofs_enabled();
tactic_report report("normalize-bounds", *in); tactic_report report("normalize-bounds", *in);
@ -166,10 +163,9 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
try { try {
(*m_imp)(in, result, core); (*m_imp)(in, result);
} }
catch (rewriter_exception & ex) { catch (rewriter_exception & ex) {
throw tactic_exception(ex.msg()); throw tactic_exception(ex.msg());

View file

@ -886,14 +886,13 @@ private:
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
TRACE("pb2bv", g->display(tout);); TRACE("pb2bv", g->display(tout););
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
fail_if_proof_generation("pb2bv", g); fail_if_proof_generation("pb2bv", g);
m_produce_models = g->models_enabled(); m_produce_models = g->models_enabled();
m_produce_unsat_cores = g->unsat_core_enabled(); m_produce_unsat_cores = g->unsat_core_enabled();
core = 0; result.reset(); result.reset();
tactic_report report("pb2bv", *g); tactic_report report("pb2bv", *g);
m_bm.reset(); m_rw.reset(); m_new_deps.reset(); m_bm.reset(); m_rw.reset(); m_new_deps.reset();
@ -999,9 +998,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -52,7 +52,7 @@ public:
virtual void updt_params(params_ref const & p); virtual void updt_params(params_ref const & p);
virtual void collect_param_descrs(param_descrs & r) {} virtual void collect_param_descrs(param_descrs & r) {}
virtual void operator()(goal_ref const & g, goal_ref_buffer & result, expr_dependency_ref & core); virtual void operator()(goal_ref const & g, goal_ref_buffer & result);
virtual void cleanup(); virtual void cleanup();
}; };
@ -527,12 +527,11 @@ void propagate_ineqs_tactic::updt_params(params_ref const & p) {
} }
void propagate_ineqs_tactic::operator()(goal_ref const & g, void propagate_ineqs_tactic::operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
fail_if_proof_generation("propagate-ineqs", g); fail_if_proof_generation("propagate-ineqs", g);
fail_if_unsat_core_generation("propagate-ineqs", g); fail_if_unsat_core_generation("propagate-ineqs", g);
core = 0; result.reset(); result.reset();
goal_ref r; goal_ref r;
(*m_imp)(g.get(), r); (*m_imp)(g.get(), r);
result.push_back(r.get()); result.push_back(r.get());

View file

@ -821,11 +821,9 @@ public:
} }
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
try { try {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("purify-arith", *g); tactic_report report("purify-arith", *g);
TRACE("purify_arith", g->display(tout);); TRACE("purify_arith", g->display(tout););
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();

View file

@ -292,13 +292,12 @@ class recover_01_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
fail_if_proof_generation("recover-01", g); fail_if_proof_generation("recover-01", g);
fail_if_unsat_core_generation("recover-01", g); fail_if_unsat_core_generation("recover-01", g);
m_produce_models = g->models_enabled(); m_produce_models = g->models_enabled();
core = 0; result.reset(); result.reset();
tactic_report report("recover-01", *g); tactic_report report("recover-01", *g);
bool saved = false; bool saved = false;
@ -401,10 +400,9 @@ public:
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
try { try {
(*m_imp)(g, result, core); (*m_imp)(g, result);
} }
catch (rewriter_exception & ex) { catch (rewriter_exception & ex) {
throw tactic_exception(ex.msg()); throw tactic_exception(ex.msg());

View file

@ -51,9 +51,7 @@ class bit_blaster_tactic : public tactic {
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
core = 0;
bool proofs_enabled = g->proofs_enabled(); bool proofs_enabled = g->proofs_enabled();
if (proofs_enabled && m_blast_quant) if (proofs_enabled && m_blast_quant)
@ -131,10 +129,9 @@ public:
} }
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
try { try {
(*m_imp)(g, result, core); (*m_imp)(g, result);
} }
catch (rewriter_exception & ex) { catch (rewriter_exception & ex) {
throw tactic_exception(ex.msg()); throw tactic_exception(ex.msg());

View file

@ -379,9 +379,7 @@ class bv1_blaster_tactic : public tactic {
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
core = 0;
if (!is_target(*g)) if (!is_target(*g))
throw tactic_exception("bv1 blaster cannot be applied to goal"); throw tactic_exception("bv1 blaster cannot be applied to goal");
@ -453,9 +451,8 @@ public:
Return a model_converter that converts any model for the updated set into a model for the old set. Return a model_converter that converts any model for the updated set into a model for the old set.
*/ */
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(g, result);
(*m_imp)(g, result, core);
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -136,9 +136,7 @@ class bv_bound_chk_tactic : public tactic {
public: public:
bv_bound_chk_tactic(ast_manager & m, params_ref const & p); bv_bound_chk_tactic(ast_manager & m, params_ref const & p);
virtual ~bv_bound_chk_tactic(); virtual ~bv_bound_chk_tactic();
void operator()(goal_ref const & g, void operator()(goal_ref const & g, goal_ref_buffer & result) override;
goal_ref_buffer & result,
expr_dependency_ref & core);
virtual tactic * translate(ast_manager & m); virtual tactic * translate(ast_manager & m);
virtual void updt_params(params_ref const & p); virtual void updt_params(params_ref const & p);
void cleanup(); void cleanup();
@ -195,14 +193,12 @@ bv_bound_chk_tactic::~bv_bound_chk_tactic() {
dealloc(m_imp); dealloc(m_imp);
} }
void bv_bound_chk_tactic::operator()(goal_ref const & g, void bv_bound_chk_tactic::operator()(goal_ref const & g, goal_ref_buffer & result) {
goal_ref_buffer & result,
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
fail_if_proof_generation("bv-bound-chk", g); fail_if_proof_generation("bv-bound-chk", g);
fail_if_unsat_core_generation("bv-bound-chk", g); fail_if_unsat_core_generation("bv-bound-chk", g);
TRACE("bv-bound-chk", g->display(tout << "before:"); tout << std::endl;); TRACE("bv-bound-chk", g->display(tout << "before:"); tout << std::endl;);
core = 0; result.reset(); result.reset();
m_imp->operator()(g); m_imp->operator()(g);
g->inc_depth(); g->inc_depth();
result.push_back(g.get()); result.push_back(g.get());

View file

@ -39,7 +39,7 @@ public:
virtual ~bv_size_reduction_tactic(); virtual ~bv_size_reduction_tactic();
virtual void operator()(goal_ref const & g, goal_ref_buffer & result, expr_dependency_ref & core); virtual void operator()(goal_ref const & g, goal_ref_buffer & result);
virtual void cleanup(); virtual void cleanup();
}; };
@ -382,12 +382,11 @@ bv_size_reduction_tactic::~bv_size_reduction_tactic() {
} }
void bv_size_reduction_tactic::operator()(goal_ref const & g, void bv_size_reduction_tactic::operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
fail_if_proof_generation("bv-size-reduction", g); fail_if_proof_generation("bv-size-reduction", g);
fail_if_unsat_core_generation("bv-size-reduction", g); fail_if_unsat_core_generation("bv-size-reduction", g);
core = 0; result.reset(); result.reset();
model_converter_ref mc; model_converter_ref mc;
m_imp->operator()(*(g.get()), mc); m_imp->operator()(*(g.get()), mc);
g->inc_depth(); g->inc_depth();

View file

@ -53,12 +53,11 @@ class bvarray2uf_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result)
expr_dependency_ref & core)
{ {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
tactic_report report("bvarray2uf", *g); tactic_report report("bvarray2uf", *g);
core = 0; result.reset(); result.reset();
fail_if_unsat_core_generation("bvarray2uf", g); fail_if_unsat_core_generation("bvarray2uf", g);
TRACE("bvarray2uf", tout << "Before: " << std::endl; g->display(tout); ); TRACE("bvarray2uf", tout << "Before: " << std::endl; g->display(tout); );
@ -129,9 +128,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -116,10 +116,7 @@ public:
virtual void collect_param_descrs(param_descrs & r) { virtual void collect_param_descrs(param_descrs & r) {
} }
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g, goal_ref_buffer & result) {
goal_ref_buffer & result,
expr_dependency_ref & core) {
core = 0;
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();
tactic_report report("dt2bv", *g); tactic_report report("dt2bv", *g);
unsigned size = g->size(); unsigned size = g->size();

View file

@ -224,11 +224,8 @@ class elim_small_bv_tactic : public tactic {
m_rw.cfg().updt_params(p); m_rw.cfg().updt_params(p);
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g, goal_ref_buffer & result) {
goal_ref_buffer & result,
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("elim-small-bv", *g); tactic_report report("elim-small-bv", *g);
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();
fail_if_proof_generation("elim-small-bv", g); fail_if_proof_generation("elim-small-bv", g);
@ -286,9 +283,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -237,10 +237,8 @@ class max_bv_sharing_tactic : public tactic {
ast_manager & m() const { return m_rw.m(); } ast_manager & m() const { return m_rw.m(); }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("max-bv-sharing", *g); tactic_report report("max-bv-sharing", *g);
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();
@ -297,9 +295,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -113,11 +113,8 @@ class blast_term_ite_tactic : public tactic {
m_rw.cfg().updt_params(p); m_rw.cfg().updt_params(p);
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g, goal_ref_buffer & result) {
goal_ref_buffer & result,
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("blast-term-ite", *g); tactic_report report("blast-term-ite", *g);
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();
@ -170,9 +167,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -54,14 +54,11 @@ public:
virtual void updt_params(params_ref const & p) { m_params = p; m_elim_ite.updt_params(p); } virtual void updt_params(params_ref const & p) { m_params = p; m_elim_ite.updt_params(p); }
virtual void collect_param_descrs(param_descrs & r) { m_elim_ite.collect_param_descrs(r); } virtual void collect_param_descrs(param_descrs & r) { m_elim_ite.collect_param_descrs(r); }
virtual void operator()(goal_ref const & g, void operator()(goal_ref const & g, goal_ref_buffer& result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
fail_if_proof_generation("cofactor-term-ite", g); fail_if_proof_generation("cofactor-term-ite", g);
fail_if_unsat_core_generation("cofactor-term-ite", g); fail_if_unsat_core_generation("cofactor-term-ite", g);
tactic_report report("cofactor-term-ite", *g); tactic_report report("cofactor-term-ite", *g);
core = 0;
process(*(g.get())); process(*(g.get()));
g->inc_depth(); g->inc_depth();
result.push_back(g.get()); result.push_back(g.get());

View file

@ -63,8 +63,7 @@ public:
virtual void collect_param_descrs(param_descrs & r) {} virtual void collect_param_descrs(param_descrs & r) {}
virtual void operator()(goal_ref const & g, goal_ref_buffer & result, virtual void operator()(goal_ref const & g, goal_ref_buffer & result) {
expr_dependency_ref & core) {
tactic_report report("collect-statistics", *g); tactic_report report("collect-statistics", *g);
collect_proc cp(m, m_stats); collect_proc cp(m, m_stats);

View file

@ -621,9 +621,7 @@ void ctx_simplify_tactic::get_param_descrs(param_descrs & r) {
} }
void ctx_simplify_tactic::operator()(goal_ref const & in, void ctx_simplify_tactic::operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
core = 0;
(*m_imp)(*(in.get())); (*m_imp)(*(in.get()));
in->inc_depth(); in->inc_depth();
result.push_back(in.get()); result.push_back(in.get());

View file

@ -55,8 +55,7 @@ public:
virtual void collect_param_descrs(param_descrs & r) { get_param_descrs(r); } virtual void collect_param_descrs(param_descrs & r) { get_param_descrs(r); }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result);
expr_dependency_ref & core);
virtual void cleanup(); virtual void cleanup();
}; };

View file

@ -74,9 +74,7 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
core = 0;
(*m_imp)(*(in.get())); (*m_imp)(*(in.get()));
in->inc_depth(); in->inc_depth();
result.push_back(in.get()); result.push_back(in.get());

View file

@ -100,14 +100,13 @@ public:
} }
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
ast_manager & m = g->m(); ast_manager & m = g->m();
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();
rw r(m, produce_proofs); rw r(m, produce_proofs);
m_rw = &r; m_rw = &r;
core = 0; result.reset(); result.reset();
tactic_report report("distribute-forall", *g); tactic_report report("distribute-forall", *g);
expr_ref new_curr(m); expr_ref new_curr(m);

View file

@ -183,17 +183,11 @@ tactic * dom_simplify_tactic::translate(ast_manager & m) {
return alloc(dom_simplify_tactic, m, m_simplifier->translate(m), m_params); return alloc(dom_simplify_tactic, m, m_simplifier->translate(m), m_params);
} }
void dom_simplify_tactic::operator()( void dom_simplify_tactic::operator()(goal_ref const & in, goal_ref_buffer & result) {
goal_ref const & in,
goal_ref_buffer & result,
expr_dependency_ref & core) {
core = 0;
tactic_report report("dom-simplify", *in.get()); tactic_report report("dom-simplify", *in.get());
simplify_goal(*(in.get())); simplify_goal(*(in.get()));
in->inc_depth(); in->inc_depth();
result.push_back(in.get()); result.push_back(in.get());
} }
void dom_simplify_tactic::cleanup() { void dom_simplify_tactic::cleanup() {

View file

@ -137,9 +137,7 @@ public:
static void get_param_descrs(param_descrs & r) {} static void get_param_descrs(param_descrs & r) {}
virtual void collect_param_descrs(param_descrs & r) { get_param_descrs(r); } virtual void collect_param_descrs(param_descrs & r) { get_param_descrs(r); }
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer & result) override;
goal_ref_buffer & result,
expr_dependency_ref & core);
virtual void cleanup(); virtual void cleanup();
}; };

View file

@ -100,10 +100,8 @@ class elim_term_ite_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("elim-term-ite", *g); tactic_report report("elim-term-ite", *g);
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();
m_rw.cfg().m_produce_models = g->models_enabled(); m_rw.cfg().m_produce_models = g->models_enabled();
@ -160,9 +158,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -816,9 +816,7 @@ class elim_uncnstr_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
core = 0;
bool produce_models = g->models_enabled(); bool produce_models = g->models_enabled();
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();
@ -929,9 +927,8 @@ public:
} }
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(g, result);
(*m_imp)(g, result, core);
report_tactic_progress(":num-elim-apps", get_num_elim_apps()); report_tactic_progress(":num-elim-apps", get_num_elim_apps());
} }

View file

@ -144,10 +144,8 @@ class injectivity_tactic : public tactic {
} }
void operator()(goal_ref const & goal, void operator()(goal_ref const & goal,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(goal->is_well_sorted()); SASSERT(goal->is_well_sorted());
core = 0;
tactic_report report("injectivity", *goal); tactic_report report("injectivity", *goal);
fail_if_unsat_core_generation("injectivity", goal); // TODO: Support UNSAT cores fail_if_unsat_core_generation("injectivity", goal); // TODO: Support UNSAT cores
fail_if_proof_generation("injectivity", goal); fail_if_proof_generation("injectivity", goal);
@ -269,9 +267,8 @@ public:
} }
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_finder)(g, result);
(*m_finder)(g, result, core);
for (unsigned i = 0; i < g->size(); ++i) { for (unsigned i = 0; i < g->size(); ++i) {
expr* curr = g->form(i); expr* curr = g->form(i);

View file

@ -54,11 +54,9 @@ public:
virtual void collect_param_descrs(param_descrs & r) { nnf::get_param_descrs(r); } virtual void collect_param_descrs(param_descrs & r) { nnf::get_param_descrs(r); }
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
TRACE("nnf", tout << "params: " << m_params << "\n"; g->display(tout);); TRACE("nnf", tout << "params: " << m_params << "\n"; g->display(tout););
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("nnf", *g); tactic_report report("nnf", *g);
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();

View file

@ -128,10 +128,8 @@ class occf_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
fail_if_proof_generation("occf", g); fail_if_proof_generation("occf", g);
@ -209,9 +207,8 @@ public:
virtual void collect_param_descrs(param_descrs & r) {} virtual void collect_param_descrs(param_descrs & r) {}
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -147,12 +147,10 @@ public:
return alloc(pb_preprocess_tactic, m); return alloc(pb_preprocess_tactic, m);
} }
virtual void operator()( void operator()(
goal_ref const & g, goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) override {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
if (g->proofs_enabled()) { if (g->proofs_enabled()) {
throw tactic_exception("pb-preprocess does not support proofs"); throw tactic_exception("pb-preprocess does not support proofs");

View file

@ -136,10 +136,8 @@ class propagate_values_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("propagate-values", *g); tactic_report report("propagate-values", *g);
m_goal = g.get(); m_goal = g.get();
@ -238,11 +236,9 @@ public:
r.insert("max_rounds", CPK_UINT, "(default: 2) maximum number of rounds."); r.insert("max_rounds", CPK_UINT, "(default: 2) maximum number of rounds.");
} }
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer & result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
try { try {
(*m_imp)(in, result, core); (*m_imp)(in, result);
} }
catch (rewriter_exception & ex) { catch (rewriter_exception & ex) {
throw tactic_exception(ex.msg()); throw tactic_exception(ex.msg());

View file

@ -73,8 +73,8 @@ public:
virtual ~reduce_args_tactic(); virtual ~reduce_args_tactic();
virtual void operator()(goal_ref const & g, goal_ref_buffer & result, expr_dependency_ref & core); void operator()(goal_ref const & g, goal_ref_buffer & result) override;
virtual void cleanup(); void cleanup() override;
}; };
tactic * mk_reduce_args_tactic(ast_manager & m, params_ref const & p) { tactic * mk_reduce_args_tactic(ast_manager & m, params_ref const & p) {
@ -483,12 +483,11 @@ reduce_args_tactic::~reduce_args_tactic() {
} }
void reduce_args_tactic::operator()(goal_ref const & g, void reduce_args_tactic::operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
fail_if_proof_generation("reduce-args", g); fail_if_proof_generation("reduce-args", g);
fail_if_unsat_core_generation("reduce-args", g); fail_if_unsat_core_generation("reduce-args", g);
core = 0; result.reset(); result.reset();
m_imp->operator()(*(g.get())); m_imp->operator()(*(g.get()));
g->inc_depth(); g->inc_depth();
result.push_back(g.get()); result.push_back(g.get());

View file

@ -93,13 +93,11 @@ void simplify_tactic::get_param_descrs(param_descrs & r) {
} }
void simplify_tactic::operator()(goal_ref const & in, void simplify_tactic::operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
try { try {
(*m_imp)(*(in.get())); (*m_imp)(*(in.get()));
in->inc_depth(); in->inc_depth();
result.push_back(in.get()); result.push_back(in.get());
core = 0;
} }
catch (rewriter_exception & ex) { catch (rewriter_exception & ex) {
throw tactic_exception(ex.msg()); throw tactic_exception(ex.msg());

View file

@ -30,19 +30,19 @@ public:
simplify_tactic(ast_manager & m, params_ref const & ref = params_ref()); simplify_tactic(ast_manager & m, params_ref const & ref = params_ref());
virtual ~simplify_tactic(); virtual ~simplify_tactic();
virtual void updt_params(params_ref const & p); void updt_params(params_ref const & p) override;
static void get_param_descrs(param_descrs & r); static void get_param_descrs(param_descrs & r);
virtual void collect_param_descrs(param_descrs & r) { get_param_descrs(r); }
virtual void operator()(goal_ref const & in, void collect_param_descrs(param_descrs & r) override { get_param_descrs(r); }
goal_ref_buffer & result,
expr_dependency_ref & core);
virtual void cleanup(); void operator()(goal_ref const & in, goal_ref_buffer & result) override;
void cleanup() override;
unsigned get_num_steps() const; unsigned get_num_steps() const;
virtual tactic * translate(ast_manager & m) { return alloc(simplify_tactic, m, m_params); } tactic * translate(ast_manager & m) override { return alloc(simplify_tactic, m, m_params); }
}; };

View file

@ -666,11 +666,8 @@ class solve_eqs_tactic : public tactic {
return m_num_eliminated_vars; return m_num_eliminated_vars;
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g, goal_ref_buffer & result) {
goal_ref_buffer & result,
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
model_converter_ref mc; model_converter_ref mc;
tactic_report report("solve_eqs", *g); tactic_report report("solve_eqs", *g);
m_produce_models = g->models_enabled(); m_produce_models = g->models_enabled();
@ -732,10 +729,9 @@ public:
r.insert("ite_solver", CPK_BOOL, "(default: true) use if-then-else solver."); r.insert("ite_solver", CPK_BOOL, "(default: true) use if-then-else solver.");
} }
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) override {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
report_tactic_progress(":num-elim-vars", m_imp->get_num_eliminated_vars()); report_tactic_progress(":num-elim-vars", m_imp->get_num_eliminated_vars());
} }

View file

@ -101,12 +101,10 @@ public:
} }
void operator()(goal_ref const & in, void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) override {
expr_dependency_ref & core) override {
SASSERT(in->is_well_sorted()); SASSERT(in->is_well_sorted());
tactic_report report("split-clause", *in); tactic_report report("split-clause", *in);
TRACE("before_split_clause", in->display(tout);); TRACE("before_split_clause", in->display(tout););
core = 0;
ast_manager & m = in->m(); ast_manager & m = in->m();
unsigned cls_pos = select_clause(m, in); unsigned cls_pos = select_clause(m, in);
if (cls_pos == UINT_MAX) { if (cls_pos == UINT_MAX) {
@ -129,6 +127,7 @@ public:
result.push_back(subgoal_i); result.push_back(subgoal_i);
} }
in->set(concat(in->pc(), result.size(), result.c_ptr())); in->set(concat(in->pc(), result.size(), result.c_ptr()));
in->add(dependency_converter::concat(result.size(), result.c_ptr()));
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -39,8 +39,7 @@ public:
virtual ~symmetry_reduce_tactic(); virtual ~symmetry_reduce_tactic();
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result);
expr_dependency_ref & core);
virtual void cleanup(); virtual void cleanup();
}; };
@ -633,11 +632,10 @@ symmetry_reduce_tactic::~symmetry_reduce_tactic() {
} }
void symmetry_reduce_tactic::operator()(goal_ref const & g, void symmetry_reduce_tactic::operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
fail_if_proof_generation("symmetry_reduce", g); fail_if_proof_generation("symmetry_reduce", g);
fail_if_unsat_core_generation("symmetry_reduce", g); fail_if_unsat_core_generation("symmetry_reduce", g);
core = 0; result.reset(); result.reset();
(*m_imp)(*(g.get())); (*m_imp)(*(g.get()));
g->inc_depth(); g->inc_depth();
result.push_back(g.get()); result.push_back(g.get());

View file

@ -799,10 +799,8 @@ class tseitin_cnf_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("tseitin-cnf", *g); tactic_report report("tseitin-cnf", *g);
fail_if_proof_generation("tseitin-cnf", g); fail_if_proof_generation("tseitin-cnf", g);
m_produce_models = g->models_enabled(); m_produce_models = g->models_enabled();
@ -880,9 +878,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
report_tactic_progress(":cnf-aux-vars", m_imp->m_num_aux_vars); report_tactic_progress(":cnf-aux-vars", m_imp->m_num_aux_vars);
} }

View file

@ -47,14 +47,13 @@ class fpa2bv_tactic : public tactic {
} }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
m_proofs_enabled = g->proofs_enabled(); m_proofs_enabled = g->proofs_enabled();
m_produce_models = g->models_enabled(); m_produce_models = g->models_enabled();
m_produce_unsat_cores = g->unsat_core_enabled(); m_produce_unsat_cores = g->unsat_core_enabled();
core = 0; result.reset(); result.reset();
tactic_report report("fpa2bv", *g); tactic_report report("fpa2bv", *g);
m_rw.reset(); m_rw.reset();
@ -138,10 +137,9 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
try { try {
(*m_imp)(in, result, core); (*m_imp)(in, result);
} }
catch (rewriter_exception & ex) { catch (rewriter_exception & ex) {
throw tactic_exception(ex.msg()); throw tactic_exception(ex.msg());

View file

@ -107,6 +107,7 @@ void goal::copy_to(goal & target) const {
target.m_precision = mk_union(prec(), target.prec()); target.m_precision = mk_union(prec(), target.prec());
target.m_mc = m_mc.get(); target.m_mc = m_mc.get();
target.m_pc = m_pc.get(); target.m_pc = m_pc.get();
target.m_dc = m_dc.get();
} }
void goal::push_back(expr * f, proof * pr, expr_dependency * d) { void goal::push_back(expr * f, proof * pr, expr_dependency * d) {
@ -655,6 +656,7 @@ goal * goal::translate(ast_translation & translator) const {
res->m_precision = m_precision; res->m_precision = m_precision;
res->m_pc = m_pc ? m_pc->translate(translator) : nullptr; res->m_pc = m_pc ? m_pc->translate(translator) : nullptr;
res->m_mc = m_mc ? m_mc->translate(translator) : nullptr; res->m_mc = m_mc ? m_mc->translate(translator) : nullptr;
res->m_dc = m_dc ? m_dc->translate(translator) : nullptr;
return res; return res;
} }

View file

@ -37,6 +37,7 @@ Revision History:
#include "util/ref_buffer.h" #include "util/ref_buffer.h"
#include "tactic/model_converter.h" #include "tactic/model_converter.h"
#include "tactic/proof_converter.h" #include "tactic/proof_converter.h"
#include "tactic/dependency_converter.h"
class goal { class goal {
public: public:
@ -53,6 +54,7 @@ protected:
ast_manager & m_manager; ast_manager & m_manager;
model_converter_ref m_mc; model_converter_ref m_mc;
proof_converter_ref m_pc; proof_converter_ref m_pc;
dependency_converter_ref m_dc;
unsigned m_ref_count; unsigned m_ref_count;
expr_array m_forms; expr_array m_forms;
expr_array m_proofs; expr_array m_proofs;
@ -147,10 +149,13 @@ public:
bool is_decided() const; bool is_decided() const;
bool is_well_sorted() const; bool is_well_sorted() const;
dependency_converter* dc() { return m_dc.get(); }
model_converter* mc() { return m_mc.get(); } model_converter* mc() { return m_mc.get(); }
proof_converter* pc() { return inconsistent() ? proof2proof_converter(m(), pr(0)) : m_pc.get(); } proof_converter* pc() { return inconsistent() ? proof2proof_converter(m(), pr(0)) : m_pc.get(); }
void add(dependency_converter* d) { m_dc = dependency_converter::concat(m_dc.get(), d); }
void add(model_converter* m) { m_mc = concat(m_mc.get(), m); } void add(model_converter* m) { m_mc = concat(m_mc.get(), m); }
void add(proof_converter* p) { m_pc = concat(m_pc.get(), p); } void add(proof_converter* p) { m_pc = concat(m_pc.get(), p); }
void set(dependency_converter* d) { m_dc = d; }
void set(model_converter* m) { m_mc = m; } void set(model_converter* m) { m_mc = m; }
void set(proof_converter* p) { m_pc = p; } void set(proof_converter* p) { m_pc = p; }

View file

@ -15,6 +15,42 @@ Author:
Notes: Notes:
A model converter, mc, can be used to convert a model for one
of a generated subgoal into a model for an initial goal or solver state.
For a goal or solver state that is decided, a model converter can be
a simple wrapper around a model.
Logically, given a formula F and subgoal formula F_s a model converter mc
for F_s relative to F has the property:
m |= F_s iff mc(m) |= F for every model m
For the evaluator associated with models, m, we expect
eval(m)(F_s) <=> eval(mc(m))(F)
This property holds for both eval, that decides on a fixed value
for constants that have no interpretation in m and for 'peval'
(partial eval) that retuns just the constants that are unfixed.
(in the model evaluator one can control this behavior using a
configuration flag)
and more generally over the eval method have:
G => F_s iff peval(mc(e))(G) => F for every formula G
where e is the empty model (a model that does not evaluate any
When a model converter supports application to a formula it satisfies
the following property:
mc(G) & F_s is SAT iff G & F is SAT
For a model converter that is a sequence of definitions and removals
of functions we can obtain mc(G) by adding back or expanding definitinos
that are required to interpret G fully in the context of F_s.
--*/ --*/
#ifndef MODEL_CONVERTER_H_ #ifndef MODEL_CONVERTER_H_
#define MODEL_CONVERTER_H_ #define MODEL_CONVERTER_H_

View file

@ -541,7 +541,7 @@ public:
init(); init();
} }
void operator ()(const goal_ref & g,goal_ref_buffer & result, expr_dependency_ref & dep) { void operator ()(const goal_ref & g,goal_ref_buffer & result) {
ast_manager& m = g->m(); ast_manager& m = g->m();
solver* s = mk_fd_solver(m, m_params); solver* s = mk_fd_solver(m, m_params);
solver_state* st = alloc(solver_state, 0, s, m_params, cube_task); solver_state* st = alloc(solver_state, 0, s, m_params, cube_task);

View file

@ -46,11 +46,7 @@ public:
virtual void collect_param_descrs(param_descrs & r) { virtual void collect_param_descrs(param_descrs & r) {
} }
virtual void operator()(goal_ref const & g, void operator()(goal_ref const & g, goal_ref_buffer& result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
core = 0;
TRACE("sine", g->display(tout);); TRACE("sine", g->display(tout););
TRACE("sine", tout << g->size();); TRACE("sine", tout << g->size(););
ptr_vector<expr> new_forms; ptr_vector<expr> new_forms;

View file

@ -60,10 +60,9 @@ public:
} }
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0; result.reset(); result.reset();
TRACE("sls", g->display(tout);); TRACE("sls", g->display(tout););
tactic_report report("sls", *g); tactic_report report("sls", *g);

View file

@ -54,8 +54,7 @@ public:
virtual ~qfufbv_ackr_tactic() { } virtual ~qfufbv_ackr_tactic() { }
virtual void operator()(goal_ref const & g, virtual void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
ast_manager& m(g->m()); ast_manager& m(g->m());
tactic_report report("qfufbv_ackr", *g); tactic_report report("qfufbv_ackr", *g);
fail_if_unsat_core_generation("qfufbv_ackr", g); fail_if_unsat_core_generation("qfufbv_ackr", g);

View file

@ -67,12 +67,8 @@ void report_tactic_progress(char const * id, unsigned val) {
} }
} }
void skip_tactic::operator()(goal_ref const & in, void skip_tactic::operator()(goal_ref const & in, goal_ref_buffer& result) {
goal_ref_buffer & result,
expr_dependency_ref & core) {
result.reset();
result.push_back(in.get()); result.push_back(in.get());
core = 0;
} }
tactic * mk_skip_tactic() { tactic * mk_skip_tactic() {
@ -81,9 +77,7 @@ tactic * mk_skip_tactic() {
class fail_tactic : public tactic { class fail_tactic : public tactic {
public: public:
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer & result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
throw tactic_exception("fail tactic"); throw tactic_exception("fail tactic");
} }
@ -102,11 +96,9 @@ class report_verbose_tactic : public skip_tactic {
public: public:
report_verbose_tactic(char const * msg, unsigned lvl) : m_msg(msg), m_lvl(lvl) {} report_verbose_tactic(char const * msg, unsigned lvl) : m_msg(msg), m_lvl(lvl) {}
void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) override {
IF_VERBOSE(m_lvl, verbose_stream() << m_msg << "\n";); IF_VERBOSE(m_lvl, verbose_stream() << m_msg << "\n";);
skip_tactic::operator()(in, result, core); skip_tactic::operator()(in, result);
} }
}; };
@ -119,12 +111,10 @@ class trace_tactic : public skip_tactic {
public: public:
trace_tactic(char const * tag): m_tag(tag) {} trace_tactic(char const * tag): m_tag(tag) {}
void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) override {
TRACE(m_tag, in->display(tout);); TRACE(m_tag, in->display(tout););
(void)m_tag; (void)m_tag;
skip_tactic::operator()(in, result, core); skip_tactic::operator()(in, result);
} }
}; };
@ -136,12 +126,10 @@ class fail_if_undecided_tactic : public skip_tactic {
public: public:
fail_if_undecided_tactic() {} fail_if_undecided_tactic() {}
void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) override {
if (!in->is_decided()) if (!in->is_decided())
throw tactic_exception("undecided"); throw tactic_exception("undecided");
skip_tactic::operator()(in, result, core); skip_tactic::operator()(in, result);
} }
}; };
@ -149,10 +137,10 @@ tactic * mk_fail_if_undecided_tactic() {
return alloc(fail_if_undecided_tactic); return alloc(fail_if_undecided_tactic);
} }
void exec(tactic & t, goal_ref const & in, goal_ref_buffer & result, expr_dependency_ref & core) { void exec(tactic & t, goal_ref const & in, goal_ref_buffer & result) {
t.reset_statistics(); t.reset_statistics();
try { try {
t(in, result, core); t(in, result);
t.cleanup(); t.cleanup();
} }
catch (tactic_exception & ex) { catch (tactic_exception & ex) {
@ -173,7 +161,7 @@ lbool check_sat(tactic & t, goal_ref & g, model_ref & md, labels_vec & labels, p
ast_manager & m = g->m(); ast_manager & m = g->m();
goal_ref_buffer r; goal_ref_buffer r;
try { try {
exec(t, g, r, core); exec(t, g, r);
} }
catch (tactic_exception & ex) { catch (tactic_exception & ex) {
reason_unknown = ex.msg(); reason_unknown = ex.msg();

View file

@ -61,9 +61,7 @@ public:
Therefore, in most cases, pc == 0 and core == 0 for non-branching tactics. Therefore, in most cases, pc == 0 and core == 0 for non-branching tactics.
*/ */
virtual void operator()(/* in */ goal_ref const & in, virtual void operator()(goal_ref const & in, goal_ref_buffer& result) = 0;
/* out */ goal_ref_buffer & result,
/* out */ expr_dependency_ref & core) = 0;
virtual void collect_statistics(statistics & st) const {} virtual void collect_statistics(statistics & st) const {}
virtual void reset_statistics() {} virtual void reset_statistics() {}
@ -103,7 +101,7 @@ void report_tactic_progress(char const * id, unsigned val);
class skip_tactic : public tactic { class skip_tactic : public tactic {
public: public:
void operator()(goal_ref const & in, goal_ref_buffer & result, expr_dependency_ref & core) override; void operator()(goal_ref const & in, goal_ref_buffer& result) override;
void cleanup() override {} void cleanup() override {}
tactic * translate(ast_manager & m) override { return this; } tactic * translate(ast_manager & m) override { return this; }
}; };
@ -136,7 +134,7 @@ public:
#define MK_SIMPLE_TACTIC_FACTORY(NAME, ST) MK_TACTIC_FACTORY(NAME, return ST;) #define MK_SIMPLE_TACTIC_FACTORY(NAME, ST) MK_TACTIC_FACTORY(NAME, return ST;)
void exec(tactic & t, goal_ref const & in, goal_ref_buffer & result, expr_dependency_ref & core); void exec(tactic & t, goal_ref const & in, goal_ref_buffer & result);
lbool check_sat(tactic & t, goal_ref & g, model_ref & md, labels_vec & labels, proof_ref & pr, expr_dependency_ref & core, std::string & reason_unknown); lbool check_sat(tactic & t, goal_ref & g, model_ref & md, labels_vec & labels, proof_ref & pr, expr_dependency_ref & core, std::string & reason_unknown);
// Throws an exception if goal \c in requires proof generation. // Throws an exception if goal \c in requires proof generation.

View file

@ -101,9 +101,7 @@ public:
and_then_tactical(tactic * t1, tactic * t2):binary_tactical(t1, t2) {} and_then_tactical(tactic * t1, tactic * t2):binary_tactical(t1, t2) {}
virtual ~and_then_tactical() {} virtual ~and_then_tactical() {}
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
bool models_enabled = in->models_enabled(); bool models_enabled = in->models_enabled();
bool proofs_enabled = in->proofs_enabled(); bool proofs_enabled = in->proofs_enabled();
@ -111,11 +109,7 @@ public:
ast_manager & m = in->m(); ast_manager & m = in->m();
goal_ref_buffer r1; goal_ref_buffer r1;
expr_dependency_ref core1(m); m_t1->operator()(in, r1);
result.reset();
core = 0;
m_t1->operator()(in, r1, core1);
SASSERT(!is_decided(r1) || !core1); // the pc and core of decided goals is 0
unsigned r1_size = r1.size(); unsigned r1_size = r1.size();
SASSERT(r1_size > 0); SASSERT(r1_size > 0);
if (r1_size == 1) { if (r1_size == 1) {
@ -124,36 +118,28 @@ public:
return; return;
} }
goal_ref r1_0 = r1[0]; goal_ref r1_0 = r1[0];
m_t2->operator()(r1_0, result, core); m_t2->operator()(r1_0, result);
if (cores_enabled) core = m.mk_join(core1.get(), core);
} }
else { else {
if (cores_enabled) core = core1;
goal_ref_buffer r2; goal_ref_buffer r2;
for (unsigned i = 0; i < r1_size; i++) { for (unsigned i = 0; i < r1_size; i++) {
goal_ref g = r1[i]; goal_ref g = r1[i];
r2.reset(); r2.reset();
expr_dependency_ref core2(m); m_t2->operator()(g, r2);
m_t2->operator()(g, r2, core2);
if (is_decided(r2)) { if (is_decided(r2)) {
SASSERT(r2.size() == 1); SASSERT(r2.size() == 1);
if (is_decided_sat(r2)) { if (is_decided_sat(r2)) {
// found solution... // found solution...
result.reset();
result.push_back(r2[0]); result.push_back(r2[0]);
SASSERT(!core);
return; return;
} }
else { else {
SASSERT(is_decided_unsat(r2)); SASSERT(is_decided_unsat(r2));
// the proof and unsat core of a decided_unsat goal are stored in the node itself.
// core2 must be 0.
SASSERT(!core2);
if (cores_enabled) core = m.mk_join(core.get(), r2[0]->dep(0));
} }
} }
else { else {
result.append(r2.size(), r2.c_ptr()); result.append(r2.size(), r2.c_ptr());
if (cores_enabled) core = m.mk_join(core.get(), core2.get());
} }
} }
@ -162,17 +148,16 @@ public:
// create an decided_unsat goal with the proof // create an decided_unsat goal with the proof
in->reset_all(); in->reset_all();
proof_ref pr(m); proof_ref pr(m);
expr_dependency_ref core(m);
if (proofs_enabled) { if (proofs_enabled) {
apply(m, in->pc(), pr); apply(m, in->pc(), pr);
} }
SASSERT(cores_enabled || core == 0); dependency_converter* dc = in->dc();
in->assert_expr(m.mk_false(), pr, core); if (cores_enabled && dc) {
core = 0; core = (*dc)();
result.push_back(in.get());
SASSERT(!core);
} }
else { in->assert_expr(m.mk_false(), pr, core);
SASSERT(cores_enabled || core == 0); result.push_back(in.get());
} }
} }
} }
@ -300,30 +285,24 @@ public:
virtual ~or_else_tactical() {} virtual ~or_else_tactical() {}
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in, goal_ref_buffer& result) {
goal_ref_buffer & result,
expr_dependency_ref & core) {
goal orig(*(in.get())); goal orig(*(in.get()));
proof_converter_ref pc = in->pc();
unsigned sz = m_ts.size(); unsigned sz = m_ts.size();
unsigned i; unsigned i;
for (i = 0; i < sz; i++) { for (i = 0; i < sz; i++) {
tactic * t = m_ts[i]; tactic * t = m_ts[i];
result.reset();
pc = 0;
core = 0;
SASSERT(sz > 0); SASSERT(sz > 0);
if (i < sz - 1) { if (i < sz - 1) {
try { try {
t->operator()(in, result, core); t->operator()(in, result);
return; return;
} }
catch (tactic_exception &) { catch (tactic_exception &) {
in->set(pc.get()); result.reset();
} }
} }
else { else {
t->operator()(in, result, core); t->operator()(in, result);
return; return;
} }
in->reset_all(); in->reset_all();
@ -398,9 +377,7 @@ public:
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
bool use_seq; bool use_seq;
#ifdef _NO_OMP_ #ifdef _NO_OMP_
use_seq = true; use_seq = true;
@ -409,7 +386,7 @@ public:
#endif #endif
if (use_seq) { if (use_seq) {
// execute tasks sequentially // execute tasks sequentially
or_else_tactical::operator()(in, result, core); or_else_tactical::operator()(in, result);
return; return;
} }
@ -437,13 +414,12 @@ public:
#pragma omp parallel for #pragma omp parallel for
for (int i = 0; i < static_cast<int>(sz); i++) { for (int i = 0; i < static_cast<int>(sz); i++) {
goal_ref_buffer _result; goal_ref_buffer _result;
expr_dependency_ref _core(*(managers[i]));
goal_ref in_copy = in_copies[i]; goal_ref in_copy = in_copies[i];
tactic & t = *(ts.get(i)); tactic & t = *(ts.get(i));
try { try {
t(in_copy, _result, _core); t(in_copy, _result);
bool first = false; bool first = false;
#pragma omp critical (par_tactical) #pragma omp critical (par_tactical)
{ {
@ -462,8 +438,8 @@ public:
for (goal* g : _result) { for (goal* g : _result) {
result.push_back(g->translate(translator)); result.push_back(g->translate(translator));
} }
expr_dependency_translation td(translator); goal_ref in2(in_copy->translate(translator));
core = td(_core); in->copy_from(*(in2.get()));
} }
} }
catch (tactic_exception & ex) { catch (tactic_exception & ex) {
@ -522,9 +498,7 @@ public:
par_and_then_tactical(tactic * t1, tactic * t2):and_then_tactical(t1, t2) {} par_and_then_tactical(tactic * t1, tactic * t2):and_then_tactical(t1, t2) {}
virtual ~par_and_then_tactical() {} virtual ~par_and_then_tactical() {}
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
bool use_seq; bool use_seq;
#ifdef _NO_OMP_ #ifdef _NO_OMP_
use_seq = true; use_seq = true;
@ -533,7 +507,7 @@ public:
#endif #endif
if (use_seq) { if (use_seq) {
// execute tasks sequentially // execute tasks sequentially
and_then_tactical::operator()(in, result, core); and_then_tactical::operator()(in, result);
return; return;
} }
@ -545,26 +519,19 @@ public:
ast_manager & m = in->m(); ast_manager & m = in->m();
goal_ref_buffer r1; goal_ref_buffer r1;
expr_dependency_ref core1(m); m_t1->operator()(in, r1);
result.reset();
core = 0;
m_t1->operator()(in, r1, core1);
SASSERT(!is_decided(r1) || !core1); // the core of decided goals is 0
unsigned r1_size = r1.size(); unsigned r1_size = r1.size();
SASSERT(r1_size > 0); SASSERT(r1_size > 0);
if (r1_size == 1) { if (r1_size == 1) {
// Only one subgoal created... no need for parallelism // Only one subgoal created... no need for parallelism
if (r1[0]->is_decided()) { if (r1[0]->is_decided()) {
result.push_back(r1[0]); result.push_back(r1[0]);
SASSERT(!core);
return; return;
} }
goal_ref r1_0 = r1[0]; goal_ref r1_0 = r1[0];
m_t2->operator()(r1_0, result, core); m_t2->operator()(r1_0, result);
if (cores_enabled) core = m.mk_join(core1.get(), core);
} }
else { else {
if (cores_enabled) core = core1;
scoped_ptr_vector<ast_manager> managers; scoped_ptr_vector<ast_manager> managers;
tactic_ref_vector ts2; tactic_ref_vector ts2;
@ -596,12 +563,11 @@ public:
goal_ref new_g = g_copies[i]; goal_ref new_g = g_copies[i];
goal_ref_buffer r2; goal_ref_buffer r2;
expr_dependency_ref core2(new_m);
bool curr_failed = false; bool curr_failed = false;
try { try {
ts2[i]->operator()(new_g, r2, core2); ts2[i]->operator()(new_g, r2);
} }
catch (tactic_exception & ex) { catch (tactic_exception & ex) {
#pragma omp critical (par_and_then_tactical) #pragma omp critical (par_and_then_tactical)
@ -667,14 +633,10 @@ public:
ast_translation translator(new_m, m, false); ast_translation translator(new_m, m, false);
SASSERT(r2.size() == 1); SASSERT(r2.size() == 1);
result.push_back(r2[0]->translate(translator)); result.push_back(r2[0]->translate(translator));
SASSERT(!core);
} }
} }
else { else {
SASSERT(is_decided_unsat(r2)); SASSERT(is_decided_unsat(r2));
// the proof and unsat core of a decided_unsat goal are stored in the node itself.
// core2 must be 0.
SASSERT(!core2);
if (cores_enabled && r2[0]->dep(0) != 0) { if (cores_enabled && r2[0]->dep(0) != 0) {
expr_dependency_ref * new_dep = alloc(expr_dependency_ref, new_m); expr_dependency_ref * new_dep = alloc(expr_dependency_ref, new_m);
@ -687,9 +649,10 @@ public:
goal_ref_buffer * new_r2 = alloc(goal_ref_buffer); goal_ref_buffer * new_r2 = alloc(goal_ref_buffer);
goals_vect.set(i, new_r2); goals_vect.set(i, new_r2);
new_r2->append(r2.size(), r2.c_ptr()); new_r2->append(r2.size(), r2.c_ptr());
if (cores_enabled && core2 != 0) { dependency_converter* dc = r1[i]->dc();
if (cores_enabled && dc) {
expr_dependency_ref * new_dep = alloc(expr_dependency_ref, new_m); expr_dependency_ref * new_dep = alloc(expr_dependency_ref, new_m);
*new_dep = core2; *new_dep = (*dc)();
core_buffer.set(i, new_dep); core_buffer.set(i, new_dep);
} }
} }
@ -708,7 +671,7 @@ public:
if (found_solution) if (found_solution)
return; return;
core = 0; expr_dependency_ref core(m);
for (unsigned i = 0; i < r1_size; i++) { for (unsigned i = 0; i < r1_size; i++) {
ast_translation translator(*(managers[i]), m, false); ast_translation translator(*(managers[i]), m, false);
goal_ref_buffer * r = goals_vect[i]; goal_ref_buffer * r = goals_vect[i];
@ -730,7 +693,9 @@ public:
core = m.mk_join(curr_core, core); core = m.mk_join(curr_core, core);
} }
} }
if (core) {
in->add(dependency_converter::unit(core));
}
if (result.empty()) { if (result.empty()) {
// all subgoals were shown to be unsat. // all subgoals were shown to be unsat.
@ -740,14 +705,12 @@ public:
if (proofs_enabled) { if (proofs_enabled) {
apply(m, in->pc(), pr); apply(m, in->pc(), pr);
} }
SASSERT(cores_enabled || core == 0); dependency_converter* dc = in->dc();
in->assert_expr(m.mk_false(), pr, core); if (cores_enabled && dc) {
core = 0; core = (*dc)();
result.push_back(in.get());
SASSERT(!core);
} }
else { in->assert_expr(m.mk_false(), pr, core);
SASSERT(cores_enabled || core == 0); result.push_back(in.get());
} }
} }
} }
@ -786,10 +749,8 @@ public:
virtual ~unary_tactical() { } virtual ~unary_tactical() { }
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result, m_t->operator()(in, result);
expr_dependency_ref & core) {
m_t->operator()(in, result, core);
} }
virtual void cleanup(void) { m_t->cleanup(); } virtual void cleanup(void) { m_t->cleanup(); }
@ -814,12 +775,10 @@ class repeat_tactical : public unary_tactical {
void operator()(unsigned depth, void operator()(unsigned depth,
goal_ref const & in, goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer& result) {
expr_dependency_ref & core) {
// TODO: implement a non-recursive version. // TODO: implement a non-recursive version.
if (depth > m_max_depth) { if (depth > m_max_depth) {
result.push_back(in.get()); result.push_back(in.get());
core = 0;
return; return;
} }
@ -829,16 +788,13 @@ class repeat_tactical : public unary_tactical {
ast_manager & m = in->m(); ast_manager & m = in->m();
goal_ref_buffer r1; goal_ref_buffer r1;
expr_dependency_ref core1(m);
result.reset(); result.reset();
core = 0;
{ {
goal orig_in(in->m(), proofs_enabled, models_enabled, cores_enabled); goal orig_in(in->m(), proofs_enabled, models_enabled, cores_enabled);
orig_in.copy_from(*(in.get())); orig_in.copy_from(*(in.get()));
m_t->operator()(in, r1, core1); m_t->operator()(in, r1);
if (r1.size() == 1 && is_equal(orig_in, *(r1[0]))) { if (r1.size() == 1 && is_equal(orig_in, *(r1[0]))) {
result.push_back(r1[0]); result.push_back(r1[0]);
if (cores_enabled) core = core1;
return; return;
} }
} }
@ -847,38 +803,30 @@ class repeat_tactical : public unary_tactical {
if (r1_size == 1) { if (r1_size == 1) {
if (r1[0]->is_decided()) { if (r1[0]->is_decided()) {
result.push_back(r1[0]); result.push_back(r1[0]);
SASSERT(!core);
return; return;
} }
goal_ref r1_0 = r1[0]; goal_ref r1_0 = r1[0];
operator()(depth+1, r1_0, result, core); operator()(depth+1, r1_0, result);
if (cores_enabled) core = m.mk_join(core1.get(), core);
} }
else { else {
if (cores_enabled) core = core1;
goal_ref_buffer r2; goal_ref_buffer r2;
for (unsigned i = 0; i < r1_size; i++) { for (unsigned i = 0; i < r1_size; i++) {
goal_ref g = r1[i]; goal_ref g = r1[i];
r2.reset(); r2.reset();
expr_dependency_ref core2(m); operator()(depth+1, g, r2);
operator()(depth+1, g, r2, core2);
if (is_decided(r2)) { if (is_decided(r2)) {
SASSERT(r2.size() == 1); SASSERT(r2.size() == 1);
if (is_decided_sat(r2)) { if (is_decided_sat(r2)) {
// found solution... // found solution...
result.push_back(r2[0]); result.push_back(r2[0]);
SASSERT(!core);
return; return;
} }
else { else {
SASSERT(is_decided_unsat(r2)); SASSERT(is_decided_unsat(r2));
SASSERT(!core2);
if (cores_enabled) core = m.mk_join(core.get(), r2[0]->dep(0));
} }
} }
else { else {
result.append(r2.size(), r2.c_ptr()); result.append(r2.size(), r2.c_ptr());
if (cores_enabled) core = m.mk_join(core.get(), core2.get());
} }
} }
@ -887,17 +835,15 @@ class repeat_tactical : public unary_tactical {
// create an decided_unsat goal with the proof // create an decided_unsat goal with the proof
in->reset_all(); in->reset_all();
proof_ref pr(m); proof_ref pr(m);
expr_dependency_ref core(m);
if (proofs_enabled) { if (proofs_enabled) {
apply(m, in->pc(), pr); apply(m, in->pc(), pr);
} }
SASSERT(cores_enabled || core == 0); if (cores_enabled && in->dc()) {
in->assert_expr(m.mk_false(), pr, core); core = (*in->dc())();
core = 0;
result.push_back(in.get());
SASSERT(!core);
} }
else { in->assert_expr(m.mk_false(), pr, core);
SASSERT(cores_enabled || core == 0); result.push_back(in.get());
} }
} }
} }
@ -908,10 +854,8 @@ public:
m_max_depth(max_depth) { m_max_depth(max_depth) {
} }
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result, operator()(0, in, result);
expr_dependency_ref & core) {
operator()(0, in, result, core);
} }
virtual tactic * translate(ast_manager & m) { virtual tactic * translate(ast_manager & m) {
@ -929,13 +873,10 @@ class fail_if_branching_tactical : public unary_tactical {
public: public:
fail_if_branching_tactical(tactic * t, unsigned threshold):unary_tactical(t), m_threshold(threshold) {} fail_if_branching_tactical(tactic * t, unsigned threshold):unary_tactical(t), m_threshold(threshold) {}
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result, m_t->operator()(in, result);
expr_dependency_ref & core) {
m_t->operator()(in, result, core);
if (result.size() > m_threshold) { if (result.size() > m_threshold) {
result.reset(); result.reset(); // assumes in is not strenthened to one of the branches
core = 0;
throw tactic_exception("failed-if-branching tactical"); throw tactic_exception("failed-if-branching tactical");
} }
}; };
@ -954,10 +895,8 @@ class cleanup_tactical : public unary_tactical {
public: public:
cleanup_tactical(tactic * t):unary_tactical(t) {} cleanup_tactical(tactic * t):unary_tactical(t) {}
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result, m_t->operator()(in, result);
expr_dependency_ref & core) {
m_t->operator()(in, result, core);
m_t->cleanup(); m_t->cleanup();
} }
@ -976,14 +915,12 @@ class try_for_tactical : public unary_tactical {
public: public:
try_for_tactical(tactic * t, unsigned ts):unary_tactical(t), m_timeout(ts) {} try_for_tactical(tactic * t, unsigned ts):unary_tactical(t), m_timeout(ts) {}
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
cancel_eh<reslimit> eh(in->m().limit()); cancel_eh<reslimit> eh(in->m().limit());
{ {
// Warning: scoped_timer is not thread safe in Linux. // Warning: scoped_timer is not thread safe in Linux.
scoped_timer timer(m_timeout, &eh); scoped_timer timer(m_timeout, &eh);
m_t->operator()(in, result, core); m_t->operator()(in, result);
} }
} }
@ -1044,11 +981,9 @@ public:
annotate_tactical(char const* name, tactic* t): annotate_tactical(char const* name, tactic* t):
unary_tactical(t), m_name(name) {} unary_tactical(t), m_name(name) {}
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
scope _scope(m_name); scope _scope(m_name);
m_t->operator()(in, result, core); m_t->operator()(in, result);
} }
virtual tactic * translate(ast_manager & m) { virtual tactic * translate(ast_manager & m) {
@ -1073,13 +1008,11 @@ public:
virtual ~cond_tactical() {} virtual ~cond_tactical() {}
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer & result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
if (m_p->operator()(*(in.get())).is_true()) if (m_p->operator()(*(in.get())).is_true())
m_t1->operator()(in, result, core); m_t1->operator()(in, result);
else else
m_t2->operator()(in, result, core); m_t2->operator()(in, result);
} }
virtual tactic * translate(ast_manager & m) { virtual tactic * translate(ast_manager & m) {
@ -1109,10 +1042,7 @@ public:
void cleanup() {} void cleanup() {}
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
core = 0;
if (m_p->operator()(*(in.get())).is_true()) { if (m_p->operator()(*(in.get())).is_true()) {
throw tactic_exception("fail-if tactic"); throw tactic_exception("fail-if tactic");
} }
@ -1136,16 +1066,12 @@ class if_no_proofs_tactical : public unary_tactical {
public: public:
if_no_proofs_tactical(tactic * t):unary_tactical(t) {} if_no_proofs_tactical(tactic * t):unary_tactical(t) {}
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer & result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
if (in->proofs_enabled()) { if (in->proofs_enabled()) {
core = 0;
result.reset();
result.push_back(in.get()); result.push_back(in.get());
} }
else { else {
m_t->operator()(in, result, core); m_t->operator()(in, result);
} }
} }
@ -1156,16 +1082,12 @@ class if_no_unsat_cores_tactical : public unary_tactical {
public: public:
if_no_unsat_cores_tactical(tactic * t):unary_tactical(t) {} if_no_unsat_cores_tactical(tactic * t):unary_tactical(t) {}
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
if (in->unsat_core_enabled()) { if (in->unsat_core_enabled()) {
core = 0;
result.reset();
result.push_back(in.get()); result.push_back(in.get());
} }
else { else {
m_t->operator()(in, result, core); m_t->operator()(in, result);
} }
} }
@ -1176,16 +1098,12 @@ class if_no_models_tactical : public unary_tactical {
public: public:
if_no_models_tactical(tactic * t):unary_tactical(t) {} if_no_models_tactical(tactic * t):unary_tactical(t) {}
virtual void operator()(goal_ref const & in, void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal_ref_buffer & result,
expr_dependency_ref & core) {
if (in->models_enabled()) { if (in->models_enabled()) {
core = 0;
result.reset();
result.push_back(in.get()); result.push_back(in.get());
} }
else { else {
m_t->operator()(in, result, core); m_t->operator()(in, result);
} }
} }

View file

@ -38,10 +38,8 @@ class macro_finder_tactic : public tactic {
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("macro-finder", *g); tactic_report report("macro-finder", *g);
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();
@ -115,9 +113,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -36,10 +36,8 @@ class quasi_macros_tactic : public tactic {
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("quasi-macros", *g); tactic_report report("quasi-macros", *g);
bool produce_proofs = g->proofs_enabled(); bool produce_proofs = g->proofs_enabled();
@ -126,9 +124,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
virtual void cleanup() { virtual void cleanup() {

View file

@ -32,10 +32,8 @@ class ufbv_rewriter_tactic : public tactic {
ast_manager & m() const { return m_manager; } ast_manager & m() const { return m_manager; }
void operator()(goal_ref const & g, void operator()(goal_ref const & g,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted()); SASSERT(g->is_well_sorted());
core = 0;
tactic_report report("ufbv-rewriter", *g); tactic_report report("ufbv-rewriter", *g);
fail_if_unsat_core_generation("ufbv-rewriter", g); fail_if_unsat_core_generation("ufbv-rewriter", g);
@ -100,9 +98,8 @@ public:
} }
virtual void operator()(goal_ref const & in, virtual void operator()(goal_ref const & in,
goal_ref_buffer & result, goal_ref_buffer & result) {
expr_dependency_ref & core) { (*m_imp)(in, result);
(*m_imp)(in, result, core);
} }
virtual void cleanup() { virtual void cleanup() {