3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-11 17:54:43 +00:00

remove level of indirection for context and ast_manager in smt_theory (#4253)

* remove level of indirection for context and ast_manager in smt_theory

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* add request by #4252

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* move to def

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* int

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-05-08 16:46:03 -07:00 committed by GitHub
parent 17b8db95c1
commit becf423c77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 750 additions and 1257 deletions

View file

@ -30,16 +30,16 @@ namespace smt {
class model_value_proc;
class theory {
protected:
theory_id m_id;
context * m_context;
ast_manager * m_manager;
context & ctx;
ast_manager & m;
enode_vector m_var2enode;
unsigned_vector m_var2enode_lim;
friend class context;
friend class arith_value;
protected:
virtual void init(context * ctx);
/* ---------------------------------------------------
@ -351,11 +351,12 @@ namespace smt {
public:
theory(family_id fid);
theory(context& ctx, family_id fid);
virtual ~theory();
virtual void setup() {
}
virtual void setup() {}
virtual void init() {}
theory_id get_id() const {
return m_id;
@ -366,17 +367,15 @@ namespace smt {
}
context & get_context() const {
SASSERT(m_context);
return *m_context;
return ctx;
}
context & ctx() const { return get_context(); }
ast_manager & get_manager() const {
SASSERT(m_manager);
return *m_manager;
return m;
}
smt_params const& get_fparams() const;
enode * get_enode(theory_var v) const {
SASSERT(v < static_cast<int>(m_var2enode.size()));
return m_var2enode[v];
@ -453,7 +452,7 @@ namespace smt {
void log_axiom_unit(app* r) {
log_axiom_instantiation(r);
m_manager->trace_stream() << "[end-of-instance]\n";
m.trace_stream() << "[end-of-instance]\n";
}
public: