Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é de Bruijn index?

Definition 5.3 University Computer Science — Year 3 · Capítulo 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.
Ler no capítulo →