mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 03:45:51 +00:00
remove also cores as arguments to tactics
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
4bbece6616
commit
2f218b0bdc
90 changed files with 326 additions and 565 deletions
|
@ -113,11 +113,8 @@ class blast_term_ite_tactic : public tactic {
|
|||
m_rw.cfg().updt_params(p);
|
||||
}
|
||||
|
||||
void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
void operator()(goal_ref const & g, goal_ref_buffer & result) {
|
||||
SASSERT(g->is_well_sorted());
|
||||
core = 0;
|
||||
tactic_report report("blast-term-ite", *g);
|
||||
bool produce_proofs = g->proofs_enabled();
|
||||
|
||||
|
@ -170,9 +167,8 @@ public:
|
|||
}
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_imp)(in, result, core);
|
||||
goal_ref_buffer & result) {
|
||||
(*m_imp)(in, result);
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
|
|
|
@ -54,14 +54,11 @@ public:
|
|||
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 operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
void operator()(goal_ref const & g, goal_ref_buffer& result) override {
|
||||
SASSERT(g->is_well_sorted());
|
||||
fail_if_proof_generation("cofactor-term-ite", g);
|
||||
fail_if_unsat_core_generation("cofactor-term-ite", g);
|
||||
tactic_report report("cofactor-term-ite", *g);
|
||||
core = 0;
|
||||
process(*(g.get()));
|
||||
g->inc_depth();
|
||||
result.push_back(g.get());
|
||||
|
|
|
@ -63,8 +63,7 @@ public:
|
|||
|
||||
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) {
|
||||
tactic_report report("collect-statistics", *g);
|
||||
|
||||
collect_proc cp(m, m_stats);
|
||||
|
|
|
@ -621,9 +621,7 @@ void ctx_simplify_tactic::get_param_descrs(param_descrs & r) {
|
|||
}
|
||||
|
||||
void ctx_simplify_tactic::operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
core = 0;
|
||||
goal_ref_buffer & result) {
|
||||
(*m_imp)(*(in.get()));
|
||||
in->inc_depth();
|
||||
result.push_back(in.get());
|
||||
|
|
|
@ -55,8 +55,7 @@ public:
|
|||
virtual void collect_param_descrs(param_descrs & r) { get_param_descrs(r); }
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core);
|
||||
goal_ref_buffer & result);
|
||||
|
||||
virtual void cleanup();
|
||||
};
|
||||
|
|
|
@ -74,9 +74,7 @@ public:
|
|||
}
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
core = 0;
|
||||
goal_ref_buffer & result) {
|
||||
(*m_imp)(*(in.get()));
|
||||
in->inc_depth();
|
||||
result.push_back(in.get());
|
||||
|
|
|
@ -100,14 +100,13 @@ public:
|
|||
}
|
||||
|
||||
virtual void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
goal_ref_buffer & result) {
|
||||
SASSERT(g->is_well_sorted());
|
||||
ast_manager & m = g->m();
|
||||
bool produce_proofs = g->proofs_enabled();
|
||||
rw r(m, produce_proofs);
|
||||
m_rw = &r;
|
||||
core = 0; result.reset();
|
||||
result.reset();
|
||||
tactic_report report("distribute-forall", *g);
|
||||
|
||||
expr_ref new_curr(m);
|
||||
|
|
|
@ -183,17 +183,11 @@ tactic * dom_simplify_tactic::translate(ast_manager & m) {
|
|||
return alloc(dom_simplify_tactic, m, m_simplifier->translate(m), m_params);
|
||||
}
|
||||
|
||||
void dom_simplify_tactic::operator()(
|
||||
goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
core = 0;
|
||||
|
||||
void dom_simplify_tactic::operator()(goal_ref const & in, goal_ref_buffer & result) {
|
||||
tactic_report report("dom-simplify", *in.get());
|
||||
simplify_goal(*(in.get()));
|
||||
in->inc_depth();
|
||||
result.push_back(in.get());
|
||||
|
||||
}
|
||||
|
||||
void dom_simplify_tactic::cleanup() {
|
||||
|
|
|
@ -137,9 +137,7 @@ public:
|
|||
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,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core);
|
||||
void operator()(goal_ref const & in, goal_ref_buffer & result) override;
|
||||
|
||||
virtual void cleanup();
|
||||
};
|
||||
|
|
|
@ -100,10 +100,8 @@ class elim_term_ite_tactic : public tactic {
|
|||
}
|
||||
|
||||
void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
goal_ref_buffer & result) {
|
||||
SASSERT(g->is_well_sorted());
|
||||
core = 0;
|
||||
tactic_report report("elim-term-ite", *g);
|
||||
bool produce_proofs = g->proofs_enabled();
|
||||
m_rw.cfg().m_produce_models = g->models_enabled();
|
||||
|
@ -160,9 +158,8 @@ public:
|
|||
}
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_imp)(in, result, core);
|
||||
goal_ref_buffer & result) {
|
||||
(*m_imp)(in, result);
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
|
|
|
@ -816,9 +816,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
}
|
||||
|
||||
void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
core = 0;
|
||||
goal_ref_buffer & result) {
|
||||
bool produce_models = g->models_enabled();
|
||||
bool produce_proofs = g->proofs_enabled();
|
||||
|
||||
|
@ -929,9 +927,8 @@ public:
|
|||
}
|
||||
|
||||
virtual void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_imp)(g, result, core);
|
||||
goal_ref_buffer & result) {
|
||||
(*m_imp)(g, result);
|
||||
report_tactic_progress(":num-elim-apps", get_num_elim_apps());
|
||||
}
|
||||
|
||||
|
|
|
@ -144,10 +144,8 @@ class injectivity_tactic : public tactic {
|
|||
}
|
||||
|
||||
void operator()(goal_ref const & goal,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
goal_ref_buffer & result) {
|
||||
SASSERT(goal->is_well_sorted());
|
||||
core = 0;
|
||||
tactic_report report("injectivity", *goal);
|
||||
fail_if_unsat_core_generation("injectivity", goal); // TODO: Support UNSAT cores
|
||||
fail_if_proof_generation("injectivity", goal);
|
||||
|
@ -269,9 +267,8 @@ public:
|
|||
}
|
||||
|
||||
virtual void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_finder)(g, result, core);
|
||||
goal_ref_buffer & result) {
|
||||
(*m_finder)(g, result);
|
||||
|
||||
for (unsigned i = 0; i < g->size(); ++i) {
|
||||
expr* curr = g->form(i);
|
||||
|
|
|
@ -54,11 +54,9 @@ public:
|
|||
virtual void collect_param_descrs(param_descrs & r) { nnf::get_param_descrs(r); }
|
||||
|
||||
virtual void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
goal_ref_buffer & result) {
|
||||
TRACE("nnf", tout << "params: " << m_params << "\n"; g->display(tout););
|
||||
SASSERT(g->is_well_sorted());
|
||||
core = 0;
|
||||
tactic_report report("nnf", *g);
|
||||
bool produce_proofs = g->proofs_enabled();
|
||||
|
||||
|
|
|
@ -128,10 +128,8 @@ class occf_tactic : public tactic {
|
|||
}
|
||||
|
||||
void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
goal_ref_buffer & result) {
|
||||
SASSERT(g->is_well_sorted());
|
||||
core = 0;
|
||||
|
||||
fail_if_proof_generation("occf", g);
|
||||
|
||||
|
@ -209,9 +207,8 @@ public:
|
|||
virtual void collect_param_descrs(param_descrs & r) {}
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_imp)(in, result, core);
|
||||
goal_ref_buffer & result) {
|
||||
(*m_imp)(in, result);
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
|
|
|
@ -147,12 +147,10 @@ public:
|
|||
return alloc(pb_preprocess_tactic, m);
|
||||
}
|
||||
|
||||
virtual void operator()(
|
||||
void operator()(
|
||||
goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
goal_ref_buffer & result) override {
|
||||
SASSERT(g->is_well_sorted());
|
||||
core = 0;
|
||||
|
||||
if (g->proofs_enabled()) {
|
||||
throw tactic_exception("pb-preprocess does not support proofs");
|
||||
|
|
|
@ -136,10 +136,8 @@ class propagate_values_tactic : public tactic {
|
|||
}
|
||||
|
||||
void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
goal_ref_buffer & result) {
|
||||
SASSERT(g->is_well_sorted());
|
||||
core = 0;
|
||||
tactic_report report("propagate-values", *g);
|
||||
m_goal = g.get();
|
||||
|
||||
|
@ -238,11 +236,9 @@ public:
|
|||
r.insert("max_rounds", CPK_UINT, "(default: 2) maximum number of rounds.");
|
||||
}
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
void operator()(goal_ref const & in, goal_ref_buffer & result) override {
|
||||
try {
|
||||
(*m_imp)(in, result, core);
|
||||
(*m_imp)(in, result);
|
||||
}
|
||||
catch (rewriter_exception & ex) {
|
||||
throw tactic_exception(ex.msg());
|
||||
|
|
|
@ -73,8 +73,8 @@ public:
|
|||
|
||||
virtual ~reduce_args_tactic();
|
||||
|
||||
virtual void operator()(goal_ref const & g, goal_ref_buffer & result, expr_dependency_ref & core);
|
||||
virtual void cleanup();
|
||||
void operator()(goal_ref const & g, goal_ref_buffer & result) override;
|
||||
void cleanup() override;
|
||||
};
|
||||
|
||||
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,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
goal_ref_buffer & result) {
|
||||
SASSERT(g->is_well_sorted());
|
||||
fail_if_proof_generation("reduce-args", g);
|
||||
fail_if_unsat_core_generation("reduce-args", g);
|
||||
core = 0; result.reset();
|
||||
result.reset();
|
||||
m_imp->operator()(*(g.get()));
|
||||
g->inc_depth();
|
||||
result.push_back(g.get());
|
||||
|
|
|
@ -93,13 +93,11 @@ void simplify_tactic::get_param_descrs(param_descrs & r) {
|
|||
}
|
||||
|
||||
void simplify_tactic::operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
goal_ref_buffer & result) {
|
||||
try {
|
||||
(*m_imp)(*(in.get()));
|
||||
in->inc_depth();
|
||||
result.push_back(in.get());
|
||||
core = 0;
|
||||
}
|
||||
catch (rewriter_exception & ex) {
|
||||
throw tactic_exception(ex.msg());
|
||||
|
|
|
@ -30,19 +30,19 @@ public:
|
|||
simplify_tactic(ast_manager & m, params_ref const & ref = params_ref());
|
||||
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);
|
||||
virtual void collect_param_descrs(param_descrs & r) { get_param_descrs(r); }
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core);
|
||||
void collect_param_descrs(param_descrs & r) override { get_param_descrs(r); }
|
||||
|
||||
virtual void cleanup();
|
||||
void operator()(goal_ref const & in, goal_ref_buffer & result) override;
|
||||
|
||||
void cleanup() override;
|
||||
|
||||
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); }
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -666,11 +666,8 @@ class solve_eqs_tactic : public tactic {
|
|||
return m_num_eliminated_vars;
|
||||
}
|
||||
|
||||
void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
void operator()(goal_ref const & g, goal_ref_buffer & result) {
|
||||
SASSERT(g->is_well_sorted());
|
||||
core = 0;
|
||||
model_converter_ref mc;
|
||||
tactic_report report("solve_eqs", *g);
|
||||
m_produce_models = g->models_enabled();
|
||||
|
@ -732,10 +729,9 @@ public:
|
|||
r.insert("ite_solver", CPK_BOOL, "(default: true) use if-then-else solver.");
|
||||
}
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_imp)(in, result, core);
|
||||
void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result) override {
|
||||
(*m_imp)(in, result);
|
||||
report_tactic_progress(":num-elim-vars", m_imp->get_num_eliminated_vars());
|
||||
}
|
||||
|
||||
|
|
|
@ -101,12 +101,10 @@ public:
|
|||
}
|
||||
|
||||
void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) override {
|
||||
goal_ref_buffer & result) override {
|
||||
SASSERT(in->is_well_sorted());
|
||||
tactic_report report("split-clause", *in);
|
||||
TRACE("before_split_clause", in->display(tout););
|
||||
core = 0;
|
||||
ast_manager & m = in->m();
|
||||
unsigned cls_pos = select_clause(m, in);
|
||||
if (cls_pos == UINT_MAX) {
|
||||
|
@ -129,6 +127,7 @@ public:
|
|||
result.push_back(subgoal_i);
|
||||
}
|
||||
in->set(concat(in->pc(), result.size(), result.c_ptr()));
|
||||
in->add(dependency_converter::concat(result.size(), result.c_ptr()));
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
|
|
|
@ -39,8 +39,7 @@ public:
|
|||
virtual ~symmetry_reduce_tactic();
|
||||
|
||||
virtual void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core);
|
||||
goal_ref_buffer & result);
|
||||
virtual void cleanup();
|
||||
};
|
||||
|
||||
|
@ -633,11 +632,10 @@ symmetry_reduce_tactic::~symmetry_reduce_tactic() {
|
|||
}
|
||||
|
||||
void symmetry_reduce_tactic::operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
goal_ref_buffer & result) {
|
||||
fail_if_proof_generation("symmetry_reduce", g);
|
||||
fail_if_unsat_core_generation("symmetry_reduce", g);
|
||||
core = 0; result.reset();
|
||||
result.reset();
|
||||
(*m_imp)(*(g.get()));
|
||||
g->inc_depth();
|
||||
result.push_back(g.get());
|
||||
|
|
|
@ -799,10 +799,8 @@ class tseitin_cnf_tactic : public tactic {
|
|||
}
|
||||
|
||||
void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
goal_ref_buffer & result) {
|
||||
SASSERT(g->is_well_sorted());
|
||||
core = 0;
|
||||
tactic_report report("tseitin-cnf", *g);
|
||||
fail_if_proof_generation("tseitin-cnf", g);
|
||||
m_produce_models = g->models_enabled();
|
||||
|
@ -880,9 +878,8 @@ public:
|
|||
}
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_imp)(in, result, core);
|
||||
goal_ref_buffer & result) {
|
||||
(*m_imp)(in, result);
|
||||
report_tactic_progress(":cnf-aux-vars", m_imp->m_num_aux_vars);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue