mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
remove dependency on ast from params
This commit is contained in:
parent
f00db08221
commit
4b3fecc35e
13 changed files with 49 additions and 48 deletions
|
@ -24,7 +24,6 @@ Revision History:
|
|||
#include "util/symbol.h"
|
||||
#include "util/gparams.h"
|
||||
#include "util/env_params.h"
|
||||
#include "params/context_params.h"
|
||||
|
||||
extern "C" {
|
||||
void Z3_API Z3_global_param_set(Z3_string param_id, Z3_string param_value) {
|
||||
|
@ -71,7 +70,7 @@ extern "C" {
|
|||
try {
|
||||
memory::initialize(UINT_MAX);
|
||||
LOG_Z3_mk_config();
|
||||
Z3_config r = reinterpret_cast<Z3_config>(alloc(context_params));
|
||||
Z3_config r = reinterpret_cast<Z3_config>(alloc(ast_context));
|
||||
RETURN_Z3(r);
|
||||
} catch (z3_exception & ex) {
|
||||
// The error handler is only available for contexts
|
||||
|
@ -83,13 +82,13 @@ extern "C" {
|
|||
|
||||
void Z3_API Z3_del_config(Z3_config c) {
|
||||
LOG_Z3_del_config(c);
|
||||
dealloc((reinterpret_cast<context_params*>(c)));
|
||||
dealloc((reinterpret_cast<ast_context*>(c)));
|
||||
}
|
||||
|
||||
void Z3_API Z3_set_param_value(Z3_config c, char const * param_id, char const * param_value) {
|
||||
LOG_Z3_set_param_value(c, param_id, param_value);
|
||||
try {
|
||||
context_params * p = reinterpret_cast<context_params*>(c);
|
||||
ast_context * p = reinterpret_cast<ast_context*>(c);
|
||||
p->set(param_id, param_value);
|
||||
}
|
||||
catch (z3_exception & ex) {
|
||||
|
|
|
@ -70,8 +70,8 @@ namespace api {
|
|||
//
|
||||
// ------------------------
|
||||
|
||||
context::context(context_params * p, bool user_ref_count):
|
||||
m_params(p != nullptr ? *p : context_params()),
|
||||
context::context(ast_context * p, bool user_ref_count):
|
||||
m_params(p != nullptr ? *p : ast_context()),
|
||||
m_user_ref_count(user_ref_count),
|
||||
m_manager(m_params.mk_ast_manager()),
|
||||
m_plugins(m()),
|
||||
|
@ -343,7 +343,7 @@ extern "C" {
|
|||
Z3_TRY;
|
||||
LOG_Z3_mk_context(c);
|
||||
memory::initialize(UINT_MAX);
|
||||
Z3_context r = reinterpret_cast<Z3_context>(alloc(api::context, reinterpret_cast<context_params*>(c), false));
|
||||
Z3_context r = reinterpret_cast<Z3_context>(alloc(api::context, reinterpret_cast<ast_context*>(c), false));
|
||||
RETURN_Z3(r);
|
||||
Z3_CATCH_RETURN_NO_HANDLE(nullptr);
|
||||
}
|
||||
|
@ -352,7 +352,7 @@ extern "C" {
|
|||
Z3_TRY;
|
||||
LOG_Z3_mk_context_rc(c);
|
||||
memory::initialize(UINT_MAX);
|
||||
Z3_context r = reinterpret_cast<Z3_context>(alloc(api::context, reinterpret_cast<context_params*>(c), true));
|
||||
Z3_context r = reinterpret_cast<Z3_context>(alloc(api::context, reinterpret_cast<ast_context*>(c), true));
|
||||
RETURN_Z3(r);
|
||||
Z3_CATCH_RETURN_NO_HANDLE(nullptr);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@ Revision History:
|
|||
#include "smt/smt_kernel.h"
|
||||
#include "smt/smt_solver.h"
|
||||
#include "cmd_context/tactic_manager.h"
|
||||
#include "params/context_params.h"
|
||||
#include "cmd_context/cmd_context.h"
|
||||
#include "solver/solver.h"
|
||||
#include "api/z3.h"
|
||||
|
@ -74,7 +73,7 @@ namespace api {
|
|||
|
||||
class context : public tactic_manager {
|
||||
struct add_plugins { add_plugins(ast_manager & m); };
|
||||
context_params m_params;
|
||||
ast_context m_params;
|
||||
bool m_user_ref_count; //!< if true, the user is responsible for managing reference counters.
|
||||
scoped_ptr<ast_manager> m_manager;
|
||||
scoped_ptr<cmd_context> m_cmd;
|
||||
|
@ -136,11 +135,11 @@ namespace api {
|
|||
//
|
||||
// ------------------------
|
||||
|
||||
context(context_params * p, bool user_ref_count = false);
|
||||
context(ast_context * p, bool user_ref_count = false);
|
||||
~context();
|
||||
ast_manager & m() const { return *(m_manager.get()); }
|
||||
|
||||
context_params & params() { m_params.updt_params(); return m_params; }
|
||||
ast_context & params() { m_params.updt_params(); return m_params; }
|
||||
scoped_ptr<cmd_context>& cmd() { return m_cmd; }
|
||||
bool produce_proofs() const { return m().proofs_enabled(); }
|
||||
bool produce_models() const { return m_params.m_model; }
|
||||
|
|
|
@ -876,7 +876,7 @@ extern "C" {
|
|||
solver::push_eh_t _push = push_eh;
|
||||
solver::pop_eh_t _pop = pop_eh;
|
||||
solver::fresh_eh_t _fresh = [&](void * user_ctx, ast_manager& m, solver::context_obj*& _ctx) {
|
||||
context_params params;
|
||||
ast_context params;
|
||||
params.set_foreign_manager(&m);
|
||||
auto* ctx = alloc(api::context, ¶ms, false);
|
||||
_ctx = alloc(api_context_obj, ctx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue