mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 09:35:32 +00:00
support for smtlib2.6 datatype parsing
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
5492d0e135
commit
5d17e28667
29 changed files with 374 additions and 206 deletions
|
@ -174,7 +174,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
if (fid == m_dt_util.get_family_id()) {
|
||||
// In the current implementation, I only handle the case where
|
||||
// the datatype has a recursive constructor.
|
||||
ptr_vector<func_decl> const & constructors = m_dt_util.get_datatype_constructors(s);
|
||||
ptr_vector<func_decl> const & constructors = *m_dt_util.get_datatype_constructors(s);
|
||||
for (func_decl * constructor : constructors) {
|
||||
unsigned num = constructor->get_arity();
|
||||
unsigned target = UINT_MAX;
|
||||
|
@ -704,7 +704,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
app * u;
|
||||
if (!mk_fresh_uncnstr_var_for(f, num, args, u))
|
||||
return u;
|
||||
ptr_vector<func_decl> const & accs = m_dt_util.get_constructor_accessors(c);
|
||||
ptr_vector<func_decl> const & accs = *m_dt_util.get_constructor_accessors(c);
|
||||
ptr_buffer<expr> new_args;
|
||||
for (unsigned i = 0; i < accs.size(); i++) {
|
||||
if (accs[i] == f)
|
||||
|
@ -723,7 +723,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
return u;
|
||||
if (!m_mc)
|
||||
return u;
|
||||
ptr_vector<func_decl> const & accs = m_dt_util.get_constructor_accessors(f);
|
||||
ptr_vector<func_decl> const & accs = *m_dt_util.get_constructor_accessors(f);
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
add_def(args[i], m().mk_app(accs[i], u));
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ public:
|
|||
if (m.is_eq(b, u, v) && is_uninterp_const(u) && m_rewriter.bv2enum().find(to_app(u)->get_decl(), f) && bv.is_numeral(v, num, bvsize)) {
|
||||
SASSERT(num.is_unsigned());
|
||||
expr_ref head(m);
|
||||
ptr_vector<func_decl> const& enums = dt.get_datatype_constructors(f->get_range());
|
||||
ptr_vector<func_decl> const& enums = *dt.get_datatype_constructors(f->get_range());
|
||||
if (enums.size() > num.get_unsigned()) {
|
||||
head = m.mk_eq(m.mk_const(f), m.mk_const(enums[num.get_unsigned()]));
|
||||
consequences[i] = m.mk_implies(a, head);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue