3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-07 18:05:21 +00:00

remove cooperate

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-06-12 20:15:46 -07:00
parent 42ac3a5363
commit e0d8cefde4
52 changed files with 0 additions and 204 deletions

View file

@ -20,7 +20,6 @@
#include "ackermannization/ackr_info.h"
#include "ackermannization/ackr_helper.h"
#include "ast/rewriter/th_rewriter.h"
#include "util/cooperate.h"
#include "ast/bv_decl_plugin.h"
#include "util/lbool.h"
#include "model/model.h"
@ -75,7 +74,6 @@ class lackr {
if (m_m.canceled()) {
throw tactic_exception(TACTIC_CANCELED_MSG);
}
cooperate("lackr");
}
private:
typedef ackr_helper::fun2terms_map fun2terms_map;

View file

@ -22,7 +22,6 @@ Notes:
#include "ast/arith_decl_plugin.h"
#include "ast/ast_smt2_pp.h"
#include "util/z3_exception.h"
#include "util/cooperate.h"
#include "util/common_msgs.h"
struct expr2polynomial::imp {
@ -96,7 +95,6 @@ struct expr2polynomial::imp {
void checkpoint() {
if (m_cancel)
throw default_exception(Z3_CANCELED_MSG);
cooperate("expr2polynomial");
}
void throw_not_polynomial() {

View file

@ -20,7 +20,6 @@ Notes:
#include "ast/rewriter/rewriter_def.h"
#include "ast/fpa/fpa2bv_rewriter.h"
#include "util/cooperate.h"
#include "ast/fpa/fpa2bv_rewriter_params.hpp"
@ -50,7 +49,6 @@ void fpa2bv_rewriter_cfg::updt_params(params_ref const & p) {
}
bool fpa2bv_rewriter_cfg::max_steps_exceeded(unsigned num_steps) const {
cooperate("fpa2bv");
return num_steps > m_max_steps;
}

View file

@ -19,7 +19,6 @@ Notes:
--*/
#include "util/warning.h"
#include "util/cooperate.h"
#include "ast/normal_forms/nnf.h"
#include "ast/normal_forms/nnf_params.hpp"
#include "ast/used_vars.h"
@ -380,7 +379,6 @@ struct nnf::imp {
void checkpoint() {
cooperate("nnf");
if (memory::get_allocation_size() > m_max_memory)
throw nnf_exception(Z3_MAX_MEMORY_MSG);
if (m.canceled())

View file

@ -142,7 +142,6 @@ struct blaster_rewriter_cfg : public default_rewriter_cfg {
bool rewrite_patterns() const { return true; }
bool max_steps_exceeded(unsigned num_steps) const {
cooperate("bit blaster");
if (memory::get_allocation_size() > m_max_memory)
throw rewriter_exception(Z3_MAX_MEMORY_MSG);
return num_steps > m_max_steps;

View file

@ -19,7 +19,6 @@ Revision History:
#include "ast/rewriter/bit_blaster/bit_blaster_tpl.h"
#include "util/rational.h"
#include "ast/ast_pp.h"
#include "util/cooperate.h"
#include "util/common_msgs.h"
#include "ast/rewriter/rewriter_types.h"
@ -30,7 +29,6 @@ void bit_blaster_tpl<Cfg>::checkpoint() {
throw rewriter_exception(Z3_MAX_MEMORY_MSG);
if (m().canceled())
throw rewriter_exception(m().limit().get_cancel_msg());
cooperate("bit-blaster");
}
/**

View file

@ -19,7 +19,6 @@ Notes:
#include "ast/rewriter/expr_replacer.h"
#include "ast/rewriter/rewriter_def.h"
#include "ast/rewriter/th_rewriter.h"
#include "util/cooperate.h"
void expr_replacer::operator()(expr * t, expr_ref & result, proof_ref & result_pr) {
expr_dependency_ref result_dep(m());
@ -74,7 +73,6 @@ struct default_expr_replacer_cfg : public default_rewriter_cfg {
}
bool max_steps_exceeded(unsigned num_steps) const {
cooperate("simplifier");
return false;
}
};

View file

@ -16,7 +16,6 @@ Author:
Notes:
--*/
#include "util/cooperate.h"
#include "ast/rewriter/th_rewriter.h"
#include "ast/rewriter/rewriter_params.hpp"
#include "ast/rewriter/bool_rewriter.h"
@ -108,7 +107,6 @@ struct th_rewriter_cfg : public default_rewriter_cfg {
bool cache_all_results() const { return m_cache_all; }
bool max_steps_exceeded(unsigned num_steps) const {
cooperate("simplifier");
if (memory::get_allocation_size() > m_max_memory)
throw rewriter_exception(Z3_MAX_MEMORY_MSG);
return num_steps > m_max_steps;

View file

@ -23,7 +23,6 @@ Revision History:
#include "util/debug.h"
#include "util/trace.h"
#include "util/scoped_numeral.h"
#include "util/cooperate.h"
#include "util/common_msgs.h"
#define DEFAULT_PI_PRECISION 2
@ -65,7 +64,6 @@ template<typename C>
void interval_manager<C>::checkpoint() {
if (!m_limit.inc())
throw default_exception(Z3_CANCELED_MSG);
cooperate("interval");
}
/*

View file

@ -20,7 +20,6 @@ Notes:
#include "math/polynomial/upolynomial.h"
#include "util/mpbq.h"
#include "util/basic_interval.h"
#include "util/cooperate.h"
#include "math/polynomial/sexpr2upolynomial.h"
#include "util/scoped_ptr_vector.h"
#include "util/mpbqi.h"
@ -128,7 +127,6 @@ namespace algebraic_numbers {
void checkpoint() {
if (!m_limit.inc())
throw algebraic_exception(Z3_CANCELED_MSG);
cooperate("algebraic");
}
void reset_statistics() {

View file

@ -23,7 +23,6 @@ Notes:
#include "util/id_gen.h"
#include "util/buffer.h"
#include "util/scoped_ptr_vector.h"
#include "util/cooperate.h"
#include "math/polynomial/upolynomial_factorization.h"
#include "math/polynomial/polynomial_primes.h"
#include "util/permutation.h"
@ -2372,7 +2371,6 @@ namespace polynomial {
if (!m_limit.inc()) {
throw polynomial_exception(Z3_CANCELED_MSG);
}
cooperate("polynomial");
}
mpzzp_manager & m() const { return const_cast<imp*>(this)->m_manager; }

View file

@ -25,7 +25,6 @@ Notes:
#include "math/polynomial/upolynomial_factorization.h"
#include "math/polynomial/polynomial_primes.h"
#include "util/buffer.h"
#include "util/cooperate.h"
#include "util/common_msgs.h"
namespace upolynomial {
@ -157,7 +156,6 @@ namespace upolynomial {
void core_manager::checkpoint() {
if (!m_limit.inc())
throw upolynomial_exception(Z3_CANCELED_MSG);
cooperate("upolynomial");
}
// Eliminate leading zeros from buffer.

View file

@ -28,7 +28,6 @@ Notes:
#include "util/obj_ref.h"
#include "util/ref_vector.h"
#include "util/ref_buffer.h"
#include "util/cooperate.h"
#include "util/common_msgs.h"
#ifndef REALCLOSURE_INI_BUFFER_SIZE
@ -550,7 +549,6 @@ namespace realclosure {
void checkpoint() {
if (!m_limit.inc())
throw exception(Z3_CANCELED_MSG);
cooperate("rcf");
}
value * one() const {

View file

@ -19,7 +19,6 @@ Revision History:
#include "math/subpaving/subpaving_t.h"
#include "math/interval/interval_def.h"
#include "util/buffer.h"
#include "util/cooperate.h"
#include "util/z3_exception.h"
#include "util/common_msgs.h"
@ -463,7 +462,6 @@ void context_t<C>::checkpoint() {
throw default_exception(Z3_CANCELED_MSG);
if (memory::get_allocation_size() > m_max_memory)
throw default_exception(Z3_MAX_MEMORY_MSG);
cooperate("subpaving");
}
template<typename C>

View file

@ -21,7 +21,6 @@ Notes:
#include "ast/expr2var.h"
#include "util/ref_util.h"
#include "util/z3_exception.h"
#include "util/cooperate.h"
#include "ast/arith_decl_plugin.h"
#include "util/scoped_numeral_buffer.h"
#include "util/common_msgs.h"
@ -96,7 +95,6 @@ struct expr2subpaving::imp {
void checkpoint() {
if (m().canceled())
throw default_exception(Z3_CANCELED_MSG);
cooperate("expr2subpaving");
}
subpaving::var mk_var_for(expr * t) {

View file

@ -16,7 +16,6 @@ Author:
Revision History:
--*/
#include "util/cooperate.h"
#include "model/model.h"
#include "model/model_evaluator_params.hpp"
#include "model/model_evaluator.h"
@ -342,7 +341,6 @@ struct evaluator_cfg : public default_rewriter_cfg {
bool max_steps_exceeded(unsigned num_steps) const {
cooperate("model evaluator");
if (memory::get_allocation_size() > m_max_memory)
throw rewriter_exception(Z3_MAX_MEMORY_MSG);
return num_steps > m_max_steps;

View file

@ -50,7 +50,6 @@ Notes:
#include "ast/rewriter/var_subst.h"
#include "ast/normal_forms/name_exprs.h"
#include "ast/act_cache.h"
#include "util/cooperate.h"
#include "ast/ast_pp.h"
#include "ast/rewriter/quant_hoist.h"
#include "ast/ast_util.h"

View file

@ -25,7 +25,6 @@ Revision History:
#include"ast/rewriter/datatype_rewriter.h"
#include"ast/rewriter/array_rewriter.h"
#include"ast/rewriter/rewriter_def.h"
#include"util/cooperate.h"
#include"ast/ast_pp.h"
#include"model/func_interp.h"

View file

@ -41,7 +41,6 @@ Revision History:
#include "model/model_evaluator.h"
#include "ast/has_free_vars.h"
#include "ast/rewriter/rewriter_def.h"
#include "util/cooperate.h"
#include "tactic/tactical.h"
#include "model/model_v2_pp.h"
#include "util/obj_hashtable.h"
@ -2048,7 +2047,6 @@ namespace qe {
void checkpoint() {
if (m.canceled())
throw tactic_exception(m.limit().get_cancel_msg());
cooperate("qe");
}

View file

@ -32,7 +32,6 @@ Revision History:
#include "ast/rewriter/th_rewriter.h"
#include "ast/for_each_expr.h"
#include "ast/rewriter/expr_safe_replace.h"
#include "util/cooperate.h"
#include "ast/datatype_decl_plugin.h"
#include "qe/qe_vartest.h"
@ -687,7 +686,6 @@ namespace eq {
}
void checkpoint() {
cooperate("der");
if (m.canceled())
throw tactic_exception(m.limit().get_cancel_msg());
}
@ -878,7 +876,6 @@ namespace ar {
}
void checkpoint() {
cooperate("der");
if (m.canceled())
throw tactic_exception(m.limit().get_cancel_msg());
}
@ -2154,7 +2151,6 @@ namespace fm {
}
void checkpoint() {
cooperate("fm");
if (m.canceled())
throw tactic_exception(m.limit().get_cancel_msg());
}
@ -2428,7 +2424,6 @@ class qe_lite_tactic : public tactic {
void checkpoint() {
if (m.canceled())
throw tactic_exception(m.limit().get_cancel_msg());
cooperate("qe-lite");
}
void debug_diff(expr* a, expr* b) {

View file

@ -25,7 +25,6 @@ Revision History:
#include "ast/ast_pp.h"
#include "smt/smt_kernel.h"
#include "qe/qe.h"
#include "util/cooperate.h"
#include "model/model_v2_pp.h"
#include "ast/rewriter/expr_replacer.h"
#include "ast/rewriter/th_rewriter.h"
@ -657,7 +656,6 @@ namespace qe {
if (m.canceled()) {
throw tactic_exception(m.limit().get_cancel_msg());
}
cooperate("qe-sat");
}
void check_success(bool ok) {

View file

@ -17,7 +17,6 @@ Revision History:
--*/
#include "tactic/tactical.h"
#include "util/cooperate.h"
#include "qe/qe.h"
class qe_tactic : public tactic {
@ -46,7 +45,6 @@ class qe_tactic : public tactic {
void checkpoint() {
if (m.canceled())
throw tactic_exception(m.limit().get_cancel_msg());
cooperate("qe");
}
void operator()(goal_ref const & g,

View file

@ -27,7 +27,6 @@ Notes:
--*/
#include "util/ref_util.h"
#include "util/cooperate.h"
#include "ast/ast_smt2_pp.h"
#include "ast/ast_pp.h"
#include "ast/pb_decl_plugin.h"
@ -749,7 +748,6 @@ struct goal2sat::imp {
}
while (!m_frame_stack.empty()) {
loop:
cooperate("goal2sat");
if (m.canceled())
throw tactic_exception(m.limit().get_cancel_msg());
if (memory::get_allocation_size() > m_max_memory)

View file

@ -16,7 +16,6 @@ Author:
Revision History:
--*/
#include "util/cooperate.h"
#include "util/backtrackable_set.h"
#include "ast/ast_util.h"
#include "ast/macros/macro_util.h"
@ -3179,7 +3178,6 @@ namespace smt {
}
void model_finder::checkpoint(char const* msg) {
cooperate(msg);
if (m_context && m_context->get_cancel_flag())
throw tactic_exception(m_context->get_manager().limit().get_cancel_msg());
}

View file

@ -49,7 +49,6 @@ Revision History:
#include "ast/ast.h"
#include "ast/func_decl_dependencies.h"
#include "smt/proto_model/proto_model.h"
#include "util/cooperate.h"
#include "tactic/tactic_exception.h"
namespace smt {

View file

@ -19,7 +19,6 @@ Notes:
#include "tactic/aig/aig.h"
#include "tactic/goal.h"
#include "ast/ast_smt2_pp.h"
#include "util/cooperate.h"
#define USE_TWO_LEVEL_RULES
#define FIRST_NODE_ID (UINT_MAX/2)
@ -129,7 +128,6 @@ struct aig_manager::imp {
throw aig_exception(TACTIC_MAX_MEMORY_MSG);
if (m().canceled())
throw aig_exception(m().limit().get_cancel_msg());
cooperate("aig");
}
void dec_ref_core(aig_lit const & r) { dec_ref_core(r.ptr()); }

View file

@ -17,7 +17,6 @@ Notes:
--*/
#include "tactic/tactical.h"
#include "util/cooperate.h"
#include "ast/ast_smt2_pp.h"
#include "tactic/arith/card2bv_tactic.h"
#include "ast/rewriter/pb2bv_rewriter.h"

View file

@ -21,7 +21,6 @@ Revision History:
--*/
#include "tactic/tactical.h"
#include "tactic/generic_model_converter.h"
#include "util/cooperate.h"
#include "ast/arith_decl_plugin.h"
#include "tactic/core/simplify_tactic.h"
#include "ast/ast_smt2_pp.h"
@ -100,7 +99,6 @@ class degree_shift_tactic : public tactic {
void checkpoint() {
if (m.canceled())
throw tactic_exception(m.limit().get_cancel_msg());
cooperate("degree_shift");
}
void visit(expr * t, expr_fast_mark1 & visited) {

View file

@ -18,7 +18,6 @@ Notes:
--*/
#include "tactic/tactical.h"
#include "util/cooperate.h"
#include "tactic/arith/bound_manager.h"
#include "ast/ast_pp.h"
#include "ast/arith_decl_plugin.h"

View file

@ -25,7 +25,6 @@ Revision History:
#include "tactic/tactical.h"
#include "ast/arith_decl_plugin.h"
#include "ast/for_each_expr.h"
#include "util/cooperate.h"
#include "ast/ast_smt2_pp.h"
#include "ast/ast_pp.h"
#include "util/id_gen.h"
@ -1543,7 +1542,6 @@ class fm_tactic : public tactic {
}
void checkpoint() {
cooperate("fm");
if (m.canceled())
throw tactic_exception(m.limit().get_cancel_msg());
if (memory::get_allocation_size() > m_max_memory)

View file

@ -16,7 +16,6 @@ Author:
Notes:
--*/
#include "util/cooperate.h"
#include "ast/ast_pp.h"
#include "ast/pb_decl_plugin.h"
#include "ast/arith_decl_plugin.h"

View file

@ -17,7 +17,6 @@ Notes:
--*/
#include "tactic/tactical.h"
#include "util/cooperate.h"
#include "tactic/arith/bound_manager.h"
#include "ast/rewriter/bool_rewriter.h"
#include "ast/rewriter/rewriter_def.h"
@ -182,7 +181,6 @@ private:
};
void checkpoint() {
cooperate("pb2bv");
if (memory::get_allocation_size() > m_max_memory)
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
}
@ -209,7 +207,6 @@ private:
}
bool max_steps_exceeded(unsigned num_steps) const {
cooperate("pb2bv");
if (memory::get_allocation_size() > owner.m_max_memory)
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
return false;

View file

@ -27,7 +27,6 @@ Notes:
#include "ast/bv_decl_plugin.h"
#include "ast/rewriter/rewriter_def.h"
#include "ast/for_each_expr.h"
#include "util/cooperate.h"
#include "ast/rewriter/bv_rewriter.h"
class bv1_blaster_tactic : public tactic {
@ -73,7 +72,6 @@ class bv1_blaster_tactic : public tactic {
bool rewrite_patterns() const { UNREACHABLE(); return false; }
bool max_steps_exceeded(unsigned num_steps) const {
cooperate("bv1 blaster");
if (memory::get_allocation_size() > m_max_memory)
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
return num_steps > m_max_steps;

View file

@ -21,7 +21,6 @@
#include "ast/rewriter/bv_bounds.h"
#include "ast/rewriter/rewriter_params.hpp"
#include "ast/rewriter/bool_rewriter.h"
#include "util/cooperate.h"
struct bv_bound_chk_stats {
unsigned m_unsats;
@ -80,7 +79,6 @@ struct bv_bound_chk_rewriter_cfg : public default_rewriter_cfg {
}
bool max_steps_exceeded(unsigned long long num_steps) const {
cooperate("bv-bound-chk");
if (num_steps > m_max_steps)
return true;
if (memory::get_allocation_size() > m_max_memory)

View file

@ -18,7 +18,6 @@ Notes:
--*/
#include "util/cooperate.h"
#include "ast/bv_decl_plugin.h"
#include "ast/array_decl_plugin.h"
#include "util/params.h"

View file

@ -19,7 +19,6 @@ Revision History:
#include "tactic/tactical.h"
#include "ast/rewriter/rewriter_def.h"
#include "tactic/generic_model_converter.h"
#include "util/cooperate.h"
#include "ast/bv_decl_plugin.h"
#include "ast/used_vars.h"
#include "ast/well_sorted.h"
@ -56,7 +55,6 @@ class elim_small_bv_tactic : public tactic {
}
bool max_steps_exceeded(unsigned long long num_steps) const {
cooperate("elim-small-bv");
if (num_steps > m_max_steps)
return true;
if (memory::get_allocation_size() > m_max_memory)

View file

@ -24,7 +24,6 @@ Revision History:
#include "ast/rewriter/rewriter_def.h"
#include "util/obj_pair_hashtable.h"
#include "ast/ast_lt.h"
#include "util/cooperate.h"
class max_bv_sharing_tactic : public tactic {
@ -61,7 +60,6 @@ class max_bv_sharing_tactic : public tactic {
}
bool max_steps_exceeded(unsigned num_steps) const {
cooperate("max bv sharing");
if (memory::get_allocation_size() > m_max_memory)
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
return num_steps > m_max_steps;

View file

@ -16,7 +16,6 @@ Author:
Notes:
--*/
#include "util/cooperate.h"
#include "ast/normal_forms/defined_names.h"
#include "ast/rewriter/rewriter_def.h"
#include "ast/scoped_proof.h"
@ -60,7 +59,6 @@ class blast_term_ite_tactic : public tactic {
bool max_steps_exceeded(unsigned num_steps) const {
cooperate("blast term ite");
// if (memory::get_allocation_size() > m_max_memory)
// throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
return num_steps >= m_max_steps;

View file

@ -19,7 +19,6 @@ Revision History:
#include "tactic/core/cofactor_elim_term_ite.h"
#include "ast/rewriter/mk_simplified_app.h"
#include "ast/rewriter/rewriter_def.h"
#include "util/cooperate.h"
#include "ast/for_each_expr.h"
#include "ast/ast_smt2_pp.h"
#include "ast/ast_ll_pp.h"
@ -32,7 +31,6 @@ struct cofactor_elim_term_ite::imp {
bool m_cofactor_equalities;
void checkpoint() {
cooperate("cofactor ite");
if (memory::get_allocation_size() > m_max_memory)
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
if (m.canceled())

View file

@ -18,7 +18,6 @@ Notes:
--*/
#include "tactic/core/ctx_simplify_tactic.h"
#include "ast/rewriter/mk_simplified_app.h"
#include "util/cooperate.h"
#include "ast/ast_ll_pp.h"
#include "ast/ast_pp.h"
@ -202,7 +201,6 @@ struct ctx_simplify_tactic::imp {
}
void checkpoint() {
cooperate("ctx_simplify_tactic");
if (memory::get_allocation_size() > m_max_memory)
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
if (m.canceled())

View file

@ -21,7 +21,6 @@ Notes:
#include "ast/normal_forms/defined_names.h"
#include "ast/rewriter/rewriter_def.h"
#include "tactic/generic_model_converter.h"
#include "util/cooperate.h"
class elim_term_ite_tactic : public tactic {
@ -35,7 +34,6 @@ class elim_term_ite_tactic : public tactic {
unsigned m_num_fresh;
bool max_steps_exceeded(unsigned num_steps) const {
cooperate("elim term ite");
if (memory::get_allocation_size() > m_max_memory)
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
return false;

View file

@ -24,7 +24,6 @@ Notes:
#include "ast/array_decl_plugin.h"
#include "ast/datatype_decl_plugin.h"
#include "tactic/core/collect_occs.h"
#include "util/cooperate.h"
#include "ast/ast_smt2_pp.h"
#include "ast/ast_ll_pp.h"
@ -67,7 +66,6 @@ class elim_uncnstr_tactic : public tactic {
ast_manager & m() const { return m_a_util.get_manager(); }
bool max_steps_exceeded(unsigned num_steps) const {
cooperate("elim-uncnstr-vars");
if (memory::get_allocation_size() > m_max_memory)
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
return num_steps > m_max_steps;

View file

@ -24,7 +24,6 @@ Revision History:
#include "tactic/tactical.h"
#include "tactic/core/occf_tactic.h"
#include "tactic/generic_model_converter.h"
#include "util/cooperate.h"
class occf_tactic : public tactic {
struct imp {
@ -38,7 +37,6 @@ class occf_tactic : public tactic {
void checkpoint() {
if (m.canceled())
throw tactic_exception(TACTIC_CANCELED_MSG);
cooperate("occf");
}
bool is_literal(expr * t) const {

View file

@ -17,7 +17,6 @@ Notes:
--*/
#include "tactic/tactical.h"
#include "util/cooperate.h"
#include "ast/ast_smt2_pp.h"
#include "ast/has_free_vars.h"
#include "util/map.h"
@ -115,7 +114,6 @@ struct reduce_args_tactic::imp {
void checkpoint() {
if (m_manager.canceled())
throw tactic_exception(m_manager.limit().get_cancel_msg());
cooperate("reduce-args");
}
struct find_non_candidates_proc {

View file

@ -20,7 +20,6 @@ Notes:
--*/
#include "util/cooperate.h"
#include "ast/bv_decl_plugin.h"
#include "ast/arith_decl_plugin.h"
#include "ast/ast_pp.h"
@ -97,7 +96,6 @@ private:
void checkpoint() {
if (m.canceled())
throw tactic_exception(m.limit().get_cancel_msg());
cooperate("reduce-invertible");
}
expr_mark m_inverted;

View file

@ -17,7 +17,6 @@ Revision History:
--*/
#include "ast/rewriter/expr_replacer.h"
#include "util/cooperate.h"
#include "ast/occurs.h"
#include "ast/ast_util.h"
#include "ast/ast_pp.h"
@ -87,7 +86,6 @@ class solve_eqs_tactic : public tactic {
void checkpoint() {
if (m().canceled())
throw tactic_exception(m().limit().get_cancel_msg());
cooperate("solve-eqs");
}
// Check if the number of occurrences of t is below the specified threshold :solve-eqs-max-occs

View file

@ -54,7 +54,6 @@ Notes:
#include "tactic/generic_model_converter.h"
#include "ast/rewriter/bool_rewriter.h"
#include "tactic/core/simplify_tactic.h"
#include "util/cooperate.h"
static void swap_if_gt(expr * & n1, expr * & n2) {
if (n1->get_id() > n2->get_id())
@ -785,7 +784,6 @@ class tseitin_cnf_tactic : public tactic {
void checkpoint() {
cooperate("tseitin cnf");
if (m.canceled())
throw tactic_exception(TACTIC_CANCELED_MSG);
if (memory::get_allocation_size() > m_max_memory)

View file

@ -24,7 +24,6 @@ Notes:
#include "ast/rewriter/var_subst.h"
#include "model/model_pp.h"
#include "tactic/tactic.h"
#include "util/cooperate.h"
#include "util/luby.h"
#include "tactic/sls/sls_params.hpp"
@ -96,7 +95,6 @@ void sls_engine::collect_statistics(statistics& st) const {
void sls_engine::checkpoint() {
if (m_manager.canceled())
throw tactic_exception(m_manager.limit().get_cancel_msg());
cooperate("sls");
}
bool sls_engine::full_eval(model & mdl) {

View file

@ -30,7 +30,6 @@ Notes:
#include "tactic/smtlogics/qfufbv_tactic_params.hpp"
///////////////
#include "model/model_smt2_pp.h"
#include "util/cooperate.h"
#include "ackermannization/lackr.h"
#include "ackermannization/ackermannization_params.hpp"
#include "tactic/smtlogics/qfufbv_ackr_model_converter.h"

View file

@ -16,7 +16,6 @@ z3_add_component(util
bit_vector.cpp
cmd_context_types.cpp
common_msgs.cpp
cooperate.cpp
debug.cpp
env_params.cpp
fixed_bit_vector.cpp
@ -63,7 +62,6 @@ z3_add_component(util
EXTRA_REGISTER_MODULE_HEADERS
env_params.h
MEMORY_INIT_FINALIZER_HEADERS
cooperate.h
debug.h
gparams.h
prime_generator.h

View file

@ -1,59 +0,0 @@
/*++
Copyright (c) 2011 Microsoft Corporation
Module Name:
cooperate.cpp
Abstract:
Cooperation support
Author:
Leonardo (leonardo) 2011-05-17
Notes:
--*/
#ifndef SINGLE_THREAD
#include "util/cooperate.h"
#include "util/trace.h"
#include "util/debug.h"
#include <atomic>
#include <mutex>
#include <thread>
static std::mutex* s_mux = nullptr;
void initialize_cooperate() {
s_mux = new std::mutex();
}
void finalize_cooperate() {
delete s_mux;
}
static std::atomic<std::thread::id> owner_thread;
bool cooperation_ctx::g_cooperate = false;
void cooperation_ctx::checkpoint(char const * task) {
SASSERT(cooperation_ctx::enabled());
std::thread::id tid = std::this_thread::get_id();
if (owner_thread == tid) {
owner_thread = std::thread::id();
s_mux->unlock();
}
// this critical section is used to force the owner thread to give a chance to
// another thread to get the lock
std::this_thread::yield();
s_mux->lock();
TRACE("cooperate_detail", tout << task << ", tid: " << tid << "\n";);
owner_thread = tid;
}
#endif

View file

@ -1,50 +0,0 @@
/*++
Copyright (c) 2011 Microsoft Corporation
Module Name:
cooperate.h
Abstract:
Cooperation support
Author:
Leonardo (leonardo) 2011-05-17
Notes:
--*/
#pragma once
#ifndef SINGLE_THREAD
class cooperation_ctx {
static bool g_cooperate;
public:
static bool enabled() { return g_cooperate; }
static void checkpoint(char const * task);
};
inline void cooperate(char const * task) {
if (cooperation_ctx::enabled()) cooperation_ctx::checkpoint(task);
}
void initialize_cooperate();
void finalize_cooperate();
#else
inline void cooperate(char const *) {}
inline void initialize_cooperate() {}
inline void finalize_cooperate() {}
#endif
/*
ADD_INITIALIZER('initialize_cooperate();')
ADD_FINALIZER('finalize_cooperate();')
*/