mirror of
https://github.com/Z3Prover/z3
synced 2025-04-30 04:15:51 +00:00
cleanup cancelation logic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
4e155887b2
commit
61dbb6168e
37 changed files with 93 additions and 198 deletions
|
@ -230,8 +230,7 @@ namespace datalog {
|
|||
m_enable_bind_variables(true),
|
||||
m_last_status(OK),
|
||||
m_last_answer(m),
|
||||
m_engine_type(LAST_ENGINE),
|
||||
m_cancel(false) {
|
||||
m_engine_type(LAST_ENGINE) {
|
||||
re.set_context(this);
|
||||
updt_params(pa);
|
||||
}
|
||||
|
@ -751,15 +750,16 @@ namespace datalog {
|
|||
}
|
||||
|
||||
|
||||
#if 0
|
||||
void context::cancel() {
|
||||
m_cancel = true;
|
||||
m_last_status = CANCELED;
|
||||
m_transf.cancel();
|
||||
if (m_engine) m_engine->cancel();
|
||||
}
|
||||
#endif
|
||||
|
||||
void context::cleanup() {
|
||||
m_cancel = false;
|
||||
m_last_status = OK;
|
||||
if (m_engine) m_engine->cleanup();
|
||||
}
|
||||
|
|
|
@ -487,11 +487,13 @@ namespace datalog {
|
|||
//
|
||||
// -----------------------------------
|
||||
|
||||
void cancel();
|
||||
bool canceled() const { return m_cancel; }
|
||||
bool canceled() {
|
||||
if (m.limit().inc()) return true;
|
||||
m_last_status = CANCELED;
|
||||
return false;
|
||||
}
|
||||
|
||||
void cleanup();
|
||||
void reset_cancel() { cleanup(); }
|
||||
|
||||
/**
|
||||
\brief check if query 'q' is satisfied under asserted rules and background.
|
||||
|
|
|
@ -74,7 +74,6 @@ class hnf::imp {
|
|||
|
||||
ast_manager& m;
|
||||
bool m_produce_proofs;
|
||||
volatile bool m_cancel;
|
||||
expr_ref_vector m_todo;
|
||||
proof_ref_vector m_proofs;
|
||||
expr_ref_vector m_refs;
|
||||
|
@ -96,7 +95,6 @@ public:
|
|||
imp(ast_manager & m):
|
||||
m(m),
|
||||
m_produce_proofs(false),
|
||||
m_cancel(false),
|
||||
m_todo(m),
|
||||
m_proofs(m),
|
||||
m_refs(m),
|
||||
|
@ -156,7 +154,7 @@ public:
|
|||
m_todo.push_back(n);
|
||||
m_proofs.push_back(p);
|
||||
m_produce_proofs = p != 0;
|
||||
while (!m_todo.empty() && !m_cancel) {
|
||||
while (!m_todo.empty() && checkpoint()) {
|
||||
fml = m_todo.back();
|
||||
pr = m_proofs.back();
|
||||
m_todo.pop_back();
|
||||
|
@ -174,8 +172,8 @@ public:
|
|||
});
|
||||
}
|
||||
|
||||
void set_cancel(bool f) {
|
||||
m_cancel = f;
|
||||
bool checkpoint() {
|
||||
return m.limit().inc();
|
||||
}
|
||||
|
||||
void set_name(symbol const& n) {
|
||||
|
@ -192,7 +190,6 @@ public:
|
|||
}
|
||||
|
||||
void reset() {
|
||||
m_cancel = false;
|
||||
m_todo.reset();
|
||||
m_proofs.reset();
|
||||
m_refs.reset();
|
||||
|
@ -524,9 +521,6 @@ void hnf::operator()(expr * n, proof* p, expr_ref_vector & rs, proof_ref_vector&
|
|||
);
|
||||
}
|
||||
|
||||
void hnf::set_cancel(bool f) {
|
||||
m_imp->set_cancel(f);
|
||||
}
|
||||
|
||||
void hnf::set_name(symbol const& n) {
|
||||
m_imp->set_name(n);
|
||||
|
|
|
@ -43,9 +43,6 @@ class hnf {
|
|||
proof_ref_vector& ps // [OUT] proofs of rs
|
||||
);
|
||||
|
||||
void cancel() { set_cancel(true); }
|
||||
void reset_cancel() { set_cancel(false); }
|
||||
void set_cancel(bool f);
|
||||
void set_name(symbol const& name);
|
||||
void reset();
|
||||
func_decl_ref_vector const& get_fresh_predicates();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue