3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 19:27:06 +00:00

attempt at more graceful timeout handling

This commit is contained in:
Nikolaj Bjorner 2020-11-26 06:33:44 -08:00
parent d6a5ef4343
commit b5a6c6bc66
2 changed files with 9 additions and 3 deletions

View file

@ -166,7 +166,7 @@ extern "C" {
mk_c(c)->handle_exception(ex);
}
r = l_undef;
if (ex.msg() == std::string("canceled") && !mk_c(c)->m().inc()) {
if (!mk_c(c)->m().inc()) {
to_optimize_ptr(o)->set_reason_unknown(ex.msg());
}
else {

View file

@ -155,6 +155,9 @@ lia_move int_solver::check(lp::explanation * e) {
check_return_helper pc(lra);
if (settings().get_cancel_flag())
return lia_move::undef;
++m_number_of_calls;
if (r == lia_move::undef && m_patcher.should_apply()) r = m_patcher();
if (r == lia_move::undef && should_find_cube()) r = int_cube(*this)();
@ -536,11 +539,14 @@ std::ostream& int_solver::display_row_info(std::ostream & out, unsigned row_inde
bool int_solver::shift_var(unsigned j, unsigned range) {
if (is_fixed(j) || is_base(j))
return false;
if (settings().get_cancel_flag())
return false;
bool inf_l = false, inf_u = false;
impq l, u;
mpq m;
VERIFY(get_freedom_interval_for_column(j, inf_l, l, inf_u, u, m));
VERIFY(get_freedom_interval_for_column(j, inf_l, l, inf_u, u, m) || settings().get_cancel_flag());
if (settings().get_cancel_flag())
return false;
const impq & x = get_value(j);
// x, the value of j column, might be shifted on a multiple of m
if (inf_l && inf_u) {