全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 de Bruijn index?

Definition 5.3 University Computer Science — Year 3 · 第 5 章 — The Lambda Calculus and Operational Semantics

In the de Bruijn notation, a bound variable is replaced by the number of λ\lambda’s between its occurrence and its binder: 0 for the nearest enclosing λ\lambda, 1 for the next one out, and so on. The term λx. λy. x y\lambda x.\,\lambda y.\,x\,y becomes λ. λ. 1  0\lambda.\,\lambda.\,1\;0.

A term as a tree, each variable joined to its binder (dashed). The index counts the  nodes crossed on the way up: from y the path meets z first, so y is 1, and so is x, which meets y.
A term as a tree, each variable joined to its binder (dashed). The index counts the λ\lambda nodes crossed on the way up: from yy the path meets λz\lambda z first, so yy is 1, and so is xx, which meets λy\lambda y.
在原文中阅读 →