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

more reorg

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-12-01 17:03:14 -08:00
parent 32791204e7
commit 29cf179364
20 changed files with 31 additions and 91 deletions

View file

@ -48,7 +48,7 @@ namespace smt {
void model_generator::init_model() {
SASSERT(!m_model);
// PARAM-TODO
// PARAM-TODO smt_params ---> params_ref
m_model = alloc(proto_model, m_manager, m_context->get_simplifier()); // , m_context->get_fparams());
ptr_vector<theory>::const_iterator it = m_context->begin_theories();
ptr_vector<theory>::const_iterator end = m_context->end_theories();

View file

@ -24,22 +24,19 @@ Notes:
namespace smt {
class solver : public solver_na2as {
front_end_params * m_params;
front_end_params m_params;
smt::kernel * m_context;
progress_callback * m_callback;
public:
solver():m_params(0), m_context(0), m_callback(0) {}
solver():m_context(0), m_callback(0) {}
virtual ~solver() {
if (m_context != 0)
dealloc(m_context);
}
virtual void set_front_end_params(front_end_params & p) {
m_params = &p;
}
virtual void updt_params(params_ref const & p) {
// PARAM-TODO copy p --> m_params
if (m_context == 0)
return;
m_context->updt_params(p);
@ -49,8 +46,7 @@ namespace smt {
if (m_context == 0) {
ast_manager m;
reg_decl_plugins(m);
front_end_params p;
smt::kernel s(m, p);
smt::kernel s(m, m_params);
s.collect_param_descrs(r);
}
else {
@ -59,11 +55,10 @@ namespace smt {
}
virtual void init_core(ast_manager & m, symbol const & logic) {
SASSERT(m_params);
reset();
#pragma omp critical (solver)
{
m_context = alloc(smt::kernel, m, *m_params);
m_context = alloc(smt::kernel, m, m_params);
if (m_callback)
m_context->set_progress_callback(m_callback);
}

View file

@ -24,7 +24,7 @@ Notes:
#include"rewriter_types.h"
class smt_tactic : public tactic {
scoped_ptr<front_end_params> m_params;
front_end_params m_params;
params_ref m_params_ref;
statistics m_stats;
std::string m_failure;
@ -52,11 +52,7 @@ public:
}
front_end_params & fparams() {
if (!m_params) {
m_params = alloc(front_end_params);
params2front_end_params(m_params_ref, fparams());
}
return *m_params;
return m_params;
}
void updt_params_core(params_ref const & p) {
@ -68,6 +64,7 @@ public:
TRACE("smt_tactic", tout << this << "\nupdt_params: " << p << "\n";);
updt_params_core(p);
m_params_ref = p;
// PARAM-TODO update params2front_end_params p ---> m_params
params2front_end_params(m_params_ref, fparams());
SASSERT(p.get_bool("auto_config", fparams().m_auto_config) == fparams().m_auto_config);
}
@ -97,14 +94,6 @@ public:
m_stats.reset();
}
// for backward compatibility
virtual void set_front_end_params(front_end_params & p) {
m_params = alloc(front_end_params, p);
SASSERT(m_params.get() == &fparams());
// must propagate the params_ref to fparams
params2front_end_params(m_params_ref, fparams());
}
virtual void set_logic(symbol const & l) {
m_logic = l;
}