mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 09:35:32 +00:00
parent
0b856638e9
commit
426e4cc75c
65 changed files with 135 additions and 146 deletions
|
@ -126,7 +126,7 @@ struct aig_manager::imp {
|
|||
void checkpoint() {
|
||||
if (memory::get_allocation_size() > m_max_memory)
|
||||
throw aig_exception(TACTIC_MAX_MEMORY_MSG);
|
||||
if (m().canceled())
|
||||
if (!m().inc())
|
||||
throw aig_exception(m().limit().get_cancel_msg());
|
||||
}
|
||||
|
||||
|
|
|
@ -33,9 +33,7 @@ struct arith_bounds_tactic : public tactic {
|
|||
}
|
||||
|
||||
void checkpoint() {
|
||||
if (m.canceled()) {
|
||||
throw tactic_exception(m.limit().get_cancel_msg());
|
||||
}
|
||||
tactic::checkpoint(m);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ class degree_shift_tactic : public tactic {
|
|||
|
||||
|
||||
void checkpoint() {
|
||||
if (m.canceled())
|
||||
if (!m.inc())
|
||||
throw tactic_exception(m.limit().get_cancel_msg());
|
||||
}
|
||||
|
||||
|
|
|
@ -288,7 +288,7 @@ class diff_neq_tactic : public tactic {
|
|||
init_forbidden();
|
||||
unsigned nvars = num_vars();
|
||||
while (m_stack.size() < nvars) {
|
||||
if (m.canceled())
|
||||
if (!m.inc())
|
||||
throw tactic_exception(m.limit().get_cancel_msg());
|
||||
TRACE("diff_neq_tactic", display_model(tout););
|
||||
var x = m_stack.size();
|
||||
|
|
|
@ -198,7 +198,8 @@ class fm_tactic : public tactic {
|
|||
clauses::iterator it = m_clauses[i].begin();
|
||||
clauses::iterator end = m_clauses[i].end();
|
||||
for (; it != end; ++it) {
|
||||
if (m.canceled()) throw tactic_exception(m.limit().get_cancel_msg());
|
||||
if (!m.inc())
|
||||
throw tactic_exception(m.limit().get_cancel_msg());
|
||||
switch (process(x, *it, u, *md, val)) {
|
||||
case NONE:
|
||||
TRACE("fm_mc", tout << "no bound for:\n" << mk_ismt2_pp(*it, m) << "\n";);
|
||||
|
@ -1542,7 +1543,7 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
|
||||
void checkpoint() {
|
||||
if (m.canceled())
|
||||
if (!m.inc())
|
||||
throw tactic_exception(m.limit().get_cancel_msg());
|
||||
if (memory::get_allocation_size() > m_max_memory)
|
||||
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
|
||||
|
|
|
@ -164,7 +164,7 @@ public:
|
|||
}
|
||||
|
||||
void checkpoint() {
|
||||
if (m.canceled()) {
|
||||
if (!m.inc()) {
|
||||
throw tactic_exception(m.limit().get_cancel_msg());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,7 +171,7 @@ public:
|
|||
}
|
||||
|
||||
void checkpoint() {
|
||||
if (m.canceled())
|
||||
if (!m.inc())
|
||||
throw tactic_exception(m.limit().get_cancel_msg());
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ class bvarray2uf_tactic : public tactic {
|
|||
|
||||
|
||||
void checkpoint() {
|
||||
if (m_manager.canceled())
|
||||
if (!m_manager.inc())
|
||||
throw tactic_exception(m_manager.limit().get_cancel_msg());
|
||||
}
|
||||
|
||||
|
|
|
@ -33,8 +33,7 @@ struct cofactor_elim_term_ite::imp {
|
|||
void checkpoint() {
|
||||
if (memory::get_allocation_size() > m_max_memory)
|
||||
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
|
||||
if (m.canceled())
|
||||
throw tactic_exception(m.limit().get_cancel_msg());
|
||||
tactic::checkpoint(m);
|
||||
}
|
||||
|
||||
// Collect atoms that contain term if-then-else
|
||||
|
|
|
@ -203,8 +203,7 @@ struct ctx_simplify_tactic::imp {
|
|||
void checkpoint() {
|
||||
if (memory::get_allocation_size() > m_max_memory)
|
||||
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
|
||||
if (m.canceled())
|
||||
throw tactic_exception(m.limit().get_cancel_msg());
|
||||
tactic::checkpoint(m);
|
||||
}
|
||||
|
||||
bool shared(expr * t) const {
|
||||
|
|
|
@ -35,8 +35,7 @@ class occf_tactic : public tactic {
|
|||
}
|
||||
|
||||
void checkpoint() {
|
||||
if (m.canceled())
|
||||
throw tactic_exception(TACTIC_CANCELED_MSG);
|
||||
tactic::checkpoint(m);
|
||||
}
|
||||
|
||||
bool is_literal(expr * t) const {
|
||||
|
|
|
@ -112,8 +112,7 @@ struct reduce_args_tactic::imp {
|
|||
}
|
||||
|
||||
void checkpoint() {
|
||||
if (m_manager.canceled())
|
||||
throw tactic_exception(m_manager.limit().get_cancel_msg());
|
||||
tactic::checkpoint(m_manager);
|
||||
}
|
||||
|
||||
struct find_non_candidates_proc {
|
||||
|
|
|
@ -101,8 +101,7 @@ public:
|
|||
|
||||
private:
|
||||
void checkpoint() {
|
||||
if (m.canceled())
|
||||
throw tactic_exception(m.limit().get_cancel_msg());
|
||||
tactic::checkpoint(m);
|
||||
}
|
||||
|
||||
bool is_bv_neg(expr * e) {
|
||||
|
|
|
@ -86,8 +86,7 @@ class solve_eqs_tactic : public tactic {
|
|||
}
|
||||
|
||||
void checkpoint() {
|
||||
if (m().canceled())
|
||||
throw tactic_exception(m().limit().get_cancel_msg());
|
||||
tactic::checkpoint(m());
|
||||
}
|
||||
|
||||
// Check if the number of occurrences of t is below the specified threshold :solve-eqs-max-occs
|
||||
|
|
|
@ -786,8 +786,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
|
||||
|
||||
void checkpoint() {
|
||||
if (m.canceled())
|
||||
throw tactic_exception(TACTIC_CANCELED_MSG);
|
||||
tactic::checkpoint(m);
|
||||
if (memory::get_allocation_size() > m_max_memory)
|
||||
throw tactic_exception(TACTIC_MAX_MEMORY_MSG);
|
||||
}
|
||||
|
|
|
@ -329,7 +329,7 @@ private:
|
|||
for (expr* a : m_assertions) {
|
||||
sub(a, fml1);
|
||||
m_rewriter(fml1, fml2, proof);
|
||||
if (m.canceled()) {
|
||||
if (!m.inc()) {
|
||||
m_rewriter.reset();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1815,9 +1815,7 @@ namespace smtfd {
|
|||
}
|
||||
|
||||
void checkpoint() {
|
||||
if (m.canceled()) {
|
||||
throw tactic_exception(m.limit().get_cancel_msg());
|
||||
}
|
||||
tactic::checkpoint(m);
|
||||
}
|
||||
|
||||
expr* rep(expr* e) { return m_abs.rep(e); }
|
||||
|
|
|
@ -93,8 +93,7 @@ void sls_engine::collect_statistics(statistics& st) const {
|
|||
}
|
||||
|
||||
void sls_engine::checkpoint() {
|
||||
if (m_manager.canceled())
|
||||
throw tactic_exception(m_manager.limit().get_cancel_msg());
|
||||
tactic::checkpoint(m_manager);
|
||||
}
|
||||
|
||||
bool sls_engine::full_eval(model & mdl) {
|
||||
|
|
|
@ -246,3 +246,7 @@ void fail_if_has_quantifiers(char const* tactic_name, goal_ref const& g) {
|
|||
}
|
||||
}
|
||||
|
||||
void tactic::checkpoint(ast_manager& m) {
|
||||
if (!m.inc())
|
||||
throw tactic_exception(m.limit().get_cancel_msg());
|
||||
}
|
||||
|
|
|
@ -74,6 +74,9 @@ public:
|
|||
|
||||
// translate tactic to the given manager
|
||||
virtual tactic * translate(ast_manager & m) = 0;
|
||||
|
||||
static void checkpoint(ast_manager& m);
|
||||
|
||||
protected:
|
||||
friend class nary_tactical;
|
||||
friend class binary_tactical;
|
||||
|
|
|
@ -57,8 +57,7 @@ class quasi_macros_tactic : public tactic {
|
|||
}
|
||||
|
||||
do {
|
||||
if (m().canceled())
|
||||
throw tactic_exception(m().limit().get_cancel_msg());
|
||||
tactic::checkpoint(m());
|
||||
}
|
||||
while (qm(forms, proofs, deps));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue