mirror of
https://github.com/Z3Prover/z3
synced 2025-05-05 23:05:46 +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
|
@ -87,7 +87,7 @@ typedef ptr_hashtable<psort, psort_hash_proc, psort_eq_proc> psort_table;
|
|||
|
||||
#define PSORT_DECL_VAR_PARAMS UINT_MAX
|
||||
|
||||
typedef enum { PSORT_BASE = 0, PSORT_USER, PSORT_BUILTIN } psort_decl_kind;
|
||||
typedef enum { PSORT_BASE = 0, PSORT_USER, PSORT_BUILTIN, PSORT_DT } psort_decl_kind;
|
||||
|
||||
class psort_decl : public pdecl {
|
||||
protected:
|
||||
|
@ -111,6 +111,7 @@ public:
|
|||
virtual void reset_cache(pdecl_manager& m);
|
||||
bool is_user_decl() const { return m_psort_kind == PSORT_USER; }
|
||||
bool is_builtin_decl() const { return m_psort_kind == PSORT_BUILTIN; }
|
||||
bool is_dt_decl() const { return m_psort_kind == PSORT_DT; }
|
||||
};
|
||||
|
||||
class psort_user_decl : public psort_decl {
|
||||
|
@ -125,7 +126,7 @@ public:
|
|||
virtual sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s);
|
||||
virtual void display(std::ostream & out) const;
|
||||
};
|
||||
|
||||
|
||||
class psort_builtin_decl : public psort_decl {
|
||||
protected:
|
||||
friend class pdecl_manager;
|
||||
|
@ -140,10 +141,17 @@ public:
|
|||
virtual void display(std::ostream & out) const;
|
||||
};
|
||||
|
||||
//class datatype_decl_plugin;
|
||||
//class datatype_decl;
|
||||
//class constructor_decl;
|
||||
//class accessor_decl;
|
||||
class psort_dt_decl : public psort_decl {
|
||||
protected:
|
||||
friend class pdecl_manager;
|
||||
psort_dt_decl(unsigned id, unsigned num_params, pdecl_manager & m, symbol const & n);
|
||||
virtual size_t obj_size() const { return sizeof(psort_dt_decl); }
|
||||
virtual ~psort_dt_decl() {}
|
||||
public:
|
||||
virtual sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s);
|
||||
virtual void display(std::ostream & out) const;
|
||||
};
|
||||
|
||||
|
||||
class pdatatypes_decl;
|
||||
class pdatatype_decl;
|
||||
|
@ -233,6 +241,9 @@ public:
|
|||
virtual void display(std::ostream & out) const;
|
||||
bool has_missing_refs(symbol & missing) const;
|
||||
bool has_duplicate_accessors(symbol & repeated) const;
|
||||
#ifdef DATATYPE_V2
|
||||
bool commit(pdecl_manager& m);
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -250,6 +261,10 @@ class pdatatypes_decl : public pdecl {
|
|||
virtual ~pdatatypes_decl() {}
|
||||
public:
|
||||
pdatatype_decl const * const * children() const { return m_datatypes.c_ptr(); }
|
||||
#ifdef DATATYPE_V2
|
||||
// commit declaration
|
||||
bool commit(pdecl_manager& m);
|
||||
#endif
|
||||
};
|
||||
|
||||
class new_datatype_eh {
|
||||
|
@ -292,7 +307,7 @@ public:
|
|||
psort * mk_psort_var(unsigned num_params, unsigned vidx);
|
||||
psort * mk_psort_app(unsigned num_params, psort_decl * d, unsigned num_args, psort * const * args);
|
||||
psort * mk_psort_app(psort_decl * d);
|
||||
// psort_decl * mk_psort_dt_decl(unsigned num_params, symbol const & n);
|
||||
psort_decl * mk_psort_dt_decl(unsigned num_params, symbol const & n);
|
||||
psort_decl * mk_psort_user_decl(unsigned num_params, symbol const & n, psort * def);
|
||||
psort_decl * mk_psort_builtin_decl(symbol const & n, family_id fid, decl_kind k);
|
||||
paccessor_decl * mk_paccessor_decl(unsigned num_params, symbol const & s, ptype const & p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue