Abstract 1 Introduction 2 Partial Metric Spaces 3 Quantifying 𝝀-Theories 4 Quantifying Scott Domains 5 Quantifying a Reflexive Object 6 Quantifying the Taylor Expansion 7 Conclusions References

The Lambda Calculus Is Quantifiable

Valentin Maestracci ORCID I2M, Université d’Aix-Marseille, France Paolo Pistone ORCID LIP, Université Claude Bernard Lyon 1, France
Abstract

In this paper we introduce several quantitative methods for the lambda-calculus based on partial metrics, a well-studied variant of standard metric spaces that have been used to metrize non-Hausdorff topologies, like those arising from Scott domains. First, we study quantitative variants, based on program distances, of sensible equational theories for the λ-calculus, like those arising from Böhm trees and from the contextual preorder. Then, we introduce applicative distances capturing higher-order Scott topologies, including reflexive objects like the D model. Finally, we provide a quantitative insight on the well-known connection between the Böhm tree of a λ-term and its Taylor expansion, by showing that the latter can be presented as an isometric transformation.

Keywords and phrases:
Lambda-calculus, Scott semantics, Partial metric spaces, Böhm trees, Taylor expansion
Funding:
Paolo Pistone: Research has been funded by the French project ANR-23-CPJ1-0054-01.
Copyright and License:
[Uncaptioned image] © Valentin Maestracci and Paolo Pistone; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Lambda calculus
; Theory of computation Program semantics
Related Version:
Full Version: https://arxiv.org/abs/2411.11809
Editors:
Jörg Endrullis and Sylvain Schmitz

1 Introduction

Two notions of program approximation.

One of the fundamental goals of program semantics is to understand when two different programs compute the same function. This is why, since its origins, the semantics of the λ-calculus, the mathematical foundation for higher-order programming languages, has been focused on the problem of program equivalence. Indeed, λ-theories, the equational theories of the λ-calculus, constitute one of the pillars of the mathematical theory behind this much studied language, ranging from more operational theories, like β-equivalence, to more observational ones, like contextual equivalence.

Actually, several well-known denotational models of the λ-calculus are not just the source for some λ-theory, but they also provide a topological point of view on them: the interpretations of the λ-calculus via Böhm trees, Scott domains or the Taylor expansion, involve spaces whose objects can be seen as limits of “finite” approximants, as well as continuous functions between such spaces, that is, functions commuting with such limits. In this way, the λ-theory induced by a topological model is associated with a notion of approximation, in the sense that a program is equivalent to another program whenever the net of finite approximants of the first converges to the second.

However, in general computer science, the approximation of a program is more commonly thought as the fact of computing values which are close (possibly up to some probability) to those produced by the program itself. By the way, the replacement of computationally expensive algorithms by more efficient, but somehow inaccurate, ones, is pervasive in all domains involving probabilistic or numerical methods. This has motivated, in the last few years, a rise of interest towards semantic approaches to functional languages focused, rather than on program equivalence, on notions of program similarity [37, 17, 11, 14, 16]. In these approaches, each type is endowed with a pseudo-metric, measuring the amount to which two programs behave in a similar, although non necessarily equivalent, way, and thus providing ways to estimate the errors produced by approximated optimization methods. At the same time, since any pseudo-metric induces an equational theory over programs, namely the one formed by all the pairs of programs which are at no distance the one from the other, this approach can be seen as a way to enrich, or “topologize”, well-established notions of program equivalence.

Quantifying 𝝀-theories via partial metrics.

In a sense, the overall goal of this paper is to reconcile these two, apparently different, ways to look at program approximations, by developing metric counterparts to well-established methods for the λ-calculus, thus providing ways to enrich λ-theories with notions of program similarity.

One reason why one could wish to approximate λ-theories by metrics is computational: while equational theories are generally undecidable, equivalences and, as we’ll see, distances of finite approximants can often be computed effectively. Could one thus express the equivalence between two terms as the fact that the distance between their respective approximants gets closer and closer to zero? This amounts to requiring that the limits in the topology T1 generating the λ-theory are also limits in the topology T2 generated by some program pseudo-metric. In other words, that T1 is finer than T2.

At the same time, since program metrics are generally undecidable as well, could the distances between two programs be themselves approximated by looking at the (computable) distances between their approximants? This amounts to requiring, conversely, that the metric limits, that is, the limits in T2, are also limits in the topology T1 inducing the λ-theory. In other words, that T2 is finer than T1.

All this sums up to the following question: can we make the topology arising from the semantics and the topology arising from the metric coincide? At first, one would tend to answer no: for instance, while the topology of a metric space is always Hausdorff, the topologies arising from the semantics of the λ-calculus (e.g. Scott domains) are not. Nevertheless, there is a well-known reply to this answer, namely partial metrics [8, 9, 28, 42, 40, 38], a well-studied variant of standard metrics developed in connection with ideas from program semantics. A partial metric differs from a standard metric in that the self-distances p(x,x) need not be zero; correspondingly, one has a stronger triangular law of the form p(x,y)p(x,z)+p(z,y)p(z,z), taking into account the self-distance of the middle point z. As a consequence, distinct points will not have disjoint neighborhoods, as soon as the self-distance of one makes it “too thick”, so to say, to separate it from the other.

In fact, any continuous domain with a countable basis is quantifiable (a term we borrow from [40]) by a partial metric. This means that its Scott topology does coincide with the topology induced by the metric [9, 35, 42, 40, 41], so that the limits in the Scott topology agree with the metric limits and viceversa.

While the quantification of domains via partial metrics has been well-known for a while, the application of such results to the study of higher-order languages has not been much explored so far. We do it in this paper: we introduce quantitative variants for well-known methods like Böhm trees, Scott domains and the Taylor expansion, based on partial metrics, at the same time providing ways to approximate their associated λ-theories.

Contributions.

In this paper we show that several well-known approaches to the study of the λ-calculus can be quantified, that is, enriched with metric reasoning on program similarity. Our contributions can be summarized as follows:

  • We introduce a partial metric variant of the notion of sensible λ-theory [5] and we explore quantitative versions of well-known theories like those arising from Böhm trees and the contextual preorder.

  • We introduce applicative partial metrics, and we illustrate their use to quantify higher-order Scott domains as well as reflexive objects, like Scott’s model D. This opens the way to apply metric techniques to typed or non-typed higher-order languages.

  • Finally, we study the Taylor expansion of λ-terms [18, 19, 4], a powerful technique inspired by ideas from linear logic, and show that it can be presented as an isometric transformation from Böhm trees to sets of resource λ-terms, thus refining the well-known commutation theorem [20], that relates the corresponding λ-theories.

Outline.

In Section 2 we recall basic notions about partial metric spaces. In Section 3 we introduce quantitative variants of sensible λ-theories. In Section 4 we investigate the quantification of higher-order Scott domains via applicative distances, and in Section 5 we apply these ideas to the quantification of reflexive objects. In Section 6 we discuss the Taylor expansion. Finally, in Section 7 we indicate related work as well as a few future directions.

2 Partial Metric Spaces

In this section we introduce partial metric spaces and we illustrate a few examples.

Definition 1.

A function p:X×X[0,+] is called a partial metric (PM) when it satisfies the following axioms:

  1. (P1)

    p(x,x)p(x,y),

  2. (P2)

    If p(x,x)=p(x,y)=p(y,y) then x=y,

  3. (P3)

    p(x,y)=p(y,x),

  4. (P4)

    p(x,y)p(x,z)+p(z,y)p(z,z).

p is called a partial pseudo-metric (PPM) when it satisfies P1, P3 and P4, and a partial ultra-metric (PUM) when it satisfies P1, P3 and

(P4U)

p(x,y)max{p(x,z),p(z,y)}.

While in a standard (pseudo-)metric space each point is at distance 0 from itself, condition P1 states that the distance of a point from itself is only required to be smaller than its distance from any other point. Condition P2 adapts the usual separation condition d(x,y)=0x=y to non-zero self-distances, and distinguishes PMs from PPMs. Condition P3 is the usual symmetry, while P4 is a strengthening of the triangular law of metric spaces, that also takes into account the possibly non-zero self-distance of the middle point z. P4U is as for standard ultra-metric spaces. Notice that P4U implies P4, so PUMs are indeed PPMs. Notice that a PPM (resp. a PUM, a PM) p always induces a pseudo-metric (resp. a ultra-metric, a metric) by the formula dp(x,y):=2p(x,y)p(x,x)p(y,y).

A PPM p induces a preorder on X defined by xpy iff p(x,y)p(x,x). Notice that this implies by P1 that p(x,y)=p(x,x). When p is a PM the preorder p is indeed an order. With respect to this preorder, p is antimonotonic in the sense that xpx implies p(x,y)p(x,y). Intuitively, the higher points are those with smaller self-distance.

The symmetrization of the preorder p yields an equivalence relation p. In the next section we will indeed explore the use of partial metrics as ways of approximating preorders or equivalence relations on λ-terms. We will say that a PPM p quantifies an order (resp. an equivalence) relation over X when this relation coincides with p (resp. p).

Let us now talk about the topology induced by a PPM.

Definition 2 (open balls, topology).

Let p be a PPM on X. For any xX and ϵ(0,+), the open ball of center x and radius ϵ is the set Bϵp(x)={yXp(y,x)<p(x,x)+ϵ}. The topology of p, noted 𝒪p(X), is formed by all subsets UX which are unions of open balls.

Recall that, by P1, the distance between two points x,y is always greater or equal than the self-distances p(x,x),p(y,y). We could equivalently define open balls as for standard metric spaces, i.e. Bϵp(x)={yXp(y,x)<ϵ}, but this would make Bϵp(x) empty whenever ϵp(x,x). Open balls are upper: if yBϵp(x) and ypy, by antimonotonicity we deduce p(y,x)p(y,x)<p(x,x)+ϵ, whence yBϵp(x). As a consequence, all open sets U𝒪p(X) are upper.

Contrarily to standard metric spaces, the topology 𝒪p(X) is not in general Hausdorff: suppose x,y are distinct points such that xpy; since any open set containing x must also contain y, there can be no disjoint open sets U,V such that xU and yV. In some cases, as we’ll see, 𝒪p(X) may coincide with the Scott topology induced by the order p.

In Sections 4 and 5 we will explore the use of partial metrics as ways of approximating (Scott) topologies on λ-terms. We will say that a PPM p quantifies a topology 𝒪(X) over X when 𝒪(X)=𝒪p(X).

Continuous functions between PPMs can be defined in the usual topological sense: given PPMs p,p, respectively on X and X, a function f:XX is p,p-continuous when f1 sends open sets in 𝒪p(X) onto open sets in 𝒪p(X). There is an equivalent ϵ/δ-definition: f is p,p-continuous if for all xX and ϵ>0, there exists δ>0 such that f(Bδp(x))Bϵp(f(x)).

We compare different PPMs on a set X by relating the associated topologies:

Definition 3.

Given two PPMs p,p on X, we say that p is finer than p (noted pp) when 𝒪p(X)𝒪p(X).

Equivalently, pp when the identity map idX:XX is p,p-continuous, i.e. every open p-ball contains an open p-ball around any of its points.

We conclude this short presentation with a few examples.

Example 4 (Sierpinski space).

The simplest example of a non-Hausdorff topology that is quantified by a partial metric is the Sierpinski space S={0,1}, with the Scott topology 𝒪σ(S)={,{1},{0,1}} induced by the order 01. Define the PM s on S by s(0,0)=s(0,1)=1 and s(1,1)=0. Notice how this implies 0s1. Since 0 has self-distance 1, the unique open balls are indeed , {1} and {0,1}, that is, 𝒪σ(S)=𝒪s(S).

Example 5 (Intervals).

The closed intervals of , noted 𝐈(), admit the PM pint(I1,I2):=inf{|ba|I1I2[a,b]}, which is the size of the smallest interval containing I1 and I2. The order defined by the metric here is intuitive, it is reverse inclusion/the Scott information order: IpintJ iff pint(I,J)pint(I,I) iff JI. The more information one has, the higher. This example explains the choice of the word “partial”: an interval, in term of Scott topology, represents an information on a partial execution: we have yet to discover the precise real number that we are computing. By contrast, the total elements will be those with self distance 0 (the ones where p behaves like a regular metric), i.e. of the form {r}, a complete information, of a terminated execution.

Example 6 (Labeled trees).

Let ΣTree be the set of (non necessarily finite) finitely branching Σ-labeled trees, where Σ is a countable set of labels. For any αΣTree, let |α|{} indicate the height of α. For any n, let αn be the finite tree obtained by truncating all paths of α at length n, if |α|n, and be undefined otherwise. We write αnβn to indicate that αn and βn are both definite and equal, and αn≜̸βn for its negation. For any α,βΣTree, define div(α,β):=inf{nαnβn and αn+1≜̸βn+1}.

The standard tree (ultra-)metric dtree is defined by d(α,β)=0 if α=β and 2div(α,β) otherwise. We obtain instead a PUM by simply letting ptree(α,β):=2div(α,β) (where it is intended that 2=0). For a finite tree α, its self-distance is ptree(α,α)=2|α|, while ptree(α,α)=0 holds iff α has infinite height. Also this case suggests that finite trees are seen as “partial” objects, while the infinite trees are the “total” ones. Indeed, ptree, unlike dtree, quantifies the Scott topology on ΣTree (see Section 4).

3 Quantifying 𝝀-Theories

In this section we introduce quantitative variants, based on partial metrics, of sensible λ-theories that arise from well-studied models of the untyped lambda-calculus, that is, the theory of Böhm trees and the theory of contextual equivalence. Moreover, we lift several properties of such equational theories to the corresponding notion of program similarity.

𝝀-PPMs.

Let us first recall the standard notion of λ-theory [5].

Definition 7.

A λ-theory T is an equivalence relation T on the set Λ of all λ-terms satisfying the rules below:

(congr1)

MTNMPTNP,

(congr2)

MTNPMTPN,

(ξ)

MTNλx.MTλx.N,

(β)

(λx.M)NTM[N/x].

A λ-theory T is said extensional when it satisfies the rule (η):

(η)

MTλx.Mx.

and sensible when it equates all unsolvable terms and does not equate a solvable and an unsolvable term.

Notice that a sensible theory T must be consistent: it cannot equate all terms.

A λ-theory may either arise from an operational theory (e.g. β- and βη-reduction) or be induced by a model (as the theory formed by all equations between terms that are interpreted by the same entity in the model). While there exists a continuum of different λ-theories, beyond the theories of β and βη-equivalence (respectively, the smallest λ-theory and the smallest extensional λ-theory), very few theories have been studied in depth. Indeed, all most common denotational models of the untyped λ-calculus induce one of the two sensible theories , and , that we consider below.

We now introduce a quantitative variant of λ-theories. Let us first recall that a point x in a topological space X is said generic when its closure is X or, equivalently, all its neighborhoods are dense in X. For instance, 0 is generic in the Sierpinski space S. In the case of PPM we have the following:

Lemma 8.

x is generic in the topology 𝒪p(X) iff xpy holds for all yX.

Proof.

Call x generic for p if xpy (that is, p(y,x)=p(x,x)) holds for all yX. x is generic for p iff the only open ball centered at x is X: from p(y,x)=p(x,x) it follows that for any ϵ>0, yBϵ(x), that is, Bϵ(x)=X; conversely, if any open ball centered at x is equal to X, then, for all ϵ>0, p(y,x)<p(x,x)+ϵ, which implies p(y,x)p(x,x) and thus p(y,x)=p(x,x) by P1.

Now, if x is generic for p, then any open set U containing x must contain some open ball Bϵ(x), which forces U=X since Bϵ(x)=X, so x is generic in 𝒪p(X). Conversely, if x is generic in 𝒪p(X), then for any ϵ>0, the closure of Bϵ(x) is X. This implies that for all ϵ>0, p(y,x)p(x,x)+ϵ, and thus that p(y,x)=p(x,x), so x is generic for p.

 Remark 9.

Generic points are indistinguishable: if x and y are both generic for p, then from p(y,y)=p(x,y)=p(x,x) it follows that xpy. Conversely, if x is generic and y is not, then, x≄py: if xpy, then, since p(y,x)=p(y,y), for all z, p(y,z)p(y,x)+p(x,z)p(x,x)=p(y,x)+p(x,x)p(x,x)=p(y,x)=p(y,y), so y would be generic as well.

Definition 10 (λ-PPM).

A pseudo-partial metric p over Λ is called a λ-PPM (resp. an extensional λ-PPM) if the following hold:

  • p is a λ-theory (resp. an extensional λ-theory);

  • all contexts 𝙲[] correspond to p-continuous maps ΛΛ.

p is called sensible if all unsolvable terms are generic while no solvable term is.

Observe that we do not require contexts to be non-expansive (or 1-Lipschitz), as in other standard metric approaches [37, 17, 15], but just continuous. Also notice that, by Remark 9, a sensible PPM p must satisfy MpN for all unsolvable terms M,N, and M≄pN for M unsolvable and N solvable: the associated λ-theory p is thus sensible.

In the rest of this section we introduce λ-PPMs quantifying the λ-theories and .

Böhm Trees.

The interpretation of λ-terms as Böhm trees is one of the fundamental tools in the λ-calculus. The Böhm tree (M) of a λ-term M is a (Λ{})-labeled tree defined co-inductively as follows:

  • if M reduces to λx1..λxm.xM1Mn, then (M) has a root with label λx1..λxm.x and n subtrees (M1),,(Mn);

  • otherwise, (M) only consists of the root, with label .

An alternative presentation of (M) is via partial terms, which are λ-terms in normal form, enriched with the constant and rules λx., M. We note these partial terms A,B,. The set 𝒜 of partial terms is ordered by the contextual closure of the relation generated by A, for all A𝒜. Partial terms correspond straightforwardly to finite Böhm trees.

For any λ-term M, let the partial term M𝒜 be defined inductively as follows: M𝒜=λx.y(M1)𝒜(Mn)𝒜 if M=λx.yM1Mn, and M𝒜= if M=λx.(λy.P)M1Mn+1. Let AM whenever M β-reduces to M with AM𝒜. We then let (M)={AAM}. Observe that (M) can be seen at the same time as a tree under the relation , and the standard tree ordering (M)(N) holds precisely when (M) is included in (N).

The λ-theory contains all equations MN, where (M)=(N). is sensible but non-extensional (as e.g. (λx.x)(λx.λy.xy)).

We now introduce the corresponding λ-PPM: we measure the distance between λ-terms by comparing their Böhm trees via the tree partial metric.

Definition 11 (Böhm partial metric).

For any two λ-terms M,N, let

pBöhm(M,N) :=ptree((M),(N)).

