mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
fix #5289
This commit is contained in:
parent
4d41db2920
commit
b1606487f0
9 changed files with 88 additions and 41 deletions
|
@ -54,7 +54,9 @@ namespace recfun {
|
|||
unsigned arity, sort* const * domain, sort* range, bool is_generated)
|
||||
: m(m), m_name(s),
|
||||
m_domain(m, arity, domain),
|
||||
m_range(range, m), m_vars(m), m_cases(),
|
||||
m_range(range, m),
|
||||
m_vars(m),
|
||||
m_cases(),
|
||||
m_decl(m),
|
||||
m_rhs(m),
|
||||
m_fid(fid)
|
||||
|
@ -413,6 +415,16 @@ namespace recfun {
|
|||
m_defs.insert(d->get_decl(), d);
|
||||
return promise_def(&u(), d);
|
||||
}
|
||||
|
||||
void plugin::erase_def(func_decl* f) {
|
||||
def* d = nullptr;
|
||||
if (m_defs.find(f, d)) {
|
||||
for (case_def & c : d->get_cases())
|
||||
m_case_defs.erase(c.get_decl());
|
||||
m_defs.erase(f);
|
||||
dealloc(d);
|
||||
}
|
||||
}
|
||||
|
||||
void plugin::set_definition(replace& r, promise_def & d, unsigned n_vars, var * const * vars, expr * rhs) {
|
||||
u().set_definition(r, d, n_vars, vars, rhs);
|
||||
|
|
|
@ -186,6 +186,8 @@ namespace recfun {
|
|||
|
||||
def* mk_def(replace& subst, symbol const& name, unsigned n, sort ** params, sort * range, unsigned n_vars, var ** vars, expr * rhs);
|
||||
|
||||
void erase_def(func_decl* f);
|
||||
|
||||
bool has_def(func_decl* f) const { return m_defs.contains(f); }
|
||||
bool has_defs() const;
|
||||
def const& get_def(func_decl* f) const { return *(m_defs[f]); }
|
||||
|
|
|
@ -25,7 +25,7 @@ Notes:
|
|||
|
||||
expr_ref var_subst::operator()(expr * n, unsigned num_args, expr * const * args) {
|
||||
expr_ref result(m_reducer.m());
|
||||
if (is_ground(n)) {
|
||||
if (is_ground(n) || num_args == 0) {
|
||||
result = n;
|
||||
//application does not have free variables or nested quantifiers.
|
||||
//There is no need to print the bindings here?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue