Ohana Trees and Taylor Expansion
for the λI-Calculus
Abstract
Although the -calculus is a natural fragment of the -calculus, obtained by forbidding the erasure, its equational theories did not receive much attention. The reason is that all proper denotational models studied in the literature equate all non-normalizable -terms, whence the associated theory is not very informative. The goal of this paper is to introduce a previously unknown theory of the -calculus, induced by a notion of evaluation trees that we call “Ohana trees”. The Ohana tree of a -term is an annotated version of its Böhm tree, remembering all free variables that are hidden within its meaningless subtrees, or pushed into infinity along its infinite branches.
We develop the associated theories of program approximation: the first approach – more classic – is based on finite trees and continuity, the second adapts Ehrhard and Regnier’s Taylor expansion. We then prove a Commutation Theorem stating that the normal form of the Taylor expansion of a -term coincides with the Taylor expansion of its Ohana tree. As a corollary, we obtain that the equality induced by Ohana trees is compatible with abstraction and application. We conclude by discussing the cases of Lévy-Longo and Berarducci trees, and generalizations to the full -calculus.
Keywords and phrases:
-calculus, program approximation, Taylor expansion, λI-calculus, persistent free variables, Böhm trees, Ohana treesFunding:
Rémy Cerda: Partially funded by the ANR project RECIPROG ANR-21-CE48-019.Copyright and License:
2012 ACM Subject Classification:
Theory of computation Rewrite systems ; Theory of computation Lambda calculus ; Theory of computation Denotational semanticsRelated Version:
Version hosted on arXiv, with additional proofs in an appendix: https://arxiv.org/abs/2505.06193 [11]Acknowledgements:
We wish to thank Thomas Ehrhard, Paul-André Melliès, Lorenzo Tortora de Falco and Lionel Vaux Auclair for interesting discussions. We also thank the anonymous reviewers for the many valuable corrections they suggested.Editors:
Maribel FernándezSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
In the pioneering article “The calculi of lambda-conversion” [13] Alonzo Church introduced the -calculus together with its fragment without weakening, called the -calculus, where each abstraction must bind at least one occurrence of a variable. Historically, the -calculus has proven to be a useful framework for establishing results such as the finiteness of developments and standardization, which were successfully proven for the full -calculus only decades later. Despite that, in the last forty years there are no groundbreaking advances in its study.
The study of models and theories of -calculus flourished in the 1970s [4] and remained central in theoretical computer science for decades [5]. Although the equational theories of -calculus, called -theories, form a complete lattice of cardinality [33], only a handful are of interest to computer scientists. Most articles focus on -theories generated through some notion of “evaluation tree” of a -term, which means that two -terms are equated in the theory exactly when their evaluation trees coincide. The definitions of evaluation trees present in the literature follow the same pattern: they collect in a possibly infinite tree all stable portions of the output coming out from the computation, and replace the subterms that are considered meaningless by a constant , representing the lack of information. By modifying the notions of “stable” and “meaningless”, one obtains Böhm trees [3], possibly endowed with some form of extensionality [42, 27], Lévy-Longo trees [31, 32] and Berarducci trees [7]. In the modern language of infinitary term rewriting systems, these trees can be seen as the transfinite normal forms of infinitary -calculi [22, 14]. Another popular method for defining -theories is via observational equivalences [37]: two -terms are equivalent if they display the same behaviour whenever plugged in any context. For instance, the theory of Scott’s model [41] captures the maximal consistent observational equivalence [26, 47].
Since the -calculus is a conservative extension of the -calculus, every theory of the former is also a theory of the latter, namely a -theory, while the converse does not hold. A typical example is the -theory generated by equating all -terms that are not -normalizing. The maximal consistent observational equivalence is similar, except for the fact that it is extensional. Note that equating all -terms without a -normal form gives rise to an inconsistent -theory, but in the context of -calculus it is consistent and arises naturally: all “proper” denotational models of the -calculus induce either or [25]. This is somewhat disappointing, since models and theories are most valuable when they capture non-trivial operational properties of programs, and normalization is relatively elementary in this setting. In this paper we are going to introduce a new (proper) -theory, induced by a notion of evaluation trees inspired by Böhm trees, but explicitly designed for -terms.
Böhm trees and Taylor expansion for the -calculus
An important feature of Böhm trees is that, because of their coinductive nature, they are capable of pushing some subterms into infinity. Consider for instance a -term satisfying
then the Böhm tree of is the “limit” of this infinite reduction: . Observe that is “persistent” in the sense that it is never erased along any finite reduction, but is forgotten at the limit. We say that is pushed into infinity in the Böhm tree of . To some extent, also the variable is pushed into infinity, but it occurs infinitely often in . The variable can also disappear because it is hidden behind a meaningless term like . For instance, the Böhm tree of the -term is just and we say that is left behind.
As a consequence there are -terms, like and , whose Böhm tree is not a -tree [4, Def. 10.1.26] since the variable is abstracted, but does not appear in the tree. This shows that Böhm trees are not well-suited for the -calculus, and the question of whether other notions of trees can model -terms in a more faithful way naturally arises.
In this paper we introduce a notion of Böhm trees keeping tracks of the variables persistently occurring along each possibly infinite path, or left behind a meaningless subterm. We call them Ohana trees as they remember all the variables present in the terms generating them, even if these variables are never actually used in their evaluations. This is obtained by simply annotating such variables on the branches of the Böhm tree, and on its -nodes, but bares interesting consequences: since Ohana trees are invariant under -conversion, showing that two terms have distinct Ohana trees becomes a way of separating them modulo .
Once the coinductive definition of Ohana trees is given (Definition 10), we develop the corresponding theory of program approximation based on finite trees. Perhaps surprisingly, in the finite approximants, the only variable annotations that are actually required are those on the constant , as all other labels can be reconstructed when taking their supremum. Our main result in this setting is the Approximation Theorem 20 stating that the Ohana tree of a -term is uniquely determined by the (directed) set of all its finite approximants.
Inspired by quantitative semantics of linear logics, Ehrhard and Regnier proposed a theory of program approximation for regular -terms based on Taylor expansion [19, 21]. A -term is approximated by a possibly infinite power-series of programs living in a completely linear resource calculus, where no resource can be duplicated or erased along the computation. This theory is linked to Böhm trees by a Commutation Theorem [20] stating that the normal form of the Taylor expansion of a -term is equal to the Taylor expansion of its Böhm tree.
The second part of our paper is devoted to explore the question of whether it is possible to define a Taylor expansion for the -calculus capturing the Ohana tree equality. In Section 4 we design a -resource calculus with memory, mixing linear and non-linear features. Our terms are either applied to non-empty bags (finite multiset) of non-duplicable resources, or to an empty bag annotated with a set of variables (the non-linear parts of the terms). The reduction of a resource term preserves its free variables : if the reduction is valid then consumes all its linear resources and each variable is recorded in some labels, otherwise an exception is thrown and reduces to an empty program , where .
First we prove that the resource calculus so-obtained is confluent and strongly normalizing, then we use it as the target language of a Taylor expansion with memory, capable of approximating both -terms and Ohana trees. Our main result is that the Commutation Theorem from [20] extends to this setting: the normal form of the Taylor expansion with memory of a -term always exists and is equal to the Taylor expansion with memory of its Ohana tree (Theorem 38). As consequences (Corollaries 44 and 45), we obtain that: 1) The equality induced on -terms by Ohana trees coincides with the equality induced by the normalized Taylor expansion with memory; 2) The equality induced by Ohana trees is compatible with application and abstraction, in the sense of the -calculus, and it is therefore a -theory. We consider this work a first step in a broader line of research, which we discuss further in the conclusion of the paper. In particular, we aim to extend our formalism to the full -calculus and explore its applicability to other kinds of trees.
Related works
On the syntactic side, the -calculus can be translated into MELL proofnets without weakening studied in [15, 16]. Our Ohana trees can be presented as labelled Böhm trees, and therefore share similarities with Melliès”s (infinitary) -terms “with boundaries”, whose branches are annotated by booleans [36]. However, our labels are describing additional points occurring at transfinite positions, a phenomenon reminiscent of the non-monotonic pre-fixed point construction defined in [6]. They can also be seen as an instances of the transfinite terms considered in [30], but simpler, because no reduction is performed at transfinite positions. Thus, Ohana trees should correspond to normal forms of an infinitary labelled -calculus, just like Böhm trees are the normal forms of the infinitary -calculus [29]. We wonder whether a clever translation of the -calculus into the process calculus in [17] would allow us to retrieve the Ohana trees and the associated Taylor expansion, in which case our Commutation Theorem might become an instance of their general construction.
Concerning denotational semantics, certain relevant intersection type systems [44, 24, 1] can be used to represent models of the -calculus, as they describe reflexive objects in the smcc of cpos and strict functions [28]. In [25], the authors show that the model introduced in [18] is fully abstract for the -theory . The results in [16] suggest that the relational semantics, endowed with the comonad of finite non-empty multisets, contains models whose theory is either or . No filter model or relational graph model can induce the Ohana tree equality, since they equate all -terms having the same Böhm tree [40, 8]. However, the relational model defined in [9] using the comonad of finite multisets with possibly infinite coefficients, gives hope since it separates from , and from , when . This category appears to be the most promising for finding models capturing Ohana trees.
2 Preliminaries
We recall some basic notions and results concerning the -calculus, and its fragment without weakening known as the -calculus. For more information, we refer to Barendregt’s book [4].
2.1 The -calculus, in a nutshell
Let us fix an infinite set of variables. The set of -terms is defined by induction
We use parentheses when needed. We assume that application associates on the left, and has higher precedence than abstraction. E.g., stands for . We write or even for , and for , where occurs times. In particular, when , we get .
The set of free variables of is defined as usual, and we say that is closed whenever . Hereafter, -terms are considered modulo -conversion (see [4, §2.1]).
Example 1.
The -terms below are used throughout the paper to construct examples:
The -term is the identity, are the projections, is the composition, is the diagonal and a looping term. The pairing of is encoded as , for fresh.
The -reduction is generated by the rule , where is called a -redex and stands for the capture-free substitution of for all free occurrences of in . We let (resp. ) be the reflexive-transitive (and symmetric) closure of . We say that is in -normal form (-nf) if does not contain any -redex, and that has a -nf if , for some in -nf. Since is confluent, such must be unique.
Remark 2.
Any -term can be written in one of the following forms: either , in which case is called a head normal form (hnf) and its head variable; or , where is referred to as its head redex.
The head reduction is the restriction of obtained by contracting the head redex.
Definition 3.
A -term is a fixed-point combinator (fpc) if it satisfies .
Notice that we do not require that fixed-point combinators are closed -terms. We recall Curry’s combinator and define, for all , Polonsky’s and Klop’s [35]:
| (1) |
It is easy to check that and are fpcs. Regarding the Bible , which owes its name to its distinctive spelling, we get . Note that the variable remains in a passive position along the reduction of (and of ), therefore (resp. ) remains a fpc, for all .
Although fpcs are not -normalizable, they differ from since they produce increasing stable amounts of information along reduction: . Barendregt introduced a notion of “evaluation tree” to capture this infinitary behaviour [3].
Definition 4.
The Böhm tree of a -term is coinductively defined as follows.
-
1.
If has a hnf, that is , then
-
2.
, otherwise. The constant represents the absolute lack of information.
Example 5.
Using the terms from Example 1 and (1), let us construct some Böhm trees.
-
(i)
If has a -normal form then, up to isomorphism, . E.g., .
-
(ii)
Since and have no hnf, we get .
-
(iii)
If is an fpc, then . Thus, .
-
(iv)
Using the fpc , one can define -terms satisfying and . These two -terms both construct a “stream” , but the former places at even positions and at odd ones, while the latter does the converse. This difference is however forgotten in their Böhm trees:
-
(v)
Check that, given , we have .
2.2 The -calculus
The set of -terms is the subset of consisting of those -terms in which every abstraction binds at least one occurrence of the abstracted variable. Note that induces a reduction on since and entail . In other words, the property of being a -term is preserved by . Similarly, the -calculus inherits from -calculus all the notions previously defined like head reduction, Böhm trees, etc. For convenience, we consider an alternative definition of simultaneously defining -terms and their sets of free variables.
Definition 6.
-
(i)
For all , is defined as the smallest subset of such that:
-
(ii)
Finally, the set of all -terms is given by the disjoint union .
Remark 7.
-
(i)
Note that means that is a -term such that . As a consequence, if then the set must be finite.
-
(ii)
Each set is closed under -conversion.
-
(iii)
Our examples are -terms, while .
Definition 8.
A -theory is given by an equivalence containing -conversion and compatible with application and abstraction. In the context of -calculus, the compatibility with abstraction becomes: and imply .
The only subtlety in the definition above stands in the side condition on the compatibility with abstraction. However, this small difference has significant consequences: e.g., the theory axiomatized by equating all terms without a -nf is consistent as a -theory, but inconsistent as a -theory. The following theorem collects the main properties of the -calculus.
Theorem 9.
By (iii), Böhm trees induce a -theory, but we argue that this theory does not respect the spirit of . E.g., the variable is never erased along the reduction of, say, , but it disappears in its Böhm tree. Using the terminology of [4], one says that is pushed to infinity in . This shows that the Böhm tree of the -term is not a -tree: the outer -abstraction “” does not bind any free occurrence of in .
3 Ohana trees
We have seen that Böhm trees are not well-suited for representing -terms faithfully, because variables that are never erased along the reduction are forgotten (i.e., pushed into infinity). We now introduce a notion of evaluation tree that records all variables that are pushed along each path, ensuring that none are forgotten, whether they remain in passive position or not.
3.1 The coinductive definition
For every finite set , written , we introduce a constant representing any looping . Intuitively, the Ohana tree of a -term is obtained from by annotating each subtree (also ) with the free variables of the -term that generated it.
Definition 10.
The Ohana tree of a term is coinductively defined as follows:
-
(i)
If with , (for ), then
-
(ii)
, otherwise. Recall that , since .
We sometimes use an inline presentation of Ohana trees, by introducing application symbols annotated with the sets , as in .
Example 11.
-
(i)
, , .
-
(ii)
, . More generally: .
-
(iii)
. In fact, it is easy to check that for all closed fpcs , we have .
-
(iv)
In the variable which is pushed into infinity becomes visible: . Thus when .
Other examples of Ohana trees are depicted in Figure 1. Note that the Ohana trees of and are now distinguished. The interest of is that it pushes into infinity an increasing amount of variables:
So – at the limit – infinitely many variables are pushed into infinity (but only is free).
Remark 12.
If has a -nf , then there is an isomorphism . In fact, since is finite, it is possible to reconstruct all the labels in .
3.2 The associated approximation theory
We introduce a theory of program approximation that captures Ohana trees, by adapting the well-established approach originally developed for Böhm trees [31, 48] (see also [4, Ch. 14]). We start by defining the approximants with memory, corresponding to finite Ohana trees.
Definition 13.
-
(i)
The set of approximants with memory is , where is defined by (for , , and ):
-
(ii)
We define as the least partial order closed under the following rules:
Each is a pointed poset (partially ordered set) with bottom element , while the poset is not pointed because it has countably many minimal elements. Note that we do not annotate the application symbols in with the sets of variables , since the labels in its -nodes carry enough information to reconstruct the finite Ohana tree associated with .
Lemma 14.
There is a bijection between and the set of finite Ohana trees of -terms.
We now give the recipe to compute the set of approximants with memory of a -term.
Definition 15.
-
(i)
The direct approximant of is given by:
-
(ii)
The set of approximants with memory of is defined by:
Remark 16.
For all , we have and .
Example 17.
-
(i)
, .
-
(ii)
.
-
(iii)
.
-
(iv)
.
Lemma 18.
-
(i)
For every , entails .
-
(ii)
For all , is an ideal of the poset . More precisely:
-
(a)
non-emptiness: ;
-
(b)
downward closure: and imply ;
-
(c)
directedness: such that .
-
(a)
Proof.
- (i)
-
(ii)
(a) and (b) are trivial. For (c), define by setting: , , if and are compatible, then and . Check that is their supremum.
The next result shows that -convertible terms share the same the set of approximants.
Proposition 19.
Let . If , then .
Proof.
Theorem 20.
There is a bijection between the set of Ohana trees and the set of approximants of -terms satisfying , for all .
Proof.
From to . Let be the set of all finite subtrees of , where each truncated subtree is replaced by . By Lemma 14, .
From to . For every finite path in , there is an representing along . Conclude since is the supremum of all such .
4 A resource calculus with memory
In this section we introduce the -resource calculus refining the (finite) resource calculus [19], best known as the target language of Ehrhard and Regnier’s Taylor expansion [21]. So, the resource calculus is not meant to be a stand-alone language, but rather another theory of approximations for the -calculus. Before going further, we recall its main properties.
We consider here the promotion-free fragment of the resource calculus introduced in [39]. Its syntax is similar to the -calculus, except for the applications that are of shape , where is a multiset of resources called bag. The resources populating are linear as they cannot be erased or copied by , they must be used exactly once along the reduction. When contracting a term of the form there are two possibilities.
-
1.
If the number of occurrences of in is exactly , then each occurrence is substituted by a different . Since the elements in the bag are unordered, there is no canonical bijection between the resources and the occurrences of . The solution consists in collecting all possibilities in a formal sum of terms, the sum representing an inner-choice operator.
-
2.
If there is a mismatch between the number of occurrences and the amount of resources, then reduces to the empty-sum, . From a programming-language perspective, this can be thought of as a program terminating abruptly after throwing an uncaught exception.
The first-class citizens of the resource calculus are therefore finite sums of resource terms, that are needed to ensure the (strong) confluence of reductions. Another important property is strong normalization, that follows from the fact that no resource can be duplicated.
4.1 -resource expressions and -resource sums
Our version of the resource calculus is extended with labels representing the memory of free variables that were present in the -term they approximate. Just like in Definition 13(i) we endowed the constant with a finite set of variables, here we annotate:
-
the empty bag of resource terms, since an empty bag of approximants of should remember the free variables of ;
-
the empty sum of resource terms. Indeed, if a resource term vanishes during reduction because of the mismatch described above, its free variables should be remembered.
Definition 21.
-
(i)
For all , the sets and are defined by induction:
-
(ii)
The set of -resource terms and the set of bags are given by:
As a matter of notation, we let denote either or , indistinctly but coherently. We call resource expressions generic elements . We denote the union of two bags multiplicatively by , whose neutral element is the empty bag, .
Remark 22.
-
(i)
In every -resource term of the form , the variable must occur freely in : it may appear in the undecorated underlying term, or in the “memory” decorating . Therefore, it makes sense to define whenever .
-
(ii)
Each set is isomorphic to the monoid of multisets of elements of . Notice that is not the set of all bags of elements of , just its subset of bags whose elements have the same free variables (and so inductively in the subterms).
Example 23.
We consider resource expressions up to -equivalence, under the proviso that abstractions bind linear occurrences of variables as well as occurrences in the memory of empty bags. For instance, and are considered -equivalent.
Definition 24.
For all , the set of sums of -resource terms (“resource sums”, for short) is defined as the -semimodule of finitely supported formal sums of expressions in , with coefficients in . Explicitly, it can be presented as:
quotiented by associativity and commutativity of , as well as neutrality of .
Note that , that is, resource expressions are assimilated to the corresponding one-element sum. The constructors of the calculus are extended to resource sums by (bi)linearity, i.e. for , , , , and , we have:
Therefore, if occurs in not as a summand but as a proper subterm, then .
4.2 Memory substitution and resource substitution
While the usual finite resource calculus is completely linear, the variables we store in the memory of and are not. The memory remembers the variables present in not their amounts, this is the reason why it is modelled as a set, not as a multiset. This consideration leads us to define two kinds of substitutions.
The (non-linear) memory substitution of a set for a variable in a -resource term does not interact with the linear occurrences of in (i.e., they remain unchanged), it just replaces the “memory” of in the empty bags with the content of .
Definition 25.
-
(i)
For all and , define
-
(ii)
Given , the memory substitution of by in is the resource term defined as follows (for and, in the abstraction case, ):
We now define the resource substitution of a bag for in , whose effect is twofold. 1) It non-deterministically replaces each linear occurrence of with a resource from the bag (as usual). 2) It applies the memory substitution of by to the resulting sum of terms.
Definition 26.
Given , and , the resource substitution of by in is the resource sum defined as follows:
with and in the abstraction case . We extend it to sums in by setting:
It is easy to verify that the definition above does indeed define a resource sum in , and that it is stable under the quotients of Definition 24.
Definition 27.
The linear degree of in some is defined by:
The next lemma is not strictly needed, but helps understanding resource substitution.
Lemma 28.
Consider , and , and write . Then
where: is the set of permutations of ; is any enumeration of the elements in ; enumerate the occurrences of in ; and is the -resource term obtained by substituting each element for the occurrence .
Proof.
Straightforward induction on .
The next Substitution Lemma concerns the commutation of resource substitutions, and is the analogous of [4, Lemma 2.1.16]. Notice that the assumptions on the substituted variables are stronger than in the usual resource calculus [21, Lemma 2], where only is required.
Lemma 29.
Given , , , and , ,
Proof.
By structural induction on , using Lemma 28 in order to apply the induction hypothesis only to those subterms where the hypotheses are actually satisfied.
4.3 The operational semantics
We finally endow resource expressions and resource sums with a notion of reduction .
Definition 30.
-
(i)
For each , define the resource reduction as a relation between -resource terms and resource sums, i.e. :
-
(ii)
We extend the reduction relation to resource sums , and simultaneously introduce its reflexive closure , as follows:
-
(iii)
We denote by the reflexive and transitive closure of the relation given in (ii).
Observe that is well-defined because . Indeed with , whence .
Example 31.
We use the resource -terms and from Example 23.
-
(i)
. Similarly, .
-
(ii)
has two redexes. Contracting the outermost first gives . Contracting the innermost .
-
(iii)
. Thus, sums can arise from single terms.
We show that enjoys the properties of strong confluence and strong normalisation.
Theorem 32.
-
(i)
The reduction is strongly normalising.
-
(ii)
is strongly confluent in the following sense: for all such that and , there exists such that and .
Proof.
-
(i)
The size of a resource expression is defined by structural induction as usual, with base cases and , so that . The sum-size of a resource sum is the finite multiset defined by and . Sum-sizes are well-ordered by the usual well-founded ordering on finite multisets over (see [43, §A.6]).
Now, assume that . Since the contraction of a redex suppresses an abstraction and there is no duplication, we get . Conclude since is well-founded.
- (ii)
By (ii) above every has a unique -normal form which is denoted .
5 Taylor approximation for Ohana trees
In its original formulation, Ehrhard and Regnier’s Taylor expansion translates a -term as a power series of iterated derivatives [20]. We now introduce a qualitative Taylor expansion [34] specifically designed for the -calculus, having as target the -resource calculus.
5.1 The Taylor approximation
Intuitively, a qualitative Taylor expansion should associate each term with a set of resource approximants . Therefore the codomain of should be , and what we actually define is with . Notice that, whereas all previous constructions of disjoint unions were formed from genuinely disjoint sets, this is no longer the case here, as , for all .
Notation 33.
-
(i)
For and , we write .
-
(ii)
We let denote the order relation on such that whenever and . We write for the corresponding least upper bounds.
-
(iii)
We write to mean that .
-
(iv)
Given , and , we write:
Definition 34.
-
(i)
The Taylor expansion of a -term , is defined together with by mutual induction:
-
(ii)
The above definition is extended to Ohana trees by setting, for all ,
Remark 35.
For all , we have . Similarly, , due to Remark 16 and the way we ordered .
Example 36.
-
(i)
, .
-
(ii)
and , where the sets of approximants can be described as the smallest (in fact, unique) subsets of such that:
We now describe how resource reduction acts on Taylor expansions, i.e. on potentially infinite sets of resource expressions.
Notation 37.
-
(i)
Given , we denote by its support, defined by and . Notice that whenever bears a non-zero coefficient in (i.e. , for some ).
-
(ii)
Given , we write . Notice that , and that if and only if , for all .
This allows us to state the following theorem, adapting [20, Theorem 2].
Theorem 38 (Commutation).
For all , .
We outline a proof in the following sequence of lemmas, similar to the one in [2]; alternatively, the variants of [20, 21], [38] and [10, 12] could also be adapted.
Lemma 39.
For all resource sums such that , there exists a reduction such that .
Proof.
By induction on the length of the longest reduction . If it is , take . Otherwise, the longest reduction is . By firing all redexes in and at the same position as the redex fired in (formally we do this by induction on this reduction), we obtain and such that . By confluence, . We conclude by induction on this (shorter) reduction.
Lemma 40.
If is in -nf, then there exists such that .
Proof.
By induction on . An -nf is also a hnf, hence and . For , . If define . If , each is in -nf, by induction there is , . Define . Finally, and .
Lemma 41 (Monotonicity of ).
-
(i)
if and only if .
-
(ii)
For all , we have .
Proof.
Immediate inductions (i) on and , and (ii) on the head structure of .
Lemma 42 (Simulation of ).
If , then for resource sums such that .
Proof.
One first shows by induction on that for all and , . Then the proof is an induction on , using the previous equality in the base case. See the details of a similar proof in [12, Lemmas 4.1 and 4.2].
Lemma 43.
If then all are in -nf.
Proof.
Immediate induction on .
Everything is now in place to prove the Commutation Theorem 38.
Proof of Theorem 38.
By Remark 35, . Thus, it is sufficient to prove that, for : if and only if .
Take , i.e. for some . Then, by Lemma 39, there exists a reduction such that . Hence and is in -nf: Lemma 40 ensures that for some (by Proposition 19). This means exactly that .
5.2 The -theory of Ohana trees
Consider the equivalence on , defined by if and only if . Thanks to Theorem 38, we are now able to show that this equivalence is a -theory.
Corollary 44.
For , if and only if .
Proof.
() Immediate by Theorem 38. () Take such that . By Theorem 20, it is sufficient to prove . Take . If , then is trivial since is downward closed. Otherwise, by hypothesis and Theorem 38, . There is a such that , where is defined by
By induction on , one shows that implies , hence by downward-closure (Lemma 18(ii)). This shows that . The converse inclusion is symmetric.
Corollary 45.
is a -theory.
Proof.
The relation is clearly an equivalence. By Propositions 19 and 20, for all , entails .
For compatibility with abstraction, take and . By Corollary 44, we get .
For compatibility with application, by Theorem 32 observe that for all , , where is defined by adapting Notation 37 to sets of resource bags. Therefore, and imply , and we can conclude the proof by Corollary 44.
6 Conclusions and future work
In this paper we introduced the Ohana trees for the -calculus, together with two theories of program approximations: the former based on finite trees, the latter on resource approximants and Taylor expansion. Our pioneering results look encouraging, so we believe that this approach deserves further investigations.
6.1 Further work on the -calculus
The Ohana trees introduced in Definition 10 are an adaptation of Böhm trees, since they regard as meaningless the terms without hnf. By considering as meaningless the subset of zero-terms111I.e., terms without an hnf that never reduce to an abstraction. one obtains Lévy-Longo trees [31, 32], and by taking mute terms222Also called root active, mute terms have the property that all their reducts can reduce to a redex. as meaningless one obtains Berarducci trees [7]. Our definition of Ohana trees can be readily adapted to both settings by appropriately modifying the notion of meaningless. Preliminary investigations indicate that all our results extend seamlessly to the Lévy-Longo version. Regarding the Berarducci version, the direct approximants can be generalized without any issues (except for the fact that an oracle is needed, see [45]). We are currently studying whether the corresponding -resource calculus and Taylor expansion could also be designed.
Our investigation of memory trees started from semantical considerations. The relational model with infinite multiplicities , defined in [9], distinguishes from , and from , just like our memory trees. Unlike our memory trees, it equates and , thus the induced theory is different from memory trees equality ().
Finding a denotational model whose theory captures exactly the Ohana tree equality would reinforce our belief that they are a natural notion of trees for the -calculus.
Problem 46.
Is there a denotational model of whose theory is exactly ?
As pointed out by one of the referees, our Definition 6 of -terms can most likely be recast in the framework of abstract syntax with binding [23]: just as can be described as a canonical presheaf over (a skeleton of) the category of finite sets and functions, would be a presheaf over the category of finite sets and surjections (intuitively, considering only surjective renamings of variables prevents any weakening). Similarly, would appear as a presheaf over the same category. One could then wonder whether all our work can be presented “over” finite sets and surjections; in particular, would our Taylor expansion act naturally with respect to these presheaf constructions? There is hope that it is the case, given that we followed the inductive structures of both -terms and -resource terms, which may pave the way towards building (presheaf) models answering to Problem 46.
We believe that finding a denotational model and studying its categorical properties are important steps towards a deeper mathematical understanding of our Taylor expansion. In particular, it is currently unclear whether our resource calculus stands on a solid notion of differentiation, as it is the case for the usual resource calculus [19], or if it is an ad hoc adaptation.
Problem 47.
Is the -resource calculus representing some notion of derivative?
We now discuss more speculative extensions, going beyond the setting of -calculus.
6.2 What about the full -calculus?
We have seen that the model from [9] distinguishes some meaningless terms having different free variables, but equates some -terms having different Ohana trees. Characterizing its theory seems a very natural question that has been completely overlooked in the literature.
Problem 48.
Is there an operational characterization of the -theory induced by ?
The fact that is a model of the full -calculus witnesses the existence of consistent -theories that remember variables that are pushed into infinity in the Böhm tree semantics. It is then natural to wonder whether it makes sense to extend the definition of Ohana trees to arbitrary -terms. The idea is to consider the set of permanent free variables of :
Intuitively, is the set of free variables of that are never erased along a reduction.
Definition 49.
The Ohana tree of a -term can be then defined by setting:
-
, if ;
-
, otherwise.
For the definition above is equivalent to Definition 10, since . For an arbitrary , one needs an oracle to compute , but an oracle is already needed to determine whether has an hnf, therefore the logical complexity does not increase.
Preliminary investigations show that the above notion of Ohana tree remains invariant by . The key property which is exploited to prove this result is that . The main problem of Definition 49 is that the equality induced on -terms is not a -theory because it is not compatible with application. The following counterexample exploits the fact that, in general, . Define:
We have and , whence . By applying these terms to , we obtain and , therefore . We conclude that the equality induced on is not a -theory, because it is not compositional. This counterexample is particularly strong because it shows that this is independent from the fact that Ohana trees are generalizations of Böhm trees and not, say, Berarducci trees. Indeed, the constructed above have the same Böhm tree, Lévy-Longo tree and Berarducci tree.
A natural question is whether Ohana trees can be used as a meaningful notion of observation, in the sense of Morris’s observational equivalences [37].
Problem 50.
Is there a denotational model inducing the following -theory?
where denotes a -calculus context (namely, a -term containing a hole ), and the -term obtained by replacing for the hole in , possibly with capture of free variables.
References
- [1] Sandra Alves and Mário Florido. Structural rules and algebraic properties of intersection types. In Helmut Seidl, Zhiming Liu, and Corina S. Pasareanu, editors, Theoretical Aspects of Computing - ICTAC 2022 - 19th International Colloquium, Tbilisi, Georgia, September 27-29, 2022, Proceedings, volume 13572 of Lecture Notes in Computer Science, pages 60–77. Springer, 2022. doi:10.1007/978-3-031-17715-6_6.
- [2] Davide Barbarossa and Giulio Manzonetto. Taylor subsumes Scott, Berry, Kahn and Plotkin. Proceedings of the ACM on Programming Languages, 4(POPL):1–23, 2019. doi:10.1145/3371069.
- [3] Henk Barendregt. The type free lambda calculus. In Jon Barwise, editor, Handbook of Mathematical Logic, volume 90 of Studies in Logic and the Foundations of Mathematics, pages 1091–1132. North-Holland, Amsterdam, 1977.
- [4] Henk Barendregt. The lambda calculus - its syntax and semantics, volume 103 of Studies in logic and the foundations of mathematics. North-Holland, 1984.
- [5] Henk Barendregt and Giulio Manzonetto. A Lambda Calculus Satellite. College Publications, 2022. URL: https://www.collegepublications.co.uk/logic/mlf/?00035.
- [6] Stefano Berardi and Ugo de’Liguoro. Non-monotonic pre-fix points and learning. Fundam. Informaticae, 150(3-4):259–280, 2017. doi:10.3233/FI-2017-1470.
- [7] Alessandro Berarducci. Infinite -calculus and non-sensible models. In Marcel Dekker, editor, Logic and Algebra, volume 180, pages 339–377, New York, 1996. Presented to the conference in honour of Roberto Magari, Pontignano 1994.
- [8] Flavien Breuvart, Giulio Manzonetto, and Domenico Ruoppolo. Relational graph models at work. Log. Methods Comput. Sci., 14(3), 2018. doi:10.23638/LMCS-14(3:2)2018.
- [9] Alberto Carraro, Thomas Ehrhard, and Antonino Salibra. Exponentials with infinite multiplicities. In Anuj Dawar and Helmut Veith, editors, Computer Science Logic, 24th International Workshop, CSL 2010, 19th Annual Conference of the EACSL, Brno, Czech Republic, August 23-27, 2010. Proceedings, volume 6247 of Lecture Notes in Computer Science, pages 170–184. Springer, 2010. doi:10.1007/978-3-642-15205-4_16.
- [10] Rémy Cerda. Taylor Approximation and Infinitary -Calculi. Phd thesis, Aix-Marseille Université, 2024. URL: https://hal.science/tel-04664728.
- [11] Rémy Cerda, Giulio Manzonetto, and Alexis Saurin. Ohana trees and Taylor expansion for the I-calculus. No variable gets left behind or forgotten!, 2025. Version of this paper with additional proofs in an appendix. arXiv:2505.06193.
- [12] Rémy Cerda and Lionel Vaux Auclair. Finitary simulation of infinitary -reduction via Taylor expansion, and applications. Logical Methods in Computer Science, 19, 2023. doi:10.46298/lmcs-19(4:34)2023.
- [13] Alonzo Church. The calculi of lambda conversion. Princeton University Press, 1941.
- [14] Lukasz Czajka. A new coinductive confluence proof for infinitary lambda calculus. Log. Methods Comput. Sci., 16(1), 2020. doi:10.23638/LMCS-16(1:31)2020.
- [15] Daniel de Carvalho and Lorenzo Tortora de Falco. The relational model is injective for multiplicative exponential linear logic (without weakenings). Ann. Pure Appl. Log., 163(9):1210–1236, 2012. doi:10.1016/J.APAL.2012.01.004.
- [16] Daniel de Carvalho and Lorenzo Tortora de Falco. A semantic account of strong normalization in linear logic. Inf. Comput., 248:104–129, 2016. doi:10.1016/J.IC.2015.12.010.
- [17] Aloÿs Dufour and Damiano Mazza. Böhm and Taylor for all! In Jakob Rehof, editor, 9th International Conference on Formal Structures for Computation and Deduction, FSCD 2024, July 10-13, 2024, Tallinn, Estonia, volume 299 of LIPIcs, pages 29:1–29:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.FSCD.2024.29.
- [18] Lavinia Egidi, Furio Honsell, and Simona Ronchi Della Rocca. Operational, denotational and logical descriptions: a case study. Fundam. Informaticae, 16(1):149–169, 1992.
- [19] Thomas Ehrhard and Laurent Regnier. The differential lambda-calculus. Theor. Comput. Sci., 309(1-3):1–41, 2003. doi:10.1016/S0304-3975(03)00392-X.
- [20] Thomas Ehrhard and Laurent Regnier. Böhm trees, Krivine’s machine and the Taylor expansion of lambda-terms. In Arnold Beckmann, Ulrich Berger, Benedikt Löwe, and John V. Tucker, editors, Logical Approaches to Computational Barriers (CiE 2006), pages 186–197, 2006. doi:10.1007/11780342_20.
- [21] Thomas Ehrhard and Laurent Regnier. Uniformity and the Taylor expansion of ordinary lambda-terms. Theoretical Computer Science, 403(2):347–372, 2008. doi:10.1016/j.tcs.2008.06.001.
- [22] Jörg Endrullis, Dimitri Hendriks, and Jan Willem Klop. Highlights in infinitary rewriting and lambda calculus. Theor. Comput. Sci., 464:48–71, 2012. doi:10.1016/J.TCS.2012.08.018.
- [23] Marcelo Fiore, Gordon Plotkin, and Daniele Turi. Abstract syntax and variable binding. In 14th Symposium on Logic in Computer Science, 1999. doi:10.1109/lics.1999.782615.
- [24] Silvia Ghilezan. Strong normalization and typability with intersection types. Notre Dame J. Formal Log., 37(1):44–52, 1996. doi:10.1305/NDJFL/1040067315.
- [25] Furio Honsell and Marina Lenisa. Some results on the full abstraction problem for restricted lambda calculi. In Andrzej M. Borzyszkowski and Stefan Sokolowski, editors, Mathematical Foundations of Computer Science 1993, 18th International Symposium, MFCS’93, Gdansk, Poland, August 30 - September 3, 1993, Proceedings, volume 711 of Lecture Notes in Computer Science, pages 84–104. Springer, 1993. doi:10.1007/3-540-57182-5_6.
- [26] J. Martin E. Hyland. A syntactic characterization of the equality in some models for the -calculus. Journal London Mathematical Society (2), 12(3):361–370, 1975.
- [27] Benedetto Intrigila, Giulio Manzonetto, and Andrew Polonsky. Degrees of extensionality in the theory of Böhm trees and Sallé’s conjecture. Log. Methods Comput. Sci., 15(1), 2019. doi:10.23638/LMCS-15(1:6)2019.
- [28] Bart Jacobs. Semantics of lambda-I and of other substructure lambda calculi. In Marc Bezem and Jan Friso Groote, editors, Typed Lambda Calculi and Applications, International Conference on Typed Lambda Calculi and Applications, TLCA ’93, Utrecht, The Netherlands, March 16-18, 1993, Proceedings, volume 664 of Lecture Notes in Computer Science, pages 195–208. Springer, 1993. doi:10.1007/BFB0037107.
- [29] Richard Kennaway, Jan Willem Klop, M. Ronan Sleep, and Fer-Jan de Vries. Infinitary lambda calculi and Böhm models. In Jieh Hsiang, editor, Rewriting Techniques and Applications, 6th International Conference, RTA-95, Kaiserslautern, Germany, April 5-7, 1995, Proceedings, volume 914 of Lecture Notes in Computer Science, pages 257–270. Springer, 1995. doi:10.1007/3-540-59200-8_62.
- [30] Jeroen Ketema, Stefan Blom, Takahito Aoto, and Jakob Grue Simonsen. Rewriting Transfinite Terms, pages 129–144. Lulu Press Inc, United States, 2009.
- [31] Jean-Jacques Lévy. An algebraic interpretation of the K-calculus; and an application of a labelled -calculus. Theor. Comput. Sci., 2(1):97–114, 1976. doi:10.1016/0304-3975(76)90009-8.
- [32] Giuseppe Longo. Set-theoretical models of -calculus: theories, expansions, isomorphisms. Annals of Pure and Applied Logic, 24(2):153–188, 1983. doi:10.1016/0168-0072(83)90030-1.
- [33] Stefania Lusin and Antonino Salibra. The lattice of lambda theories. J. Log. Comput., 14(3):373–394, 2004. doi:10.1093/LOGCOM/14.3.373.
- [34] Giulio Manzonetto and Michele Pagani. Böhm’s Theorem for resource lambda calculus through Taylor Expansion. In C.-H. Luke Ong, editor, Typed Lambda Calculi and Applications - 10th International Conference, TLCA 2011, Novi Sad, Serbia, June 1-3, 2011. Proceedings, volume 6690 of Lecture Notes in Computer Science, pages 153–168. Springer, 2011. doi:10.1007/978-3-642-21691-6_14.
- [35] Giulio Manzonetto, Andrew Polonsky, Alexis Saurin, and Jakob Grue Simonsen. The fixed point property and a technique to harness double fixed point combinators. J. Log. Comput., 29(5):831–880, 2019. doi:10.1093/LOGCOM/EXZ013.
- [36] Paul-André Melliès. Higher-order parity automata. In 32nd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2017, Reykjavik, Iceland, June 20-23, 2017, pages 1–12. IEEE Computer Society, 2017. doi:10.1109/LICS.2017.8005077.
- [37] James Hiram Morris. Lambda calculus models of programming languages. Phd thesis, Massachusetts Institute of Technology (MIT), 1968.
- [38] Federico Olimpieri and Lionel Vaux Auclair. On the Taylor expansion of -terms and the groupoid structure of their rigid approximants. Logical Methods in Computer Science, 18, 2022. doi:10.46298/lmcs-18(1:1)2022.
- [39] Michele Pagani and Paolo Tranquilli. Parallel reduction in resource lambda-calculus. In Zhenjiang Hu, editor, Programming Languages and Systems, 7th Asian Symposium, APLAS 2009, Seoul, Korea, December 14-16, 2009. Proceedings, volume 5904 of Lecture Notes in Computer Science, pages 226–242. Springer, 2009. doi:10.1007/978-3-642-10672-9_17.
- [40] Simona Ronchi Della Rocca. Characterization theorems for a filter lambda model. Inf. Control., 54(3):201–216, 1982. doi:10.1016/S0019-9958(82)80022-3.
- [41] Dana S. Scott. Continuous lattices. In Lawvere, editor, Toposes, Algebraic Geometry and Logic, volume 274 of Lecture Notes in Mathematics, pages 97–136. Springer, 1972.
- [42] Paula Severi and Fer-Jan de Vries. The infinitary lambda calculus of the infinite -Böhm trees. Math. Struct. Comput. Sci., 27(5):681–733, 2017. doi:10.1017/S096012951500033X.
- [43] Terese. Term Rewriting Systems, volume 55 of Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, 2003.
- [44] Steffen van Bakel. Complete restrictions of the intersection type discipline. Theor. Comput. Sci., 102(1):135–163, 1992. doi:10.1016/0304-3975(92)90297-S.
- [45] Steffen van Bakel, Franco Barbanera, Mariangiola Dezani-Ciancaglini, and Fer-Jan de Vries. Intersection types for lambda-trees. Theor. Comput. Sci., 272(1-2):3–40, 2002. doi:10.1016/S0304-3975(00)00346-7.
- [46] Lionel Vaux. Normalizing the Taylor expansion of non-deterministic -terms, via parallel reduction of resource vectors. Logical Methods in Computer Science, 15, 2019. doi:10.23638/LMCS-15(3:9)2019.
- [47] Christopher P. Wadsworth. The relation between computational and denotational properties for Scott’s -models of the lambda-calculus. SIAM J. Comput., 5(3):488–521, 1976. doi:10.1137/0205036.
- [48] Christopher P. Wadsworth. Approximate reduction and lambda calculus models. SIAM J. Comput., 7(3):337–356, 1978. doi:10.1137/0207028.
