3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-24 03:57:51 +00:00

hide new datatype plugin

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-09-03 20:01:59 -07:00
parent 09386e43e3
commit a3dba5b2f9
24 changed files with 211 additions and 191 deletions

View file

@ -47,11 +47,11 @@ br_status datatype_rewriter::mk_app_core(func_decl * f, unsigned num_args, expr
func_decl * c_decl = a->get_decl();
if (c_decl != m_util.get_accessor_constructor(f))
return BR_FAILED;
ptr_vector<func_decl> const * acc = m_util.get_constructor_accessors(c_decl);
SASSERT(acc && acc->size() == a->get_num_args());
unsigned num = acc->size();
ptr_vector<func_decl> const & acc = m_util.get_constructor_accessors(c_decl);
SASSERT(acc.size() == a->get_num_args());
unsigned num = acc.size();
for (unsigned i = 0; i < num; ++i) {
if (f == (*acc)[i]) {
if (f == acc[i]) {
// found it.
result = a->get_arg(i);
return BR_DONE;
@ -70,13 +70,13 @@ br_status datatype_rewriter::mk_app_core(func_decl * f, unsigned num_args, expr
result = a;
return BR_DONE;
}
ptr_vector<func_decl> const * acc = m_util.get_constructor_accessors(c_decl);
SASSERT(acc && acc->size() == a->get_num_args());
unsigned num = acc->size();
ptr_vector<func_decl> const & acc = m_util.get_constructor_accessors(c_decl);
SASSERT(acc.size() == a->get_num_args());
unsigned num = acc.size();
ptr_buffer<expr> new_args;
for (unsigned i = 0; i < num; ++i) {
if (f == (*acc)[i]) {
if (f == acc[i]) {
new_args.push_back(args[1]);
}
else {

View file

@ -130,7 +130,7 @@ struct enum2bv_rewriter::imp {
m_imp.m_bounds.push_back(m_bv.mk_ule(result, m_bv.mk_numeral(nc-1, bv_size)));
}
expr_ref f_def(m);
ptr_vector<func_decl> const& cs = *m_dt.get_datatype_constructors(s);
ptr_vector<func_decl> const& cs = m_dt.get_datatype_constructors(s);
f_def = m.mk_const(cs[nc-1]);
for (unsigned i = nc - 1; i > 0; ) {
--i;