mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +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
|
@ -44,6 +44,7 @@ Revision History:
|
|||
#include"chashtable.h"
|
||||
#include"z3_exception.h"
|
||||
#include"dependency.h"
|
||||
#include"rlimit.h"
|
||||
|
||||
#define RECYCLE_FREE_AST_INDICES
|
||||
|
||||
|
@ -1424,6 +1425,7 @@ public:
|
|||
void show_id_gen();
|
||||
|
||||
protected:
|
||||
reslimit m_limit;
|
||||
small_object_allocator m_alloc;
|
||||
family_manager m_family_manager;
|
||||
expr_array_manager m_expr_array_manager;
|
||||
|
@ -1519,6 +1521,8 @@ public:
|
|||
fid == m_user_sort_family_id;
|
||||
}
|
||||
|
||||
reslimit& limit() { return m_limit; }
|
||||
|
||||
void register_plugin(symbol const & s, decl_plugin * plugin);
|
||||
|
||||
void register_plugin(family_id id, decl_plugin * plugin);
|
||||
|
|
|
@ -578,6 +578,8 @@ void rewriter_tpl<Config>::resume_core(expr_ref & result, proof_ref & result_pr)
|
|||
while (!frame_stack().empty()) {
|
||||
if (m_cancel)
|
||||
throw rewriter_exception(Z3_CANCELED_MSG);
|
||||
if (!m().limit().inc())
|
||||
throw rewriter_exception(Z3_CANCELED_MSG);
|
||||
SASSERT(!ProofGen || result_stack().size() == result_pr_stack().size());
|
||||
frame & fr = frame_stack().back();
|
||||
expr * t = fr.m_curr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue