How to deal with alpha-equivalence? #232
Unanswered
silversquirl
asked this question in
Q&A
Replies: 2 comments 2 replies
-
There's a preprint by @Bastacyclop where they address that issue with some ideas for mitigation. It doesn't sound like it from the title, but it's exactly what they discuss in 4.1: https://arxiv.org/abs/2111.13040 |
Beta Was this translation helpful? Give feedback.
1 reply
-
I wrote a blog post about one idea for this: https://pavpanchekha.com/blog/egg-bindings.html It basically proposes using an explicit-substitution calculus plus de Bruijn indices. It's "e-graphy" but I'm not sure it's faster than rewriting the whole tree to remove an abstraction layer. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to apply egg to optimization of lambda calculus terms, but it's proving rather difficult because e-graphs don't have any concept of alpha-equivalence. If I add a rule that can generate fresh variables, it ends up generating hundreds of equivalent terms that all have to be stored in the e-graph because they use different names.
I've heard some mentions of using de Bruijn indexing to work around this problem but I'm not sure how to write rules for this nicely - anything that removes an abstraction would require rewriting the entire nested tree to adjust all the indices, which gets quite annoying quite quickly.
Any suggestions on how to handle this problem?
Beta Was this translation helpful? Give feedback.
All reactions