New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to work with De Bruijn indexes? #596
Comments
@joneshf: It's going to be very similar to how α-normalization works, except that instead of renaming each variable to See: https://github.com/dhall-lang/dhall-lang/blob/master/standard/semantics.md#%CE%B1-normalization For example, this is the judgment for renaming a variable named
If you were instead renaming the variable
Same thing for the other α-normalization rules: just replace |
Thanks, that make sense! And it worked too 🎉! |
You're welcome! 🙂 |
Right, the example expression is broken in my implementation as well so I guess the easiest way to go is to make α-normalization "parametric" 🤔 @Gabriel439 actually would it make sense to "unexpose" De Bruijn indices? |
@f-f: It wouldn't make it easier to implement the language. A conforming implementation has to support α-normalization to power both equivalence checking and also for semantic integrity checks and α-normalization requires support for De Bruijn indices. |
I'm writing a program that takes a Dhall expression and compiles it to another language. This language does not support accessing shadowed variables. So, if there is a Dhall expression like:
Something has to be done to make that work. What's the correct way to deal with this? It sounds like renaming all bound variables is what's necessary, but each time I try to implement it it doesn't work quite right. Is there a function I'm missing that might already be doing the right thing?
The text was updated successfully, but these errors were encountered: