Skip to content
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

fix the free variable names #51

Merged
merged 4 commits into from
Sep 20, 2023
Merged

Conversation

hiratara
Copy link

Hello,

I noticed that in the current implementation, the free variables are named incorrectly.

For example, 34(λ45)(λλ56) refers to the third and fourth names of the free variable list in each lambda abstraction, but is printed in c d (λa.d e) (λa.λb.e f). It is correct that the free variables within any lambda abstraction are the same, as in e f (λa.e f) (λa.λb.e f).

Comment on lines +471 to +472
// use a different name than bound variables
from_u32(max_depth + 96 + *i as u32 - depth)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to the free variable list while considering depth. Also, avoid using names that might be used for bound variables by using max_depth.

@ljedrz
Copy link
Owner

ljedrz commented Sep 19, 2023

Apologies for not having checked this out yet, I was on vacation. I'll look into it soon, though!

Signed-off-by: ljedrz <ljedrz@gmail.com>
Signed-off-by: ljedrz <ljedrz@gmail.com>
@ljedrz ljedrz merged commit 14fad22 into ljedrz:master Sep 20, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants