mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
include rlimit in nlsat, include dedicated error message, for issue #216
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
0cf18ab18e
commit
d9b6623400
6 changed files with 13 additions and 6 deletions
|
@ -67,6 +67,7 @@ namespace nlsat {
|
|||
typedef ptr_vector<interval_set> interval_set_vector;
|
||||
|
||||
solver & m_solver;
|
||||
reslimit& m_rlimit;
|
||||
small_object_allocator m_allocator;
|
||||
unsynch_mpq_manager m_qm;
|
||||
pmanager m_pm;
|
||||
|
@ -159,8 +160,9 @@ namespace nlsat {
|
|||
unsigned m_stages;
|
||||
unsigned m_irrational_assignments; // number of irrational witnesses
|
||||
|
||||
imp(solver & s, params_ref const & p):
|
||||
imp(solver & s, reslimit& rlim, params_ref const & p):
|
||||
m_solver(s),
|
||||
m_rlimit(rlim),
|
||||
m_allocator("nlsat"),
|
||||
m_pm(m_qm, &m_allocator),
|
||||
m_cache(m_pm),
|
||||
|
@ -224,6 +226,7 @@ namespace nlsat {
|
|||
|
||||
void checkpoint() {
|
||||
if (m_cancel) throw solver_exception(Z3_CANCELED_MSG);
|
||||
if (!m_rlimit.inc()) throw solver_exception(Z3_MAX_RESOURCE_MSG);
|
||||
if (memory::get_allocation_size() > m_max_memory) throw solver_exception(Z3_MAX_MEMORY_MSG);
|
||||
}
|
||||
|
||||
|
@ -2556,8 +2559,8 @@ namespace nlsat {
|
|||
}
|
||||
};
|
||||
|
||||
solver::solver(params_ref const & p) {
|
||||
m_imp = alloc(imp, *this, p);
|
||||
solver::solver(reslimit& rlim, params_ref const & p) {
|
||||
m_imp = alloc(imp, *this, rlim, p);
|
||||
}
|
||||
|
||||
solver::~solver() {
|
||||
|
|
|
@ -24,6 +24,7 @@ Revision History:
|
|||
#include"nlsat_types.h"
|
||||
#include"params.h"
|
||||
#include"statistics.h"
|
||||
#include"rlimit.h"
|
||||
|
||||
namespace nlsat {
|
||||
|
||||
|
@ -31,7 +32,7 @@ namespace nlsat {
|
|||
struct imp;
|
||||
imp * m_imp;
|
||||
public:
|
||||
solver(params_ref const & p);
|
||||
solver(reslimit& rlim, params_ref const & p);
|
||||
~solver();
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,7 +50,7 @@ class nlsat_tactic : public tactic {
|
|||
m(_m),
|
||||
m_params(p),
|
||||
m_display_var(_m),
|
||||
m_solver(p) {
|
||||
m_solver(m.limit(), p) {
|
||||
}
|
||||
|
||||
void updt_params(params_ref const & p) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue