3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-02 17:30:23 +00:00

moving to resource managed cancellation

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-12-11 13:13:11 -08:00
parent 61dbb6168e
commit 32b6b2da44
41 changed files with 55 additions and 280 deletions

View file

@ -60,7 +60,6 @@ namespace smt {
pb_util pb;
unsynch_mpz_manager mgr;
th_rewriter m_rewrite;
volatile bool m_cancel;
vector<clause> m_clauses; // clauses to be satisfied
expr_ref_vector m_orig_clauses; // for debugging
model_ref m_orig_model; // for debugging
@ -86,7 +85,6 @@ namespace smt {
m(m),
pb(m),
m_rewrite(m),
m_cancel(false),
m_orig_clauses(m),
m_trail(m),
one(mgr)
@ -157,7 +155,7 @@ namespace smt {
while (m_max_flips > 0) {
--m_max_flips;
literal lit = flip();
if (m_cancel) {
if (m.canceled()) {
return l_undef;
}
IF_VERBOSE(3, verbose_stream()
@ -203,9 +201,6 @@ namespace smt {
bool get_value(literal l) {
return l.sign() ^ m_assignment[l.var()];
}
void set_cancel(bool f) {
m_cancel = f;
}
void get_model(model_ref& mdl) {
mdl = alloc(model, m);
for (unsigned i = 1; i < m_var2decl.size(); ++i) {
@ -719,9 +714,6 @@ namespace smt {
lbool pb_sls::operator()() {
return (*m_imp)();
}
void pb_sls::set_cancel(bool f) {
m_imp->set_cancel(f);
}
void pb_sls::collect_statistics(statistics& st) const {
m_imp->collect_statistics(st);
}