Böhm tree explained

In the study of denotational semantics of the lambda calculus, Böhm trees, Lévy-Longo trees,[1] [2] and Berarducci trees[3] 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,[4] 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.

In the infinitary lambda calculus, 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.

Sets of meaningless terms

We define a set

U

of meaningless terms as follows:[5]

U

. A term

M

is root-active if for all

M\stackrel{*}{\to}N

there exists a redex

(λx.P)Q

such that

N\stackrel{*}{\to}(λx.P)Q

.

M\inU

, if

M\stackrel{*}{\to}N

then

N\inU

.

M\inU

and substitutions

\sigma

,

M\sigma\inU

.

λx.M\inU

,

(λx.M)N\inU

.

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\inU

if and only if

N\inU

.

N\inU

, if

M\stackrel{*}{\to}N

, then

M\inU

. Some definitions leave this out, but it is useful.

There are infinitely many sets of meaningless terms, but the ones most common in the literature are:

Note that '''Ω''' is root-active and therefore

\Omega\inU

for every set of meaningless terms

U

.

λ⊥-terms

The set of λ-terms with ⊥ (abbreviated λ⊥-terms) is defined coinductively by the grammar

M=\bot\midx\mid(λx.M)\mid(MM)

. 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\Omega]\inU

and

M\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.

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:

  1. BT(M) is

\bot

, if M has no head normal form

BT(M)=λx1.λx2.\ldotsλxn.yBT(M1)\ldotsBT(Mm)

, if

M

reduces in a finite number of steps to the head normal form

λx1.λx2.\ldotsλxn.yM1\ldotsMm

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

.[6]

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:

  1. LLT(M) is

\bot

, if M has no weak head normal form.
  1. If

M

reduces to the weak head normal form

yM1\ldotsMm

, then

LLT(M)=yLLT(M1)\ldotsLLT(Mm)

.
  1. If

M

reduces to the weak head normal form

λx.N

, then

LLT(M)=λx.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:

  1. BerT(M) is

\bot

, if M is root-active.
  1. If

M

reduces to a term

λx.N

, then

BerT(M)=λx.BerT(N)

.
  1. If

M

reduces to a term

NP

where

N

does not reduce to any abstraction

λx.Q

, then

BerT(M)=BerT(N)BerT(P)

.

References

Notes and References

  1. Book: Levy . Jean-Jacques . λ-Calculus and Computer Science Theory . An algebraic interpretation of the λβK-calculus and a labelled λ-calculus . Lecture Notes in Computer Science . 1975 . 37 . 147–165 . 10.1007/BFb0029523. 3-540-07416-3 .
  2. Longo . Giuseppe . Set-theoretical models of λ-calculus: theories, expansions, isomorphisms . Annals of Pure and Applied Logic . August 1983 . 24 . 2 . 153–188 . 10.1016/0168-0072(83)90030-1. free .
  3. Book: Berarducci, Alessandro. Logic and algebra . 1996 . Marcel Dekker . New York . 0824796063. Infinite λ-calculus and non-sensible models. 339–377. http://people.dm.unipi.it/berardu/Art/1996Nonsensible/non-sensible.pdf. 23 September 2007.
  4. Book: Church, Alonzo. The calculi of lambda-conversion. 1941. Princeton University Press. 0691083940. 15.
  5. Book: Kennaway . Richard . van Oostrom . Vincent . de Vries . Fer-Jan . Algebraic and Logic Programming . Meaningless terms in rewriting . Lecture Notes in Computer Science . 1996 . 1139 . 254–268 . 10.1007/3-540-61735-3_17. 978-3-540-61735-8 . 10.1.1.37.3616.
  6. Book: Barendregt, Henk P.. The Lambda Calculus : Its Syntax and Semantics. 2012 . College Publications. London. 9781848900660. 219–221.