mirror of
https://github.com/Z3Prover/z3
synced 2025-10-01 21:49:29 +00:00
adding rlimit resource limit facility to provide platform and architecture independent method for canceling activities
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
ad16cc0ce2
commit
9b3e242990
26 changed files with 165 additions and 14 deletions
|
@ -199,7 +199,7 @@ namespace smt {
|
|||
bool context::bcp() {
|
||||
SASSERT(!inconsistent());
|
||||
while (m_qhead < m_assigned_literals.size()) {
|
||||
if (m_cancel_flag) {
|
||||
if (get_cancel_flag()) {
|
||||
return true;
|
||||
}
|
||||
literal l = m_assigned_literals[m_qhead];
|
||||
|
@ -1616,7 +1616,7 @@ namespace smt {
|
|||
unsigned qhead = m_qhead;
|
||||
if (!bcp())
|
||||
return false;
|
||||
if (m_cancel_flag)
|
||||
if (get_cancel_flag())
|
||||
return true;
|
||||
SASSERT(!inconsistent());
|
||||
propagate_relevancy(qhead);
|
||||
|
@ -2773,7 +2773,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
void context::assert_expr_core(expr * e, proof * pr) {
|
||||
if (m_cancel_flag) return;
|
||||
if (get_cancel_flag()) return;
|
||||
SASSERT(is_well_sorted(m_manager, e));
|
||||
TRACE("begin_assert_expr", tout << mk_pp(e, m_manager) << "\n";);
|
||||
TRACE("begin_assert_expr_ll", tout << mk_ll_pp(e, m_manager) << "\n";);
|
||||
|
@ -2803,7 +2803,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
void context::internalize_assertions() {
|
||||
if (m_cancel_flag) return;
|
||||
if (get_cancel_flag()) return;
|
||||
TRACE("internalize_assertions", tout << "internalize_assertions()...\n";);
|
||||
timeit tt(get_verbosity_level() >= 100, "smt.preprocessing");
|
||||
reduce_assertions();
|
||||
|
@ -3311,6 +3311,9 @@ namespace smt {
|
|||
if (!inconsistent()) {
|
||||
if (resource_limits_exceeded())
|
||||
return l_undef;
|
||||
|
||||
if (!m_manager.limit().inc())
|
||||
return l_undef;
|
||||
|
||||
if (m_num_conflicts_since_restart > m_restart_threshold && m_scope_lvl - m_base_lvl > 2) {
|
||||
TRACE("search_bug", tout << "bounded-search return undef, inconsistent: " << inconsistent() << "\n";);
|
||||
|
@ -3337,9 +3340,11 @@ namespace smt {
|
|||
return l_undef;
|
||||
}
|
||||
|
||||
if (!m_manager.limit().inc())
|
||||
return l_undef;
|
||||
|
||||
if (m_base_lvl == m_scope_lvl && m_fparams.m_simplify_clauses)
|
||||
simplify_clauses();
|
||||
|
||||
|
||||
if (!decide()) {
|
||||
final_check_status fcs = final_check();
|
||||
|
@ -3381,7 +3386,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
if (m_cancel_flag) {
|
||||
if (get_cancel_flag()) {
|
||||
m_last_search_failure = CANCELED;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue