mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +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
|
@ -141,7 +141,6 @@ namespace nlsat {
|
|||
svector<trail> m_trail;
|
||||
|
||||
anum m_zero;
|
||||
bool m_cancel;
|
||||
|
||||
// configuration
|
||||
unsigned long long m_max_memory;
|
||||
|
@ -164,7 +163,7 @@ namespace nlsat {
|
|||
m_solver(s),
|
||||
m_rlimit(rlim),
|
||||
m_allocator("nlsat"),
|
||||
m_pm(m_qm, &m_allocator),
|
||||
m_pm(rlim, m_qm, &m_allocator),
|
||||
m_cache(m_pm),
|
||||
m_am(rlim, m_qm, p, &m_allocator),
|
||||
m_asm(*this, m_allocator),
|
||||
|
@ -180,7 +179,6 @@ namespace nlsat {
|
|||
m_lemma_assumptions(m_asm) {
|
||||
updt_params(p);
|
||||
reset_statistics();
|
||||
m_cancel = false;
|
||||
mk_true_bvar();
|
||||
}
|
||||
|
||||
|
@ -218,15 +216,11 @@ namespace nlsat {
|
|||
m_am.updt_params(p.p);
|
||||
}
|
||||
|
||||
void set_cancel(bool f) {
|
||||
m_pm.set_cancel(f);
|
||||
m_am.set_cancel(f);
|
||||
m_cancel = f;
|
||||
}
|
||||
|
||||
void checkpoint() {
|
||||
if (m_cancel) throw solver_exception(Z3_CANCELED_MSG);
|
||||
if (!m_rlimit.inc()) throw solver_exception(Z3_MAX_RESOURCE_MSG);
|
||||
if (!m_rlimit.inc()) {
|
||||
if (m_rlimit.cancel_flag_set()) throw solver_exception(Z3_CANCELED_MSG);
|
||||
throw solver_exception(Z3_MAX_RESOURCE_MSG);
|
||||
}
|
||||
if (memory::get_allocation_size() > m_max_memory) throw solver_exception(Z3_MAX_MEMORY_MSG);
|
||||
}
|
||||
|
||||
|
@ -2571,10 +2565,6 @@ namespace nlsat {
|
|||
return m_imp->check();
|
||||
}
|
||||
|
||||
void solver::set_cancel(bool f) {
|
||||
m_imp->set_cancel(f);
|
||||
}
|
||||
|
||||
void solver::collect_param_descrs(param_descrs & d) {
|
||||
algebraic_numbers::manager::collect_param_descrs(d);
|
||||
nlsat_params::collect_param_descrs(d);
|
||||
|
|
|
@ -154,7 +154,6 @@ namespace nlsat {
|
|||
void updt_params(params_ref const & p);
|
||||
static void collect_param_descrs(param_descrs & d);
|
||||
|
||||
void set_cancel(bool f);
|
||||
void collect_statistics(statistics & st);
|
||||
void reset_statistics();
|
||||
void display_status(std::ostream & out) const;
|
||||
|
|
|
@ -61,7 +61,6 @@ struct goal2nlsat::imp {
|
|||
unsigned long long m_max_memory;
|
||||
bool m_factor;
|
||||
|
||||
volatile bool m_cancel;
|
||||
|
||||
imp(ast_manager & _m, params_ref const & p, nlsat::solver & s, expr2var & a2b, expr2var & t2x):
|
||||
m(_m),
|
||||
|
@ -73,7 +72,6 @@ struct goal2nlsat::imp {
|
|||
m_t2x(t2x),
|
||||
m_expr2poly(m_solver, m, m_solver.pm(), &m_t2x) {
|
||||
updt_params(p);
|
||||
m_cancel = false;
|
||||
}
|
||||
|
||||
void updt_params(params_ref const & p) {
|
||||
|
@ -82,11 +80,6 @@ struct goal2nlsat::imp {
|
|||
m_fparams.updt_params(p);
|
||||
}
|
||||
|
||||
void set_cancel(bool f) {
|
||||
m_cancel = f;
|
||||
m_pm.set_cancel(f);
|
||||
}
|
||||
|
||||
nlsat::atom::kind flip(nlsat::atom::kind k) {
|
||||
switch (k) {
|
||||
case nlsat::atom::EQ: return k;
|
||||
|
@ -303,7 +296,3 @@ void goal2nlsat::operator()(goal const & g, params_ref const & p, nlsat::solver
|
|||
local_imp(g);
|
||||
}
|
||||
|
||||
void goal2nlsat::set_cancel(bool f) {
|
||||
if (m_imp)
|
||||
m_imp->set_cancel(f);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,6 @@ public:
|
|||
*/
|
||||
void operator()(goal const & g, params_ref const & p, nlsat::solver & s, expr2var & a2b, expr2var & t2x);
|
||||
|
||||
void set_cancel(bool f);
|
||||
};
|
||||
|
||||
class nlsat2goal {
|
||||
|
@ -69,7 +68,6 @@ public:
|
|||
void operator()(nlsat::solver const & s, expr2var const & a2b, expr2var const & t2x,
|
||||
params_ref const & p, goal & g, model_converter_ref & mc);
|
||||
|
||||
void set_cancel(bool f);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -57,11 +57,6 @@ class nlsat_tactic : public tactic {
|
|||
m_params = p;
|
||||
m_solver.updt_params(p);
|
||||
}
|
||||
|
||||
void set_cancel(bool f) {
|
||||
m_solver.set_cancel(f);
|
||||
m_g2nl.set_cancel(f);
|
||||
}
|
||||
|
||||
bool contains_unsupported(expr_ref_vector & b2a, expr_ref_vector & x2t) {
|
||||
for (unsigned x = 0; x < x2t.size(); x++) {
|
||||
|
@ -240,11 +235,6 @@ public:
|
|||
|
||||
virtual void cleanup() {}
|
||||
|
||||
virtual void set_cancel(bool f) {
|
||||
if (m_imp)
|
||||
m_imp->set_cancel(f);
|
||||
}
|
||||
|
||||
virtual void collect_statistics(statistics & st) const {
|
||||
st.copy(m_stats);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue