Böhm tree

{{Short description|Mathematical object for the lambda calculus}}

In the study of denotational semantics of the lambda calculus, Böhm trees,{{efn|per {{harvtxt|Sangiorgi|Walker|2003|p=493}}, introduced in {{harvtxt|Barendregt|1977}} and named after a theorem of Corrado Böhm}} Lévy-Longo trees,{{cite book |last1=Levy |first1=Jean-Jacques |title=λ-Calculus and Computer Science Theory |chapter=An algebraic interpretation of the λβK-calculus and a labelled λ-calculus |series=Lecture Notes in Computer Science |date=1975 |volume=37 |pages=147–165 |doi=10.1007/BFb0029523|isbn=3-540-07416-3 }}{{cite journal |last1=Longo |first1=Giuseppe |title=Set-theoretical models of λ-calculus: theories, expansions, isomorphisms |journal=Annals of Pure and Applied Logic |date=August 1983 |volume=24 |issue=2 |pages=153–188 |doi=10.1016/0168-0072(83)90030-1|doi-access=free }}{{efn|coined in {{harvtxt|Ong|1988}}, per {{harvtxt|Sangiorgi|Walker|2003|p=511}}}} and Berarducci trees{{cite book |title=Logic and algebra |date=1996 |publisher=Marcel Dekker |location=New York |isbn=0824796063|chapter=Infinite λ-calculus and non-sensible models|pages=339–377|first=Alessandro|last=Berarducci|chapter-url=http://people.dm.unipi.it/berardu/Art/1996Nonsensible/non-sensible.pdf|access-date=23 September 2007}} are (potentially infinite) tree-like mathematical objects that capture the "meaning" of a term up to some set of "meaningless" terms.

Motivation

A simple way to read the meaning of a computation is to consider it as a mechanical procedure consisting of a finite number of steps that, when completed, yields a result. In particular, considering the lambda calculus as a rewriting system, each beta reduction step is a rewrite step, and once there are no further beta reductions the term is in normal form. We could thus, naively following Church's suggestion,{{cite book|last=Church|first=Alonzo|title=The calculi of lambda-conversion|year=1941|publisher=Princeton University Press|isbn=0691083940|page=15}} say the meaning of a term is its normal form, and that terms without a normal form are meaningless. For example the meanings of I = λx.x and I I are both I. This works for any strongly normalizing subset of the lambda calculus, such as a typed lambda calculus.

This naive assignment of meaning is however inadequate for the full lambda calculus. The term Ω =(λx.x x)(λx.x x) does not have a normal form, and similarly the term X=λx.xΩ does not have a normal form. But the application Ω (K I), where K denotes the standard lambda term λx.λy.x, reduces only to itself, whereas the application X (K I) reduces with normal order reduction to I, hence has a meaning. We thus see that not all non-normalizing terms are equivalent. We would like to say that Ω is less meaningful than X because applying X to a term can produce a result but applying Ω cannot.

Böhm trees may also be applied in the context of the infinitary lambda calculus, which includes infinitely large terms.

In this context, the term N N, where N = λx.I(xx), reduces to both to I (I (...)) and Ω, hence there are also issues with confluence of normalization.{{sfn|Severi|de Vries|2011|p=1}}

Sets of meaningless terms

The general construction is parameterized by a set U of meaningless terms, which is required to satisfy the following axioms:{{cite book |last1=Kennaway |first1=Richard |last2=van Oostrom |first2=Vincent |last3=de Vries |first3=Fer-Jan |title=Algebraic and Logic Programming |chapter=Meaningless terms in rewriting |series=Lecture Notes in Computer Science |date=1996 |volume=1139 |pages=254–268 |doi=10.1007/3-540-61735-3_17|isbn=978-3-540-61735-8 |citeseerx=10.1.1.37.3616}}{{sfn|Severi|de Vries|2011|p=5}}

  • Root-activeness: Every root-active term is in U. A term M is root-active if for all M \stackrel{*}{\to} N there exists a redex (\lambda x.P)Q such that N \stackrel{*}{\to} (\lambda x.P)Q.
  • Closure under β-reduction: For all M \in U, if M \stackrel{*}{\to} N then N \in U.
  • Closure under substitution: For all M \in U and substitutions \sigma, M\sigma \in U.
  • Overlap: For all \lambda x.M \in U, (\lambda x.M )N \in U .
  • Indiscernibility: For all M, N, if N can be obtained from M by replacing a set of pairwise disjoint subterms in U with other terms of U, then M \in U if and only if N \in U.
  • Closure under β-expansion. For all N \in U, if M \stackrel{*}{\to} N, then M \in U. Some definitions leave this out, but it is useful.{{sfn|Severi|de Vries|2011|pp=4-5}}

There are infinitely many sets of meaningless terms, but the ones most common in the literature are:{{sfn|Severi|de Vries|2011|p=2}}

  • The set of terms without head normal form
  • The set of terms without weak head normal form
  • The set of root-active terms, i.e. the terms without top normal form or root normal form. Since root-activeness is assumed, this is the smallest set of meaningless terms.

Note that Ω is root-active and therefore \mathbf{\Omega} \in U for every set of meaningless terms U.

λ⊥-terms

The set of λ-terms with ⊥ (abbreviated λ⊥-terms) is defined coinductively by the grammar M = \bot \mid x \mid (\lambda x. M) \mid (M M). This corresponds to the standard infinitary lambda calculus plus terms containing \bot. Beta-reduction on this set is defined in the standard way. Given a set of meaningless terms U, we also define a reduction to bottom: if M[\bot \mapsto \mathbf{\Omega}] \in U and M \neq \bot, then M \to \bot. The λ⊥-terms are then considered as a rewriting system with these two rules; thanks to the definition of meaningless terms this rewriting system is confluent and normalizing.{{sfn|Severi|de Vries|2011|p=5}}

The Böhm-like "tree" for a term may then be obtained as the normal form of the term in this system, possibly in an infinitary "in the limit" sense if the term expands infinitely.

= Böhm trees =

The Böhm trees are obtained by considering the λ⊥-terms where the set of meaningless terms consists of those without head normal form. More explicitly, the Böhm tree BT(M) of a lambda term M can be computed as follows:{{sfn|Severi|de Vries|2011|p=6}}

  1. BT(M) is \bot, if M has no head normal form
  2. \mathrm{BT}(M) = \lambda x_1.\lambda x_2.\ldots\lambda x_n.y \mathrm{BT}(M_1) \ldots \mathrm{BT}(M_m), if M reduces in a finite number of steps to the head normal form \lambda x_1.\lambda x_2.\ldots\lambda x_n.y M_1 \ldots M_m

For example, BT(Ω)=⊥, BT(I)=I, and BT(λx.xΩ)=λx.x.

Determining whether a term has a head normal form is an undecidable problem. Barendregt introduced a notion of an "effective" Böhm tree that is computable, with the only difference being that terms with no head normal form are not marked with \bot.{{cite book|last=Barendregt|first=Henk P.|title=The Lambda Calculus : Its Syntax and Semantics|year=2012 |publisher=College Publications|location=London|isbn=9781848900660|pages=219–221}}

Note that computing the Böhm tree is similar to finding a normal form for M. If M has a normal form, the Böhm tree is finite and has a simple correspondence to the normal form. If M does not have a normal form, normalization may "grow" some subtrees infinitely, or it may get "stuck in a loop" attempting to produce a result for part of the tree, which produce infinitary trees and meaningless terms respectively. Since the Böhm tree may be infinite the procedure should be understood as being applied co-recursively or as taking the limit of an infinite series of approximations.

= Lévy-Longo trees =

The Lévy-Longo trees are obtained by considering the λ⊥-terms where the set of meaningless terms consists of those without weak head normal form. More explicitly, the Lévy-Longo tree LLT(M) of a lambda term M can be computed as follows:{{sfn|Severi|de Vries|2011|p=6}}

  1. LLT(M) is \bot, if M has no weak head normal form.
  2. If M reduces to the weak head normal form y M_1 \ldots M_m, then \mathrm{LLT}(M) = y \mathrm{LLT}(M_1) \ldots \mathrm{LLT}(M_m).
  3. If M reduces to the weak head normal form \lambda x.N, then \mathrm{LLT}(M) = \lambda x.\mathrm{LLT}(N)/

= Berarducci trees =

The Berarducci trees are obtained by considering the λ⊥-terms where the set of meaningless terms consists of the root-active terms. More explicitly, the Berarducci tree BerT(M) of a lambda term M can be computed as follows:{{sfn|Severi|de Vries|2011|p=6}}

  1. BerT(M) is \bot, if M is root-active.
  2. If M reduces to a term \lambda x.N, then \mathrm{BerT}(M) = \lambda x.\mathrm{BerT}(N).
  3. If M reduces to a term N P where N does not reduce to any abstraction \lambda x. Q, then \mathrm{BerT}(M) = \mathrm{BerT}(N) \mathrm{BerT}(P).

Notes

{{Notelist}}

References

{{Reflist}}

{{refbegin}}

  • {{cite book |first1=Gérard |last1=Huet |first2=H. |last2=Laulhère |chapter=Finite-state Transducers as Regular Böhm Trees |title=Theoretical Aspects of Computer Software |date=1997| volume=1281| pages=604–610| publisher=Springer |editor1-first=M. |editor1-last=Abadi |editor2-first=T. |editor2-last=Ito |series=LNCS |chapter-url=http://pauillac.inria.fr/~huet/PUBLIC/trans6.pdf |doi=10.1007/BFb0014570 |isbn=978-3-540-69530-1 |citeseerx=10.1.1.110.7910}}
  • {{cite journal| author=Gérard Huet| title=Regular Böhm Trees| journal=Math. Struct. In Comp. Science| year=1998| volume=8 |issue=6 | pages=671–680| url=http://pauillac.inria.fr/~huet/PUBLIC/RBT2.pdf |doi=10.1017/S0960129598002643 |citeseerx=10.1.1.123.475| s2cid=15752309}}
  • {{cite thesis |last=Ong |first=C.-H. Luke|date=31 May 1988|title=The Lazy Lambda Calculus: An Investigation into the Foundations of Functional Programming |type=PhD|publisher=University of London|oclc= 31204528|url=https://spiral.imperial.ac.uk/bitstream/10044/1/47211/2/Ong-CHL-1988-PhD-Thesis.pdf|access-date=23 September 2022}}
  • {{cite book |last1=Sangiorgi |first1=Davide |last2=Walker |first2=David |title=The Pi-Calculus: A Theory of Mobile Processes |date=16 October 2003 |publisher=Cambridge University Press |isbn=978-0-521-54327-9 |language=en}}
  • {{cite book |last1=Barendregt |first1=Henk P. |title=Handbook of Mathematical Logic |chapter=The Type Free Lambda Calculus |series=Studies in Logic and the Foundations of Mathematics |date=1977 |volume=90 |pages=1091–1132 |doi=10.1016/S0049-237X(08)71129-7|isbn=9780444863881 |s2cid=25828519 |hdl=2066/17225 |hdl-access=free }}
  • {{cite book |last1=Severi |first1=Paula |last2=de Vries |first2=Fer-Jan |title=Logic, Language, Information and Computation |chapter=Decomposing the Lattice of Meaningless Sets in the Infinitary Lambda Calculus |series=Lecture Notes in Computer Science |date=2011 |volume=6642 |pages=210–227 |doi=10.1007/978-3-642-20920-8_22 |isbn=978-3-642-20919-2 |chapter-url=https://www.cs.le.ac.uk/people/fdv1/fdv1/Distribution/wollic2011.pdf |access-date=23 September 2022}}

{{refend}}

{{DEFAULTSORT:Bohm Tree}}

Category:Lambda calculus