De Bruijn notation
   HOME

TheInfoList



OR:

In
mathematical logic Mathematical logic is the study of formal logic within mathematics. Major subareas include model theory, proof theory, set theory, and recursion theory. Research in mathematical logic commonly addresses the mathematical properties of forma ...
, the De Bruijn notation is a
syntax In linguistics, syntax () is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure ( constituenc ...
for terms in the λ calculus invented by the Dutch
mathematician A mathematician is someone who uses an extensive knowledge of mathematics in their work, typically to solve mathematical problems. Mathematicians are concerned with numbers, data, quantity, structure, space, models, and change. History On ...
Nicolaas Govert de Bruijn Nicolaas Govert (Dick) de Bruijn (; 9 July 1918 – 17 February 2012) was a Dutch mathematician, noted for his many contributions in the fields of analysis, number theory, combinatorics and logic.
. It can be seen as a reversal of the usual syntax for the λ calculus where the
argument An argument is a statement or group of statements called premises intended to determine the degree of truth or acceptability of another statement called conclusion. Arguments can be studied from three main perspectives: the logical, the dialecti ...
in an application is placed next to its corresponding binder in the function instead of after the latter's body.


Formal definition

Terms (M, N, \ldots) in the De Bruijn notation are either variables (v), or have one of two ''wagon'' prefixes. The ''abstractor wagon'', written /math>, corresponds to the usual λ-binder of the λ calculus, and the ''applicator wagon'', written (M), corresponds to the argument in an application in the λ calculus. :M,N,... ::=\ v\ , \ ;M\ , \ (M)\;N Terms in the traditional syntax can be converted to the De Bruijn notation by defining an inductive function \mathcal for which:
\begin \mathcal(v) &= v \\ \mathcal(\lambda v.\ M) &= ;\mathcal(M) \\ \mathcal(M\;N) &= (\mathcal(N))\mathcal(M). \end
All operations on λ-terms commute with respect to the \mathcal translation. For example, the usual β-reduction, :(\lambda v.\ M)\;N\ \ \longrightarrow_\beta\ \ M := N/math> in the De Bruijn notation is, predictably, :(N)\; ;M\ \ \longrightarrow_\beta\ \ M := N A feature of this notation is that abstractor and applicator wagons of β-redexes are paired like parentheses. For example, consider the stages in the β-reduction of the term (M)\;(N)\; ;(P)\; ; ;(Q)\;z, where the redexes are underlined: The example is from page 384.
\begin (M)\;\underline\;(P)\; ; ;(Q)\;z & (M)\;\underline\; ;(Q :=N\;z \\ & \underline\;(Q :=N,v:=P[u:=N)\;z_\\ __& __(Q[u:=N,v:=P[u:=N.html" ;"title=":=N.html" ;"title=":=N,v:=P[u:=N">:=N,v:=P[u:=N)\;z \\ & (Q[u:=N,v:=P[u:=N">:=N.html" ;"title=":=N,v:=P[u:=N">:=N,v:=P[u:=N)\;z \\ & (Q[u:=N,v:=P[u:=Nw:=M])\;z. \end
Thus, if one views the applicator as an open paren ('(') and the abstractor as a close bracket (']'), then the pattern in the above term is '((]('. De Bruijn called an applicator and its corresponding abstractor in this interpretation ''partners'', and wagons without partners ''bachelors''. A sequence of wagons, which he called a ''segment'', is ''well balanced'' if all its wagons are partnered.


Advantages of the De Bruijn notation

In a well balanced segment, the partnered wagons may be moved around arbitrarily and, as long as parity is not destroyed, the meaning of the term stays the same. For example, in the above example, the applicator (M) can be brought to its abstractor /math>, or the abstractor to the applicator. In fact, ''all''
commutative In mathematics, a binary operation is commutative if changing the order of the operands does not change the result. It is a fundamental property of many binary operations, and many mathematical proofs depend on it. Most familiar as the name of ...
s and permutative conversions on lambda terms may be described simply in terms of parity-preserving reorderings of partnered wagons. One thus obtains a ''generalised conversion'' primitive for λ-terms in the De Bruijn notation. Several properties of λ-terms that are difficult to state and prove using the traditional notation are easily expressed in the De Bruijn notation. For example, in a type-theoretic setting, one can easily compute the canonical class of types for a term in a typing context, and restate the type checking problem to one of verifying that the checked type is a member of this class. De Bruijn notation has also been shown to be useful in calculi for explicit substitution in pure type systems..


See also

*
Mathematical notation Mathematical notation consists of using symbols for representing operations, unspecified numbers, relations and any other mathematical objects, and assembling them into expressions and formulas. Mathematical notation is widely used in mathem ...


References

{{reflist Lambda calculus