3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-08 00:05:46 +00:00

cleanup deprecated critical sections, fix cancellation for par_or_else tactic

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-12-12 09:43:00 -08:00
parent c97db1722d
commit 2a051719d8
50 changed files with 105 additions and 276 deletions

View file

@ -461,10 +461,21 @@ enum par_exception_kind {
};
class par_tactical : public or_else_tactical {
struct scoped_limits {
reslimit& m_limit;
unsigned m_sz;
scoped_limits(reslimit& lim): m_limit(lim), m_sz(0) {}
~scoped_limits() { for (unsigned i = 0; i < m_sz; ++i) m_limit.pop_child(); }
void push_child(reslimit* lim) { m_limit.push_child(lim); ++m_sz; }
};
public:
par_tactical(unsigned num, tactic * const * ts):or_else_tactical(num, ts) {}
virtual ~par_tactical() {}
virtual void operator()(goal_ref const & in,
goal_ref_buffer & result,
model_converter_ref & mc,
@ -485,6 +496,7 @@ public:
ast_manager & m = in->m();
scoped_ptr_vector<ast_manager> managers;
scoped_limits scl(m.limit());
goal_ref_vector in_copies;
tactic_ref_vector ts;
unsigned sz = m_ts.size();
@ -494,6 +506,7 @@ public:
ast_translation translator(m, *new_m);
in_copies.push_back(in->translate(translator));
ts.push_back(m_ts.get(i)->translate(*new_m));
scl.push_child(&new_m->limit());
}
unsigned finished_id = UINT_MAX;