3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-06 14:13:23 +00:00

Added checkpoints to lia2card tactic.

This commit is contained in:
Christoph M. Wintersteiger 2019-07-03 14:32:27 +01:00
parent df4065536f
commit 77827498bd
No known key found for this signature in database
GPG key ID: BCF6360F86294467

View file

@ -150,6 +150,8 @@ public:
xs.push_back(a.mk_int(lo));
}
for (unsigned i = lo; i < hi; ++i) {
checkpoint();
std::string name(x->get_decl()->get_name().str());
expr_ref v(m.mk_fresh_const(name.c_str(), m.mk_bool_sort()), m);
if (last_v) axioms.push_back(m.mk_implies(v, last_v));
@ -162,6 +164,12 @@ public:
return expr_ref(r, m);
}
void checkpoint() {
if (m.canceled()) {
throw tactic_exception(m.limit().get_cancel_msg());
}
}
void operator()(goal_ref const & g, goal_ref_buffer & result) override {
SASSERT(g->is_well_sorted());
m_bounds.reset();
@ -176,6 +184,8 @@ public:
bounds(*g);
for (expr* x : bounds) {
checkpoint();
bool s1 = false, s2 = false;
rational lo, hi;
if (a.is_int(x) &&
@ -189,6 +199,8 @@ public:
}
}
for (unsigned i = 0; i < g->size(); i++) {
checkpoint();
expr_ref new_curr(m), tmp(m);
proof_ref new_pr(m);
rep(g->form(i), tmp);
@ -265,6 +277,8 @@ public:
}
bool get_sum(expr* x, rational const& mul, expr_ref_vector& conds, expr_ref_vector& args, vector<rational>& coeffs, rational& coeff) {
checkpoint();
expr *y, *z, *u;
rational r, q;
if (!is_app(x)) return false;