0

I must be missing a rule to beta reduction, because I don't understand the following reduction.

(\y.x) z 

This reduces to x. Why?

(\x.x) z 

This reduces to z. Why does the above expression reduce to x?

Chris
  • 151

1 Answers1

1

To reduce (\y.x) z you "replace every instance of the lambda'ed variable (y) with the expression you're evaluating it at (z)". There are no instances of y in x, so you just get x.

Note that I'm assuming there are no ys in x. If x is some expression that does contain y that reduction would be incorrect.

JonathanZ
  • 10,615