Observe that pBöhm(M,M)=0 iff (M) is infinite. It is not difficult to check that pBöhm captures the theory :

Proposition 12.

MpBöhmN iff (M)(N), and thus MpBöhmN iff MN.

As discussed in Section 4, pBöhm captures the Scott topology of Böhm trees. This proves that contexts are continuous, and thus that pBöhm is a λ-PPM. Moreover, since ptree(,α)=1, the unsolvable terms are generic, while, for any solvable term M, pBöhm(M,M)<1 and thus, for any ϵ<1pBöhm(M,M), the open ball BϵpBöhm(M) does not contain the term λx.M (since pBöhm(M,λx.M)=1>pBöhm(M,M)+ϵ).

 Remark 13.

While the theory is Π20-complete, the distances ptree(A,B) are effectively computable whenever A,B are finite trees (equivalently, partial terms). Moreover, to check that pBöhm(M,N)<ϵ, it is necessary and sufficient to find approximants AM and BN such that ptree(A,B)<ϵ.

Contextual equivalence.

We now consider the theory arising from contextual equivalence. Let MctxN if for all context 𝙲[], if 𝙲[M] is solvable, then 𝙲[N] is solvable. The theory contains all equations MHN where MctxN and NctxM both hold. It is extensional and sensible, and is indeed the maximum sensible theory.

To quantify we define the following distance:

Definition 14 (contextual partial metric).

For all terms M,N, we define

pctx(M,N)=n=0{12n|𝙲n[M] is unsolvable or 𝙲n[N] is unsolvable},

where (𝙲n[])n is an enumeration of all contexts.

The distance pctx(M,N) intuitively counts all contexts 𝙲n[] that fail on either M or N. In particular, the self-distance pctx(M,M) counts the contexts that fail on M.

The following result shows that pctx captures the contextual preorder:

Proposition 15.

MpctxN iff MctxN, and thus MpctxN iff MN.

For the result above, the choice of the enumeration is irrelevant, as is the choice of the weights 12n, which could be replaced by arbitrary weights θn summing up to 1.

 Remark 16.

Contrarily to contextual equivalence, which is Π20-complete as well, to check that NBϵpctx(M) one does not need to look at the behavior of M and N under all contexts. Intuitively, Bϵpctx(M) contains all those programs that behave like M on certain finitely many contexts. Indeed, pctx(M,N)<pctx(M,M)+ϵ means that the contexts on which M does converge and N does not sum up to some value strictly smaller than ϵ. This is true iff N converges on those finitely many contexts 𝙲i[], where 2(i+1)ϵ, on which M converges.

Proposition 17.

pctx is a sensible extensional λ-PPM.

Proof.

Let us show that contexts yield continuous maps. Take a term M, ϵ>0 and a context 𝙲. We need to find some δ>0 such that for all PBδpctx(M), 𝙲[P]Bϵpctx(𝙲[M]). By Remark 16 there exists a finite number of contexts 𝙲1,,𝙲k such that 𝙲i[𝙲[M]] is solvable and NBϵpctx(𝙲[M]) iff 𝙲i[N] is solvable for i=1,,k. Take m such that for all i=1,,k, the context 𝙲i[𝙲[]] has an index smaller than m, and let δ=2m. Notice that 𝙲i[𝙲[M]] is solvable. Moreover, for any term P, if PBδpctx(M), then 𝙲i[𝙲[P]] must be solvable for all i=1,,m. This implies then that 𝙲[P]Bϵpctx(𝙲[M]), as desired.

The sensibility of pctx essentially follows from the well-known genericity lemma [5, 2]: if 𝙲[M] is solvable, where M is unsolvable, then 𝙲[N] must be solvable for all N; this implies that for any unsolvable M, and for any term N, pctx(M,N)=pctx(M,M), so M is generic in pctx. Conversely, if M is solvable, then, for any unsolvable term N, one can easily construct a context 𝙲 such that 𝙲[M] reduces to λx.x and 𝙲[N] diverges. This allows us to conclude that pctx(M,N)>pctx(M,M), and thus that M is not generic in p.

Similarly to the λ-theory , the λ-PPM pctx is maximum among sensible λ-PPMs.

Proposition 18.

For any sensible λ-PPM p, ppctx.

Proof.

Let p be a sensible λ-ppm. Consider a term M and ϵ>0. We must find δ>0 such that Bδp(M)Bϵpctx(M). By Remark 16 there exists a finite number of contexts 𝙲1,,𝙲k such that 𝙲i[M] is solvable and NBϵpctx(M) iff 𝙲i[N] is solvable for i=1,,k.

Fix an ik and let Qi=𝙲i[M]. Since Qi is solvable and p is sensible, we can find an open set Ui containing Qi and not containing any unsolvable term. Since p is a λ-PPM, 𝙲i corresponds to a continuous function, and thus 𝙲i1(Ui) contains some open ball Bδip(M). Let δ=miniδi: if PBδp(M), then for all i=1,,k, 𝙲i[P]Ui, so it must be solvable. We conclude then that PBϵpctx(M).

 Remark 19.

That pBöhmpctx can be easily seen directly: the elements of Bϵpctx(M) are those which converge on a finite number of contexts 𝙲1,,𝙲k on which M converges too (cf. Remark 16). For any such context 𝙲i, the convergence of 𝙲i[M] to a head normal form only depends on the exploration of a finite portion of (M), say up to height mi. Letting m=maxi{mi} and δ=2m, we have then that BδpBöhm(M)Bϵpctx(M). The converse inclusion pctxpBöhm cannot hold: any open ball BϵpBöhm(I) around I=λx.x that does not contain its η-expansion λx.λy.xy contains no open pctx-ball around I.

Other well-known characterizations of exist, which suggest different ways to quantify this theory. One is in terms of the so-called Nakajima trees (cf. [5], Ex. 19.4.4, p. 511): these are a variant of Böhm trees that are invariant under the η-rule. By adapting the tree partial metric one could then obtain another partial metric pNakajima that quantifies .

Moreover, the theory is induced by a large class of denotational models of the λ-calculus (cf. [31]), including in particular the models based on Scott domains, that we discuss in Sections 4 and 5, or the relational model from [6], to which the techniques illustrated in those sections can be easily adapted.

4 Quantifying Scott Domains

As discussed in the introduction, the λ-theories like or are induced by topological models, based on Scott domains, which provide notions of approximant for λ-terms. In this section, after discussing the connection between partial metrics and Scott domains, we introduce applicative PPMs as a means to capture domains of Scott-continuous functions, and we illustrate how this leads to quantify topological models of typed λ-calculi.

Scott Domains via Partial Metrics.

Let us recall some basic terminology about dcpos and Scott domains.

A partially ordered set (X,) is a dcpo (directed complete partial order) if all directed subsets of X admit a least upper bound. The way below relation on a dcpo is defined by xy iff for all directed subset ΔX, yΔ implies xd, for some dΔ. A point xX is said compact if xx. A basis for a dcpo X is a subset BX such that for any xX, the set Δ={yByx} is directed and x=Δ. A dcpo is said continuous if it has a basis and algebraic if it has a basis formed of compact elements. A domain is a continuous dcpo with a countable basis. A domain X is bounded complete if for any finite set YfinX, if an upper bound of Y exists in X, then Y exists in X. A bounded complete and algebraic domain is called a Scott domain.

The Scott topology 𝒪σ(X) on a partially ordered set (X,) has open sets being upper subsets UX which are finitely accessible: xU implies yU for some yx. A function f:XY between dcpos is said continuous iff f is monotone and commutes with the lubs of directed subsets, that is, for all directed ΔX, f(Δ)=f(Δ). This is equivalent to asking f to be continuous, in the usual sense, with respect to the Scott topology. The category of bounded complete domains and continuous functions is cartesian closed (cf. [1]).

Let us specify what it means for a dcpo to be quantified by a partial metric.

Definition 20.

A dcpo (X,) is quantified by a PM p when its associated Scott topology is quantified by p, that is, when 𝒪p(X)=𝒪σ(X).

Beyond the Sierpinski space S, also the other two dcpos from Section 2 are quantified by the associated PMs (proofs are in the long version):

Proposition 21.

The interval dcpo 𝐈() is quantified by pint (cf. Example 5). The domain ΣTree of Σ-trees is quantified by ptree (cf. Example 6).

When p quantifies a dcpo (X,), the order p coincides with the order of the dcpo.

Lemma 22.

Suppose the dcpo (X,) is quantified by p. Then coincides with p.

Proof.

coincides with the specialization order x𝒪σ(X)yU𝒪σ(X)(xUyU); similarly, p coincides with the specialization order x𝒪p(X)yU𝒪p(X)(xUyU). From 𝒪σ(X)=𝒪p(X) we deduce that the two specialization orders coincide, and thus and p as well.

However, checking that a partial metric p captures the order of the dcpo is not in general enough to deduce that p quantifies the dcpo, as shown by Example 24 below. The following proposition provides necessary (but not sufficient) conditions.

Proposition 23.

Let (X,) be a continuous dcpo and p a partial metric on X such that coincides with p.Then the following conditions are equivalent:

  1. 1.

    𝒪p(X)𝒪σ(X);

  2. 2.

    open p-balls are finitely accessible;

  3. 3.

    p is Scott-continuous (as a map towards the dcpo ([0,+],)).

Proof.

(12)

Since the open balls are upper sets, these are Scott open iff they are finitely accessible.

