3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-09-03 08:38:06 +00:00

reworking cancellation

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-12-11 16:21:24 -08:00
parent 981f8226fe
commit baee4225a7
145 changed files with 172 additions and 958 deletions

View file

@ -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);