3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-05 21:53:23 +00:00

move mk_fresh to inside files that include smt_context.h directly to address build problem reported in #297

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-11-07 11:50:06 -08:00
parent 73c4e938ce
commit 8d1fa3ae50
13 changed files with 35 additions and 7 deletions

View file

@ -35,6 +35,10 @@ namespace smt {
m_var_data_full.reset(); m_var_data_full.reset();
} }
theory* theory_array_full::mk_fresh(context* new_ctx) {
return alloc(theory_array_full, new_ctx->get_manager(), m_params);
}
void theory_array_full::add_map(theory_var v, enode* s) { void theory_array_full::add_map(theory_var v, enode* s) {
if (m_params.m_array_cg && !s->is_cgr()) { if (m_params.m_array_cg && !s->is_cgr()) {
return; return;

View file

@ -91,7 +91,7 @@ namespace smt {
theory_array_full(ast_manager & m, theory_array_params & params); theory_array_full(ast_manager & m, theory_array_params & params);
virtual ~theory_array_full(); virtual ~theory_array_full();
virtual theory * mk_fresh(context * new_ctx) { return alloc(theory_array_full, new_ctx->get_manager(), m_params); } virtual theory * mk_fresh(context * new_ctx);
virtual void merge_eh(theory_var v1, theory_var v2, theory_var, theory_var); virtual void merge_eh(theory_var v1, theory_var v2, theory_var, theory_var);
virtual void display_var(std::ostream & out, theory_var v) const; virtual void display_var(std::ostream & out, theory_var v) const;

View file

@ -36,6 +36,11 @@ namespace smt {
virtual theory_id get_from_theory() const { return null_theory_id; } virtual theory_id get_from_theory() const { return null_theory_id; }
}; };
theory* theory_datatype::mk_fresh(context* new_ctx) {
return alloc(theory_datatype, new_ctx->get_manager(), m_params);
}
/** /**
\brief Assert the axiom (antecedent => lhs = rhs) \brief Assert the axiom (antecedent => lhs = rhs)
antecedent may be null_literal antecedent may be null_literal

View file

@ -101,7 +101,7 @@ namespace smt {
public: public:
theory_datatype(ast_manager & m, theory_datatype_params & p); theory_datatype(ast_manager & m, theory_datatype_params & p);
virtual ~theory_datatype(); virtual ~theory_datatype();
virtual theory * mk_fresh(context * new_ctx) { return alloc(theory_datatype, new_ctx->get_manager(), m_params); } virtual theory * mk_fresh(context * new_ctx);
virtual void display(std::ostream & out) const; virtual void display(std::ostream & out) const;
virtual void collect_statistics(::statistics & st) const; virtual void collect_statistics(::statistics & st) const;
virtual void init_model(model_generator & m); virtual void init_model(model_generator & m);

View file

@ -282,7 +282,7 @@ namespace smt {
theory_dense_diff_logic(ast_manager & m, theory_arith_params & p); theory_dense_diff_logic(ast_manager & m, theory_arith_params & p);
virtual ~theory_dense_diff_logic() { reset_eh(); } virtual ~theory_dense_diff_logic() { reset_eh(); }
virtual theory * mk_fresh(context * new_ctx) { return alloc(theory_dense_diff_logic, new_ctx->get_manager(), m_params); } virtual theory * mk_fresh(context * new_ctx);
virtual char const * get_name() const { return "difference-logic"; } virtual char const * get_name() const { return "difference-logic"; }

View file

@ -39,6 +39,11 @@ namespace smt {
m_edges.push_back(edge()); m_edges.push_back(edge());
} }
template<typename Ext>
theory* theory_dense_diff_logic<Ext>::mk_fresh(context * new_ctx) {
return alloc(theory_dense_diff_logic<Ext>, new_ctx->get_manager(), m_params);
}
template<typename Ext> template<typename Ext>
inline app * theory_dense_diff_logic<Ext>::mk_zero_for(expr * n) { inline app * theory_dense_diff_logic<Ext>::mk_zero_for(expr * n) {
return m_autil.mk_numeral(rational(0), get_manager().get_sort(n)); return m_autil.mk_numeral(rational(0), get_manager().get_sort(n));

View file

@ -243,7 +243,7 @@ namespace smt {
reset_eh(); reset_eh();
} }
virtual theory * mk_fresh(context * new_ctx) { return alloc(theory_diff_logic, new_ctx->get_manager(), m_params); } virtual theory * mk_fresh(context * new_ctx);
virtual char const * get_name() const { return "difference-logic"; } virtual char const * get_name() const { return "difference-logic"; }

View file

@ -1384,5 +1384,11 @@ bool theory_diff_logic<Ext>::internalize_objective(expr * n, rational const& m,
return true; return true;
} }
template<typename Ext>
theory* theory_diff_logic<Ext>::mk_fresh(context* new_ctx) {
return alloc(theory_diff_logic<Ext>, new_ctx->get_manager(), m_params);
}
#endif /* THEORY_DIFF_LOGIC_DEF_H_ */ #endif /* THEORY_DIFF_LOGIC_DEF_H_ */

View file

@ -716,6 +716,10 @@ namespace smt {
return; return;
} }
theory* theory_fpa::mk_fresh(context* new_ctx) {
return alloc(theory_fpa, new_ctx->get_manager());
}
void theory_fpa::push_scope_eh() { void theory_fpa::push_scope_eh() {
theory::push_scope_eh(); theory::push_scope_eh();
m_trail_stack.push_scope(); m_trail_stack.push_scope();

View file

@ -158,7 +158,7 @@ namespace smt {
virtual void push_scope_eh(); virtual void push_scope_eh();
virtual void pop_scope_eh(unsigned num_scopes); virtual void pop_scope_eh(unsigned num_scopes);
virtual void reset_eh(); virtual void reset_eh();
virtual theory* mk_fresh(context* new_ctx) { return alloc(theory_fpa, new_ctx->get_manager()); } virtual theory* mk_fresh(context* new_ctx);
virtual char const * get_name() const { return "fpa"; } virtual char const * get_name() const { return "fpa"; }
virtual model_value_proc * mk_value(enode * n, model_generator & mg); virtual model_value_proc * mk_value(enode * n, model_generator & mg);

View file

@ -156,5 +156,5 @@ namespace smt {
return true; return true;
} }
} }

View file

@ -183,7 +183,7 @@ namespace smt {
virtual ~theory_utvpi(); virtual ~theory_utvpi();
virtual theory * mk_fresh(context * new_ctx) { return alloc(theory_utvpi, new_ctx->get_manager()); } virtual theory * mk_fresh(context * new_ctx);
virtual char const * get_name() const { return "utvpi-logic"; } virtual char const * get_name() const { return "utvpi-logic"; }

View file

@ -942,6 +942,10 @@ namespace smt {
} }
} }
template<typename Ext>
theory* theory_utvpi<Ext>::mk_fresh(context* new_ctx) {
return alloc(theory_utvpi<Ext>, new_ctx->get_manager());
}
}; };