(32)

p is Scott continuous when for all xX and directed subset ΔX one has p(x,δ)=infdδp(x,d). Suppose p is continuous and let yBϵ(x). We need to show that there exists yy such that yBϵ(x). This implies that for some ϵ<ϵ, p(y,x)<p(x,x)+ϵ. Since p is continuous and y={zzy} we have then inf{p(z,x)zy}=p(y,x)<p(x,x)+ϵ. This implies in turn that for some yy, p(y,x)p(x,x)+ϵ<p(x,x)+ϵ, that is, yBϵ(x).

(23)

Suppose that open p-balls are finitely accessible, hence Scott open. Let ΔX be a directed set and xX. We need to prove that p(x,Δ)=infdΔp(x,d). Observe that the “” direction directly follows from dΔ. To prove the “” direction we argue as follows: let p(x,Δ)=p(x,x)+δ, with δ0. Let δ>δ, so that we have ΔBδ(x). Since Bδ(x) is Scott-open, there exists wΔ such that wBδ(x). From wΔ it follows that, for some dD, wd holds, whence p(d,x)p(w,x)<p(x,x)+δ. We have thus proved that for all δ>δ there exists dΔ such that p(d,x)<p(x,x)+δ, which implies then infdΔp(d,x)p(x,x)+δ=p(x,Δ).

To check the converse condition 𝒪σ(X)𝒪p(X), one must show that, given xy, one can form open balls around y whose elements all lie way above x. This corresponds to showing that the basic open sets x={yxy} for the Scott topology are metric open.

Example 24.

We construct a PM on ΣTree that captures the tree order but fails to quantify its Scott topology. Define a variant q of the tree partial metric as q(α,β)=12ptree(α,β)+14 if αβ or α=β is finite, and as ptree(α,β) if α=β is infinite. q is still a partial metric and furthermore the order q coincides with the tree order (and thus with p as well); now, letting αn be a directed sequence of finite trees converging to an infinite tree α, we have limnq(αn,α)=14>0=q(nαn,α). Hence q is not Scott-continuous, and by Proposition 23 we have that 𝒪q(ΣTree)𝒪σ(ΣTree).

 Remark 25 (computability of p(x,y)<ϵ).

An immediate and useful consequence of the fact that open balls are Scott open is that p(x,y)<ϵ holds precisely when p(x,y)<ϵ holds for some approximants xx and yy. In other words, to verify that y is close enough to x it is enough to check that the approximants of y get close enough to the approximants of x. When distances between approximants, as well as the relation bx between a point and an approximant, are computable, the property p(x,y)<ϵ may be (semi-)decidable, even though the exact values p(x,y) are as hard as computing the λ-theory (usually, Π20 or worse). For instance, in the case of Böhm trees, to check that pBöhm(M,N)<2n, it is enough to check that (M) and (N) coincide up to height n, a property which can be semi-decided.

Example 26 (ϵ/δ-continuity of contexts).

As ptree quantifies the Scott topology of trees (cf. Proposition 21), it quantifies the Scott topology of Böhm trees. From the continuity theorem for Böhm trees (cf. [5]) we deduce then the following: for all context 𝙲[] and λ-term M and for all ϵ>0, there exists δ>0 such that, for all terms P, pBöhm(P,M)δ implies pBöhm(𝙲[P],𝙲[M])ϵ. Another way of stating this is that for all 𝙲[] and M, for all n there exists m such that, if (P) and (M) are the same up to depth m, then (𝙲[P]) and (𝙲[M]) are the same up to depth n.

Let us conclude this paragraph by recalling a very general result on the quantifiability of domains, already mentioned in the Introduction:

Theorem 27 (cf. [40]).

Let (X,) be a domain with a countable basis (bn)n, and let θn(0,1] be a sequence of weights such that nθn1. Then X is quantified by the partial metric pbn,θnX(x,y)=nNθn, where N:={n|bn≪̸xorbn≪̸y}.

While Theorem 27 provides a general positive answer to the quantifiability problem for domains, the practical usability of metrics like pbn,θnX depends on whether the relation bnx between a point and an approximant, and its negation, are computable.

Applicative distances and the function space.

The categories of Scott domains (resp. bounded complete domains) and continuous functions are sub-categories of Top that are, as is well-known, cartesian closed. Using Theorem 27 it is possible to define, on each object of such categories, a partial metric that quantifies its topology. However, in common approaches to higher-order languages (e.g. [17, 25, 16]), one requires distances to be defined in a compositional way.

For example, given metric spaces (X,dX) and (Y,dY), a standard way to define a metric on their cartesian product is by letting dX×Y(x,y,x,y)=dX(x,x)+dY(y,y). Indeed, a similar construction also works for PMs:

Proposition 28.

Let X,Y be two Scott domains, quantified, respectively, by the partial metrics pX,pY. Their cartesian product X×Y is then quantified by the partial metric pX×Y:=12(pX+pY).

We omit the proof of Proposition 28 as it is similar to that of Proposition 30 below (still, the proof can be found in the extended version).

 Remark 29.

In the following discussion we restrict attention to partial metrics valued in [0,1], rather than on [0,+]. This is not a limitation, since for any partial metric p with values in [0,+], the partial metric p1:X×X[0,1] defined by p1(x,y):=p(x,y)1+p(x,y) induces the same topology (cf. [34]).

Let us now consider the function space. Given metric spaces (X,d) and (X,d), a standard compositional way to define a metric on the space 𝒞(X,X) of continuous functions from X to X is via the sup-condition dsup(f,g)=supxXd(f(x),f(x)). Notably, when X is compact, dsup metrizes the compact-open topology on 𝒞(X,X). Other compositional metrics on the space of non-expansive functions NExp(X,X), depending on both d and d, can be found in the literature [10, 15]. Similar compositional definitions are also found in more operational approaches like e.g. [37, 25].

A common intuition in all these definitions is that two functions are close when their application to close (or even identical) points produces points that are still close. We will call functional distances respecting this idea applicative distances.

However, to define an applicative PM on the space of continuous functions, we cannot directly adapt a definition like dsup: unlike for standard (pseudo-)metrics, the sups of a family of PPMs does not define a PPMs. This is due to condition P4, which relies in a contravariant way on the medium self-distance p(z,z).

Instead, we will rely on the remark that a continuous function f:XY is uniquely determined by its action on the (countably many) elements of a basis of X. This suggests indeed the definition from the Proposition below:

Proposition 30.

Let X,Y be two bounded complete domains, quantified, respectively, by the PMs pX,pY, and let (an)n be an enumeration of a basis of X. Then, for all 0<θ12, their exponential XY is quantified by the PM

pXYθ(f,g)=n=1θnpY(f(an),g(an)). (1)

Before proving the result above, let us first discuss the PM pXYθ. The distances pXYθ(f,g) are defined by infinite series, which are convergent by our assumption that pX,pY are bounded by 1. However, for any ϵ>0, the verification that pXYθ(f,g)<ϵ can be reduced to a finitary test:

Lemma 31.

For all continuous functions f,g:XY, for all n>0, there exists N𝒪(n) such that, if pY(f(ai),g(ai))<2(n+1) holds for all i=1,,N, then pXYθ(f,g)<2n.

Proof.

Let ϵ=2n. We must choose N so that i>Nθi<ϵ2. Since n=1θn1, this corresponds to requiring n=1Nθn>1ϵ2, or, equivalently, 1θN+11θ1>1ϵ2. A few computations yield then the condition N+1>log(3θ+θ2ϵ+ϵ)𝒪(logϵ).

Let us show that under this condition the claim holds. Suppose pθ(f(ai),g(ai))ϵ2 holds for i=1,,N. Then we have

pθ(f,g) =(k=1Nθnq(f(ak),g(ak)))+(k>Nθnq(f(ak),g(ak)))(k=1Nθnϵ2)+ϵ2ϵ

The intuition behind the test above is that for N high enough, the infinite sum nNθn gets too small to actually matter in checking that pXYθ(f,g) is smaller than ϵ, and one is thus reduced to the finite sum n=1NθnpY(f(an),g(an)). This is indeed a key ingredient in showing that open balls of functions are finitely accessible, and in particular, that if gBϵ(f), this only depends on finitely many values of g.

Conversely, from pXYθ(f,g)<ϵ, one can deduce bounds pY(f(an),g(an))<θnϵ for all n, although such bounds become more and more loose as n increases, due to the exponential scaling factor θn.

Let us now turn to the proof of Proposition 30. First, let us recall that, given bounded complete domains X,Y, with countable bases B(X),B(Y), the domain 𝒞(X,Y) admits a countable basis formed by all functions of the form (ab), where aB(X),bB(Y), and (ab)(x)=b in case ax, while (ab)(x)= otherwise.

Importantly, while it is always the case that fg implies f(x)g(x) for all xX, the converse need not hold. Rather, the way below relation can be characterized as follows.

Lemma 32 (cf. [21]).

For all f,g𝒞(X,Y), fg iff there exists basis elements a1,,anB(X) and b1,,bnB(Y) such that

  • big(ai),

  • aig1(bi)111 Recall that 𝒪(X) is a continuous domain. For two open sets U,V𝒪(X), UV holds when any open cover of V has a finite subset which covers U. , for all i=1,,n,

  • fi=1n(aibi).

We now have all ingredients to prove Proposition 30.

Proof of Proposition 30.

𝒪σ(XY)𝒪pXY(XY):

We have to show that open balls are Scott-open. First observe that open balls are upper sets. We thus only need to show that they are finitely accessible: for all gBϵ(f) we must find some hg such that hBϵ(f). Let then gBϵ(f), so that pXYλ(f,g)<pXYλ(f,f)+ϵ. Observe that this implies that we can find positive reals θ,δ>0 such that θ+δϵ and pXYλ(f,g)<pXYλ(f,f)+δ. Let N be such that n>Nλnθ2. For all nN, fix some bnBθ2(g(an)) such that bng(an), and some basis element cnan.

Let now h=i=1N(cibi). From big(ai) it follows that aig1(bi), and thus that cig1(bi). By Lemma 32 this implies that hg. Let us show that hBϵ(f). For all n<N, we have pY(h(an),g(an))pY(bn,g(an))<pY(g(an),g(an))+θ2, whence, for all nN, pY(h(an),g(an))pY(g(an),g(an))<θ2. Let’s check that hBϵ(f):

pXYλ(h,f) =n=1λnpY(h(an),f(an))
n=1λn(pY(h(an),g(an))+pY(g(an),f(an))pY(g(an),g(an)))
n=1Nλn(pY(h(an),g(an))pY(g(an),g(an)))
+n>NλnpY(h(an),g(an))+pXYλ(g,f)
<n=1Nλnθ2+n>Nλn+pXYλ(f,f)+δ
θ2+θ2+pXYλ(f,f)+δpXYλ(f,f)+ϵ.
𝒪σ(XY)𝒪pXY(XY):

It suffices to show that the basic Scott open sets f contain an open p-ball Bϵ(g) around any of its points gf. So, suppose fg: by Lemma 32 there exists c1,,cnX, b1,,bnY such that big(ci), cig1(bi) and fi(cibi). From big(ci) it follows that there exists ϵi>0 such that Bϵi(g(ci))bi. Let N be such that for all i=1,,n, ci has an index N in the enumeration an of (X). Let ϵ=λNmin{ϵ1,,ϵn}.

We claim that Bϵ(g)f: let hBϵ(g), then, from nλn(pY(h(an),g(an))pY(g(an),g(an)))<ϵ, we deduce, for i=1,,n, pY(h(ci),g(ci))<pY(g(ci),g(ci))+λiϵpY(g(ci),g(ci))+ϵi, that is, h(ci)Bϵi(g(ci)). We deduce that bih(ci), and thus that fi(cibi)h. We can thus conclude that fh.

We conclude this section with a few examples.

Example 33 (RealPCF).

The language RealPCF [22] is an extension of PCF with a type 𝐈 for partial real numbers (i.e. finite approximations of real numbers or, equivalently, computable closed intervals) and primitives for computable analysis, with a canonical Scott semantics in which 𝐈 is interpreted via the domain 𝐈(). This is perfectly in line with the quantification of 𝐈() we presented in Example 5, which sees smaller and smaller intervals as providing more and more information. Via the applicative distances just presented, we obtain then a quantification of the Scott semantics of full RealPCF.

Example 34 (Scott topologies of open and closed sets).

Given a topological space X, one can endow the space 𝒪(X) of its open sets with the Scott topology induced by the inclusion order, as well as the (homeomorphic) space 𝒞(X) of its closed sets under the Scott topology induced by the reversed inclusion order.

Whenever X is exponentiable in Top (which is the case, in particular, whenever X is a Scott domain), the bijection h:𝒪(X)Top(X,S), where S is the Sierpinski space and h(U) is the characteristic function of U, is a homeomorphism [24]. Given a countable basis (xn)n of X, and weights θn with nθn1, we can then quantify 𝒪(X) and 𝒞(X) via

pxn,θn𝒪(U,V) =n=1θns(h(U)(xn),h(V)(xn))={θn|xnUxnV},
pxn,θn𝒞(C,D) =p𝒪(C¯,D¯)={θn|xnCxnD}.
Example 35 (Böhm trees as closed sets).

Consider the poset 𝒜 of partial terms. Let Ide(𝒜) be the dcpo of ideals of 𝒜, that is, of lower directed subsets of 𝒜. Observe that any Böhm tree (M)𝒜 is an element of Ide(𝒜), and the set (M)={UU(M)}Ide(𝒜) is a closed set under the Scott topology of Ide(𝒜). Given an enumeration An of partial terms and weights θn, we can then define an alternative λ-PPM by letting pAn,θn(M,N)=pAn,θn𝒞((M),(N))=n{θn|AnMorAnN}. While they produce different distances, pAn,θn and pBöhm quantify the same topology, i.e. pBöhmp.

Example 36 (Scott topology of the power set).

A countable set X is (trivially) a domain for the order given by equality, and its Scott topology coincides with the indiscrete topology, i.e. 𝒪(X)=𝒫(X). Given an enumeration xn of X, the Scott topology on 𝒫(X) is thus quantified by pxn,θn𝒫(A,B)={θn|xnAxnB}, for A,BX.

5 Quantifying a Reflexive Object

The denotational models for the untyped λ-calculus correspond to the reflexive objects within some cartesian closed category, that is, the objects X satisfying the isomorphism XXX. Within cpo-enriched categories, reflexive objects can be obtained by a direct limit construction, whose paradigmatic example is Scott’s D model. In this section we show how to quantify this model via applicative distances, at the same time illustrating a technique that could be adapted to other similar constructions, like e.g. the reflexive object within the relational model [6].

Quantifying Scott’s 𝑫.

Let us recall the idea of the direct limit construction of a reflexive object. One starts from some bounded complete domain D, and constructs a sequence of spaces D0:=D, Dn+1:DnDn, together with maps in:DnDn+1 and jn:Dn+1Dn forming a pair (in,jn) called an injection/retraction pair, that is, satisfying jnin=idDn+1 and injnidDn. One obtains then a reflexive object DDD as the direct limit of the sequence DninDn+1, as well as injection-retraction pairs in:DnD, jn:DDn.

Notice that an element x of D yields, for any n, a function xn:=jn(x)Dn=Dn1Dn2D0; conversely, any compact element xDn yields a compact element in(x)D, and such elements form indeed a basis of D.

Suppose now that the starting space D is quantified by some PM p. Using the applicative metrics from the previous section we can quantify all the Dn by letting p0:=p and pn+1(x,y)=i=112ipn(x(ain),y(ain)), where (ain)i is an enumeration of the basis elements of Dn. We obtain then a PM quantifying D by letting

p(x,y)=n=112npn(xn,yn)=n,kn1,,k0=1(12n+kn1++k0)p(xn(akn1n1)(ak00),yn(akn1n1)(ak00)).

Intuitively, the distance p compares x and y by considering all possible ways of evaluating the functions xn,ynDn on n basis elements of the corresponding spaces Dn1,,D0. As for the applicative metrics from the previous section, while the distances p(x,y) are defined via infinite series, one can check that xBϵp(y) by a finitary criterion.

Lemma 37.

For all xD and n>0, there exists N𝒪(n) such that for all yD, if, for all i,k0,,ki1N, p(xiai1ki1a0k0,yiai1ki1a0k0)<2(n+1), then p(x,y)<2n.

Proof.

We must find N satisfying n,kn1,,k0>N12n+kn1++k0<ϵ2. Notice that if N satisfies n>N12n<ϵ2, then it also satisfies the other condition, so we can argue as for Lemma 31.

The following result is proved in detail in the long version.

Theorem 38.

The partial metric p quantifies the Scott topology of D.

Proof.

We will exploit a few properties of the maps inm, proved in the extended version:

  1. i.

    For all n, xXn and yX, xyn in(x)y.

  2. ii.

    For all x,yX, xy iff there exists N and w1,,wkXN such that w1,,wkyN and xiN(w1wk).

  3. iii.

    For all n, xXn and yX, in(x)y NkN,in(n+k)(x)yn+k.

𝒪σ(D)𝒪p(D):

Let yBϵ(x). We need to find yD such that yBϵ(x) and yy. From p(y,x)<p(x,x)+ϵ it follows that we can find θ,δ>0 such that p(y,x)<p(x,x)+δ and δ+θϵ. Let N be such that n>N12n<θ2. Since the pn-balls are Scott open, for all nN, we can find some znBθ2(yn) such that znyn. Observe that by (i.) we have in(zn)y. This implies in particular that the join n=1Nin(zn) exists in D. Define y:=n=1Nin(zn). Notice that yy holds so we just have to check that yBϵ(x).

First recall that, by antimonotonicity of pn, pn(aa,b)min{pn(a,b),pn(a,b)}. Now, for all nN, we have that yn=jn(y)=(k<Nik,n(zk))zn(n<kNjk,n(zk)). Then we deduce pn(yn,yn)pn(zn,yn)<pn(yn,yn)+θ2. We can now compute

p(y,x) =n=112npn(yn,xn)
n=112n(pn(yn,yn)+pn(yn,xn)p(yn,yn))
(n=112npn(yn,yn)pn(yn,yn))+p(y,x)
=(n=1N12n(pn(yn,yn)pn(yn,yn)))
+(n>N12n(pn(yn,yn)pn(yn,yn)))+p(y,x)
<(n=1N12nθ2)+θ2+p(x,x)+δp(x,x)+θ+δp(x,x)+ϵ.
𝒪σ(X)𝒪p(X):

Suppose xy. We need to find ϵ>0 such that Bϵ(y)x. By (ii.) there exists N and w1,,wkXN such that xiN(w1wk)y. By (iii.) there exists NN such that iNN(wj)yN. Observe that iN(iNN(u))=iN(u), which implies that xjiN(iNN(wj)).

For each j=1,,k we can find then ϵj>0 such that Bϵj(yN)iNN(wj). Let ϵ:=2(N+1)min{ϵjj=1,,k}. Suppose zBϵ(y): for all j=1,,k, from p(z,y)ϵ we deduce pN(zN,yN)2Nϵ<ϵj, whence zNBϵj(yN), which forces iNN(wj)zN. By (i.) the last inequality implies iN(wj)=iN(iNN(wj))z, and we thus obtain xjiN(iNN)(wj))z, that is, xz.

The Scott 𝝀-PPM.

The interpretation of closed λ-terms in the Scott model D, for D an arbitrary algebraic domain quantified by a PM p, yields a PPM pScott(M,N):=p(M,N), where MD indicates the interpretation of M inside D. When D is non-trivial (i.e. D{}), using well-known properties of the Scott model, pScott(M,N) yields an extensional and sensible λ-PPM.

The result below relates pScott to the other λ-PPMs discussed in Section 3.

Proposition 39.

pBöhmpScottpctx.

Proof sketch.

(pBöhmpScott)

We exploit the approximation theorem for D [5] which says that, for any closed λ-term M, letting Λo be the set of closed partial terms and :ΛoD the interpretation function, M={AAM}. Since D is algebraic, any open ball Bϵp0(M(a)) contains some compact element cM(a). By the approximation theorem, then, we deduce that there exists a partial term AM such that cA(a).

