且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

lambda 表达式的***变量列表

更新时间:2021-11-29 03:54:24

在对 OP 的评论中,@PasqualCuoq 指出,λ 在 lambda 演算中与 λ 相关联OCaml 中的代码>乐趣代码>.也就是说,术语 t in λx.t 被贪婪地评估(参见 http://en.wikipedia.org/wiki/Lambda_calculus#Notation).

In the comments to the OP it has been pointed out by the kind @PasqualCuoq that λ in lambda calculus associates the same as fun in OCaml. That is, the term t in λx.t is evaluated greedily (see http://en.wikipedia.org/wiki/Lambda_calculus#Notation).

这意味着(λz.yz)实际上是(λz.(yz)),上面的函数是正确的,但是提供的翻译对于示例表达式 (λx.(x (λz.yz))) x 不是,因为它应该是

What this is means is that (λz.y z) is actually (λz.(y z)), and that the function above is correct, but the translation provided for the sample expression (λx.(x (λz.y z))) x isn't, as it should've been

(App(Abs("x", App(Var "x", Abs("z", App(Var "y", Var "z")))), Var "x"))

代替

(App(Abs ("x", App (Abs ("z", Var "y"), Var "z")), Var "x"))

这是一个很棒的地方,叫做 Stack Overflow!

Here's to this awesome place called Stack Overflow!