mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 10:55:50 +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
|
@ -84,7 +84,7 @@ private:
|
|||
volatile bool m_canceled;
|
||||
aux_timeout_eh(solver * s):m_solver(s), m_canceled(false) {}
|
||||
virtual void operator()() {
|
||||
m_solver->cancel();
|
||||
m_solver->get_manager().cancel();
|
||||
m_canceled = true;
|
||||
}
|
||||
};
|
||||
|
@ -96,6 +96,8 @@ private:
|
|||
m_inc_unknown_behavior = static_cast<inc_unknown_behavior>(p.solver2_unknown());
|
||||
}
|
||||
|
||||
virtual ast_manager& get_manager() { return m_solver1->get_manager(); }
|
||||
|
||||
bool has_quantifiers() const {
|
||||
unsigned sz = get_num_assertions();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
|
@ -220,25 +222,18 @@ public:
|
|||
m_use_solver1_results = false;
|
||||
return r;
|
||||
}
|
||||
if (eh.m_canceled) {
|
||||
m_solver1->get_manager().limit().reset_cancel();
|
||||
}
|
||||
}
|
||||
IF_VERBOSE(PS_VB_LVL, verbose_stream() << "(combined-solver \"solver 2 failed, trying solver1\")\n";);
|
||||
IF_VERBOSE(PS_VB_LVL, verbose_stream() << "(combined-solver \"solver 2 failed, trying solver1\")\n";);
|
||||
|
||||
}
|
||||
|
||||
IF_VERBOSE(PS_VB_LVL, verbose_stream() << "(combined-solver \"using solver 1\")\n";);
|
||||
m_use_solver1_results = true;
|
||||
return m_solver1->check_sat(0, 0);
|
||||
}
|
||||
|
||||
virtual void set_cancel(bool f) {
|
||||
if (f) {
|
||||
m_solver1->cancel();
|
||||
m_solver2->cancel();
|
||||
}
|
||||
else {
|
||||
m_solver1->reset_cancel();
|
||||
m_solver2->reset_cancel();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void set_progress_callback(progress_callback * callback) {
|
||||
m_solver1->set_progress_callback(callback);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue