3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 10:55:50 +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

@ -183,16 +183,11 @@ public:
virtual void cleanup() {
ast_manager & m = m_imp->m;
imp * d = m_imp;
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
}
m_imp = 0;
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
m_imp = d;
}
static void blast_term_ite(expr_ref& fml) {

View file

@ -697,10 +697,7 @@ void cofactor_elim_term_ite::operator()(expr * t, expr_ref & r) {
void cofactor_elim_term_ite::cleanup() {
ast_manager & m = m_imp->m;
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
std::swap(d, m_imp);
}
std::swap(d, m_imp);
dealloc(d);
}

View file

@ -540,10 +540,7 @@ void ctx_simplify_tactic::operator()(goal_ref const & in,
void ctx_simplify_tactic::cleanup() {
ast_manager & m = m_imp->m;
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
std::swap(d, m_imp);
}
std::swap(d, m_imp);
dealloc(d);
}

View file

@ -87,10 +87,7 @@ public:
virtual void cleanup() {
ast_manager & m = m_imp->m();
imp * d = alloc(imp, m);
#pragma omp critical (tactic_cancel)
{
std::swap(d, m_imp);
}
std::swap(d, m_imp);
dealloc(d);
}

View file

@ -108,10 +108,7 @@ public:
ast_manager & m = g->m();
bool produce_proofs = g->proofs_enabled();
rw r(m, produce_proofs);
#pragma omp critical (tactic_cancel)
{
m_rw = &r;
}
m_rw = &r;
mc = 0; pc = 0; core = 0; result.reset();
tactic_report report("distribute-forall", *g);
@ -134,10 +131,7 @@ public:
result.push_back(g.get());
TRACE("distribute-forall", g->display(tout););
SASSERT(g->is_well_sorted());
#pragma omp critical (tactic_cancel)
{
m_rw = 0;
}
m_rw = 0;
}
virtual void cleanup() {}

View file

@ -172,10 +172,7 @@ public:
virtual void cleanup() {
ast_manager & m = m_imp->m;
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
std::swap(d, m_imp);
}
std::swap(d, m_imp);
dealloc(d);
}

View file

@ -895,10 +895,7 @@ class elim_uncnstr_tactic : public tactic {
}
void init_rw(bool produce_proofs) {
#pragma omp critical (tactic_cancel)
{
m_rw = alloc(rw, m(), produce_proofs, m_vars, m_mc.get(), m_max_memory, m_max_steps);
}
m_rw = alloc(rw, m(), produce_proofs, m_vars, m_mc.get(), m_max_memory, m_max_steps);
}
virtual void operator()(goal_ref const & g,
@ -968,10 +965,7 @@ class elim_uncnstr_tactic : public tactic {
}
}
m_mc = 0;
#pragma omp critical (tactic_cancel)
{
m_rw = 0;
}
m_rw = 0;
TRACE("elim_uncnstr", if (mc) mc->display(tout););
result.push_back(g.get());
g->inc_depth();
@ -1034,10 +1028,7 @@ public:
unsigned num_elim_apps = get_num_elim_apps();
ast_manager & m = m_imp->m_manager;
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
std::swap(d, m_imp);
}
std::swap(d, m_imp);
dealloc(d);
m_imp->m_num_elim_apps = num_elim_apps;
}

View file

@ -29,17 +29,11 @@ class nnf_tactic : public tactic {
set_nnf(nnf_tactic & owner, nnf & n):
m_owner(owner) {
#pragma omp critical (nnf_tactic)
{
m_owner.m_nnf = &n;
}
m_owner.m_nnf = &n;
}
~set_nnf() {
#pragma omp critical (nnf_tactic)
{
m_owner.m_nnf = 0;
}
m_owner.m_nnf = 0;
}
};
public:

View file

@ -220,10 +220,7 @@ public:
virtual void cleanup() {
imp * d = alloc(imp, m_imp->m);
#pragma omp critical (tactic_cancel)
{
std::swap(d, m_imp);
}
std::swap(d, m_imp);
dealloc(d);
}

View file

@ -257,10 +257,7 @@ public:
virtual void cleanup() {
ast_manager & m = m_imp->m();
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
std::swap(d, m_imp);
}
std::swap(d, m_imp);
dealloc(d);
}

View file

@ -532,10 +532,7 @@ void reduce_args_tactic::operator()(goal_ref const & g,
void reduce_args_tactic::cleanup() {
ast_manager & m = m_imp->m();
imp * d = alloc(imp, m);
#pragma omp critical (tactic_cancel)
{
std::swap(d, m_imp);
}
std::swap(d, m_imp);
dealloc(d);
}

View file

@ -112,10 +112,7 @@ void simplify_tactic::operator()(goal_ref const & in,
void simplify_tactic::cleanup() {
ast_manager & m = m_imp->m();
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
std::swap(d, m_imp);
}
std::swap(d, m_imp);
dealloc(d);
}

View file

@ -751,10 +751,7 @@ public:
imp * d = alloc(imp, m, m_params, r, owner);
d->m_num_eliminated_vars = num_elim_vars;
#pragma omp critical (tactic_cancel)
{
std::swap(d, m_imp);
}
std::swap(d, m_imp);
dealloc(d);
}

View file

@ -896,10 +896,7 @@ public:
ast_manager & m = m_imp->m;
imp * d = alloc(imp, m, m_params);
d->m_num_aux_vars = m_imp->m_num_aux_vars;
#pragma omp critical (tactic_cancel)
{
std::swap(d, m_imp);
}
std::swap(d, m_imp);
dealloc(d);
}