3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 09:35:32 +00:00

Merge branch 'unstable' of https://git01.codeplex.com/z3 into bvsls

Conflicts:
	src/tactic/sls/sls_tactic.cpp

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2014-09-11 00:19:05 +01:00
commit 3660c617ea
125 changed files with 1759 additions and 657 deletions

View file

@ -73,8 +73,6 @@ public:
void display(std::ostream & out, aig_ref const & r) const;
void display_smt2(std::ostream & out, aig_ref const & r) const;
unsigned get_num_aigs() const;
void cancel() { set_cancel(true); }
void reset_cancel() { set_cancel(false); }
void set_cancel(bool f);
};

View file

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

View file

@ -218,6 +218,7 @@ br_status bv2int_rewriter::mk_mod(expr * s, expr * t, expr_ref & result) {
if (is_bv2int(s, s1) && is_bv2int(t, t1)) {
align_sizes(s1, t1, false);
result = m_bv.mk_bv2int(m_bv.mk_bv_urem(s1, t1));
TRACE("bv2int_rewriter", tout << mk_pp(result,m()) << "\n";);
return BR_DONE;
}
@ -232,6 +233,7 @@ br_status bv2int_rewriter::mk_mod(expr * s, expr * t, expr_ref & result) {
u1 = mk_bv_add(s1, u1, false);
align_sizes(u1, t1, false);
result = m_bv.mk_bv2int(m_bv.mk_bv_urem(u1, t1));
TRACE("bv2int_rewriter", tout << mk_pp(result,m()) << "\n";);
return BR_DONE;
}

View file

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

View file

@ -398,20 +398,13 @@ public:
}
virtual void cleanup() {
unsigned num_conflicts = m_imp->m_num_conflicts;
ast_manager & m = m_imp->m;
imp * d = m_imp;
imp * d = alloc(imp, m_imp->m, m_params);
d->m_num_conflicts = m_imp->m_num_conflicts;
#pragma omp critical (tactic_cancel)
{
d = m_imp;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
m_imp->m_num_conflicts = num_conflicts;
}
protected:

View file

@ -333,18 +333,12 @@ public:
}
virtual void cleanup() {
ast_manager & m = m_imp->m;
imp * d = m_imp;
imp * d = alloc(imp, m_imp->m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}
virtual void set_cancel(bool f) {

View file

@ -338,18 +338,12 @@ public:
}
virtual void cleanup() {
ast_manager & m = m_imp->m;
imp * d = m_imp;
imp * d = alloc(imp, m_imp->m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}
virtual void set_cancel(bool f) {

View file

@ -1682,18 +1682,12 @@ public:
}
virtual void cleanup() {
ast_manager & m = m_imp->m;
imp * d = m_imp;
imp * d = alloc(imp, m_imp->m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}
virtual void operator()(goal_ref const & in,

View file

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

View file

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

View file

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

View file

@ -548,16 +548,10 @@ void propagate_ineqs_tactic::set_cancel(bool f) {
}
void propagate_ineqs_tactic::cleanup() {
ast_manager & m = m_imp->m;
imp * d = m_imp;
imp * d = alloc(imp, m_imp->m, m_params);
#pragma omp critical (tactic_cancel)
{
d = m_imp;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}

View file

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

View file

@ -140,18 +140,12 @@ public:
}
virtual void cleanup() {
ast_manager & m = m_imp->m();
imp * d = m_imp;
imp * d = alloc(imp, m_imp->m(), m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}
unsigned get_num_steps() const {

View file

@ -465,18 +465,12 @@ public:
}
virtual void cleanup() {
ast_manager & m = m_imp->m();
imp * d = m_imp;
imp * d = alloc(imp, m_imp->m(), m_params);
#pragma omp critical (tactic_cancel)
{
d = m_imp;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}
unsigned get_num_steps() const {

View file

@ -392,17 +392,11 @@ void bv_size_reduction_tactic::set_cancel(bool f) {
}
void bv_size_reduction_tactic::cleanup() {
ast_manager & m = m_imp->m;
imp * d = m_imp;
imp * d = alloc(imp, m_imp->m);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}

View file

@ -311,18 +311,12 @@ public:
}
virtual void cleanup() {
ast_manager & m = m_imp->m();
imp * d = m_imp;
imp * d = alloc(imp, m_imp->m(), m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}
virtual void set_cancel(bool f) {

View file

@ -29,14 +29,15 @@ struct cofactor_elim_term_ite::imp {
ast_manager & m;
params_ref m_params;
unsigned long long m_max_memory;
volatile bool m_cancel;
bool m_cofactor_equalities;
volatile bool m_cancel;
void checkpoint() {
cooperate("cofactor ite");
if (memory::get_allocation_size() > m_max_memory)
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
if (m_cancel)
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
throw tactic_exception(TACTIC_CANCELED_MSG);
}
// Collect atoms that contain term if-then-else
@ -111,7 +112,7 @@ struct cofactor_elim_term_ite::imp {
frame & fr = m_frame_stack.back();
expr * t = fr.m_t;
bool form_ctx = fr.m_form_ctx;
TRACE("cofactor_ite_analyzer", tout << "processing, form_ctx: " << form_ctx << "\n" << mk_bounded_pp(t, m) << "\n";);
TRACE("cofactor", tout << "processing, form_ctx: " << form_ctx << "\n" << mk_bounded_pp(t, m) << "\n";);
m_owner.checkpoint();
@ -150,7 +151,7 @@ struct cofactor_elim_term_ite::imp {
}
if (i < num_args) {
m_has_term_ite.mark(t);
TRACE("cofactor_ite_analyzer", tout << "saving candidate: " << form_ctx << "\n" << mk_bounded_pp(t, m) << "\n";);
TRACE("cofactor", tout << "saving candidate: " << form_ctx << "\n" << mk_bounded_pp(t, m) << "\n";);
save_candidate(t, form_ctx);
}
}
@ -167,6 +168,7 @@ struct cofactor_elim_term_ite::imp {
};
expr * get_first(expr * t) {
TRACE("cofactor", tout << mk_ismt2_pp(t, m) << "\n";);
typedef std::pair<expr *, unsigned> frame;
expr_fast_mark1 visited;
sbuffer<frame> stack;
@ -225,6 +227,7 @@ struct cofactor_elim_term_ite::imp {
\brief Fuctor for selecting the term if-then-else condition with the most number of occurrences.
*/
expr * get_best(expr * t) {
TRACE("cofactor", tout << mk_ismt2_pp(t, m) << "\n";);
typedef std::pair<expr *, unsigned> frame;
obj_map<expr, unsigned> occs;
expr_fast_mark1 visited;
@ -299,12 +302,17 @@ struct cofactor_elim_term_ite::imp {
}
}
visited.reset();
CTRACE("cofactor_ite_get_best", best != 0, tout << "best num-occs: " << best_occs << "\n" << mk_ismt2_pp(best, m) << "\n";);
CTRACE("cofactor", best != 0, tout << "best num-occs: " << best_occs << "\n" << mk_ismt2_pp(best, m) << "\n";);
return best;
}
void updt_params(params_ref const & p) {
m_max_memory = megabytes_to_bytes(p.get_uint("max_memory", UINT_MAX));
m_cofactor_equalities = p.get_bool("cofactor_equalities", true);
}
void collect_param_descrs(param_descrs & r) {
r.insert("cofactor_equalities", CPK_BOOL, "(default: true) use equalities to rewrite bodies of ite-expressions. This is potentially expensive.");
}
void set_cancel(bool f) {
@ -354,16 +362,16 @@ struct cofactor_elim_term_ite::imp {
m_term = 0;
expr * lhs;
expr * rhs;
if (m.is_eq(t, lhs, rhs)) {
if (m_owner.m_cofactor_equalities && m.is_eq(t, lhs, rhs)) {
if (m.is_unique_value(lhs)) {
m_term = rhs;
m_value = to_app(lhs);
TRACE("set_cofactor_atom", tout << "term:\n" << mk_ismt2_pp(m_term, m) << "\nvalue: " << mk_ismt2_pp(m_value, m) << "\n";);
TRACE("cofactor", tout << "term:\n" << mk_ismt2_pp(m_term, m) << "\nvalue: " << mk_ismt2_pp(m_value, m) << "\n";);
}
else if (m.is_unique_value(rhs)) {
m_term = lhs;
m_value = to_app(rhs);
TRACE("set_cofactor_atom", tout << "term:\n" << mk_ismt2_pp(m_term, m) << "\nvalue: " << mk_ismt2_pp(m_value, m) << "\n";);
TRACE("cofactor", tout << "term:\n" << mk_ismt2_pp(m_term, m) << "\nvalue: " << mk_ismt2_pp(m_value, m) << "\n";);
}
}
// TODO: bounds
@ -467,7 +475,7 @@ struct cofactor_elim_term_ite::imp {
m_cofactor.set_cofactor_atom(neg_c);
m_cofactor(curr, neg_cofactor);
curr = m.mk_ite(c, pos_cofactor, neg_cofactor);
TRACE("cofactor_ite", tout << "cofactor_ite step: " << step << "\n" << mk_ismt2_pp(curr, m) << "\n";);
TRACE("cofactor", tout << "cofactor_ite step: " << step << "\n" << mk_ismt2_pp(curr, m) << "\n";);
}
}
return false;
@ -522,7 +530,7 @@ struct cofactor_elim_term_ite::imp {
void cofactor(expr * t, expr_ref & r) {
unsigned step = 0;
TRACE("cofactor_ite", tout << "cofactor target:\n" << mk_ismt2_pp(t, m) << "\n";);
TRACE("cofactor", tout << "cofactor target:\n" << mk_ismt2_pp(t, m) << "\n";);
expr_ref curr(m);
curr = t;
while (true) {
@ -543,21 +551,20 @@ struct cofactor_elim_term_ite::imp {
m_cofactor(curr, neg_cofactor);
if (pos_cofactor == neg_cofactor) {
curr = pos_cofactor;
TRACE("cofactor_ite", tout << "cofactor_ite step: " << step << "\n" << mk_ismt2_pp(curr, m) << "\n";);
continue;
}
if (m.is_true(pos_cofactor) && m.is_false(neg_cofactor)) {
else if (m.is_true(pos_cofactor) && m.is_false(neg_cofactor)) {
curr = c;
TRACE("cofactor_ite", tout << "cofactor_ite step: " << step << "\n" << mk_ismt2_pp(curr, m) << "\n";);
continue;
}
if (m.is_false(pos_cofactor) && m.is_true(neg_cofactor)) {
else if (m.is_false(pos_cofactor) && m.is_true(neg_cofactor)) {
curr = neg_c;
TRACE("cofactor_ite", tout << "cofactor_ite step: " << step << "\n" << mk_ismt2_pp(curr, m) << "\n";);
continue;
}
curr = m.mk_ite(c, pos_cofactor, neg_cofactor);
TRACE("cofactor_ite", tout << "cofactor_ite step: " << step << "\n" << mk_ismt2_pp(curr, m) << "\n";);
else {
curr = m.mk_ite(c, pos_cofactor, neg_cofactor);
}
TRACE("cofactor",
tout << "cofactor_ite step: " << step << "\n";
tout << "cofactor: " << mk_ismt2_pp(c, m) << "\n";
tout << mk_ismt2_pp(curr, m) << "\n";);
}
}
@ -570,6 +577,7 @@ struct cofactor_elim_term_ite::imp {
void operator()(expr * t, expr_ref & r) {
ptr_vector<expr> new_args;
SASSERT(m_frames.empty());
m_frames.push_back(frame(t, true));
while (!m_frames.empty()) {
m_owner.checkpoint();
@ -649,7 +657,8 @@ struct cofactor_elim_term_ite::imp {
imp(ast_manager & _m, params_ref const & p):
m(_m),
m_params(p) {
m_params(p),
m_cofactor_equalities(true) {
m_cancel = false;
updt_params(p);
}
@ -674,19 +683,15 @@ cofactor_elim_term_ite::cofactor_elim_term_ite(ast_manager & m, params_ref const
}
cofactor_elim_term_ite::~cofactor_elim_term_ite() {
imp * d = m_imp;
#pragma omp critical (cofactor_elim_term_ite)
{
m_imp = 0;
}
dealloc(d);
dealloc(m_imp);
}
void cofactor_elim_term_ite::updt_params(params_ref const & p) {
m_imp->updt_params(p);
}
void cofactor_elim_term_ite::get_param_descrs(param_descrs & r) {
void cofactor_elim_term_ite::collect_param_descrs(param_descrs & r) {
m_imp->collect_param_descrs(r);
}
void cofactor_elim_term_ite::operator()(expr * t, expr_ref & r) {
@ -694,19 +699,17 @@ void cofactor_elim_term_ite::operator()(expr * t, expr_ref & r) {
}
void cofactor_elim_term_ite::set_cancel(bool f) {
#pragma omp critical (cofactor_elim_term_ite)
{
if (m_imp)
m_imp->set_cancel(f);
}
if (m_imp)
m_imp->set_cancel(f);
}
void cofactor_elim_term_ite::cleanup() {
ast_manager & m = m_imp->m;
#pragma omp critical (cofactor_elim_term_ite)
ast_manager & m = m_imp->m;
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
dealloc(m_imp);
m_imp = alloc(imp, m, m_params);
std::swap(d, m_imp);
}
dealloc(d);
}

View file

@ -31,14 +31,15 @@ public:
virtual ~cofactor_elim_term_ite();
void updt_params(params_ref const & p);
static void get_param_descrs(param_descrs & r);
void collect_param_descrs(param_descrs & r);
void operator()(expr * t, expr_ref & r);
void cancel() { set_cancel(true); }
void reset_cancel() { set_cancel(false); }
void set_cancel(bool f);
void cleanup();
void set_cancel(bool f);
};
#endif

View file

@ -52,8 +52,7 @@ public:
virtual ~cofactor_term_ite_tactic() {}
virtual void updt_params(params_ref const & p) { m_params = p; m_elim_ite.updt_params(p); }
static void get_param_descrs(param_descrs & r) { cofactor_elim_term_ite::get_param_descrs(r); }
virtual void collect_param_descrs(param_descrs & r) { get_param_descrs(r); }
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,

View file

@ -548,16 +548,11 @@ void ctx_simplify_tactic::set_cancel(bool f) {
void ctx_simplify_tactic::cleanup() {
ast_manager & m = m_imp->m;
imp * d = m_imp;
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}

View file

@ -90,17 +90,12 @@ public:
virtual void cleanup() {
ast_manager & m = m_imp->m();
imp * d = m_imp;
imp * d = alloc(imp, m);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}
virtual void set_cancel(bool f) {

View file

@ -174,17 +174,12 @@ public:
virtual void cleanup() {
ast_manager & m = m_imp->m;
imp * d = m_imp;
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}
virtual void set_cancel(bool f) {

View file

@ -1036,18 +1036,13 @@ public:
virtual void cleanup() {
unsigned num_elim_apps = get_num_elim_apps();
ast_manager & m = m_imp->m_manager;
imp * d = m_imp;
ast_manager & m = m_imp->m_manager;
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
m_imp->m_num_elim_apps = num_elim_apps;
}

View file

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

View file

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

View file

@ -541,17 +541,12 @@ void reduce_args_tactic::set_cancel(bool f) {
}
void reduce_args_tactic::cleanup() {
ast_manager & m = m_imp->m();
imp * d = m_imp;
ast_manager & m = m_imp->m();
imp * d = alloc(imp, m);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}

View file

@ -115,17 +115,12 @@ void simplify_tactic::set_cancel(bool f) {
void simplify_tactic::cleanup() {
ast_manager & m = m_imp->m();
imp * d = m_imp;
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}
unsigned simplify_tactic::get_num_steps() const {

View file

@ -43,9 +43,11 @@ public:
virtual void cleanup();
unsigned get_num_steps() const;
virtual void set_cancel(bool f);
virtual tactic * translate(ast_manager & m) { return alloc(simplify_tactic, m, m_params); }
protected:
virtual void set_cancel(bool f);
};
tactic * mk_simplify_tactic(ast_manager & m, params_ref const & p = params_ref());

View file

@ -749,23 +749,19 @@ public:
virtual void cleanup() {
unsigned num_elim_vars = m_imp->m_num_eliminated_vars;
ast_manager & m = m_imp->m();
imp * d = m_imp;
expr_replacer * r = m_imp->m_r;
if (r)
r->set_substitution(0);
bool owner = m_imp->m_r_owner;
m_imp->m_r_owner = false; // stole replacer
imp * d = alloc(imp, m, m_params, r, owner);
d->m_num_eliminated_vars = num_elim_vars;
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params, r, owner);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
m_imp->m_num_eliminated_vars = num_elim_vars;
}
virtual void collect_statistics(statistics & st) const {

View file

@ -898,20 +898,14 @@ public:
}
virtual void cleanup() {
unsigned num_aux_vars = m_imp->m_num_aux_vars;
ast_manager & m = m_imp->m;
imp * d = m_imp;
imp * d = alloc(imp, m, m_params);
d->m_num_aux_vars = m_imp->m_num_aux_vars;
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
m_imp->m_num_aux_vars = num_aux_vars;
}
virtual void set_cancel(bool f) {

View file

@ -43,6 +43,7 @@ void filter_model_converter::operator()(model_ref & old_model, unsigned goal_idx
if (fs.is_marked(f))
continue;
func_interp * fi = old_model->get_func_interp(f);
SASSERT(fi);
new_model->register_decl(f, fi->copy());
}
new_model->copy_usort_interps(*old_model);

View file

@ -138,19 +138,13 @@ public:
(*m_imp)(in, result, mc, pc, core);
}
virtual void cleanup() {
ast_manager & m = m_imp->m;
imp * d = m_imp;
virtual void cleanup() {
imp * d = alloc(imp, m_imp->m, m_params);
#pragma omp critical (tactic_cancel)
{
d = m_imp;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}
protected:

View file

@ -79,17 +79,12 @@ public:
}
virtual void cleanup() {
sls_engine * d = m_engine;
imp * d = alloc(imp, m, m_params, m_stats);
#pragma omp critical (tactic_cancel)
{
d = m_engine;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(sls_engine, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_engine = d;
}
}
virtual void collect_statistics(statistics & st) const {

View file

@ -47,7 +47,6 @@ public:
void cancel();
void reset_cancel();
virtual void set_cancel(bool f) {}
/**
\brief Apply tactic to goal \c in.
@ -96,6 +95,13 @@ public:
// translate tactic to the given manager
virtual tactic * translate(ast_manager & m) = 0;
private:
friend class nary_tactical;
friend class binary_tactical;
friend class unary_tactical;
virtual void set_cancel(bool f) {}
};
typedef ref<tactic> tactic_ref;

View file

@ -102,11 +102,8 @@ protected:
\brief Reset cancel flag of t if this was not canceled.
*/
void parent_reset_cancel(tactic & t) {
#pragma omp critical (tactic_cancel)
{
if (!m_cancel) {
t.set_cancel(false);
}
if (!m_cancel) {
t.reset_cancel();
}
}
@ -393,11 +390,8 @@ protected:
\brief Reset cancel flag of st if this was not canceled.
*/
void parent_reset_cancel(tactic & t) {
#pragma omp critical (tactic_cancel)
{
if (!m_cancel) {
t.set_cancel(false);
}
if (!m_cancel) {
t.reset_cancel();
}
}
@ -988,7 +982,7 @@ protected:
virtual void set_cancel(bool f) {
m_cancel = f;
if (m_t)
m_t->set_cancel(f);
m_t->set_cancel(f);
}
template<typename T>

View file

@ -144,17 +144,12 @@ public:
virtual void cleanup() {
ast_manager & m = m_imp->m();
imp * d = m_imp;
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}
virtual void set_cancel(bool f) {

View file

@ -151,17 +151,12 @@ public:
virtual void cleanup() {
ast_manager & m = m_imp->m();
imp * d = m_imp;
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}
virtual void set_cancel(bool f) {

View file

@ -119,17 +119,12 @@ public:
virtual void cleanup() {
ast_manager & m = m_imp->m();
imp * d = m_imp;
imp * d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = 0;
std::swap(d, m_imp);
}
dealloc(d);
d = alloc(imp, m, m_params);
#pragma omp critical (tactic_cancel)
{
m_imp = d;
}
}
virtual void set_cancel(bool f) {