Consider the open ball BϵpScott(M). Thanks to Lemma 37 one can find a finite number of sequences of basis elements a1,,an and positive reals δ1,,δn>0 such that for all term P, if P(ai)Bδip0(M(ai) holds for all i=1,,n, then PBϵpScott(M).

By reasoning as above via the approximation theorem, we obtain partial terms A1,,AnM such that AiBδip0(M(ai), and we deduce then A=iAiBϵpScott(M). Letting now k be the height A and θ=2k, we thus conclude that BθBöhm(M)BϵpScott(M).

The strictness follows from the fact that the associated λ-theories and are strictly included, as argued at the end of Remark 19 for the case of pctx.

(pScottpctx)

By Proposition 18, we only need to prove strictness. Let I:=λx.x and consider the terms Pk:=λy1..λyk.I. It can be easily checked that, for any context 𝙲, if 𝙲[I] is solvable, then 𝙲[Pk] must be solvable as well. This implies then that, for any ϵ>0, the open ball Bϵctx(I) contains all the terms Pk.

Now, one can construct a compact basis element cD such that, for all k>2, Pk≪̸cI (see the extended version for the details). Since 𝒪p(D) coincides with the Scott topology, which is generated by the sets b, for b a basis element, from cI we deduce that there exists ϵ>0 such that Bϵp(I)c. From P2≪̸c we deduce then P2Bϵp(I), we conclude that the open p-ball Bϵp(I) contains no open pctx-ball.

Recalling that D induces the theory , the relation pBöhmpScott is in accordance with what happens with the corresponding λ-theories. By contrast, while D and the contextual preorder both induce the λ-theory , the first induces a λ-PPM which is finer than the contextual partial metric. As can be seen in the proof in the Appendix, the reason behind this is that, given terms MctxP, there exists open pScott-balls Bϵ(P) whose elements all lie above M, while pctx cannot define any such ball, since whether MQ cannot be tested by applying only finitely many contexts to Q (cf. Remark 16).

6 Quantifying the Taylor Expansion

In this section we discuss the Taylor expansion of λ-terms [18, 19, 20], a well-studied method that refines methods based on Böhm trees and Scott domains, by decomposing the non-linear behavior of a term into the linear behavior of a set of simpler terms, called resource λ-terms. Notably, several well-known properties of λ-terms (like e.g. continuity and stability), which were originally established by topological and semantic methods, can be proved in a simpler, combinatorial way, via the Taylor expansion [4].

The famous commutation theorem [20] says that the Taylor expansion commutes with the construction of the Böhm tree, and shows that the associated λ-theories coincide. By presenting the Taylor expansion as an isometric transformation, we add a quantitative flavor to this result, showing that also the corresponding notions of program similarity coincide.

All proofs of the results contained in this section can be found in the extended version.

Resource terms and the Taylor expansion.

As we said, the Taylor expansion associates a λ-term with a set of terms, called resource terms, with a linear operational semantics. The set Λr of resource terms is defined by the grammar t:=xλx.ttt,,t, where t,,t indicates a finite multiset of terms. We define an order over resource λ-terms as the context closure of the relation t1,,tn. The operational semantics of resource terms replaces the standard β-rule with a linear monadic rule r that relates a redex (λx.t)u1,,un with the set of terms t[uσ(1)/x1,,uσ(n)/n], obtained by replacing each occurrence xi of x in t by the term uσ(i), whenever t contains exactly n occurrences of x and where σ is any permutation in 𝔖n. For example, the resource term (λx.xx)y,z reduces to the set of terms {yz,zy} corresponding to the two possible ways of distributing y,z across the two occurrences of x in xx. Instead, the resource term (λx.xx)y reduces to the empty set: as the single occurrence of y cannot be duplicated, it does not suffice to replace all occurrences of x in xx. More generally, if t contains a number of occurrences of x different from n, then (λx.t)u1,,unr. Thanks to the impossibility of duplicating terms, linear reduction r is not only confluent, but also strongly normalizing (in linear time).

The Taylor expansion of a λ-term M is a set 𝒯(M)Λr defined inductively as 𝒯(x)={x}, 𝒯(λx.M)={λx.tt𝒯(M)} and 𝒯(MN)={tt1,,tnt𝒯(M),xn,t1,,tn𝒯(N)}. For example, the Taylor expansion of λx.λy.yx is composed of all resource terms of the form λx.λy.yx,,x. Since reduction is confluent and strongly normalizing, we can define the set nf(𝒯(M)) containing the normal forms of the resource terms in 𝒯(M).

The Taylor expansion extends to partial λ-terms by letting 𝒯()=. In this way, we can define the Taylor expansion of a Böhm tree αIde(𝒜) by 𝒯(α)={𝒯(A)Aα},. The aforementioned commutation theorem says then that 𝒯((M))=nf(𝒯(M)); together with the injectivity of 𝒯 over Böhm trees (which is easily proved), this shows the equivalence of the λ-theory and the λ-theory generated by equating all closed terms whose Taylor expansions have the same normal form.

We provide an alternative, topological, presentation of the Taylor expansion of Böhm trees. A natural choice would be to take the Scott topology induced by the resource term order . However, under this order, Λr is not a dcpo: limits of directed sequences need not exist (as they would correspond, just like Böhm trees, to infinite terms). This leads then to consider, just like for partial terms, the completion Ide(Λr) of Λr, which forms an algebraic dcpo. The elements of Ide(Λr) can be seen as possibly infinite resource terms, and the compact elements correspond to the finite ones, that is, to ordinary resource terms.

Recall that Ide(𝒜) can be identified with the set of Böhm trees; the Taylor expansion can be presented in this setting as a map 𝒯:Ide(𝒜)𝒫(Ide(Λr)) defined by 𝒯(α)=Ide(𝒯(α)). To see that it is well-defined, let us observe that 𝒯(α)Λr, so Ide(𝒯(α))Ide(Λr) is a set of ideals. Notice that the set 𝒯(α) is closed with respect to the Scott topology of Ide(Λr).

Defining a metric on 𝚲𝒓.

We introduce a PUM on Λr quantifying the order , which is essentially an adaptation of the tree partial metric. A normal resource term is of the form t=λx1..λxn.xb1bm, where each bi is a finite multiset bi=ti1,,timi. The height of a resource term h(t) is defined recursively as h(t)=maxijh(tij)+1, where t is as above. For any variable occurrence z in t, we define its height in t ht(z) as ht(z)=1 if z is as x above, and as ht(z)=htij(z)+1 if the occurrence is in tij.

For any normal resource term t and nh(t), we define the resource term t|n, corresponding to the “truncation” of t at height n: if h(t)n, then t|n=t, and if h(t)>n, then we replace any subterm of t of the form xb1bm, where x is at height n, by x. Observe that h(t|n)n and h(t|n)=n holds whenever h(t)n.

Definition 40 (resource partial metric).

For any two resource terms t,uΛr, we define

r(t,u):=inf{2nh(t),h(u)n and t|n=u|n}.

By arguing similarly to the case of trees, it can be shown that r is a PUM, and that the order r coincides with . Notice that r(t,t)=2h(t).

Lifting the metric to 𝓟(𝚲𝒓).

We now discuss how to lift the metric r to subsets of Λr. A standard way to lift a metric d from a set X to its powerset 𝒫(X) is via the Hausdorff lifting Hd(A,B)=max{supaAinfbBd(a,b),supbBinfaAd(a,b)}. Intuitively, Hd(A,B) looks, for each element of one set, for its closest element in the other set, and then measures the distance that is obtained by this operation in the worst case. The same construction, when applied to a partial metric p, yields the partial Hausdorff metric Hp (see [3, 28]) which, in spite of its name, is in fact not a partial metric, as it satisfies a weaker triangular law Hp(A,B)Hp(A,C)+Hp(C,B)infcCp(c,c).

In any case, the Hausdorff lifting Hr of the resource partial metric is not the right choice for us: suppose α is an infinite Böhm tree, so that its self-distance is 0; then 𝒯(α) is a set of finite terms of arbitrary depth, so that Hr(𝒯(α),𝒯(α))=supt𝒯(α)r(t,t)=sup{2|t|t𝒯(α)}=12>0=ptree(α,α). Beyond making the Taylor expansion non-isometric, from this we deduce that Hr is constantly 12 over all non-empty Taylor expansions!

Instead, we introduce the following variant of the Hausdorff lifting:

Definition 41.

For any PM p:X×X[0,1], let Hp:𝒫(X)×𝒫(X)[0,1] be:

Hp(A,B)=max{supaAinfapaA,bBp(a,b),supbBinfbpbB,aAp(a,b)}.

Intuitively, on two sets A,B, Hp(A,B) measures how close the elements of A get to the elements of B as soon as one is allowed to freely move higher within A and B following the order p. Notice that, for α an infinite Böhm tree, we now have Hr(𝒯(α),𝒯(α))=0, as desired. Similarly to the partial Hausdorff metric Hp, for a partial metric p, Hp is not in general a partial metric. Indeed, it only satisfies the following properties:

Proposition 42.

For any partial metric space (X,p), the distance Hp satisfies:

  1. 1.

    Hp(A,A)Hp(A,B);

  2. 2.

    Hp(A,B)=Hp(B,A);

  3. 3.

    Hp(A,B)Hp(A,C)+Hp(C,B)infcCp(c,c).

However, Hp is in fact a PM when restricted to Idep(X), the dcpo of ideals with respect to the order p.

Proposition 43.

For any PM p on X, Hp is a PM on Idep(X) quantifying the order .

When p=r, the resource partial metric, Hr indeed quantifies the Scott topology:

Proposition 44.

The PM Hr quantifies the Scott topology on Ider(Λr).

Taylor is an isometry.

The Taylor expansion can be presented either as a map 𝒯:Λ𝒫(Λr) turning a λ-term into a set of resource terms, or as a map 𝒯:Ide(𝒜)𝒫(Ide(Λr)) turning a Böhm tree (i.e. an infinitary normal λ-term) into a set of infinitary resource terms.

We will show that both maps are isometries, when considering Λ with the Böhm PM and Ide(𝒜) with the tree PM, and measuring sets of (finite/infinite) resource terms via the lifting Hr of the resource partial metric.

Let the λ-PPM pTaylor be defined by pTaylor(M,N)=Hr(nf(𝒯(M)),nf(𝒯(N))). As we observed, the λ-theory generated by equating all terms M,N such that nf(𝒯(M))=nf(𝒯(N)) coincides the theory . Our result will extend this to the corresponding quantitative theories.

Let us first consider the Taylor expansion of λ-terms.

Theorem 45.

𝒯:(Λ,pBöhm)(𝒫(Λr),Hr) is an isometry. Thus, pTaylor=pBöhm.

The results above states that, whenever the Böhm trees of two terms M,N differ at height n, then, by moving higher and higher in their normalized Taylor expansions 𝒯(M) and 𝒯(N), one can find resource terms that differ precisely at height n, and can do no better.

Let us now consider the map 𝒯. Since Ide(Λr) is quantified by Hr, we can consider its lifting HHr to 𝒫(Idep(Λr)). In fact, the computation of HHr leads us back to Hr:

Lemma 46.

For all λ-terms M,N, Hr(𝒯(M),𝒯(N))=HHr(𝒯(M),𝒯(N)).

Thanks to Proposition 45, this immediately produces:

Theorem 47.

𝒯:(Ide(𝒜),ptree)(𝒫(Ide(Λr)),HHr) is an isometry.

 Remark 48.

As shown in detail in the long version, we can obtain an isometry also if we choose to measure Böhm trees and Taylor expansions using the PMs from Examples 35 and 36. Indeed, for any enumeration (An)n of partial terms, one can define an enumeration (rn)n of resource terms and weights θn such that 𝒯:(,p(An)n,12n)(𝒫(Λr),p(rn)n,θn𝒫) is an isometry.

7 Conclusions

Related Work.

Since their introduction in [8], the literature on partial metrics has grown vast, and comprises both theoretical investigations [39, 34, 3, 29] and connections with theoretical computer science [38], notably domain theory [9, 35, 40, 41]. Recently, an elegant categorical description of partial metric spaces as quantaloid-enriched categories has been proposed [28], as well as a characterization of the partial metric spaces that are exponentiable (in a category whose morphisms are the non-expansive - or 1-Lipschitz - functions and not, as in this paper, all continuous functions). While, as we have said, the metrizability of Scott domains via partial metrics has been well known since [9, 35], not much is found in this vast literature about the specific use of partial metrics for studying the topological semantics of the λ-calculus or, more generally, of higher-order programming languages.

Beyond partial metrics, the literature on higher-order program metrics has been growing vast as well. As the category Met of metric spaces and non-expansive functions is not cartesian closed, the literature has focused on two complementary directions: on the one hand, restrict to cartesian closed sub-categories of Met, like ultra-metric spaces [23], or injective metric spaces [10]; [15] adapts Mardare’s et al.’s quantitative equational theories [32] to higher-order languages, introducing a notion of quantitative λ-theory (which, contrarily to λ-PPMs, require contexts to be non-expansive). On the other hand, restrict attention to linear [12, 16] or graded [37, 17] λ-calculi, which can be modeled in Met. Notably, [17] introduces metric CPOs, that is CPOs endowed with sub-continuous metrics (i.e. satisfying d(limnxn,limnyn)ϵ whenever d(xn,yn)ϵ holds for all n). This is a weaker condition than quantifiability, since the limits in the metric need not coincide with the CPO limits.

Differential logical relations [14, 13] have been recently introduced as a generalized approach to program metrics, relaxing usual Lipschitz, and even continuity, conditions. Notably, related models based on generalized partial metric spaces are studied in [27, 36]. In such models distances need not be positive reals but are computed on an arbitrary quantale.

Finally, several works have investigated infinitary λ-calculi defined via a metric completion of ordinary terms [30, 33]. These approaches are based on ultrametrics akin to the tree metric considered in this paper for Böhm trees. Recall that ordinary metric spaces are topologically Hausdorff, contrarily to the spaces considered in this paper. The metric completion of partial metric spaces is discussed in [26, 28].

Future Work.

While this paper focuses on metric counterparts for well-known techniques, our results suggest several potential developments.

The metrizability of Scott domains suggests to study models based on Lipschitz-continuous, rather than just continuous, functions, as is standard in the literature on linear λ-calculi. For instance, considering the Böhm metric, a non-expansive context should respect depth: if two terms M,N coincide up to depth n, then 𝙲[M] and 𝙲[N] must also coincide up to depth n. This suggests connections with recent work on stratified notions of program equivalence [2].

Sections 4 and 6 introduced several methods to lift a partial metric to the powerset; using such liftings, as we suggest at several places, our results based on Scott domains could be adapted to the relational model, in which λ-terms are interpreted via relations R𝒫(A×B).

While we here just considered the untyped λ-calculus and basic cartesian closed structure (i.e. finite products and exponentials), the applicative distances introduced in this paper should adapt well also to languages with coproducts and dependent types; moreover, our results on the Hausdorff lifting suggests that other monadic liftings (e.g. the probability monad) could be considered. At the same time, the metric account of RealPCF suggested at in Example 33 could be explored in more depth, for instance considering the behavior of operators like the parallel if or even program derivatives.

Finally, the fact that several partial metrics considered in this paper produce computable distances between finite approximants suggests to explore potential connections with quantitative type systems related to the relational and topological semantics, like those based on non-idempotent intersection types [7].

References

  • [1] Roberto M. Amadio and Pierre-Louis Curien. Domains and Lambda-Calculi. Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, 1998.
  • [2] Victor Arrial, Giulio Guerrieri, and Delia Kesner. Genericity through stratification. In Proceedings of the 39th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS ’24, New York, NY, USA, 2024. Association for Computing Machinery. doi:10.1145/3661814.3662113.
  • [3] Hassen Aydi, Mujahid Abbas, and Calogero Vetro. Partial Hausdorff metric and Nadler’s fixed point theorem on partial metric spaces. Topology and its Applications, 159(14):3234–3242, 2012. doi:10.1016/j.topol.2012.06.012.
  • [4] Davide Barbarossa and Giulio Manzonetto. Taylor subsumes Scott, Berry, Kahn and Plotkin. Proc. ACM Program. Lang., 4(POPL), December 2019. doi:10.1145/3371069.
  • [5] Hendrik Pieter Barendregt. The lambda calculus - its syntax and semantics, volume 103 of Studies in logic and the foundations of mathematics. North-Holland, 1985.
  • [6] Antonio Bucciarelli, Thomas Ehrhard, and Giulio Manzonetto. Not enough points is enough. In Jacques Duparc and Thomas A. Henzinger, editors, Computer Science Logic, pages 298–312, Berlin, Heidelberg, 2007. Springer Berlin Heidelberg. doi:10.1007/978-3-540-74915-8_24.
  • [7] Antonio Bucciarelli, Delia Kesner, and Daniel Ventura. Non-idempotent intersection types for the lambda-calculus. Logic Journal of the IGPL, 25(4):431–464, 2017. doi:10.1093/jigpal/jzx018.
  • [8] Michael Bukatin, Ralph Kopperman, Steve Matthews, and Homeira Pajoohesh. Partial metric spaces. American Mathematical Monthly, 116:708–718, October 2009. URL: http://www.jstor.org/stable/40391197, doi:10.4169/193009709X460831.
  • [9] Michael A. Bukatin and Joshua S. Scott. Towards computing distances between programs via Scott domains. In Sergei Adian and Anil Nerode, editors, Logical Foundations of Computer Science, pages 33–43, Berlin, Heidelberg, 1997. Springer Berlin Heidelberg. doi:10.1007/3-540-63045-7_4.
  • [10] Maria Manuel Clementino and Dirk Hofmann. Exponentiation in V-categories. Topology and its Applications, 153(16):3113–3128, 2006. Special Issue: Aspects of Contemporary Topology. doi:10.1016/j.topol.2005.01.038.
  • [11] Raphaëlle Crubillé and Ugo Dal Lago. Metric Reasoning About Lambda-Terms: The General Case. In Hongseok Yang, editor, Programming Languages and Systems - 26th European Symposium on Programming, ESOP 2017, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2017, Uppsala, Sweden, April 22-29, 2017, Proceedings, volume 10201 of Lecture Notes in Computer Science, pages 341–367, Berlin, Heidelberg, 2017. Springer. doi:10.1007/978-3-662-54434-1_13.
  • [12] Fredrik Dahlqvist and Renato Neves. An Internal Language for Categories Enriched over Generalised Metric Spaces. In Florin Manea and Alex Simpson, editors, 30th EACSL Annual Conference on Computer Science Logic (CSL 2022), volume 216 of Leibniz International Proceedings in Informatics (LIPIcs), pages 16:1–16:18, Dagstuhl, Germany, 2022. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.CSL.2022.16.
  • [13] Ugo Dal Lago and Francesco Gavazzo. Differential logical relations part II: increments and derivatives. In Gennaro Cordasco, Luisa Gargano, and Adele A. Rescigno, editors, Proceedings of the 21st Italian Conference on Theoretical Computer Science, Ischia, Italy, September 14-16, 2020, volume 2756 of CEUR Workshop Proceedings, pages 101–114. CEUR-WS.org, 2020. URL: http://ceur-ws.org/Vol-2756/paper_10.pdf.
  • [14] Ugo Dal Lago, Francesco Gavazzo, and Akira Yoshimizu. Differential logical relations, part I: the simply-typed case. In 46th International Colloquium on Automata, Languages, and Programming, ICALP 2019, July 9-12, 2019, Patras, Greece, pages 111:1–111:14, 2019. doi:10.4230/LIPIcs.ICALP.2019.111.
  • [15] Ugo Dal Lago, Furio Honsell, Marina Lenisa, and Paolo Pistone. On Quantitative Algebraic Higher-Order Theories. In Amy P. Felty, editor, 7th International Conference on Formal Structures for Computation and Deduction (FSCD 2022), volume 228 of Leibniz International Proceedings in Informatics (LIPIcs), pages 4:1–4:18, Dagstuhl, Germany, 2022. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.FSCD.2022.4.
  • [16] Ugo Dal Lago, Naohiko Hoshino, and Paolo Pistone. On the Lattice of Program Metrics. In Marco Gaboardi and Femke van Raamsdonk, editors, 8th International Conference on Formal Structures for Computation and Deduction (FSCD 2023), volume 260 of Leibniz International Proceedings in Informatics (LIPIcs), pages 20:1–20:19, Dagstuhl, Germany, 2023. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.FSCD.2023.20.
  • [17] Arthur Azevedo de Amorim, Marco Gaboardi, Justin Hsu, Shin-ya Katsumata, and Ikram Cherigui. A semantic account of metric preservation. In Giuseppe Castagna and Andrew D. Gordon, editors, Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18-20, 2017, POPL 2017, pages 545–556, New York, NY, USA, 2017. ACM. doi:10.1145/3009837.3009890.
  • [18] Thomas Ehrhard and Laurent Regnier. The differential lambda-calculus. Theoretical Computer Science, 309:1–41, 2003. doi:10.1016/S0304-3975(03)00392-X.
  • [19] 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, pages 186–197, Berlin, Heidelberg, 2006. Springer Berlin Heidelberg. doi:10.1007/11780342_20.
  • [20] Thomas Ehrhard and Laurent Regnier. Uniformity and the Taylor expansion of ordinary lambda-terms. Theor. Comput. Sci., 403(2-3):347–372, 2008. doi:10.1016/j.tcs.2008.06.001.
  • [21] Thomas Erker, Martín Hötzel Escardó, and Klaus Keimel. The way-below relation of function spaces over semantic domains. Topology and its Applications, 89(1):61–74, 1998. Domain Theory. doi:10.1016/S0166-8641(97)00226-5.
  • [22] Martín Hötzel Escardó. PCF extended with real numbers. Theor. Comput. Sci., 162(1):79–115, 1996. doi:10.1016/0304-3975(95)00250-2.
  • [23] Martín Hötzen Escardó. A metric model of PCF. Unpublished note presented at the Workshop on Realizability Semantics and Applications, June 1999. Available at the author’s webpage., 1999.
  • [24] M.H. Escardo and R. Heckmann. Topologies on spaces of continuous functions. Topology Proceedings, 26(2):545–564, 2001-2002.
  • [25] Francesco Gavazzo. Quantitative behavioural reasoning for higher-order effectful programs: Applicative distances. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS ’18, pages 452–461, New York, NY, USA, 2018. doi:10.1145/3209108.3209149.
  • [26] Xun Ge and Shou Lin. Completions of partial metric spaces. Topology and its Applications, 182:16–23, 2015. doi:10.1016/j.topol.2014.12.013.
  • [27] Guillaume Geoffroy and Paolo Pistone. A partial metric semantics of higher-order types and approximate program transformations. In Computer Science Logic 2021 (CSL 2021), volume 183 of LIPIcs–Leibniz International Proceedings in Informatics, pages 35:1–35:18, 2021. doi:10.4230/LIPIcs.CSL.2021.23.
  • [28] Dirk Hofmann and Isar Stubbe. Topology from enrichment: the curious case of partial metrics. Cahiers de Topologie et Géométrie DIfférentielle Catégorique, LIX, 4:307–353, 2018.
  • [29] Gunther Jäger and T. M. G. Ahsanullah. Characterization of quantale-valued metric spaces and quantale-valued partial metric spaces by convergence. Applied General Topology, 19(1):129–144, 2018.
  • [30] Richard Kennaway, Jan Willem Klop, M. Ronan Sleep, and Fer-Jan de Vries. Infinitary lambda calculus. Theor. Comput. Sci., 175(1):93–125, 1997. doi:10.1016/S0304-3975(96)00171-5.
  • [31] Giulio Manzonetto. Models and theories of lambda calculus. PhD thesis, Paris Diderot University, France, 2008. URL: https://tel.archives-ouvertes.fr/tel-00715207.
  • [32] Radu Mardare, Prakash Panangaden, and Gordon Plotkin. Quantitative algebraic reasoning. In Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science (LICS 2016). IEEE Computer Society, 2016.
  • [33] Damiano Mazza. Non-linearity as the metric completion of linearity. In Masahito Hasegawa, editor, Typed Lambda Calculi and Applications, pages 3–14, Berlin, Heidelberg, 2013. Springer Berlin Heidelberg. doi:10.1007/978-3-642-38946-7_3.
  • [34] Volodymyr Mykhaylyuk and Vadym Myronyk. Metrizability of partial metric spaces. Topology and its Applications, 308:107949, 2022. doi:10.1016/j.topol.2021.107949.
  • [35] S.J. O’Neill. Partial metrics, valuations and domain theory. Annals of the New York Academy of Sciences, 806:304–315, 1996.
  • [36] Paolo Pistone. On generalized metric spaces for the simply typed lambda-calculus. In 36th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2021, Rome, Italy, June 29 - July 2, 2021, pages 1–14. IEEE, 2021. doi:10.1109/LICS52264.2021.9470696.
  • [37] Jason Reed and Benjamin C. Pierce. Distance makes the types grow stronger: a calculus for differential privacy. In Paul Hudak and Stephanie Weirich, editors, Proceeding of the 15th ACM SIGPLAN international conference on Functional programming, ICFP 2010, Baltimore, Maryland, USA, September 27-29, 2010, pages 157–168. ACM, 2010. doi:10.1145/1863543.1863568.
  • [38] Salvador Romaguera, Pedro Tirado, and Óscar Valero. Complete partial metric spaces have partially metrizable computational models. Int. J. Comput. Math., 89(3):284–290, 2012. doi:10.1080/00207160.2011.559229.
  • [39] M. P. Schellekens. The correspondence between partial metrics and semivaluations. Theoretical Computer Science, 315(1):135–149, May 2004. doi:10.1016/j.tcs.2003.11.016.
  • [40] Michel P. Schellekens. A characterization of partial metrizability: domains are quantifiable. Theor. Comput. Sci., 305(1-3):409–432, 2003. Topology in Computer Science. doi:10.1016/S0304-3975(02)00705-3.
  • [41] Michael B. Smyth. The constructive maximal point space and partial metrizability. Ann. Pure Appl. Log., 137(1-3):360–379, 2006. doi:10.1016/j.apal.2005.05.032.
  • [42] Pawel Waszkiewicz. Distance and measurement in domain theory. Electronic Notes in Theoretical Computer Science, 45, 2001. doi:10.1016/S1571-0661(04)80975-7.