mirror of
https://github.com/Z3Prover/z3
synced 2025-08-01 08:53:18 +00:00
#5486 - improve type elaboration by epsilon to make common cases parse without type annotation
This commit is contained in:
parent
7f88cfe727
commit
5c9f4dc4d7
4 changed files with 76 additions and 4 deletions
|
@ -367,6 +367,25 @@ namespace datatype {
|
|||
return m.mk_func_decl(name, arity, domain, range, info);
|
||||
}
|
||||
|
||||
ptr_vector<constructor> plugin::get_constructors(symbol const& s) const {
|
||||
ptr_vector<constructor> result;
|
||||
for (auto [k, d] : m_defs)
|
||||
for (auto* c : *d)
|
||||
if (c->name() == s)
|
||||
result.push_back(c);
|
||||
return result;
|
||||
}
|
||||
|
||||
ptr_vector<accessor> plugin::get_accessors(symbol const& s) const {
|
||||
ptr_vector<accessor> result;
|
||||
for (auto [k, d] : m_defs)
|
||||
for (auto* c : *d)
|
||||
for (auto* a : *c)
|
||||
if (a->name() == s)
|
||||
result.push_back(a);
|
||||
return result;
|
||||
}
|
||||
|
||||
func_decl * decl::plugin::mk_recognizer(unsigned num_parameters, parameter const * parameters,
|
||||
unsigned arity, sort * const * domain, sort *) {
|
||||
ast_manager& m = *m_manager;
|
||||
|
@ -556,9 +575,8 @@ namespace datatype {
|
|||
|
||||
void plugin::remove(symbol const& s) {
|
||||
def* d = nullptr;
|
||||
if (m_defs.find(s, d)) {
|
||||
if (m_defs.find(s, d))
|
||||
dealloc(d);
|
||||
}
|
||||
m_defs.remove(s);
|
||||
}
|
||||
|
||||
|
|
|
@ -248,6 +248,8 @@ namespace datatype {
|
|||
|
||||
def const& get_def(sort* s) const { return *(m_defs[datatype_name(s)]); }
|
||||
def& get_def(symbol const& s) { return *(m_defs[s]); }
|
||||
ptr_vector<constructor> get_constructors(symbol const& s) const;
|
||||
ptr_vector<accessor> get_accessors(symbol const& s) const;
|
||||
bool is_declared(sort* s) const { return m_defs.contains(datatype_name(s)); }
|
||||
unsigned get_axiom_base_id(symbol const& s) { return m_axiom_bases[s]; }
|
||||
util & u() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue