3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

saved params work

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-11-29 17:19:12 -08:00
parent c3055207ed
commit cf28cbab0a
130 changed files with 1469 additions and 948 deletions

View file

@ -674,8 +674,8 @@ extern "C" {
ast_manager & m = mk_c(c)->m();
expr * a = to_expr(_a);
params_ref p = to_param_ref(_p);
unsigned timeout = p.get_uint(":timeout", UINT_MAX);
bool use_ctrl_c = p.get_bool(":ctrl-c", false);
unsigned timeout = p.get_uint("timeout", UINT_MAX);
bool use_ctrl_c = p.get_bool("ctrl_c", false);
th_rewriter m_rw(m, p);
expr_ref result(m);
cancel_eh<th_rewriter> eh(m_rw);

View file

@ -21,6 +21,7 @@ Revision History:
#include"pp.h"
#include"api_log_macros.h"
#include"api_util.h"
#include"cmd_context.h"
#include"symbol.h"
namespace api {
@ -41,8 +42,6 @@ namespace api {
};
extern std::string smt_keyword2opt_name(symbol const & opt);
extern "C" {
Z3_config Z3_API Z3_mk_config() {
LOG_Z3_mk_config();
@ -62,7 +61,7 @@ extern "C" {
api::config_params* p = reinterpret_cast<api::config_params*>(c);
if (param_id != 0 && param_id[0] == ':') {
// Allow SMT2 style paramater names such as :model, :relevancy, etc
std::string new_param_id = smt_keyword2opt_name(symbol(param_id));
std::string new_param_id = smt2_keyword_to_param(symbol(param_id));
p->m_ini.set_param_value(new_param_id.c_str(), param_value);
}
else {
@ -91,7 +90,7 @@ extern "C" {
}
if (param_id != 0 && param_id[0] == ':') {
// Allow SMT2 style paramater names such as :model, :relevancy, etc
std::string new_param_id = smt_keyword2opt_name(symbol(param_id));
std::string new_param_id = smt2_keyword_to_param(symbol(param_id));
ini.set_param_value(new_param_id.c_str(), param_value);
}
else {

View file

@ -265,7 +265,7 @@ extern "C" {
RESET_ERROR_CODE();
lbool r = l_undef;
cancel_eh<api::fixedpoint_context> eh(*to_fixedpoint_ref(d));
unsigned timeout = to_fixedpoint(d)->m_params.get_uint(":timeout", UINT_MAX);
unsigned timeout = to_fixedpoint(d)->m_params.get_uint("timeout", UINT_MAX);
api::context::set_interruptable(*(mk_c(c)), eh);
{
scoped_timer timer(timeout, &eh);
@ -289,7 +289,7 @@ extern "C" {
LOG_Z3_fixedpoint_query_relations(c, d, num_relations, relations);
RESET_ERROR_CODE();
lbool r = l_undef;
unsigned timeout = to_fixedpoint(d)->m_params.get_uint(":timeout", UINT_MAX);
unsigned timeout = to_fixedpoint(d)->m_params.get_uint("timeout", UINT_MAX);
cancel_eh<api::fixedpoint_context> eh(*to_fixedpoint_ref(d));
api::context::set_interruptable(*(mk_c(c)), eh);
{

View file

@ -37,8 +37,8 @@ extern "C" {
ast_manager & m = mk_c(c)->m();
Z3_solver_ref * s = to_solver(_s);
s->m_solver->set_produce_proofs(m.proofs_enabled());
s->m_solver->set_produce_unsat_cores(s->m_params.get_bool(":unsat-core", false));
s->m_solver->set_produce_models(s->m_params.get_bool(":model", true));
s->m_solver->set_produce_unsat_cores(s->m_params.get_bool("unsat_core", false));
s->m_solver->set_produce_models(s->m_params.get_bool("model", true));
s->m_solver->set_front_end_params(mk_c(c)->fparams());
s->m_solver->updt_params(s->m_params);
s->m_solver->init(m, s->m_logic);
@ -127,8 +127,8 @@ extern "C" {
LOG_Z3_solver_set_params(c, s, p);
RESET_ERROR_CODE();
if (to_solver(s)->m_initialized) {
bool old_model = to_solver(s)->m_params.get_bool(":model", true);
bool new_model = to_param_ref(p).get_bool(":model", true);
bool old_model = to_solver(s)->m_params.get_bool("model", true);
bool new_model = to_param_ref(p).get_bool("model", true);
if (old_model != new_model)
to_solver_ref(s)->set_produce_models(new_model);
to_solver_ref(s)->updt_params(to_param_ref(p));
@ -238,8 +238,8 @@ extern "C" {
}
}
expr * const * _assumptions = to_exprs(assumptions);
unsigned timeout = to_solver(s)->m_params.get_uint(":timeout", UINT_MAX);
bool use_ctrl_c = to_solver(s)->m_params.get_bool(":ctrl-c", false);
unsigned timeout = to_solver(s)->m_params.get_uint("timeout", UINT_MAX);
bool use_ctrl_c = to_solver(s)->m_params.get_bool("ctrl_c", false);
cancel_eh<solver> eh(*to_solver_ref(s));
api::context::set_interruptable(*(mk_c(c)), eh);
lbool result;

View file

@ -404,8 +404,8 @@ extern "C" {
Z3_apply_result_ref * ref = alloc(Z3_apply_result_ref, mk_c(c)->m());
mk_c(c)->save_object(ref);
unsigned timeout = p.get_uint(":timeout", UINT_MAX);
bool use_ctrl_c = p.get_bool(":ctrl-c", false);
unsigned timeout = p.get_uint("timeout", UINT_MAX);
bool use_ctrl_c = p.get_bool("ctrl_c", false);
cancel_eh<tactic> eh(*to_tactic_ref(t));
to_tactic_ref(t)->updt_params(p);