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:
parent
df4065536f
commit
77827498bd
1 changed files with 47 additions and 33 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue