3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 01:24:08 +00:00

add solver.timeout as another entry point #2354

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-10-16 09:01:02 -07:00
parent ed149ea449
commit 5122b2da7e
3 changed files with 8 additions and 3 deletions

View file

@ -35,6 +35,7 @@ Revision History:
#include "smt/smt_implied_equalities.h"
#include "solver/smt_logics.h"
#include "solver/tactic2solver.h"
#include "solver/solver_params.hpp"
#include "cmd_context/cmd_context.h"
#include "parsers/smt2/smt2parser.h"
#include "sat/dimacs.h"
@ -548,7 +549,10 @@ extern "C" {
}
}
expr * const * _assumptions = to_exprs(num_assumptions, assumptions);
unsigned timeout = to_solver(s)->m_params.get_uint("timeout", mk_c(c)->get_timeout());
solver_params sp(to_solver(s)->m_params);
unsigned timeout = mk_c(c)->get_timeout();
timeout = to_solver(s)->m_params.get_uint("timeout", timeout);
timeout = sp.timeout() != UINT_MAX ? sp.timeout() : timeout;
unsigned rlimit = to_solver(s)->m_params.get_uint("rlimit", mk_c(c)->get_rlimit());
bool use_ctrl_c = to_solver(s)->m_params.get_bool("ctrl_c", true);
cancel_eh<reslimit> eh(mk_c(c)->m().limit());

View file

@ -226,8 +226,8 @@ void solver::assert_expr(expr* f, expr* t) {
void solver::collect_param_descrs(param_descrs & r) {
r.insert("solver.enforce_model_conversion", CPK_BOOL, "(default: false) enforce model conversion when asserting formulas");
r.insert("solver.smtlib2_log", CPK_SYMBOL, "(default: None) file to log solver interaction in smtlib2 format");
solver_params sp(m_params);
sp.collect_param_descrs(r);
insert_timeout(r);
insert_rlimit(r);
insert_max_memory(r);

View file

@ -5,5 +5,6 @@ def_module_params('solver',
params=(('enforce_model_conversion', BOOL, False, "apply model transformation on new assertions"),
('smtlib2_log', SYMBOL, '', "file to save solver interaction"),
('cancel_backup_file', SYMBOL, '', "file to save partial search state if search is canceled"),
('timeout', UINT, UINT_MAX, "timeout on the solver object; overwrites a global timeout"),
))