3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-08 00:05:46 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-04-27 17:48:04 +02:00
parent 74292a48e5
commit 5dbba8bd53
9 changed files with 27 additions and 19 deletions

View file

@ -503,7 +503,7 @@ public:
ctx.set_random_seed(to_unsigned(val));
}
else if (m_option == m_reproducible_resource_limit) {
ctx.params().m_rlimit = to_unsigned(val);
ctx.params().set_rlimit(to_unsigned(val));
}
else if (m_option == m_verbosity) {
set_verbosity_level(to_unsigned(val));

View file

@ -1328,7 +1328,8 @@ void cmd_context::push() {
s.m_macros_stack_lim = m_macros_stack.size();
s.m_aux_pdecls_lim = m_aux_pdecls.size();
s.m_assertions_lim = m_assertions.size();
if (m_solver)
m().limit().push(m_params.rlimit());
if (m_solver)
m_solver->push();
if (m_opt)
m_opt->push();
@ -1443,6 +1444,9 @@ void cmd_context::pop(unsigned n) {
restore_assertions(s.m_assertions_lim);
restore_psort_inst(s.m_psort_inst_stack_lim);
m_scopes.shrink(new_lvl);
while (n--) {
m().limit().pop();
}
}
@ -1453,7 +1457,7 @@ void cmd_context::check_sat(unsigned num_assumptions, expr * const * assumptions
TRACE("before_check_sat", dump_assertions(tout););
init_manager();
unsigned timeout = m_params.m_timeout;
unsigned rlimit = m_params.m_rlimit;
unsigned rlimit = m_params.rlimit();
scoped_watch sw(*this);
lbool r;
bool was_opt = false;
@ -1530,7 +1534,7 @@ void cmd_context::check_sat(unsigned num_assumptions, expr * const * assumptions
void cmd_context::get_consequences(expr_ref_vector const& assumptions, expr_ref_vector const& vars, expr_ref_vector & conseq) {
unsigned timeout = m_params.m_timeout;
unsigned rlimit = m_params.m_rlimit;
unsigned rlimit = m_params.rlimit();
lbool r;
m_check_sat_result = m_solver.get(); // solver itself stores the result.
m_solver->set_progress_callback(this);

View file

@ -27,6 +27,8 @@ class context_params {
void set_bool(bool & opt, char const * param, char const * value);
void set_uint(unsigned & opt, char const * param, char const * value);
unsigned m_rlimit;
public:
bool m_auto_config;
bool m_proof;
@ -42,10 +44,11 @@ public:
bool m_unsat_core;
bool m_smtlib2_compliant; // it must be here because it enable/disable the use of coercions in the ast_manager.
unsigned m_timeout;
unsigned m_rlimit;
unsigned rlimit() const { return m_rlimit; }
context_params();
void set(char const * param, char const * value);
void set_rlimit(unsigned lim) { m_rlimit = lim; }
void updt_params();
void updt_params(params_ref const & p);
static void collect_param_descrs(param_descrs & d);

View file

@ -205,7 +205,7 @@ public:
tref->set_logic(ctx.get_logic());
ast_manager & m = ctx.m();
unsigned timeout = p.get_uint("timeout", ctx.params().m_timeout);
unsigned rlimit = p.get_uint("rlimit", ctx.params().m_rlimit);
unsigned rlimit = p.get_uint("rlimit", ctx.params().rlimit());
labels_vec labels;
goal_ref g = alloc(goal, m, ctx.produce_proofs(), ctx.produce_models(), ctx.produce_unsat_cores());
assert_exprs_from(ctx, *g);
@ -321,7 +321,7 @@ public:
assert_exprs_from(ctx, *g);
unsigned timeout = p.get_uint("timeout", ctx.params().m_timeout);
unsigned rlimit = p.get_uint("rlimit", ctx.params().m_rlimit);
unsigned rlimit = p.get_uint("rlimit", ctx.params().rlimit());
goal_ref_buffer result_goals;
model_converter_ref mc;