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?
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?
To reduce
(\y.x) zyou "replace every instance of the lambda'ed variable (y) with the expression you're evaluating it at (z)". There are no instances ofyinx, so you just getx.Note that I'm assuming there are no
ys inx. Ifxis some expression that does containythat reduction would be incorrect.