mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 11:55:51 +00:00
reworking cancellation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
981f8226fe
commit
baee4225a7
145 changed files with 172 additions and 958 deletions
|
@ -31,6 +31,7 @@ Revision History:
|
|||
#include"statistics.h"
|
||||
#include"lbool.h"
|
||||
#include"id_gen.h"
|
||||
#include"rlimit.h"
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4200)
|
||||
#pragma warning(disable : 4355)
|
||||
|
@ -526,8 +527,6 @@ private:
|
|||
numeral m_tmp1, m_tmp2, m_tmp3;
|
||||
interval m_i_tmp1, m_i_tmp2, m_i_tmp3;
|
||||
|
||||
// Cancel flag
|
||||
volatile bool m_cancel;
|
||||
|
||||
friend class node;
|
||||
|
||||
|
@ -759,7 +758,7 @@ private:
|
|||
bool check_invariant() const;
|
||||
|
||||
public:
|
||||
context_t(C const & c, params_ref const & p, small_object_allocator * a);
|
||||
context_t(reslimit& lim, C const & c, params_ref const & p, small_object_allocator * a);
|
||||
~context_t();
|
||||
|
||||
/**
|
||||
|
@ -835,8 +834,6 @@ public:
|
|||
|
||||
void set_display_proc(display_var_proc * p) { m_display_proc = p; }
|
||||
|
||||
void set_cancel(bool f) { m_cancel = f; im().set_cancel(f); }
|
||||
|
||||
void updt_params(params_ref const & p);
|
||||
|
||||
static void collect_param_descrs(param_descrs & d);
|
||||
|
|
|
@ -431,7 +431,6 @@ context_t<C>::context_t(C const & c, params_ref const & p, small_object_allocato
|
|||
m_node_selector = alloc(breadth_first_node_selector<C>, this);
|
||||
m_var_selector = alloc(round_robing_var_selector<C>, this);
|
||||
m_node_splitter = alloc(midpoint_node_splitter<C>, this);
|
||||
m_cancel = false;
|
||||
m_num_nodes = 0;
|
||||
updt_params(p);
|
||||
reset_statistics();
|
||||
|
@ -459,7 +458,7 @@ context_t<C>::~context_t() {
|
|||
|
||||
template<typename C>
|
||||
void context_t<C>::checkpoint() {
|
||||
if (m_cancel)
|
||||
if (m_limit.canceled())
|
||||
throw default_exception("canceled");
|
||||
if (memory::get_allocation_size() > m_max_memory)
|
||||
throw default_exception(Z3_MAX_MEMORY_MSG);
|
||||
|
|
|
@ -51,7 +51,6 @@ struct expr2subpaving::imp {
|
|||
|
||||
obj_map<expr, subpaving::ineq*> m_lit_cache;
|
||||
|
||||
volatile bool m_cancel;
|
||||
|
||||
imp(ast_manager & m, subpaving::context & s, expr2var * e2v):
|
||||
m_manager(m),
|
||||
|
@ -71,7 +70,6 @@ struct expr2subpaving::imp {
|
|||
m_expr2var_owner = false;
|
||||
}
|
||||
|
||||
m_cancel = false;
|
||||
}
|
||||
|
||||
~imp() {
|
||||
|
@ -95,7 +93,7 @@ struct expr2subpaving::imp {
|
|||
}
|
||||
|
||||
void checkpoint() {
|
||||
if (m_cancel)
|
||||
if (m().canceled())
|
||||
throw default_exception("canceled");
|
||||
cooperate("expr2subpaving");
|
||||
}
|
||||
|
@ -357,9 +355,6 @@ struct expr2subpaving::imp {
|
|||
return m_expr2var->is_var(t);
|
||||
}
|
||||
|
||||
void set_cancel(bool f) {
|
||||
m_cancel = f;
|
||||
}
|
||||
|
||||
subpaving::var internalize_term(expr * t, mpz & n, mpz & d) {
|
||||
return process(t, 0, n, d);
|
||||
|
@ -386,9 +381,6 @@ bool expr2subpaving::is_var(expr * t) const {
|
|||
return m_imp->is_var(t);
|
||||
}
|
||||
|
||||
void expr2subpaving::set_cancel(bool f) {
|
||||
m_imp->set_cancel(f);
|
||||
}
|
||||
|
||||
subpaving::var expr2subpaving::internalize_term(expr * t, mpz & n, mpz & d) {
|
||||
return m_imp->internalize_term(t, n, d);
|
||||
|
|
|
@ -40,12 +40,7 @@ public:
|
|||
\brief Return true if t was encoded as a variable by the translator.
|
||||
*/
|
||||
bool is_var(expr * t) const;
|
||||
|
||||
/**
|
||||
\brief Cancel/Interrupt execution.
|
||||
*/
|
||||
void set_cancel(bool f);
|
||||
|
||||
|
||||
/**
|
||||
\brief Internalize a Z3 arithmetical expression into the subpaving data-structure.
|
||||
|
||||
|
|
|
@ -124,7 +124,6 @@ class subpaving_tactic : public tactic {
|
|||
}
|
||||
|
||||
void set_cancel(bool f) {
|
||||
m_e2s->set_cancel(f);
|
||||
m_ctx->set_cancel(f);
|
||||
}
|
||||
|
||||
|
@ -279,11 +278,6 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void set_cancel(bool f) {
|
||||
if (m_imp)
|
||||
m_imp->set_cancel(f);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue