3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-17 08:42:15 +00:00

reworking cancellation

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-12-11 16:21:24 -08:00
parent 981f8226fe
commit baee4225a7
145 changed files with 172 additions and 958 deletions

View file

@ -49,9 +49,6 @@ class bit_blaster_tactic : public tactic {
ast_manager & m() const { return m_rewriter->m(); }
void set_cancel(bool f) {
m_rewriter->set_cancel(f);
}
void operator()(goal_ref const & g,
goal_ref_buffer & result,
@ -163,11 +160,6 @@ public:
return m_imp->get_num_steps();
}
protected:
virtual void set_cancel(bool f) {
if (m_imp)
m_imp->set_cancel(f);
}
};

View file

@ -377,9 +377,6 @@ class bv1_blaster_tactic : public tactic {
ast_manager & m() const { return m_rw.m(); }
void set_cancel(bool f) {
m_rw.set_cancel(f);
}
void operator()(goal_ref const & g,
goal_ref_buffer & result,
@ -478,11 +475,6 @@ public:
return m_imp->get_num_steps();
}
protected:
virtual void set_cancel(bool f) {
if (m_imp)
m_imp->set_cancel(f);
}
};
tactic * mk_bv1_blaster_tactic(ast_manager & m, params_ref const & p) {

View file

@ -43,7 +43,6 @@ public:
virtual void operator()(goal_ref const & g, goal_ref_buffer & result, model_converter_ref & mc, proof_converter_ref & pc, expr_dependency_ref & core);
virtual void cleanup();
virtual void set_cancel(bool f);
};
tactic * mk_bv_size_reduction_tactic(ast_manager & m, params_ref const & p) {
@ -64,13 +63,11 @@ struct bv_size_reduction_tactic::imp {
ref<filter_model_converter> m_fmc;
scoped_ptr<expr_replacer> m_replacer;
bool m_produce_models;
volatile bool m_cancel;
imp(ast_manager & _m):
m(_m),
m_util(m),
m_replacer(mk_default_expr_replacer(m)),
m_cancel(false) {
m_replacer(mk_default_expr_replacer(m)) {
}
void update_signed_lower(app * v, numeral const & k) {
@ -178,7 +175,7 @@ struct bv_size_reduction_tactic::imp {
}
void checkpoint() {
if (m_cancel)
if (m.canceled())
throw tactic_exception(TACTIC_CANCELED_MSG);
}
@ -375,10 +372,6 @@ struct bv_size_reduction_tactic::imp {
TRACE("after_bv_size_reduction", g.display(tout); if (m_mc) m_mc->display(tout););
}
void set_cancel(bool f) {
m_replacer->set_cancel(f);
m_cancel = f;
}
};
bv_size_reduction_tactic::bv_size_reduction_tactic(ast_manager & m) {
@ -404,10 +397,6 @@ void bv_size_reduction_tactic::operator()(goal_ref const & g,
SASSERT(g->is_well_sorted());
}
void bv_size_reduction_tactic::set_cancel(bool f) {
if (m_imp)
m_imp->set_cancel(f);
}
void bv_size_reduction_tactic::cleanup() {
imp * d = alloc(imp, m_imp->m);

View file

@ -34,7 +34,6 @@ class bvarray2uf_tactic : public tactic {
bool m_produce_models;
bool m_produce_proofs;
bool m_produce_cores;
volatile bool m_cancel;
bvarray2uf_rewriter m_rw;
ast_manager & m() { return m_manager; }
@ -44,17 +43,13 @@ class bvarray2uf_tactic : public tactic {
m_produce_models(false),
m_produce_proofs(false),
m_produce_cores(false),
m_cancel(false),
m_rw(m, p) {
updt_params(p);
}
void set_cancel(bool f) {
m_cancel = f;
}
void checkpoint() {
if (m_cancel)
if (m_manager.canceled())
throw tactic_exception(TACTIC_CANCELED_MSG);
}
@ -155,11 +150,6 @@ public:
dealloc(d);
}
virtual void set_cancel(bool f) {
if (m_imp)
m_imp->set_cancel(f);
}
};

View file

@ -229,10 +229,6 @@ class elim_small_bv_tactic : public tactic {
m_rw(m, p) {
}
void set_cancel(bool f) {
m_rw.set_cancel(f);
}
void updt_params(params_ref const & p) {
m_rw.cfg().updt_params(p);
}
@ -318,10 +314,6 @@ public:
dealloc(d);
}
virtual void set_cancel(bool f) {
if (m_imp)
m_imp->set_cancel(f);
}
};
tactic * mk_elim_small_bv_tactic(ast_manager & m, params_ref const & p) {

View file

@ -235,11 +235,7 @@ class max_bv_sharing_tactic : public tactic {
}
ast_manager & m() const { return m_rw.m(); }
void set_cancel(bool f) {
m_rw.set_cancel(f);
}
void operator()(goal_ref const & g,
goal_ref_buffer & result,
model_converter_ref & mc,
@ -318,11 +314,6 @@ public:
}
dealloc(d);
}
virtual void set_cancel(bool f) {
if (m_imp)
m_imp->set_cancel(f);
}
};
tactic * mk_max_bv_sharing_tactic(ast_manager & m, params_ref const & p) {