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

Explicit α-conversion #3

Closed
ayberkt opened this issue Feb 5, 2016 · 1 comment
Closed

Explicit α-conversion #3

ayberkt opened this issue Feb 5, 2016 · 1 comment
Assignees

Comments

@ayberkt
Copy link

ayberkt commented Feb 5, 2016

α-captures are correctly handled in terms of semantics, but the displayed expression doesn't display the α-conversion.

4) z y z
3) (λx. x y) z z
2) (λy. (λx. x y) y z) z
1) (λx. λy. x y z) (λx. x y) z

At step 2 we should have something like (λn. (λx. x y) n z) z so that the conversion is made explicit.

A minor problem, but wanted to make note of it in case there are people confused. It should be trivial to fix.

@cdparks
Copy link
Owner

cdparks commented Feb 7, 2016

Thanks for the heads-up!

cdparks added a commit that referenced this issue May 22, 2021
When a lambda's body was just a free variable, we were creating a new
global that pointed at the real global. For example, suppose "false"
is at address #1, and we're reducing the input at address #3:

  #1: Global "false" #2
  #2: Closure (λt. λf. f)
  #3: Apply #4 #5 <---------[input]--------> (λa. false) (λb. b)
  #4: Closure (λa. false)
  #5: Closure (λb. b)

We would reduce the input as follows:

  1. (λa. false) (λb. b)
  2. false
  3. false
  4. λt. λf. f

This is because we were instantating the body of the lambda by creating
a new Global:

  #1: Global "false" #2
  #2: Closure (λt. λf. f)
  #3: Global "false" #1

Instead of a new pointer:

  #1: Global "false" #2
  #2: Closure (λt. λf. f)
  #3: Pointer #1

And then we would have to unwind and fetch the global twice. The fix is
to use a Pointer instead (which we correctly keep unwinding through).
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

No branches or pull requests

2 participants