Lambda 演算运算符优先级
我在理解 lambda 演算运算符优先级时遇到问题。
例如以下代码:
lambda x.x z lambda y.x y
将是:
lambda x. (x (z lambda y. x y))
或
lambda x. ((x z) (lambda y. x y))
?
更复杂的例子:
(lambda x.x z) lambda y.w lambda w.w x y z
上面例子中的括号在哪里?
我知道 lambda 应用程序是左关联的,但 lambda 值确实如此 比应用程序具有更高的优先级?
I have problems understanding lambda calculus operators precedence.
For example the following code:
lambda x.x z lambda y.x y
is going to be:
lambda x. (x (z lambda y. x y))
or
lambda x. ((x z) (lambda y. x y))
?
Even more complicated examples:
(lambda x.x z) lambda y.w lambda w.w x y z
where in the above example the parentheses go ?
I know that lambda application is left associative but does lambda values
have higher precedence over applications?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应用程序的优先级高于抽象。加上应用程序是左关联而抽象是右关联的事实,这导致以下结果:
is
和
is
Application has higher precedence than abstraction. Together with the fact that application is left-associative and abstraction is right-associative, this leads to the following:
is
and
is