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

Make ast_manager::get_family_id(symbol const &) side-effect free. The version with side-effects is now called ast_manager::mk_family_id

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-12-18 17:14:25 -08:00
parent 3ddb1a85f1
commit d92efeb0c5
56 changed files with 127 additions and 108 deletions

View file

@ -34,7 +34,7 @@ func_decl * mk_aux_decl_for_array_sort(ast_manager & m, sort * s) {
}
array_factory::array_factory(ast_manager & m, proto_model & md):
struct_factory(m, m.get_family_id("array"), md) {
struct_factory(m, m.mk_family_id("array"), md) {
}
/**

View file

@ -22,7 +22,7 @@ Revision History:
#include"ast_ll_pp.h"
datatype_factory::datatype_factory(ast_manager & m, proto_model & md):
struct_factory(m, m.get_family_id("datatype"), md),
struct_factory(m, m.mk_family_id("datatype"), md),
m_util(m) {
}

View file

@ -24,7 +24,7 @@ app * arith_factory::mk_value_core(rational const & val, sort * s) {
}
arith_factory::arith_factory(ast_manager & m):
numeral_factory(m, m.get_family_id("arith")),
numeral_factory(m, m.mk_family_id("arith")),
m_util(m) {
}
@ -36,7 +36,7 @@ app * arith_factory::mk_value(rational const & val, bool is_int) {
}
bv_factory::bv_factory(ast_manager & m):
numeral_factory(m, m.get_family_id("bv")),
numeral_factory(m, m.mk_family_id("bv")),
m_util(m) {
}

View file

@ -31,7 +31,7 @@ proto_model::proto_model(ast_manager & m, simplifier & s, params_ref const & p):
model_core(m),
m_asts(m),
m_simplifier(s),
m_afid(m.get_family_id(symbol("array"))) {
m_afid(m.mk_family_id(symbol("array"))) {
register_factory(alloc(basic_factory, m));
m_user_sort_factory = alloc(user_sort_factory, m);
register_factory(m_user_sort_factory);

View file

@ -51,7 +51,7 @@ expr * basic_factory::get_fresh_value(sort * s) {
}
user_sort_factory::user_sort_factory(ast_manager & m):
simple_factory<unsigned>(m, m.get_family_id("user-sort")) {
simple_factory<unsigned>(m, m.mk_family_id("user-sort")) {
}
void user_sort_factory::freeze_universe(sort * s) {

View file

@ -454,8 +454,8 @@ namespace smt {
m_model(0),
m_eval_cache_range(m),
m_new_constraints(0) {
m_asimp = static_cast<arith_simplifier_plugin*>(s.get_plugin(m.get_family_id("arith")));
m_bvsimp = static_cast<bv_simplifier_plugin*>(s.get_plugin(m.get_family_id("bv")));
m_asimp = static_cast<arith_simplifier_plugin*>(s.get_plugin(m.mk_family_id("arith")));
m_bvsimp = static_cast<bv_simplifier_plugin*>(s.get_plugin(m.mk_family_id("bv")));
}
~auf_solver() {

View file

@ -692,7 +692,7 @@ namespace smt {
void setup::setup_arith() {
switch(m_params.m_arith_mode) {
case AS_NO_ARITH:
m_context.register_plugin(alloc(smt::theory_dummy, m_manager.get_family_id("arith"), "no arithmetic"));
m_context.register_plugin(alloc(smt::theory_dummy, m_manager.mk_family_id("arith"), "no arithmetic"));
break;
case AS_DIFF_LOGIC:
if (m_params.m_arith_fixnum) {
@ -734,7 +734,7 @@ namespace smt {
void setup::setup_bv() {
switch(m_params.m_bv_mode) {
case BS_NO_BV:
m_context.register_plugin(alloc(smt::theory_dummy, m_manager.get_family_id("bv"), "no bit-vector"));
m_context.register_plugin(alloc(smt::theory_dummy, m_manager.mk_family_id("bv"), "no bit-vector"));
break;
case BS_BLASTER:
m_context.register_plugin(alloc(smt::theory_bv, m_manager, m_params, m_params));
@ -745,7 +745,7 @@ namespace smt {
void setup::setup_arrays() {
switch(m_params.m_array_mode) {
case AR_NO_ARRAY:
m_context.register_plugin(alloc(smt::theory_dummy, m_manager.get_family_id("array"), "no array"));
m_context.register_plugin(alloc(smt::theory_dummy, m_manager.mk_family_id("array"), "no array"));
break;
case AR_SIMPLE:
m_context.register_plugin(alloc(smt::theory_array, m_manager, m_params));

View file

@ -1294,7 +1294,7 @@ namespace smt {
template<typename Ext>
theory_arith<Ext>::theory_arith(ast_manager & m, theory_arith_params & params):
theory(m.get_family_id("arith")),
theory(m.mk_family_id("arith")),
m_params(params),
m_util(m),
m_arith_eq_solver(m),

View file

@ -27,7 +27,7 @@ Revision History:
namespace smt {
theory_array_base::theory_array_base(ast_manager & m):
theory(m.get_family_id("array")),
theory(m.mk_family_id("array")),
m_found_unsupported_op(false)
{
}

View file

@ -1239,7 +1239,7 @@ namespace smt {
}
theory_bv::theory_bv(ast_manager & m, theory_bv_params const & params, bit_blaster_params const & bb_params):
theory(m.get_family_id("bv")),
theory(m.mk_family_id("bv")),
m_params(params),
m_util(m),
m_autil(m),

View file

@ -454,7 +454,7 @@ namespace smt {
}
theory_datatype::theory_datatype(ast_manager & m, theory_datatype_params & p):
theory(m.get_family_id("datatype")),
theory(m.mk_family_id("datatype")),
m_params(p),
m_util(m),
m_find(*this),

View file

@ -28,7 +28,7 @@ namespace smt {
template<typename Ext>
theory_dense_diff_logic<Ext>::theory_dense_diff_logic(ast_manager & m, theory_arith_params & p):
theory(m.get_family_id("arith")),
theory(m.mk_family_id("arith")),
m_params(p),
m_autil(m),
m_arith_eq_adapter(*this, p, m_autil),

View file

@ -306,7 +306,7 @@ namespace smt {
public:
theory_diff_logic(ast_manager& m, smt_params & params):
theory(m.get_family_id("arith")),
theory(m.mk_family_id("arith")),
m_params(params),
m_util(m),
m_arith_eq_adapter(*this, params, m_util),

View file

@ -88,7 +88,7 @@ namespace smt {
m_th.get_rep(s, r, v);
app_ref rep_of(m_th.m());
rep_of = m_th.m().mk_app(r, m_node->get_owner());
theory_id bv_id = m_th.m().get_family_id("bv");
theory_id bv_id = m_th.m().mk_family_id("bv");
theory_bv* th_bv = dynamic_cast<theory_bv*>(ctx.get_theory(bv_id));
SASSERT(th_bv);
rational val;
@ -106,7 +106,7 @@ namespace smt {
public:
theory_dl(ast_manager& m):
theory(m.get_family_id("datalog_relation")),
theory(m.mk_family_id("datalog_relation")),
m_util(m),
m_bv(m),
m_trail(m)

View file

@ -32,7 +32,7 @@ namespace smt {
virtual theory* mk_fresh(context*) { return alloc(theory_seq_empty, get_manager()); }
virtual char const * get_name() const { return "seq-empty"; }
public:
theory_seq_empty(ast_manager& m):theory(m.get_family_id("seq")), m_used(false) {}
theory_seq_empty(ast_manager& m):theory(m.mk_family_id("seq")), m_used(false) {}
};
};

View file

@ -646,7 +646,7 @@ namespace smt {
context & ctx = _s.get_context(); // HACK
symbol _name(name);
ast_manager & m = ctx.get_manager();
family_id fid = m.get_family_id(_name);
family_id fid = m.mk_family_id(_name);
user_decl_plugin * dp = alloc(user_decl_plugin);
m.register_plugin(fid, dp);
simplifier & s = ctx.get_simplifier();