mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 11:55:51 +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
|
@ -352,16 +352,15 @@ cmd_context::~cmd_context() {
|
|||
}
|
||||
|
||||
void cmd_context::set_cancel(bool f) {
|
||||
if (m_solver) {
|
||||
if (has_manager()) {
|
||||
m().set_cancel(f);
|
||||
if (f) {
|
||||
m_solver->cancel();
|
||||
m().limit().cancel();
|
||||
}
|
||||
else {
|
||||
m_solver->reset_cancel();
|
||||
m().limit().reset_cancel();
|
||||
}
|
||||
}
|
||||
if (has_manager())
|
||||
m().set_cancel(f);
|
||||
}
|
||||
|
||||
opt_wrapper* cmd_context::get_opt() {
|
||||
|
@ -1453,7 +1452,7 @@ void cmd_context::check_sat(unsigned num_assumptions, expr * const * assumptions
|
|||
else if (m_solver) {
|
||||
m_check_sat_result = m_solver.get(); // solver itself stores the result.
|
||||
m_solver->set_progress_callback(this);
|
||||
cancel_eh<solver> eh(*m_solver);
|
||||
cancel_eh<reslimit> eh(m().limit());
|
||||
scoped_ctrl_c ctrlc(eh);
|
||||
scoped_timer timer(timeout, &eh);
|
||||
scoped_rlimit _rlimit(m().limit(), rlimit);
|
||||
|
@ -1612,7 +1611,7 @@ void cmd_context::validate_model() {
|
|||
model_evaluator evaluator(*(md.get()), p);
|
||||
contains_array_op_proc contains_array(m());
|
||||
{
|
||||
cancel_eh<model_evaluator> eh(evaluator);
|
||||
cancel_eh<reslimit> eh(m().limit());
|
||||
expr_ref r(m());
|
||||
scoped_ctrl_c ctrlc(eh);
|
||||
ptr_vector<expr>::const_iterator it = begin_assertions();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue