3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

Treat arguments to recursive functions as beta redexes

An argument to a recursive function would escape the scope of the function application when the recursive function definitions are unfolded. Therefore, such argument occurrences need not be considered for extensional equality / equality sharing.

This filter is mostly relevant for recursive functions that take a lambda expression as argument. Lambda expressions / arrays that occur in shared occurrences are checked for extensionality.
This commit is contained in:
Nikolaj Bjorner 2022-06-12 10:48:55 -07:00
parent 25ad5cb073
commit 637120ced5
4 changed files with 16 additions and 0 deletions

View file

@ -467,6 +467,15 @@ namespace smt {
return found;
}
/**
* n is an argument of p, if p is a function definition or case predicate,
* then there is no reason for the solver to enforce that equality on n is
* fully determined. It is a beta-redex with respect to expanding p.
*/
bool theory_recfun::is_beta_redex(enode* p, enode* n) const {
return is_defined(p) || is_case_pred(p);
}
void theory_recfun::display(std::ostream & out) const {
out << "recfun\n";
out << "disabled guards:\n" << m_disabled_guards << "\n";

View file

@ -99,6 +99,7 @@ namespace smt {
bool can_propagate() override;
void propagate() override;
bool should_research(expr_ref_vector &) override;
bool is_beta_redex(enode* p, enode* n) const override;
void new_eq_eh(theory_var v1, theory_var v2) override {}
void new_diseq_eh(theory_var v1, theory_var v2) override {}