按姓名呼叫与正常顺序

Call by name vs normal order

我知道这个话题已经讨论过好几次了,但我还是不清楚。 我已经阅读了这个问题 applicative-order/call-by-value and normal-order/call-by-name differences 并且有一些事情我想一劳永逸地澄清:

点名

As normal order, but no reductions are performed inside abstractions. For example λx.(λx.x)x is in normal form according to this strategy, although it contains the redex (λx.x)x.

在按名称调用中,表达式 λx.(λx.x)x 被认为是范式;这是因为“(λx.x)x”被认为是主体(因为 λ 的范围尽可能向右延伸)?那么另一方面,如果我应用正常顺序,结果会是什么?

In call by name, the expression λx.(λx.x)x is said to be in normal form; is this because "(λx.x)x" is considered to be the body (since the scope of λ extends as far as possible to the right)?

是的,你是对的。

And so on the other side, if I apply the normal order, what would be the result?

你在 body 中做了归约:(λx.x)x -> x,所以整个事情归结为恒等函数:

λx.(λx.x)x -> λx.x

为了进一步澄清,让我再做一次,renaming the variables to conform with the Barendregt variable conventionλx.(λx.x)x =α λx.(λy.y)x

λx.(λy.y)x -> λx.[y := x](y) = λx.x