3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-18 09:12:16 +00:00

add tactic name

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-12-07 13:37:57 -08:00
parent e3bd5badf2
commit 9f2b18cac5
73 changed files with 218 additions and 63 deletions

View file

@ -100,6 +100,8 @@ class and_then_tactical : public binary_tactical {
public:
and_then_tactical(tactic * t1, tactic * t2):binary_tactical(t1, t2) {}
char const* name() const override { return "and_then"; }
void operator()(goal_ref const & in, goal_ref_buffer& result) override {
bool proofs_enabled = in->proofs_enabled();
@ -313,6 +315,8 @@ class or_else_tactical : public nary_tactical {
public:
or_else_tactical(unsigned num, tactic * const * ts):nary_tactical(num, ts) { SASSERT(num > 0); }
char const* name() const override { return "or_else"; }
void operator()(goal_ref const & in, goal_ref_buffer& result) override {
goal orig(*(in.get()));
unsigned sz = m_ts.size();
@ -414,6 +418,8 @@ public:
error_code = 0;
}
char const* name() const override { return "par"; }
void operator()(goal_ref const & in, goal_ref_buffer& result) override {
bool use_seq;
use_seq = false;
@ -550,6 +556,8 @@ class par_and_then_tactical : public and_then_tactical {
public:
par_and_then_tactical(tactic * t1, tactic * t2):and_then_tactical(t1, t2) {}
char const* name() const override { return "par_then"; }
void operator()(goal_ref const & in, goal_ref_buffer& result) override {
bool use_seq;
use_seq = false;
@ -915,6 +923,8 @@ public:
unary_tactical(t),
m_max_depth(max_depth) {
}
char const* name() const override { return "repeat"; }
void operator()(goal_ref const & in, goal_ref_buffer& result) override {
operator()(0, in, result);
@ -935,6 +945,8 @@ class fail_if_branching_tactical : public unary_tactical {
public:
fail_if_branching_tactical(tactic * t, unsigned threshold):unary_tactical(t), m_threshold(threshold) {}
char const* name() const override { return "fail_if_branching"; }
void operator()(goal_ref const & in, goal_ref_buffer& result) override {
m_t->operator()(in, result);
if (result.size() > m_threshold) {
@ -957,6 +969,8 @@ class cleanup_tactical : public unary_tactical {
public:
cleanup_tactical(tactic * t):unary_tactical(t) {}
char const* name() const override { return "cleanup"; }
void operator()(goal_ref const & in, goal_ref_buffer& result) override {
m_t->operator()(in, result);
m_t->cleanup();
@ -976,6 +990,8 @@ class try_for_tactical : public unary_tactical {
unsigned m_timeout;
public:
try_for_tactical(tactic * t, unsigned ts):unary_tactical(t), m_timeout(ts) {}
char const* name() const override { return "try_for"; }
void operator()(goal_ref const & in, goal_ref_buffer& result) override {
cancel_eh<reslimit> eh(in->m().limit());
@ -1003,6 +1019,8 @@ public:
t->updt_params(p);
}
char const* name() const override { return "using_params"; }
void updt_params(params_ref const & p) override {
TRACE("using_params",
tout << "before p: " << p << "\n";
@ -1052,6 +1070,8 @@ public:
tactic * new_t = m_t->translate(m);
return alloc(annotate_tactical, m_name.c_str(), new_t);
}
char const* name() const override { return "annotate"; }
};
@ -1067,6 +1087,8 @@ public:
m_p(p) {
SASSERT(m_p);
}
char const* name() const override { return "cond"; }
void operator()(goal_ref const & in, goal_ref_buffer & result) override {
if (m_p->operator()(*(in.get())).is_true())
@ -1098,6 +1120,8 @@ public:
SASSERT(m_p);
}
char const* name() const override { return "fail_if"; }
void cleanup() override {}
void operator()(goal_ref const & in, goal_ref_buffer& result) override {
@ -1123,6 +1147,8 @@ tactic * fail_if_not(probe * p) {
class if_no_proofs_tactical : public unary_tactical {
public:
if_no_proofs_tactical(tactic * t):unary_tactical(t) {}
char const* name() const override { return "if_no_proofs"; }
void operator()(goal_ref const & in, goal_ref_buffer & result) override {
if (in->proofs_enabled()) {
@ -1139,6 +1165,8 @@ public:
class if_no_unsat_cores_tactical : public unary_tactical {
public:
if_no_unsat_cores_tactical(tactic * t):unary_tactical(t) {}
char const* name() const override { return "if_no_unsat_cores"; }
void operator()(goal_ref const & in, goal_ref_buffer& result) override {
if (in->unsat_core_enabled()) {
@ -1155,6 +1183,8 @@ public:
class if_no_models_tactical : public unary_tactical {
public:
if_no_models_tactical(tactic * t):unary_tactical(t) {}
char const* name() const override { return "if_no_models"; }
void operator()(goal_ref const & in, goal_ref_buffer& result) override {
if (in->models_enabled()) {