BRICS RS-00-32 J. C. Reynolds: The Meaning of Types — From Intrinsic to Extrinsic Semantics BRICS

Basic Research in Computer Science

The Meaning of Types

From Intrinsic to Extrinsic Semantics

John C. Reynolds BRICS Report Series RS-00-32 ISSN 0909-0878 December 2000 Copyright \begin{matrix}c \\ ◯ \end{matrix} 2000, John C. Reynolds.

BRICS, Department of Computer Science University of Aarhus. All rights reserved.

Reproduction of all or part of this work is permitted for educational or research use on condition that this copyright notice is included in any copy.

See back inner page for a list of recent BRICS Report Series publications. Copies may be obtained by contacting:

BRICS Department of Computer Science University of Aarhus Ny Munkegade, building 540 DK–8000 Aarhus C Denmark

Telephone: +45 8942 3360
Telefax: +45 8942 3255
Internet: BRICS@brics.dk

BRICS publications are in general accessible through the World Wide Web and anonymous FTP through these URLs:

http://www.brics.dk
ftp://ftp.brics.dk

This document in subdirectory RS/00/32/

The Meaning of Types — From Intrinsic to Extrinsic Semantics ^{∗}^{†}

John C. Reynolds Department of Computer Science Carnegie Mellon University

Abstract

A definition of a typed language is said to be “intrinsic” if it assigns meanings to typings rather than arbitrary phrases, so that ill-typed phrases are meaningless. In contrast, a definition is said to be “extrinsic” if all phrases have meanings that are independent of their typings, while typings represent properties of these meanings.

For a simply typed lambda calculus, extended with recursion, subtypes, and named products, we give an intrinsic denotational semantics and a denotational semantics of the underlying untyped language. We then establish a logical relations theorem between these two semantics, and show that the logical relations can be “bracketed” by retractions between the domains of the two semantics. From these results, we derive an extrinsic semantics that uses partial equivalence relations.

There are two very different ways of giving denotational semantics to a programming language (or other formal language) with a nontrivial type system. In an intrinsic semantics, only phrases that satisfy typing judgements have meanings. Indeed, meanings are assigned to the typing judgements, rather than to the phrases themselves, so that a phrase that satisfies several judgements will have several meanings.

For example, consider λx. x (in a simply typed functional language). Corresponding to the typing judgement ⊢ λx. x : int → int, its intrinsic meaning is the identity function on the integers, while corresponding to the judgement ⊢ λx. x : bool → bool, its intrinsic meaning is the identity function on truth values. On the other hand, λx. x x, which does not satisfy any typing judgement, does not have any intrinsic meaning.

∗This research was supported in part by National Science Foundation Grant CCR-9804014. Much of the research was carried out during two delightful and productive visits to BRICS (Basic Research in Computer Science, http://www.brics.dk/, Centre of the Danish National Research Foundation) in Aarhus, Denmark, September to November 1999 and May to June 2000.

†A shorter and simpler version of this report, in which products and subtyping are omitted and there is only a single primitive type, will appear in “Essays on Programming Methodology”, edited by Annabelle McIver and Carroll Morgan (copyright 2001 Springer-Verlag, all rights reserved).

In contrast, in an extrinsic semantics, the meaning of each phrase is the same as it would be in a untyped language, regardless of its typing properties. In this view, a typing judgement is an assertion that the meaning of a phrase possesses some property.

For example, the extrinsic meaning of λx. x is the identity function on the universe of all values that can occur in a computation. In the simple case where integers and booleans can be regarded as members of this universe, the judgement ⊢ λx. x : int → int asserts that this function maps each integer into an integer, and the judgement ⊢ λx. x : bool → bool asserts that the same function maps each truth value into a truth value.

The terms “intrinsic” and “extrinsic” are recent coinages by the author [1, Chapter 15], but the concepts are much older. The intrinsic view is associated with Alonzo Church, and has been called “ontological” by Leivant [2]. The extrinsic view is associated with Haskell Curry, and has been called “semantical” by Leivant.

In this report, we will consider the denotational semantics of a typed callby-name language with several primitive types, functions, named products, subtyping, and recursion definitions of values (but not of types). First, we will give an intrinsic semantics and an untyped semantics, which we will relate by a logical relations theorem. Then we will define embeddingretraction pairs between the domain specified for each type in the intrinsic semantics and the universal domain used in the untyped semantics, and we will show that these pairs “bracket” the logical relations. Finally, we will use this result to derive an extrinsic semantics in which each type denotes a partial equivalence relation on the universal domain.

In the course of this report, we will use a variety of notations for functions. When f is a function, we write dom f for its domain. When ι_{1}, …, ι_{n} are distinct, we write [ f | ι_{1}: x_{1} | … | ι_{n}: x_{n}] for the function with domain dom f ∪ {ι_{1}, …, ι_{n}} that maps each ι_{k} into x_{k} and all other arguments ι′ into f ι′; in the special case where f is the empty function, we write [ ι_{1}: x_{1} | … | ι_{n}: x_{n}].

We write f ; g for the composition of functions f and g in diagrammatic order, and I_{D} for the identity function on the domain D. We assume that function application is left-associative, e.g., that f x y abbreviates (f x)y.

1 Syntax and Typing Rules

In defining the syntax and type system of our illustrative language, we will use the following metavariables, sometimes with decorations, to range over denumerably infinite sets of syntactic entities:

ι: identifiers
p: phrases
δ: primitive types
θ: types
π: type assignments.

Identifiers will be used both as variables and field names. We write I to denote the set of all identifiers.

Since our language is an extension of the lambda calculus, a phrase may be a variable, an abstraction, or an application:

p ::= ι | λι. p′ | p′ p′′

We will also have operations for constructing a record (or named tuple), and for selecting the field of a record corresponding to a field name:

p ::= ⟨ι_{1}: p_{1}, …, ι_{n}: p_{n}⟩ | p′.ι

Here, ⟨ι_{1}: p_{1}, …, ι_{n}: p_{n}⟩ is a concrete representation of a phrase that, abstractly, is the function on the set {ι_{1}, …, ι_{n}} of field names that maps each ι_{k} into the subphrase p_{k}. This implies that the field names must be distinct, and that permuting the pairs ι_{k}: p_{k} does not change the phrase.

In addition, there will be a fixed-point expression for defining a value by recursion, and a conditional expression that branches on a truth value to choose between evaluating different subexpressions:

p ::= Y p′ | if p′ then p′′ else p′′′

Finally, as primitives, we will have typical constants and operations for integers and truth values:

p ::= 0 | 1 | 2 | ⋯

| true | false

| p′ + p′′ | p′ × p′′ | p′ − p′′ | p′ = p′′ | p′ < p′′ | ¬ p′

Primitive types, types, and type assignments can also be defined by an abstract grammar:

δ ::= int | nat | bool
θ ::= δ | θ_{1} → θ_{2} | rcd(π)
π ::= ι_{1}: θ_{1}, …, ι_{n}: θ_{n}

Abstractly, a type assignment, like a record constructor, is a function whose domain is the set {ι_{1}, …, ι_{n}}; in this case each identifier ι_{k} is mapped into the type θ_{k}. Again, the identifiers must be distinct, and permuting the pairs ι_{k}: θ_{k} will not change the type assignment.

Informally, the primitive types int, nat, and bool denote the sets of integers, natural numbers (nonnegative integers), and truth values respectively, θ_{1} → θ_{2} denotes the set of functions that map values of type θ_{1} into values of type θ_{2}, and rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}) denotes the set of records with fields named ι_{1}, …, ι_{n} such that the field named ι_{k} has a value of type θ_{k}.

If θ and θ′ are types, then the formula θ ≤ θ′ is a subtype judgement, which is read “θ is a subtype of θ′”. The valid subtype judgements are defined by inference rules (i.e., they are the judgements that can be proved by the use of these rules).

First, we have rules asserting that ≤ is a preorder:

\overline{θ ≤ θ}  \frac{θ ≤ θ′′  θ′′ ≤ θ′}{θ ≤ θ′.}

Next there are rules for the primitive types:

\overline{nat ≤ int}  \overline{nat ≤ bool.}

Informally, there is an implicit conversion of natural numbers into integers that is an identity injection, and there is an implicit conversion of natural numbers into truth values that maps zero into false and all positive numbers into true. (We do not recommend this subtyping for the primitive types of a real programming language; we use it in this report to illustrate the variety of implicit conversions that are possible. For instance, the conversion from nat to bool is not injective.)

For function types, we have

θ′_{1} ≤ θ_{1} θ_{2} ≤ θ′_{2}
θ_{1} → θ_{2} ≤ θ′_{1} → θ′_{2}.

In other words, the type constructor → is antimonotone in its left argument and monotone in its right argument.

The rule for record types describes an implicit conversion in which fields can be forgotten, and the remaining fields can be implicitly converted:

\frac{θ_{1} ≤ θ′_{1} ⋯ θ_{m} ≤ θ′_{m}}{rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}) ≤ rcd(ι_{1}: θ′_{1}, …, ι_{m}: θ′_{m})}  when 0 ≤ m ≤ n.

Notice that, since the pairs ι_{k}: θ_{k} can be permuted, {ι_{1}, …, ι_{m}} can be any subset of {ι_{1}, …, ι_{n}}.

For example, the following is an (unnecessarily complex) proof of a subtype judgement, written as a tree of inferences: rcd(k: nat, b: bool, f: int → nat) ≤ rcd(f: int → nat, k: nat)

nat ≤ int nat ≤ bool

int → nat ≤ nat → bool

nat ≤ int

rcd(f: int → nat, k: nat)

≤ rcd(f: nat → bool, k: int)

rcd(k: nat, b: bool, f: int → nat) ≤ rcd(f: nat → bool, k: int).

If π is a type assignment, p is a phrase, and θ is a type, then the formula π ⊢ p : θ is a typing judgement, or more briefly a typing, which is read “p has type θ under π”. The valid typing judgements are defined by inference rules.

The subsumption rule captures the syntactic essence of subtyping: When θ is a subtype of θ′, any phrase of type θ can be used in a context requiring a phrase of type θ′:

\frac{π ⊢ p : θ θ ≤ θ′}{π ⊢ p : θ′.}

For the lambda calculus, record operations, fixed-point expressions, and conditional expressions, we have standard inference rules. (In the first two rules, we rely on the fact that type assignments are functions on identifiers.)

\overline{π ⊢ ι : π ι}  when ι ^{∈} dom π

\frac{[ π | ι: θ_{1} ] ⊢ p′ : θ_{2}}{π ⊢ λι. p′ : θ_{1} → θ_{2}}  \frac{π ⊢ p′ : θ_{1} → θ_{2}  π ⊢ p′′ : θ_{1}}{π ⊢ p′ p′′ : θ_{2}}

\frac{π ⊢ p_{1} : θ_{1} ⋯ π ⊢ p_{n} : θ_{n}}{π ⊢ ⟨ι_{1}: p_{1}, …, ι_{n}: p_{n}⟩ : rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})}

\frac{π ⊢ p′ : rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})}{π ⊢ p′.ι_{k} : θ_{k}}  when 1 ≤ k ≤ n

\frac{π ⊢ p′ : θ → θ}{π ⊢ Y p′ : θ}

\frac{π ⊢ p′ : bool  π ⊢ p′′ : θ  π ⊢ p′′′ : θ}{π ⊢ if p′ then p′′ else p′′′ : θ.}

There are also a large number of rules for primitive constants and operations, which all have the form

\frac{π ⊢ p_{1} : δ_{1}  ⋯  π ⊢ p_{n} : δ_{n}}{π ⊢ op(p_{1}, …, p_{n}) : δ.}

(To treat all of these rules uniformly, we use prefix form for the primitive operations, and regard constants as zero-ary operations.) For each rule of the above form, we say that δ_{1}, …, δ_{n} → δ is a signature of the operator op. Then, instead of giving the individual rules explicitly, it is enough to list each operator and its signatures:

Operator  Signatures
0, 1, 2, …  → nat
true, false  → bool
+, ×  nat, nat → nat
int, int → int
bool, bool → bool
−  int, int → int
=, <  int, int → bool
¬  bool → bool.

Here we have “overloaded” + and × to act on truth values as well as numbers; the intent is that + will act as “or” and × as “and”. At the other extreme, − does not act on truth values, and does not, in general, map natural numbers into natural numbers.

2 An Intrinsic Semantics

To give an intrinsic denotational semantics to our illustrative language, we must define the meanings of types, type assignments, subtype judgements, and typing judgements. Specifically, we must give:

• for each type θ, a domain [[θ]] of values appropriate to θ,

• for each type assignment π, a domain [[π]]^{∗} of environments appropriate to π,

• for each valid subtype judgement θ ≤ θ′, a strict continuous function [[θ ≤ θ′]] from [[θ]] to [[θ′]], called the implicit conversion from θ to θ′,

• for each valid typing judgement π ⊢ p : θ, a continuous function [[π ⊢ p: θ]] from [[π]]^{∗} to [[θ]], called the meaning of p with respect to π and θ.

We define a predomain to be a poset with least upper bounds of all increasing chains, and a domain to be a predomain with a least element, which we will denote by ⊥. (In fact, all of the domains we will use are Scott domains, i.e., nonempty partially ordered sets that are directed complete, bounded complete, algebraic, and countably based, but we will not make use of this fact.) A continuous function is one that preserves least upper bounds of all increasing chains; it is strict if it also preserves least elements.

In what follows, we will write Z, N, and B for the sets of integers, natural numbers, and truth values respectively; denumerable sets such as these will be also be regarded as discretely ordered predomains. We write P_{⊥} for the domain obtained from a predomain P by adding a new least element. When P is a predomain and D is a domain, we write P ⇒ D for the pointwise-ordered domain of continuous functions from P to D.

The meanings of types and type assignments are defined by induction on their structure:

Definition 2.1 For types θ and type assignments π, the domains [[θ]] and [[π]]^{∗} are such that

[[int]] = Z_{⊥}
[[nat]] = N_{⊥}
[[bool]] = B_{⊥}
[[θ_{1} → θ_{2}]] = [[θ_{1}]] ⇒ [[θ_{2}]]
[[rcd(π)]] = [[π]]^{∗}
[[ι_{1}: θ_{1}, …, ι_{n}: θ_{n}]]^{∗} = { [ ι_{1}: x_{1} | … | ι_{n}: x_{n}] | x_{1} ^{∈} [[θ_{1}]], …, x_{n} ^{∈} [[θ_{n}]]}.

(The set on the right of the final equation is a Cartesian product, indexed by the identifiers ι_{1}, …, ι_{n}, that becomes a domain when ordered componentwise.)

On the other hand, the meanings of subtype and typing judgements are defined by induction on the structure of proofs of these judgements. Specifically, for each inference rule, we give a semantic equation that expresses the meaning of a proof in which the final inference is an instance of that rule, in terms of the meanings of its immediate subproofs.

To write such equations succinctly, we write P(J) to denote a proof of the judgement J. For example, corresponding to the inference rule for subsumption, we have the semantic equation

[ ; [ \frac{P(π ⊢ p : θ) P(θ ≤ θ′)}{π ⊢ p : θ′} ] ; ] = [[P(π ⊢ p : θ)]] ; [[P(θ ≤ θ′)]],

which asserts that the meaning of a proof of π ⊢ p : θ′, in which the final inference is an instance of the subsumption rule, is the functional composition of the meanings of its immediate subproofs.

Before proceeding further, we must warn the reader that our illustrative language is rich enough that a judgement may have several significantly different proofs, e.g.,

m: nat, n: nat ⊢ m : nat  m: nat, n: nat ⊢ n : nat

m: nat, n: nat ⊢ m × n : nat

m: nat, n: nat ⊢ m × n : bool

or

m: nat, n: nat ⊢ m : nat

m: nat, n: nat ⊢ m : bool m: nat, n: nat ⊢ n : nat

m: nat, n: nat ⊢ n : bool

m: nat, n: nat ⊢ m × n : bool.

If our intrinsic semantics is to make sense, so that we can take the meaning [[P(J)]] of any proof of a judgement J to be the meaning of J itself, then we must have the property of coherence:

Definition 2.2 An intrinsic semantics is said to be coherent if all proofs of the same judgement have the same meaning.

In fact, as we will see in Section 5, our intrinsic semantics is coherent. However, this fact depends critically on the details of the language design, especially of the semantics of implicit conversions and “overloaded” operators with more than one signature [3],[1, Chapter 16].

The meanings of the subtype judgements are defined by the following semantic equations:

[ \overline{θ ≤ θ} ] = I_{[[θ]]}

[ ; [ \frac{P(θ ≤ θ′′)  P(θ′′ ≤ θ′)}{θ ≤ θ′} ] ; ] = [[P(θ ≤ θ′′)]] ; [[P(θ′′ ≤ θ′)]]

[ \overline{nat ≤ int} ] n = n

[ \overline{nat ≤ bool} ] n = \{ \begin{matrix}⊥ & when & n = ⊥ \\ true & when & n > 0 \\ false & when & n = 0 \end{matrix}

[ ; [ \frac{P(θ′_{1} ≤ θ_{1})  P(θ_{2} ≤ θ′_{2})}{θ_{1} → θ_{2} ≤ θ′_{1} → θ′_{2}} ] ; ] f = [[P(θ′_{1} ≤ θ_{1})]] ; f ; [[P(θ_{2} ≤ θ′_{2})]]

\begin{matrix}[ ; [ \frac{P(θ_{1} ≤ θ′_{1}) ⋯ P(θ_{m} ≤ θ′_{m})}{rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}) ≤ rcd(ι_{1}: θ′_{1}, …, ι_{m}: θ′_{m})} ] ; ] [ ι_{1}: x_{1} | … | ι_{n}: x_{n}] \\ = [ ι_{1}: [[P(θ_{1} ≤ θ′_{1})]]x_{1} | … | ι_{m}: [[P(θ_{m} ≤ θ′_{m})]]x_{m}]. \end{matrix}

The semantic equations for typing judgements about variables, functions, records, fixed-point expressions, and conditional expressions (as well as the equation for subsumption given earlier) give meanings that are standard for a call-by-name language:

[ \overline{π ⊢ ι : π ι} ] η = η ι

[ ; [ \frac{P([ π | ι: θ_{1} ] ⊢ p′ : θ_{2})}{π ⊢ λι. p′ : θ_{1} → θ_{2}} ] ; ] η = λx ^{∈} [[θ_{1}]]. [[P([ π | ι: θ_{1} ] ⊢ p′ : θ_{2})]][ η | ι: x]

[ ; [ \frac{P(π ⊢ p′ : θ_{1} → θ_{2}) P(π ⊢ p′′ : θ_{1})}{π ⊢ p′ p′′ : θ_{2}} ] ; ] η

= [[P(π ⊢ p′ : θ_{1} → θ_{2})]]η([[P(π ⊢ p′′ : θ_{1})]]η)

[ ; [ \frac{P(π ⊢ p_{1} : θ_{1}) ⋯ P(π ⊢ p_{n} : θ_{n})}{π ⊢ ⟨ι_{1}: p_{1}, …, ι_{n}: p_{n}⟩ : rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})} ] ; ] η

= [ ι_{1}: [[P(π ⊢ p_{1}: θ_{1})]]η | … | ι_{n}: [[P(π ⊢ p_{n}: θ_{n})]]η]

[ ; [ \frac{P(π ⊢ p′ : rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}))}{π ⊢ p′.ι_{k} : θ_{k}} ] ; ] η

= ([[P(π ⊢ p′ : rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}))]]η)ι_{k}

[ ; [ \frac{P(π ⊢ p′ : θ → θ)}{π ⊢ Y p′ : θ} ] ; ] η = ⨆_{n=0}^{∞}([[P(π ⊢ p′ : θ → θ)]]η)^{n}⊥

[ ; [ \frac{P(π ⊢ p′ : bool)  P(π ⊢ p′′ : θ)  P(π ⊢ p′′′ : θ)}{π ⊢ if p′ then p′′ else p′′′ : θ} ] ; ] η

= \{ \begin{matrix}⊥ & when & [[P(π ⊢ p′ : bool)]]η = ⊥ \\ [[P(π ⊢ p′′ : θ)]]η & when & [[P(π ⊢ p′ : bool)]]η = true \\ [[P(π ⊢ p′′′ : θ)]]η & when & [[P(π ⊢ p′ : bool)]]η = false. \end{matrix}

The semantic equations for primitive constants and operations have the general form

\begin{matrix}[ ; [ \frac{P(π ⊢ p_{1} : δ_{1})  ⋯  P(π ⊢ p_{n} : δ_{n})}{π ⊢ op(p_{1}, …, p_{n}) : δ} ] ; ] η \\ = I_{op}^{δ_{1},...,δ_{n}→δ}([[P(π ⊢ p_{1} : δ_{1})]]η, …, [[P(π ⊢ p_{n} : δ_{n})]]η), \end{matrix}

where

I_{op}^{δ_{1},...,δ_{n}→δ} ^{∈} [[δ_{1}]] × ⋯ × [[δ_{n}]] → [[δ]].

Now suppose that S_{1}, …, S_{n} are sets, D is a domain, and f is a function from S_{1} × ⋯ × S_{n} to some subset of D. Then the function f′ from (S_{1})_{⊥} × ⋯ × (S_{n})_{⊥} to D such that f′⟨x_{1}, …, x_{n}⟩ = ⊥_{D} when any x_{i} is ⊥, and f′⟨x_{1}, …, x_{n}⟩ = f⟨x_{1}, …, x_{n}⟩ otherwise, is called a componentwise strict extension of f. (In the special case where n = 0, so that f is a constant function on the singleton domain {⟨⟩}, f′ is the same as f.)

In particular, the interpretations of the primitive constants and operations are all componentwise strict extensions of standard functions:

The function:  is the componentwise strict extension of:
I_{0}^{→nat}  λx ^{∈} {⟨⟩}. 0
I_{1}^{→nat}  λx ^{∈} {⟨⟩}. 1
⋮  ⋮
I_{true}^{→bool}  λx ^{∈} {⟨⟩}. true
I_{false}^{→bool}  λx ^{∈} {⟨⟩}. false
I_{+}^{nat×nat→nat}  addition of natural numbers
I_{+}^{int×int→int}  addition of integers
I_{+}^{bool×bool→bool}  disjunction of truth values
I_{×}^{nat×nat→nat}  multiplication of natural numbers
I_{×}^{int×int→int}  multiplication of integers
I_{×}^{bool×bool→bool}  conjunction of truth values
I_{−}^{int×int→int}  subtraction of integers
I_{=}^{int×int→bool}  equality of integers
I_{<}^{int×int→bool}  ordering of integers
I_{¬}^{bool→bool}  negation of truth values.

3 An Untyped Semantics

Next, we consider the untyped semantics of our illustrative language. Here, independently of the type system, each phrase p possesses a unique meaning that is a mapping from environments to values, where environments map variables (i.e., identifiers) into values, and values range over a “universal” domain U:

[[p]] ^{∈} E ⇒ U where E = (I ⇒ U).

It is vital that this untyped semantics be call-by-name, and that U be rich enough to contain “representations” of all the typed values used in the intrinsic semantics of the previous section. These conditions, however, do not fully determine the untyped semantics. To be general, therefore, rather than specify a particular universal domain, we simply state properties of U that will be sufficient for our development. (In fact, these properties hold for a variety of untyped call-by-name models of our illustrative language.)

Specifically, we require the domains Z_{⊥} of integers (viewed as primitive values), U ⇒ U of continuous functions (viewed as functional values), and E of environments (viewed as record values) to be embeddable in U by pairs of continuous functions:

[figure: Z_{⊥}; U; Φ_{p}; Ψ_{p}; U ⇒ U; U; Φ_{f}; Ψ_{f}; E; U,; Φ_{r}; Ψ_{r}]

where each Φ_{i}, Ψ_{i} is an embedding-retraction pair, i.e., each composition Φ_{i} ; Ψ_{i} is an identity function on the embedded domain.

Using these embedding-retraction pairs, it is straightforward to give semantic equations defining the untyped semantics of variables, functions, records, and fixed points:

[[ι]] ε = ε ι
[[λι. p′]] ε = Φ_{f}(λy ^{∈} U. [[p′]][ ε | ι: y])
[[p′ p′′]] ε = Ψ_{f}([[p′]] ε)([[p′′]] ε)
[[⟨ι_{1}: p_{1}, …, ι_{n}: p_{n}⟩]] ε = Φ_{r}([ λι ^{∈} I. ⊥ | ι_{1}: [[p_{1}]] ε | … | ι_{n}: [[p_{n}]] ε])
[[p′.ι]] ε = Ψ_{r}([[p′]] ε) ι
[[Y p′]] ε = ⨆_{n=0}^{∞}(Ψ_{f}([[p′]] ε))^{n}⊥.

(Note that records with a finite number of fields are “represented” by records with an infinite number of fields, almost all of which are ⊥.)

When we come to conditional expressions, however, we encounter a problem. Since, from the untyped viewpoint, all primitive values are integers, to describe how a conditional expression branches on its first argument we must understand how integers are used to represent truth values. In fact (as we will formalize in the next section), false will be represented by zero, true will be represented by any positive integer; and no truth value will be represented by any negative integer. This leads to the semantic equation

[[if p′ then p′′ else p′′′]] ε

= \{ \begin{matrix}⊥ & when & Ψ_{p}([[p′]] ε) = ⊥ \\ [[p′′]] ε & when & Ψ_{p}([[p′]] ε) > 0 \\ [[p′′′]] ε & when & Ψ_{p}([[p′]] ε) = 0 \\ anyval([[p′]] ε, [[p′′]] ε, [[p′′′]]ε) & when & Ψ_{p}([[p′]] ε) < 0. \end{matrix}

Here anyval can be any continuous function from U ×U ×U to U. (Again, we do not want to constrain our untyped semantics more than will be necessary to establish a proper relationship to our intrinsic typed semantics.)

The semantic equations for primitive constants and operations have the general form

[[op(p_{1}, …, p_{n})]]ε = Φ_{p}(I_{op}^{U}(Ψ_{p}([[p_{1}]]ε), …, Ψ_{p}([[p_{n}]]ε))),

where I_{op}^{U} ^{∈} (Z_{⊥})^{n} → Z_{⊥}. In particular,

The function:  is the componentwise strict extension of:
I_{0}^{U}  λx ^{∈} {⟨⟩}. 0
I_{1}^{U}  λx ^{∈} {⟨⟩}. 1
⋮  ⋮
I_{true}^{U}  λx ^{∈} {⟨⟩}. trueint
I_{false}^{U}  λx ^{∈} {⟨⟩}. 0
I_{+}^{U}  addition of integers
I_{×}^{U}  multiplication of integers
I_{−}^{U}  subtraction of integers
I_{=}^{U}  eqint
I_{<}^{U}  lessint
I_{¬}^{U}  notint.

As with anyval, we state the necessary properties of trueint ^{∈} Z_{⊥}, eqint, lessint ^{∈} Z × Z → Z_{⊥}, and notint ^{∈} Z → Z_{⊥}, without being overspecific:

trueint > 0
eqint(i_{1}, i_{2}) > 0  when i_{1} = i_{2}
eqint(i_{1}, i_{2}) = 0  when i_{1} ≠ i_{2}
lessint(i_{1}, i_{2}) > 0  when i_{1} < i_{2}
lessint(i_{1}, i_{2}) = 0  when i_{1} ≥ i_{2}
notint(i_{1}) > 0  when i_{1} = 0
notint(i_{1}) = 0  when i_{1} > 0.

(Note that z > 0 does not hold when z = ⊥.)

4 Logical Relations

Our next task is to connect the intrinsic and untyped semantics by means of a type-indexed family ρ of relations such that

ρ[θ] ⊆ [[θ]] × U.

The members ρ[θ] of this family are called logical relations. Informally, ⟨x, y⟩ ^{∈} ρ[θ] means that the value x of type θ is represented by the untyped value y.

(Logical relations [4] are most often used to connect two intrinsic typed semantics, but the idea works just as well to connect an intrinsic and an untyped semantics.)

The relations ρ[θ] will be defined by induction on the structure of the type θ. To sequester the effects of our particular choice of primitive types, however, it is useful first to define primitive logical relations:

Definition 4.1 For primitive types δ, the primitive logical relations ρ̃[δ] ⊆ [[δ]] × Z_{⊥} are such that:

⟨x, z⟩ ^{∈} ρ̃[int] iff x = z
⟨n, z⟩ ^{∈} ρ̃[nat] iff n = z
⟨b, z⟩ ^{∈} ρ̃[bool] iff (b = ⊥ and z = ⊥) or (b = true and z > 0)

or (b = false and z = 0).

Then:

Definition 4.2 For types θ, the logical relations ρ[θ] ⊆ [[θ]] × U are such that:

⟨x, y⟩ ^{∈} ρ[δ] iff ⟨x, Ψ_{p}y⟩ ^{∈} ρ̃[δ]
⟨f, g⟩ ^{∈} ρ[θ_{1} → θ_{2}] iff ∀⟨x, y⟩ ^{∈} ρ[θ_{1}]. ⟨f x, Ψ_{f} g y⟩ ^{∈} ρ[θ_{2}]

⟨[ ι_{1}: x_{1} | … | ι_{n}: x_{n}], y⟩ ^{∈} ρ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})]

iff ⟨x_{1}, Ψ_{r} y ι_{1}⟩ ^{∈} ρ[θ_{1}] and ⋯ and ⟨x_{n}, Ψ_{r} y ι_{n}⟩ ^{∈} ρ[θ_{n}].

To explicate the logical relations, we begin with two domain-theoretic properties that will be necessary to deal with recursion:

Definition 4.3 A relation r between domains is

• strict iff ⟨⊥, ⊥⟩ ^{∈} r,

• chain-complete iff, whenever x_{0} ⊑ x_{1} ⊑ ⋯ and y_{0} ⊑ y_{1} ⊑ ⋯ are increasing sequences such that each ⟨x_{i}, y_{i}⟩ ^{∈} r,

⟨⨆_{i=0}^{∞}x_{i}, ⨆_{i=0}^{∞}y_{i}⟩ ^{∈} r.

Lemma 4.4 For all primitive types δ, the primitive logical relations ρ̃[δ] are strict and chain-complete.

Proof. By the definition (4.1) of the ρ̃[δ], it is immediate that ⟨⊥, ⊥⟩ ^{∈} ρ̃[δ].

Suppose x_{0} ⊑ x_{1} ⊑ ⋯ and z_{0} ⊑ z_{1} ⊑ ⋯ are increasing sequences, in [[δ]] and Z_{⊥} respectively, such that each ⟨x_{i}, z_{i}⟩ ^{∈} ρ̃[δ]. Since [[δ]] and Z_{⊥} are both flat domains, there is a sufficiently large n that ⨆_{i=0}^{∞}x_{i} = x_{n} and ⨆_{i=0}^{∞}z_{i} = z_{n}. Then ⟨⨆_{i=0}^{∞}x_{i}, ⨆_{i=0}^{∞}z_{i}⟩ = ⟨x_{n}, z_{n}⟩ ^{∈} ρ̃[δ]. end of proof

Lemma 4.5 For all types θ, the logical relations ρ[θ] are strict and chaincomplete.

Proof. We first note that, if Φ, Ψ is any embedding-retraction pair, then ⊥ ⊑ Φ⊥, and since Ψ is monotone (since it is continuous) and Φ ; Ψ is an identity, Ψ⊥ ⊑ Ψ(Φ⊥) = ⊥. Then since ⊥ ⊑ Ψ⊥, we have Ψ⊥ = ⊥, i.e., Ψ is a strict function.

The main proof is by induction on the structure of θ.

• Suppose θ is a primitive type δ. Then ⟨x, y⟩ ^{∈} ρ[δ] iff ⟨x, Ψ_{p}y⟩ ^{∈} ρ̃[δ]. Since Ψ_{p} is a strict function and ρ̃[δ] is a strict relation, ⟨⊥, Ψ_{p}⊥⟩ = ⟨⊥, ⊥⟩ ^{∈} ρ̃[δ], so that ⟨⊥, ⊥⟩ ^{∈} ρ[δ].

Now suppose that x_{i} and y_{i} are increasing sequences, in [[δ]] and U respectively, such that ⟨x_{i}, y_{i}⟩ ^{∈} ρ[δ]. Then ⟨x_{i}, Ψ_{p}y_{i}⟩ ^{∈} ρ̃[δ] for i ≥ 0, and since Ψ_{p} is monotone, the Ψ_{p}y_{i} are an increasing sequence in Z_{⊥}.

Then, since Ψ_{p} is continuous, and ρ̃[δ] is chain-complete,

⟨⨆_{i=0}^{∞}x_{i}, Ψ_{p}(⨆_{i=0}^{∞}y_{i})⟩ = ⟨⨆_{i=0}^{∞}x_{i}, ⨆_{i=0}^{∞}Ψ_{p}y_{i}⟩ ^{∈} ρ̃[δ],

so that ⟨⨆_{i=0}^{∞}x_{i}, ⨆_{i=0}^{∞}y_{i}⟩ ^{∈} ρ[δ].

• Suppose θ is θ_{1} → θ_{2}. Let f = ⊥ and g = ⊥, so that Ψ_{f} g = ⊥, since Ψ_{f} is strict. Then, for any ⟨x, y⟩ ^{∈} ρ[θ_{1}], since the least element of a domain of functions is the constant function yielding ⊥, f x = ⊥ and Ψ_{f} g y = ⊥. By the induction hypothesis for θ_{2}, ⟨f x, Ψ_{f} g y⟩ = ⟨⊥, ⊥⟩ ^{∈} ρ[θ_{2}], and since this holds for all ⟨x, y⟩ ^{∈} ρ[θ_{1}], we have ⟨f, g⟩ = ⟨⊥, ⊥⟩ ^{∈} ρ[θ_{1} → θ_{2}]. Now suppose that f_{i} and g_{i} are increasing sequences, in [[θ_{1} → θ_{2}]] and U respectively, such that ⟨f_{i}, g_{i}⟩ ^{∈} ρ[θ_{1} → θ_{2}]. Let ⟨x, y⟩ ^{∈} ρ[θ_{1}]. Then ⟨f_{i} x, Ψ_{f} g_{i} y⟩ ^{∈} ρ[θ_{2}] for i ≥ 0, and since function application and Ψ_{f} are monotone, f_{i} x and Ψ_{f} g_{i} y are increasing sequences. Then, since Ψ_{f} is continuous, and a least upper bound of functions distributes through application, the induction hypothesis for θ_{2} gives

⟨(⨆_{i=0}^{∞}f_{i})x, Ψ_{f}(⨆_{i=0}^{∞}g_{i})y⟩ = ⟨⨆_{i=0}^{∞}f_{i} x, ⨆_{i=0}^{∞}Ψ_{f} g_{i} y⟩ ^{∈} ρ[θ_{2}],

and since this holds for all ⟨x, y⟩ ^{∈} ρ[θ_{1}], ⟨⨆_{i=0}^{∞}f_{i}, ⨆_{i=0}^{∞}g_{i}⟩ ^{∈} ρ[θ_{1} → θ_{2}].

• Suppose θ is rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}). Let [ ι_{1}: x_{1} | … | ι_{n}: x_{n}] = ⊥ and y = ⊥. Then, for each k between one and n, since products are ordered componentwise, x_{k} = ⊥, and since Ψ_{r} is strict, Ψ_{r} y ι_{k} = ⊥, so that the induction hypothesis for θ_{k} gives ⟨x_{k}, Ψ_{r} y ι_{k}⟩ = ⟨⊥, ⊥⟩ ^{∈} ρ[θ_{k}]. Then, since this holds for all k, we have ⟨[ ι_{1}: x_{1} | … | ι_{n}: x_{n}], y⟩ = ⟨⊥, ⊥⟩ ^{∈} ρ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})]. Now suppose that [ ι_{1}: x_{1,i} | … | ι_{n}: x_{n,i}] and y_{i} are increasing sequences (in i) in [[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})]] and U respectively, such that ⟨[ ι_{1}: x_{1,i} | … | ι_{n}: x_{n,i}], y_{i}⟩ ^{∈} ρ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})]. Let k be between one and n. Then ⟨x_{k,i}, Ψ_{r} y_{i} ι_{k}⟩ ^{∈} ρ[θ_{k}] for i ≥ 0, and since component selection, Ψ_{r}, and function application are monotone, x_{k,i} and Ψ_{r} y_{i} ι_{k} are increasing sequences. Then, since Ψ_{r} is continuous, and a least upper bound of functions distributes through application, the induction hypothesis for θ_{k} gives

⟨⨆_{i=0}^{∞}x_{k,i}, Ψ_{r}(⨆_{i=0}^{∞}y_{i})ι_{k}⟩ = ⟨⨆_{i=0}^{∞}x_{k,i}, ⨆_{i=0}^{∞}Ψ_{r} y_{i} ι_{k}⟩ ^{∈} ρ[θ_{k}].

Finally, since this holds for all k, and since least upper bounds of products are taken componentwise,

⟨⨆_{i=0}^{∞}[ ι_{1}: x_{1,i} | … | ι_{n}: x_{n,i}], ⨆_{i=0}^{∞}y_{i}⟩
= ⟨[ ι_{1}: ⨆_{i=0}^{∞}x_{1,i} | … | ι_{n}: ⨆_{i=0}^{∞}x_{n,i}], ⨆_{i=0}^{∞}y_{i}⟩
∈ ρ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})].

end of proof

Next, we establish the connection between subtyping and the logical relations:

Theorem 4.6 If P(θ ≤ θ′) is a proof of the subtype judgement θ ≤ θ′, and ⟨x, y⟩ ^{∈} ρ[θ], then ⟨[[P(θ ≤ θ′)]]x, y⟩ ^{∈} ρ[θ′].

Proof. By induction on the structure of the proof P(θ ≤ θ′).

• Suppose P(θ ≤ θ′) is

\overline{θ ≤ θ,}

so that [[P(θ ≤ θ′)]] = I_{[[θ]]}. If ⟨x, y⟩ ^{∈} ρ[θ], then ⟨[[P(θ ≤ θ′)]]x, y⟩ = ⟨x, y⟩ ^{∈} ρ[θ] = ρ[θ′].

• Suppose P(θ ≤ θ′) is

\frac{P(θ ≤ θ′′) P(θ′′ ≤ θ′)}{θ ≤ θ′,}

so that [[P(θ ≤ θ′)]] = [[P(θ ≤ θ′′)]] ; [[P(θ′′ ≤ θ′)]]. If ⟨x, y⟩ ^{∈} ρ[θ], then ⟨[[P(θ ≤ θ′′)]]x, y⟩ ^{∈} ρ[θ′′] by the induction hypothesis for P(θ ≤ θ′′), and then ⟨[[P(θ ≤ θ′)]]x, y⟩ = ⟨[[P(θ′′ ≤ θ′)]]([[P(θ ≤ θ′′)]]x), y⟩ ^{∈} ρ[θ′] by the induction hypothesis for P(θ′′ ≤ θ′).

• Suppose P(θ ≤ θ′) is

\overline{nat ≤ int,}

so that [[P(θ ≤ θ′)]]n = n. If ⟨n, y⟩ ^{∈} ρ[nat], then n = Ψ_{p}y, so that

⟨[[P(θ ≤ θ′)]]n, Ψ_{p}y⟩ = ⟨n, Ψ_{p}y⟩ = ⟨Ψ_{p}y, Ψ_{p}y⟩,

which satisfies the definition (4.1) of a member of ρ̃[int]. It follows that ⟨[[P(θ ≤ θ′)]]n, y⟩ ^{∈} ρ[int].

• Suppose P(θ ≤ θ′) is

\overline{nat ≤ bool,}

so that

[[P(θ ≤ θ′)]]n = \{ \begin{matrix}⊥ & when & n = ⊥ \\ true & when & n > 0 \\ false & when & n = 0. \end{matrix}

If ⟨n, y⟩ ^{∈} ρ[nat], then n = Ψ_{p}y, so that the equation displayed above implies that

⟨[[P(θ ≤ θ′)]]n, Ψ_{p}y⟩ = \{ \begin{matrix}⟨⊥, Ψ_{p}y⟩ & when & Ψ_{p}y = ⊥ \\ ⟨true, Ψ_{p}y⟩ & when & Ψ_{p}y > 0 \\ ⟨false, Ψ_{p}y⟩ & when & Ψ_{p}y = 0, \end{matrix}

which satisfies the definition (4.1) of a member of ρ̃[bool]. It follows that ⟨[[P(θ ≤ θ′)]]n, y⟩ ^{∈} ρ[bool].

• Suppose P(θ ≤ θ′) is

\frac{P(θ′_{1} ≤ θ_{1}) P(θ_{2} ≤ θ′_{2})}{θ_{1} → θ_{2} ≤ θ′_{1} → θ′_{2},}

so that

[[P(θ ≤ θ′)]]f = [[P(θ′_{1} ≤ θ_{1})]] ; f ; [[P(θ_{2} ≤ θ′_{2})]].

Suppose ⟨f, g⟩ ^{∈} ρ[θ_{1} → θ_{2}], and let ⟨x, y⟩ ^{∈} ρ[θ′_{1}]. By the induction hypothesis for P(θ′_{1} ≤ θ_{1}),

⟨[[P(θ′_{1} ≤ θ_{1})]]x, y⟩ ^{∈} ρ[θ_{1}],

and since ⟨f, g⟩ ^{∈} ρ[θ_{1} → θ_{2}],

⟨f([[P(θ′_{1} ≤ θ_{1})]]x), Ψ_{f} g y⟩ ^{∈} ρ[θ_{2}].

Then, by the induction hypothesis for P(θ_{2} ≤ θ′_{2}),

⟨[[P(θ_{2} ≤ θ′_{2})]](f([[P(θ′_{1} ≤ θ_{1})]]x)), Ψ_{f} g y⟩ ^{∈} ρ[θ′_{2}],

and since this holds for all ⟨x, y⟩ ^{∈} ρ[θ′_{1}],

⟨[[P(θ ≤ θ′)]]f, g⟩ = ⟨[[P(θ′_{1} ≤ θ_{1})]] ; f ; [[P(θ_{2} ≤ θ′_{2})]], g⟩ ^{∈} ρ[θ′_{1} → θ′_{2}].

• Suppose P(θ ≤ θ′) is

P(θ_{1} ≤ θ′_{1}) ⋯ P(θ_{m} ≤ θ′_{m})
rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}) ≤ rcd(ι_{1}: θ′_{1}, …, ι_{m}: θ′_{m}),

so that

\begin{matrix}[[P(θ ≤ θ′)]][ ι_{1}: x_{1} | … | ι_{n}: x_{n}] \\ = [ ι_{1}: [[P(θ_{1} ≤ θ′_{1})]]x_{1} | … | ι_{m}: [[P(θ_{m} ≤ θ′_{m})]]x_{m}]. \end{matrix}

Suppose ⟨[ ι_{1}: x_{1} | … | ι_{n}: x_{n}], y⟩ ^{∈} ρ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})]. Then each ⟨x_{k}, Ψ_{r} y ι_{k}⟩ ^{∈} ρ[θ_{k}], so that, for 1 ≤ k ≤ m, the induction hypothesis for P(θ_{k} ≤ θ′_{k}) gives

⟨[[P(θ_{k} ≤ θ′_{k})]]x_{k}, Ψ_{r} y ι_{k}⟩ ^{∈} ρ[θ′_{k}].

Since this holds for each k ≤ m, we have

⟨[[P(θ ≤ θ′)]][ ι_{1}: x_{1} | … | ι_{n}: x_{n}], y⟩
= ⟨[ ι_{1}: [[P(θ_{1} ≤ θ′_{1})]]x_{1} | … | ι_{m}: [[P(θ_{m} ≤ θ′_{m})]]x_{m}], y⟩
∈ ρ[rcd(ι_{1}: θ′_{1}, …, ι_{m}: θ′_{m})].

end of proof

Next, we establish that, for any signature of any primitive operator, applying the typed and untyped interpretations of the operator to related arguments will yield related results, where the type-dependent notion of “related” is given by the primitive logical relations:

Lemma 4.7 Suppose δ_{1}, …, δ_{n} → δ is a signature of op, and ⟨x_{1}, z_{1}⟩ ^{∈} ρ̃[δ_{1}], …, ⟨x_{n}, z_{n}⟩ ^{∈} ρ̃[δ_{n}]. Then

⟨I_{op}^{δ_{1},...,δ_{n}→δ}(x_{1}, …, x_{n}), I_{op}^{U}(z_{1}, …, z_{n})⟩ ^{∈} ρ̃[δ].

The proof is a case analysis over each signature of each operator; we leave the tedious details to the reader. The only nontriviality is the connection between arithmetic and boolean operations that justifies the cases where + and × have the signature bool, bool → bool: Suppose z_{1} ≥ 0 and z_{2} ≥ 0; then z_{1} + z_{2} > 0 holds iff z_{1} > 0 or z_{2} > 0, and z_{1} × z_{2} > 0 holds iff z_{1} > 0 and z_{2} > 0.

Now we can establish our central result. Essentially, it asserts that, in related environments, the typed and untyped meanings of the same expression give related values, where the type-dependent notion of “related” is given by the logical relations:

Theorem 4.8 (The Logical Relations Theorem) Suppose P(π ⊢ p : θ) is a proof of the typing judgement π ⊢ p : θ, and

\begin{matrix}∀ι ^{∈} dom π. η ι ^{∈} [[π ι]] \\ ε ^{∈} I ⇒ U \\ ∀ι ^{∈} dom π. ⟨η ι, ε ι⟩ ^{∈} ρ[π ι], \end{matrix}  (A)

Then

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩ ^{∈} ρ[θ]. (B)

Proof. By induction on the structure of the proof P(π ⊢ p : θ). More precisely, we prove by induction on n that, for all π, η, ε, p, θ, and P(π ⊢ p : θ), if the depth of P(π ⊢ p : θ) is at most n, and the assumptions (A) hold, then (B) holds. However, in all of the following cases except that for abstractions (i.e., λι. p), the induction hypotheses are only applied for the same values of π, η, and ε as in the theorem being proved. (Abstractions are the only exception because they are the only binding construction in our language.)

• Suppose that the final inference of P(π ⊢ p : θ) is an instance of the subsumption rule, i.e., P(π ⊢ p : θ) is

\frac{P(π ⊢ p : θ′) P(θ′ ≤ θ)}{π ⊢ p : θ,}

so that

[[P(π ⊢ p : θ)]] = [[P(π ⊢ p : θ′)]] ; [[P(θ′ ≤ θ)]].

(We have renamed the metavariables θ and θ′ by interchanging them.) Assume (A). By the induction hypothesis for P(π ⊢ p : θ′), we have

⟨[[P(π ⊢ p : θ′)]]η, [[p]]ε⟩ ^{∈} ρ[θ′].

Then,

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩ = ⟨[[θ′ ≤ θ]]([[P(π ⊢ p : θ′)]]η), [[p]]ε⟩ ^{∈} ρ[θ], by Theorem 4.6.

• Suppose P(π ⊢ p : θ) is

\overline{π ⊢ ι : π ι,}

so that

\begin{aligned}[[P(π ⊢ p : θ)]]η & = & η ι \\ [[p]]ε & = & ε ι. \end{aligned}

Assume (A). Then

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩ = ⟨η ι, ε ι⟩ ^{∈} ρ[π ι] = ρ[θ].

• Suppose P(π ⊢ p : θ) is

\frac{P([ π | ι: θ_{1} ] ⊢ p′ : θ_{2})}{π ⊢ λι. p′ : θ_{1} → θ_{2},}

so that

\begin{aligned}[[P(π ⊢ p : θ)]]η & = & λx ^{∈} [[θ_{1}]]. [[P([ π | ι: θ_{1} ] ⊢ p′ : θ_{2})]][ η | ι: x] \\ [[p]]ε & = & Φ_{f}(λy ^{∈} U. [[p′]][ ε | ι: y]). \end{aligned}

Assume (A), and suppose ⟨x, y⟩ ^{∈} ρ[θ_{1}]. Then

\begin{matrix}∀ι′ ^{∈} dom[ π | ι: θ_{1} ]. [ η | ι: x] ι′ ^{∈} [[[ π | ι: θ_{1} ] ι′]] \\ [ ε | ι: y] ^{∈} I ⇒ U \\ ∀ι′ ^{∈} dom[ π | ι: θ_{1} ]. ⟨[ η | ι: x] ι′, [ ε | ι: y] ι′⟩ ^{∈} ρ[[ π | ι: θ_{1} ] ι′], \end{matrix}(A′)

so that ⟨[[P(π ⊢ p : θ)]]η x, Ψ_{f}([[p]]ε) y⟩

= ⟨[[P([ π | ι: θ_{1} ] ⊢ p′ : θ_{2})]][ η | ι: x], Ψ_{f}(Φ_{f}(λy. [[p′]][ ε | ι: y]))y⟩

= ⟨[[P([ π | ι: θ_{1} ] ⊢ p′ : θ_{2})]][ η | ι: x], [[p′]][ ε | ι: y]⟩
∈ ρ[θ_{2}],

where the last step follows from the induction hypothesis for P([ π | ι: θ_{1} ] ⊢ p′ : θ_{2}), taking (A) to be (A′). Then, since this holds for all ⟨x, y⟩ ^{∈} ρ[θ_{1}], the definition (4.2) of ρ[θ_{1} → θ_{2}] gives

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩ ^{∈} ρ[θ_{1} → θ_{2}].

• Suppose P(π ⊢ p : θ) is

\frac{P(π ⊢ p′ : θ_{1} → θ_{2}) P(π ⊢ p′′ : θ_{1})}{π ⊢ p′ p′′ : θ_{2},}

so that

\begin{aligned}[[P(π ⊢ p : θ)]]η & = & [[P(π ⊢ p′ : θ_{1} → θ_{2})]]η([[P(π ⊢ p′′ : θ_{1})]]η) \\ [[p]]ε & = & Ψ_{f}([[p′]] ε)([[p′′]] ε). \end{aligned}

Assume (A). Then the induction hypothesis for P(π ⊢ p′ : θ_{1} → θ_{2}) gives

⟨[[P(π ⊢ p′ : θ_{1} → θ_{2})]]η, [[p′]] ε⟩ ^{∈} ρ[θ_{1} → θ_{2}],

and the induction hypothesis for P(π ⊢ p′′ : θ_{1}) gives

⟨[[P(π ⊢ p′′ : θ_{1})]]η, [[p′′]] ε⟩ ^{∈} ρ[θ_{1}],

so that

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩

= ⟨[[P(π ⊢ p′ : θ_{1} → θ_{2})]]η([[P(π ⊢ p′′ : θ_{1})]]η), Ψ_{f}([[p′]]ε)([[p′′]]ε)⟩

∈ ρ[θ_{2}],

by the definition (4.2) of ρ[θ_{1} → θ_{2}].

• Suppose P(π ⊢ p : θ) is

\frac{P(π ⊢ p_{1} : θ_{1}) ⋯ P(π ⊢ p_{n} : θ_{n})}{π ⊢ ⟨ι_{1}: p_{1}, …, ι_{n}: p_{n}⟩ : rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}),}

so that

\begin{aligned}[[P(π ⊢ p : θ)]]η & = & [ ι_{1}: [[P(π ⊢ p_{1} : θ_{1})]]η | … | ι_{n}: [[P(π ⊢ p_{n} : θ_{n})]]η] \\ [[p]]ε & = & Φ_{r}([ λι ^{∈} I. ⊥ | ι_{1}: [[p_{1}]] ε | … | ι_{n}: [[p_{n}]] ε]). \end{aligned}

Assume (A). Then, for each k between one and n,

⟨[[P(π ⊢ p_{k} : θ_{k})]]η, Ψ_{r}(Φ_{r}([ λι ^{∈} I. ⊥ | ι_{1}: [[p_{1}]] ε | … | ι_{n}: [[p_{n}]] ε])) ι_{k}⟩

= ⟨[[P(π ⊢ p_{k} : θ_{k})]]η, [ λι ^{∈} I. ⊥ | ι_{1}: [[p_{1}]] ε | … | ι_{n}: [[p_{n}]] ε] ι_{k}⟩

= ⟨[[P(π ⊢ p_{k} : θ_{k})]]η, [[p_{k}]]ε⟩
∈ ρ[θ_{k}],

where the last step follows from the induction hypothesis for P(π ⊢ p_{k} : θ_{k}). Thus the definition (4.2) of ρ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})] gives

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩

= ⟨[ ι_{1}: [[P(π ⊢ p_{1} : θ_{1})]]η | … | ι_{n}: [[P(π ⊢ p_{n} : θ_{n})]]η],
Φ_{r}([ λι ^{∈} I. ⊥ | ι_{1}: [[p_{1}]] ε | … | ι_{n}: [[p_{n}]] ε])⟩
∈ ρ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})].

• Suppose P(π ⊢ p : θ) is

\frac{P(π ⊢ p′ : rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}))}{π ⊢ p′.ι_{k} : θ_{k},}

so that

\begin{aligned}[[P(π ⊢ p : θ)]]η & = & ([[P(π ⊢ p′ : rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}))]]η)ι_{k} \\ [[p]]ε & = & Ψ_{r}([[p′]] ε) ι_{k}. \end{aligned}

Assume (A). Then the induction hypothesis gives ⟨[[P(π ⊢ p′: rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}))]]η, [[p′]]ε⟩ ^{∈} ρ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})], so that

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩ = ⟨([[P(π ⊢ p′ : rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}))]]η)ι_{k}, Ψ_{r}([[p′]] ε) ι_{k}⟩

∈ ρ[θ_{k}],

by the definition (4.2) of ρ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})].

• Suppose P(π ⊢ p : θ) is

\frac{P(π ⊢ p′ : θ → θ)}{π ⊢ Y p′ : θ.,}

so that

\begin{aligned}[[P(π ⊢ p : θ)]]η & = & ⨆_{n=0}^{∞}([[P(π ⊢ p′ : θ → θ)]]η)^{n}⊥ \\ [[p]]ε & = & ⨆_{n=0}^{∞}(Ψ_{f}([[p′]] ε))^{n}⊥. \end{aligned}

Assume (A). By the induction hypothesis, we have ⟨[[P(π ⊢ p′ : θ → θ)]]η, [[p′]] ε⟩ ^{∈} ρ[θ → θ].

Next we can show, by induction on n, that

⟨([[P(π ⊢ p′ : θ → θ)]]η)^{n}⊥,(Ψ_{f}([[p′]] ε))^{n}⊥⟩^{∈} ρ[θ].

The case for n = 0 follows since, by Lemma 4.5, ρ[θ] is strict. For the induction step, we have

⟨([[P(π ⊢ p′ : θ → θ)]]η)^{n+1}⊥,(Ψ_{f}([[p′]] ε))^{n+1}⊥⟩
= ⟨[[P(π ⊢ p′ : θ → θ)]]η(([[P(π ⊢ p′ : θ → θ)]]η)^{n}⊥),
Ψ_{f}([[p′]] ε)((Ψ_{f}([[p′]] ε))^{n}⊥)⟩
∈ ρ[θ],

by the induction hypothesis for n and the definition (4.2) of ρ[θ → θ].

Finally,

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩

= ⟨ ⨆_{n=0}^{∞}([[P(π ⊢ p′ : θ → θ)]]η)^{n}⊥, ⨆_{n=0}^{∞}(Ψ_{f}([[p′]] ε))^{n}⊥⟩

∈ ρ[θ],

since ρ[θ] is chain-complete by Lemma 4.5.

• Suppose P(π ⊢ p : θ) is

\frac{P(π ⊢ p′ : bool)  P(π ⊢ p′′ : θ)  P(π ⊢ p′′′ : θ)}{π ⊢ if p′ then p′′ else p′′′ : θ,}

so that

[[P(π ⊢ p: θ)]]η = \{ \begin{matrix}⊥ & when & [[P(π ⊢ p′: bool)]]η = ⊥ \\ [[P(π ⊢ p′′: θ)]]η & when & [[P(π ⊢ p′: bool)]]η = true \\ [[P(π ⊢ p′′′: θ)]]η & when & [[P(π ⊢ p′: bool)]]η = false \end{matrix}

[[p]]ε = \{ \begin{matrix}⊥ & when & Ψ_{p}([[p′]] ε) = ⊥ \\ [[p′′]] ε & when & Ψ_{p}([[p′]] ε) > 0 \\ [[p′′′]] ε & when & Ψ_{p}([[p′]] ε) = 0 \\ anyval([[p′]] ε, [[p′′]] ε, [[p′′′]]ε) & when & Ψ_{p}([[p′]] ε) < 0. \end{matrix}

Assume (A). By the induction hypothesis for P(π ⊢ p′ : bool),

⟨[[P(π ⊢ p′ : bool)]]η, [[p′]]ε⟩ ^{∈} ρ[bool],

so that

⟨[[P(π ⊢ p′ : bool)]]η, Ψ_{p}([[p′]]ε)⟩ ^{∈} ρ̃[bool].

By the definition (4.1) of ρ̃[bool], there are three cases:

– [[P(π ⊢ p′ : bool)]]η = ⊥ and Ψ_{p}[[p′]]ε = ⊥. Then

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩ = ⟨⊥, ⊥⟩,

which belongs to ρ[θ] since ρ[θ] is strict.

– [[P(π ⊢ p′ : bool)]]η = true and Ψ_{p}[[p′]]ε > 0. Then

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩ = ⟨[[P(π ⊢ p′′ : θ)]]η, [[p′′]]ε⟩, which belongs to ρ[θ] by the induction hypothesis for P(π ⊢ p′′: θ).

– [[P(π ⊢ p′ : bool)]]η = false and Ψ_{p}[[p′]]ε = 0. Then

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩ = ⟨[[P(π ⊢ p′′′ : θ)]]η, [[p′′′]]ε⟩, which belongs to ρ[θ] by the induction hypothesis for P(π ⊢ p′′′: θ).

• Suppose P(π ⊢ p : θ) is

\frac{P(π ⊢ p_{1} : δ_{1})  ⋯  P(π ⊢ p_{n} : δ_{n})}{π ⊢ op(p_{1}, …, p_{n}) : δ,}

so that

[[P(π ⊢ p : θ)]]η = I_{op}^{δ_{1},...,δ_{n}→δ}([[P(π ⊢ p_{1} : δ_{1})]]η, …, [[P(π ⊢ p_{n} : δ_{n})]]η)
[[p]]ε = Φ_{p}(I_{op}^{U}(Ψ_{p}([[p_{1}]]ε), …, Ψ_{p}([[p_{n}]]ε))).

Assume (A). By the induction hypothesis, we have, for 1 ≤ k ≤ n,

⟨[[P(π ⊢ p_{k} : δ_{k})]]η, [[p_{k}]]ε⟩ ^{∈} ρ[δ_{k}],

so that

⟨[[P(π ⊢ p_{k} : δ_{k})]]η, Ψ_{p}([[p_{k}]]ε)⟩ ^{∈} ρ̃[δ_{k}].

Then

⟨I_{op}^{δ_{1},...,δ_{n}→δ}([[P(π ⊢ p_{1} : δ_{1})]]η, …, [[P(π ⊢ p_{n} : δ_{n})]]η),
Ψ_{p}(Φ_{p}(I_{op}^{U}(Ψ_{p}([[p_{1}]]ε), … Ψ_{p}([[p_{n}]]ε))))⟩
= ⟨I_{op}^{δ_{1},...,δ_{n}→δ}([[P(π ⊢ p_{1} : δ_{1})]]η, …, [[P(π ⊢ p_{n} : δ_{n})]]η),
I_{op}^{U}(Ψ_{p}([[p_{1}]]ε), … Ψ_{p}([[p_{n}]]ε))⟩
∈ ρ̃[δ],

by Lemma 4.7, so that

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩

= ⟨I_{op}^{δ_{1},...,δ_{n}→δ}([[P(π ⊢ p_{1} : δ_{1})]]η, …, [[P(π ⊢ p_{n} : δ_{n})]]η),
Φ_{p}(I_{op}^{U}(Ψ_{p}([[p_{1}]]ε), … Ψ_{p}([[p_{n}]]ε)))⟩
∈ ρ[δ].

end of proof

Finally, we can show that the logical relations possess a property that is plausibly called convexity:

Definition 4.9 A relation r between a set and a domain is said to be convex iff ⟨x, y′⟩ ^{∈} r holds whenever ⟨x, y⟩, ⟨x, y′′⟩ ^{∈} r and y ⊑ y′ ⊑ y′′.

Lemma 4.10 The primitive logical relations ρ̃[δ] are convex.

Proof. For each primitive type δ, the domain [[δ]] is flat, so that y ⊑ y′ ⊑ y′′ implies that y′ = y or y′ = y′′. end of proof

Theorem 4.11 The logical relations ρ[θ] are convex.

Proof. By induction on the structure of θ.

• Suppose θ is a primitive type δ, and that ⟨x, y⟩, ⟨x, y′′⟩ ^{∈} ρ[δ] and y ⊑ y′ ⊑ y′′. Then ⟨x, Ψ_{p}y⟩, ⟨x, Ψ_{p}y′′⟩ ^{∈} ρ̃[δ] and, since Ψ_{p} is monotone, Ψ_{p}y ⊑ Ψ_{p}y′ ⊑ Ψ_{p}y′′. Since ρ̃[δ] is convex, ⟨x, Ψ_{p}y′⟩ ^{∈} ρ̃[δ], so that ⟨x, y′⟩ ^{∈} ρ[δ].

• Suppose θ is θ_{1} → θ_{2}, and that ⟨f, g⟩, ⟨f, g′′⟩ ^{∈} ρ[θ_{1} → θ_{2}] and g ⊑ g′ ⊑ g′′. Let ⟨x, y⟩ ^{∈} ρ[θ_{1}]. Then ⟨fx, Ψ_{f} g y⟩, ⟨fx, Ψ_{f} g′′ y⟩ ^{∈} ρ[θ_{2}] and, since Ψ_{f} and function application are monotone, Ψ_{f} g y ⊑ Ψ_{f} g′ y ⊑ Ψ_{f} g′′ y. Then the induction hypothesis for ρ[θ_{2}] gives ⟨fx, Ψ_{f} g′ y⟩ ^{∈} ρ[θ_{2}], and since this holds for all ⟨x, y⟩ ^{∈} ρ[θ_{1}], we have ⟨f, g′⟩ ^{∈} ρ[θ_{1} → θ_{2}].

• Suppose θ is rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}), and that ⟨[ ι_{1}: x_{1} | … | ι_{n}: x_{n}], y⟩, ⟨[ ι_{1}: x_{1} | … | ι_{n}: x_{n}], y′′⟩ ^{∈} ρ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})] and y ⊑ y′ ⊑ y′′. Then, for each k between one and n, ⟨x_{k}, Ψ_{r} y ι_{k}⟩, ⟨x_{k}, Ψ_{r} y′′ ι_{k}⟩ ^{∈} ρ[θ_{k}] and, since Ψ_{r} and application to ι_{k} are monotone, Ψ_{r} y ι_{k} ⊑ Ψ_{r} y′ ι_{k} ⊑ Ψ_{r} y′′ ι_{k}. Then the induction hypothesis for ρ[θ_{k}] gives ⟨x_{k}, Ψ_{r} y′ ι_{k}⟩ ^{∈} ρ[θ_{k}], and since this holds for all k, we have ⟨[ ι_{1}: x_{1} | … | ι_{n}: x_{n}], y′⟩ ^{∈} ρ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})].

end of proof

5 Bracketing

Next, we show that the domains [[θ]] that are the meanings of types can be embedded in the universal domain U by a type-indexed family of function pairs:

[figure: [[θ]]; U.; ϕ[θ]; ψ[θ]]

We will show that these are embedding-retraction pairs, and that they are closely related to the logical relations defined in the previous section. (The idea that types denote retractions on a universal domain is due to Scott [5].)

First, however, as with the definition of logical relations, it is useful to define a subsidiary kind of function pair for primitive types: Definition 5.1 For primitive types δ, the functions

[figure: [[δ]]; Z_{⊥}; ϕ̃[δ]; ψ̃ [δ]]

are such that

ϕ̃[int]x = x
ψ̃ [int]z = z
ϕ̃[nat]n = n
ψ̃ [nat]z = \{ \begin{matrix}⊥ & when & z = ⊥ \\ z & when & z ≥ 0 \\ ⊥ & when & z < 0 \end{matrix}
ϕ̃[bool]b = \{ \begin{matrix}⊥ & when & b = ⊥ \\ 1 & when & b = true \\ 0 & when & b = false \end{matrix}

ψ̃ [bool]z = \{ \begin{matrix}⊥ & when & z = ⊥ \\ true & when & z > 0 \\ false & when & z = 0 \\ ⊥ & when & z < 0. \end{matrix}

¿From this definition, by tedious case analysis, the reader may verify that ϕ̃[δ] and ψ̃ [δ] bear the following relationship to the primitive logical relations ρ̃[δ]: Lemma 5.2 For each primitive type δ:

1. For all x ^{∈} [[δ]], ⟨x, ϕ̃[δ]x⟩ ^{∈} ρ̃[δ].

2. For all ⟨x, z⟩ ^{∈} ρ̃[δ], x = ψ̃ [δ]z.

Now we can define the function pairs ϕ[θ], ψ[θ] by induction on the structure of θ: Definition 5.3 For types θ, the functions

[figure: [[θ]]; U; ϕ[θ]; ψ[θ]]

are such that

ϕ[δ]x = Φ_{p}(ϕ̃[δ]x)
ψ[δ]y = ψ̃ [δ](Ψ_{p}y)
ϕ[θ_{1} → θ_{2}]f = Φ_{f}(ψ[θ_{1}] ; f ; ϕ[θ_{2}])
ψ[θ_{1} → θ_{2}]y = ϕ[θ_{1}] ; Ψ_{f}y ; ψ[θ_{2}]

ϕ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})][ ι_{1}: x_{1} | … | ι_{n}: x_{n}]

= Φ_{r}([ λι ^{∈} I. ⊥ | ι_{1}: ϕ[θ_{1}]x_{1} | … | ι_{n}: ϕ[θ_{n}]x_{n}])
ψ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})]y = [ ι_{1}: ψ[θ_{1}](Ψ_{r}y ι_{1}) | … | ι_{n}: ψ[θ_{n}](Ψ_{r}y ι_{n}) ].

These function pairs are related to the logical relations ρ[θ] in a way that is analogous to the previous lemma:

Theorem 5.4 (The Bracketing Theorem) For each type θ:

1. For all x ^{∈} [[θ]], ⟨x, ϕ[θ]x⟩ ^{∈} ρ[θ].

2. For all ⟨x, y⟩ ^{∈} ρ[θ], x = ψ[θ]y.

Proof. The proof is by induction on the structure of θ:

• Suppose θ is a primitive type δ, and x ^{∈} [[δ]]. ¿From the fact that Φ_{p} ; Ψ_{p} is an identity, and the first part of Lemma 5.2, we have

⟨x, Ψ_{p}(Φ_{p}(ϕ̃[δ]x))⟩ = ⟨x, ϕ̃[δ]x⟩ ^{∈} ρ̃[δ].

Then the definitions (5.3) of ϕ[δ] and (4.2) of ρ[δ] give

⟨x, ϕ[δ]x⟩ = ⟨x, Φ_{p}(ϕ̃[δ]x)⟩ ^{∈} ρ[δ].

Now suppose ⟨x, y⟩ ^{∈} ρ[δ]. By the definition (4.2) of ρ[δ], we have ⟨x, Ψ_{p}y⟩ ^{∈} ρ̃[δ]. Then the second part of Lemma 5.2 and the definition (5.3) of ψ[δ] give

x = ψ̃ [δ](Ψ_{p}y) = ψ[δ]y.

• Suppose θ is θ_{1} → θ_{2}, and f ^{∈} [[θ_{1} → θ_{2}]]. Let ⟨x, y⟩ ^{∈} ρ[θ_{1}]. By the second part of the induction hypothesis for θ_{1}, x = ψ[θ_{1}]y. Then

ϕ[θ_{2}](f x) = ϕ[θ_{2}](f(ψ[θ_{1}]y))
= (ψ[θ_{1}] ; f ; ϕ[θ_{2}])y
= Ψ_{f}(Φ_{f}(ψ[θ_{1}] ; f ; ϕ[θ_{2}]))y
= Ψ_{f}(ϕ[θ_{1} → θ_{2}]f)y,

from the fact that Φ_{f} ; Ψ_{f} is an identity, and the definition (5.3) of ϕ[θ_{1} → θ_{2}]. Then by the first part of the induction hypothesis for θ_{2},

⟨f x, Ψ_{f}(ϕ[θ_{1} → θ_{2}]f)y⟩ ^{∈} ρ[θ_{2}],

and since this holds for all ⟨x, y⟩ ^{∈} ρ[θ_{1}], the definition (4.2) of ρ[θ_{1} → θ_{2}] gives

⟨f, ϕ[θ_{1} → θ_{2}]f⟩ ^{∈} ρ[θ_{1} → θ_{2}].

Now suppose ⟨f, g⟩ ^{∈} ρ[θ_{1} → θ_{2}], and let x ^{∈} [[θ_{1}]]. By the first part of the induction hypothesis for θ_{1}, ⟨x, ϕ[θ_{1}]x⟩ ^{∈} ρ[θ_{1}], so by the definition (4.2) of ρ[θ_{1} → θ_{2}], ⟨f x, Ψ_{f}g(ϕ[θ_{1}]x)⟩ ^{∈} ρ[θ_{2}]. Then by the second part of the induction hypothesis for θ_{2}, f x = ψ[θ_{2}](Ψ_{f}g(ϕ[θ_{1}]x)).

Since this holds for all x ^{∈} [[θ_{1}]], we have f = ϕ[θ_{1}] ; Ψ_{f}g; ψ[θ_{2}], and by the definition (5.3) of ψ[θ_{1} → θ_{2}], f = ψ[θ_{1} → θ_{2}]g.

• Suppose θ is rcd(ι_{1}: θ_{1}, ⋯, ι_{n}: θ_{n}), and [ ι_{1}: x_{1} | … | ι_{n}: x_{n}] belongs to [[rcd(ι_{1}: θ_{1}, ⋯, ι_{n}: θ_{n})]]. For each k between one and n, the fact that Φ_{r} ; Ψ_{r} is an identity, and the first part of the induction hypothesis for θ_{k}, give

\begin{aligned}⟨x_{k}, Ψ_{r}(Φ_{r}([ λι. ⊥ | ι_{1}: ϕ[θ_{1}]x_{1} | … | ι_{n}: ϕ[θ_{n}]x_{n}]))ι_{k}⟩ & = & ⟨x_{k}, ϕ[θ_{k}]x_{k}⟩ \\ & ∈ & ρ[θ_{k}]. \end{aligned}

Then the definition (5.3) of ϕ[rcd(ι_{1}: θ_{1}, ⋯, ι_{n}: θ_{n})] and the definition (4.2) of ρ[rcd(ι_{1}: θ_{1}, ⋯, ι_{n}: θ_{n})] give

⟨[ ι_{1}: x_{1} | … | ι_{n}: x_{n}], ϕ[rcd(ι_{1}: θ_{1}, ⋯, ι_{n}: θ_{n})][ ι_{1}: x_{1} | … | ι_{n}: x_{n}]⟩

= ⟨[ ι_{1}: x_{1} | … | ι_{n}: x_{n}], Φ_{r}([ λι. ⊥ | ι_{1}: ϕ[θ_{1}]x_{1} | … | ι_{n}: ϕ[θ_{n}]x_{n}])⟩

∈ ρ[rcd(ι_{1}: θ_{1}, ⋯, ι_{n}: θ_{n})].

Now suppose ⟨[ ι_{1}: x_{1} | … | ι_{n}: x_{n}], y⟩ ^{∈} ρ[rcd(ι_{1}: θ_{1}, ⋯, ι_{n}: θ_{n})]. By the definition (4.2) of ρ[rcd(ι_{1}: θ_{1}, ⋯, ι_{n}: θ_{n})], for each k between one and n, ⟨x_{k}, Ψ_{r}y ι_{k}⟩ ^{∈} ρ[θ_{k}]. Then by the second part of the induction hypothesis for θ_{k}, x_{k} = ψ[θ_{k}](Ψ_{r}y ι_{k}), and since this holds for all k, the definition (5.3) of ψ[rcd(ι_{1}: θ_{1}, ⋯, ι_{n}: θ_{n})] gives

\begin{aligned}ψ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})]y & = & [ ι_{1}: ψ[θ_{1}](Ψ_{r}y ι_{1}) | … | ι_{n}: ψ[θ_{n}](Ψ_{r}y ι_{n}) ] \\ & = & [ ι_{1}: x_{1} | … | ι_{n}: x_{n}]. \end{aligned}

end of proof

An immediate consequence of the bracketing theorem is that

Corollary 5.5 The ϕ[θ], ψ[θ] are embedding-retraction pairs.

Proof. Suppose x ^{∈} [[θ]]. By the first part of the bracketing theorem, ⟨x, ϕ[θ]x⟩ ^{∈} ρ[θ]; then by the second part, x = ψ[θ](ϕ[θ]x). Since this holds for all x ^{∈} [[θ]], we have ϕ[θ] ; ψ[θ] = I_{[[θ]]}. end of proof

The name “bracketing theorem” alludes to a more succinct formulation of the theorem as a subset relationship between graphs of functions and relations. Writing † for the reflection of a graph, we can restate the bracketing theorem as:

For each type θ, ϕ[θ] ⊆ ρ[θ] ⊆ (ψ[θ])^{†}.

The essence of the bracketing theorem is that it connects the notion of representation provided by the logical relations with the different notion provided by the embedding-retraction pairs. For each typed value x ^{∈} [[θ]], one can regard

• the set { y | x = ψ[θ]y } (i.e., the preimage of x under ψ[θ]) as the set of untyped values that “weakly” represent x,

• the subset { y | ⟨x, y⟩ ^{∈} ρ[θ] } ⊆ { y | x = ψ[θ]y } as the set of untyped values that represent x,

• the member ϕ[θ]x ^{∈} { y | ⟨x, y⟩ ^{∈} ρ[θ] } as the “best” or “canonical” representation of x.

An essential difference between representation and weak representation is that, since ψ[θ] is a total function, every untyped value “weakly” represents some typed value.

By combining the bracketing theorem with Theorem 4.6, one can express implicit conversions in terms of the embedding-retraction pairs:

Theorem 5.6 When θ ≤ θ′, [[P(θ ≤ θ′)]] = ϕ[θ] ; ψ[θ′].

Proof. Suppose x ^{∈} [[θ]]. By the first part of the bracketing theorem, ⟨x, ϕ[θ]x⟩ ^{∈} ρ[θ]. Then, by Theorem 4.6, ⟨[[P(θ ≤ θ′)]]x, ϕ[θ]x⟩ ^{∈} ρ[θ′], and by the second part of the bracketing theorem, [[P(θ ≤ θ′)]]x = ψ[θ′](ϕ[θ]x).

end of proof

Finally, by combining the bracketing theorem with the logical relations theorem, one can express the intrinsic typed semantics of a phrase in terms of its untyped semantics:

Theorem 5.7 Suppose π ⊢ p : θ and η ^{∈} [[π]]^{∗}. Then

[[P(π ⊢ p : θ)]]η = ψ[θ]([[p]](λι. if ι ^{∈} dom π then ϕ[π ι](η ι) else ⊥)).

Proof. Let ε = λι. if ι ^{∈} dom π then ϕ[π ι](η ι) else ⊥. For each ι ^{∈} dom π, by this definition of ε and the first part of the bracketing theorem,

⟨η ι, ε ι⟩ = ⟨η ι, ϕ[π ι](η ι)⟩ ^{∈} ρ[π ι].

Then the logical relations theorem gives

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩ ^{∈} ρ[θ],

and the second part of the bracketing theorem gives

[[P(π ⊢ p : θ)]]η = ψ[θ]([[p]]ε).

end of proof

Theorem 5.6 expresses the meaning of a proof of the subtype judgement θ ≤ θ′ as a function of the retraction-embedding pairs associated with θ and θ′, which are determined by the judgement itself rather than its proof. Similarly, Theorem 5.7 expresses the meaning of a proof of the typing judgement π ⊢ p : θ in terms of the untyped meaning of p and the retraction-embedding pairs associated with θ and the components of π — all of which are determined by the judgement itself rather than its proof. Thus every proof of the same judgement must have the same intrinsic semantics:

Corollary 5.8 The intrinsic semantics is coherent.

Of course, the coherence of the kind of language we have been considering has been known for some time [6], but we believe this is an unusually elegant proof.

It should also be noted that the above theorem expresses a particular intrinsic semantics in terms of any of a variety of untyped semantics, i.e., all of the untyped semantics meeting the constraints in Section 3, where we permitted variations in the universal domain U and the way in which primitive values, functions, and records are embedded within it, as well as in certain aspects of the primitive operations, such as the choice of trueint.

For example, one might take the untyped semantics to be one in which η-reduction does or does not preserve meaning [1, Section 10.5], or one in which the fixed-point combinator λf. (λx. f(x x))(λx. f(x x)) is or is not a least fixed-point operator [7].

6 An Extrinsic PER Semantics

Suppose we define a type-indexed family of relations between untyped values:

Definition 6.1 For types θ, the relations σ[θ] ⊆ U × U are such that

⟨y, y′⟩ ^{∈} σ[θ] iff ∃x ^{∈} [[θ]]. ⟨x, y⟩, ⟨x, y′⟩ ^{∈} ρ[θ].

(More abstractly, using relational composition, σ[θ] =^{def} (ρ[θ])^{†} ; ρ[θ].)

Obviously, the σ[θ] are symmetric. Moreover, these relations are transitive:

Theorem 6.2 If ⟨y, y′⟩, ⟨y′, y′′⟩ ^{∈} σ[θ], then ⟨y, y′′⟩ ^{∈} σ[θ].

Proof. If ⟨y, y′⟩, ⟨y′, y′′⟩ ^{∈} σ[θ], then there are x, x′ ^{∈} [[θ]] such that ⟨x, y⟩, ⟨x, y′⟩, ⟨x′, y′⟩, ⟨x′, y′′⟩ ^{∈} ρ[θ]. Then by the second part of the bracketing theorem, x = ψ[θ]y′ and x′ = ψ[θ]y′, so that x = x′. Then ⟨x, y⟩, ⟨x, y′′⟩ ^{∈} ρ[θ], so that ⟨y, y′′⟩ ^{∈} σ[θ]. end of proof

Thus, the σ[θ] are partial equivalence relations (PER’s). Although we have chosen to define them in terms of the logical relations, they can also be described directly by induction on the structure of θ. To see this, we first define a subsidiary relations for primitive types:

Definition 6.3 For primitive types δ, the relation σ̃ [δ] ⊆ Z_{⊥} × Z_{⊥} is such that:

⟨z, z′⟩ ^{∈} σ̃ [δ] iff ∃x ^{∈} [[δ]]. ⟨x, z⟩, ⟨x, z′⟩ ^{∈} ρ̃[δ].

The reader may verify from the definition (4.1) of ρ̃[δ] that

Lemma 6.4

⟨z, z′⟩ ^{∈} σ̃ [int] iff z = z′
⟨z, z′⟩ ^{∈} σ̃ [nat] iff z = z′ and (z ≥ 0 or z = ⊥)
⟨z, z′⟩ ^{∈} σ̃ [bool] iff (z = z′ = ⊥) or (z > 0 and z′ > 0) or z = z′ = 0.

Then the σ[θ] are described by:

Theorem 6.5

⟨y, y′⟩ ^{∈} σ[δ] iff ⟨Ψ_{p}y, Ψ_{p}y′⟩ ^{∈} σ̃ [δ]
⟨g, g′⟩ ^{∈} σ[θ_{1} → θ_{2}] iff ∀⟨y, y′⟩ ^{∈} σ[θ_{1}]. ⟨Ψ_{f} g y, Ψ_{f} g′ y′⟩ ^{∈} σ[θ_{2}]

⟨y, y′⟩ ^{∈} σ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})]

iff ⟨Ψ_{r} y ι_{1}, Ψ_{r} y′ ι_{1}⟩ ^{∈} σ[θ_{1}] and ⋯ and ⟨Ψ_{r} y ι_{n}, Ψ_{r} y′ ι_{n}⟩ ^{∈} σ[θ_{n}].

Proof. Using the definitions (6.1) of σ, (4.2) of ρ[δ], and (6.3) of σ̃, we have ⟨y, y′⟩ ^{∈} σ[δ] iff there is an x ^{∈} [[δ]] such that ⟨x, y⟩, ⟨x, y′⟩ ^{∈} ρ[δ], iff there is an x ^{∈} [[δ]] such that ⟨x, Ψ_{p}y⟩, ⟨x, Ψ_{p}y′⟩ ^{∈} ρ̃[δ], iff ⟨Ψ_{p}y, Ψ_{p}y′⟩ ^{∈} σ̃ [δ].

Suppose ⟨g, g′⟩ ^{∈} σ[θ_{1} → θ_{2}] and ⟨y, y′⟩ ^{∈} σ[θ_{1}]. ¿From the definition (6.1) of σ, there is an f ^{∈} [[θ_{1} → θ_{2}]] such that ⟨f, g⟩, ⟨f, g′⟩ ^{∈} ρ[θ_{1} → θ_{2}] and there is an x ^{∈} [[θ_{1}]] such that ⟨x, y⟩, ⟨x, y′⟩ ^{∈} ρ[θ_{1}]. Then, from the definition (4.2) of ρ[θ_{1} → θ_{2}], we have ⟨f x, Ψ_{f} g y⟩ ^{∈} ρ[θ_{2}] and ⟨f x, Ψ_{f} g′ y′⟩ ^{∈} ρ[θ_{2}], and from the definition (6.1) of σ, we have ⟨Ψ_{f} g y, Ψ_{f} g′ y′⟩ ^{∈} σ[θ_{2}].

On the other hand, suppose

∀⟨y, y′⟩ ^{∈} σ[θ_{1}]. ⟨Ψ_{f} g y, Ψ_{f} g′ y′⟩ ^{∈} σ[θ_{2}],

and let ⟨x, y⟩ ^{∈} ρ[θ_{1}]. We have ⟨y, y⟩ ^{∈} σ[θ_{1}] by the definition (6.1) of σ. Moreover, since the first half of the bracketing theorem gives ⟨x, ϕ[θ_{1}]x⟩ ^{∈} ρ[θ_{1}], we also have ⟨ϕ[θ_{1}]x, y⟩ ^{∈} σ[θ_{1}] by the definition (6.1) of σ. Then, by the supposition displayed above, we have both ⟨Ψ_{f} g y, Ψ_{f} g′ y⟩ ^{∈} σ[θ_{2}] and ⟨Ψ_{f} g(ϕ[θ_{1}]x), Ψ_{f} g′ y⟩ ^{∈} σ[θ_{2}], and since σ[θ_{2}] is symmetric and transitive, ⟨Ψ_{f} g(ϕ[θ_{1}]x), Ψ_{f} g y⟩ ^{∈} σ[θ_{2}].

Thus we have ⟨Ψ_{f} g(ϕ[θ_{1}]x), Ψ_{f} ĝ y⟩ ^{∈} σ[θ_{2}], where ĝ is either g or g′. By the definition (6.1) of σ, there is a w ^{∈} [[θ_{2}]] such that ⟨w, Ψ_{f} g(ϕ[θ_{1}]x)⟩ ^{∈} ρ[θ_{2}] and ⟨w, Ψ_{f} ĝ y⟩ ^{∈} ρ[θ_{2}]. ¿From the first of these inclusions, the second part of the bracketing theorem gives w = ψ[θ_{2}](Ψ_{f} g(ϕ[θ_{1}]x)), or w = f x, where f is the function ϕ[θ_{1}];Ψ_{f} g;ψ[θ_{2}]. Thus the second inclusion can be written as ⟨f x, Ψ_{f} ĝ y⟩ ^{∈} ρ[θ_{2}]. Since this holds for all ⟨x, y⟩ ^{∈} ρ[θ_{1}], the definition (4.2) of ρ[θ_{1} → θ_{2}] gives ⟨f, ĝ⟩ ^{∈} ρ[θ_{1} → θ_{2}], and since this holds when ĝ is either g or g′, the definition (6.1) of σ gives ⟨g, g′⟩ ^{∈} σ[θ_{1} → θ_{2}].

Finally, we have the case where θ = rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n}). Using the definitions (6.1) of σ, (2.1) of [[θ]], (4.2) of ρ[rcd(ι_{1}: θ_{1}, …, ι_{n}: θ_{n})], and (6.1) of σ, we have that

⟨y, y′⟩ ^{∈} σ[θ]

iff there is a record r ^{∈} [[θ]] such that

⟨r, y⟩, ⟨r, y′⟩ ^{∈} ρ[θ],

iff there are x_{1} ^{∈} [[θ_{1}]], … x_{n} ^{∈} [[θ_{n}]] such that

⟨[ ι_{1}: x_{1} | … | ι_{n}: x_{n}], y⟩, ⟨[ ι_{1}: x_{1} | … | ι_{n}: x_{n}], y′⟩ ^{∈} ρ[θ],

iff there are x_{1} ^{∈} [[θ_{1}]], … x_{n} ^{∈} [[θ_{n}]] such that

⟨x_{1}, Ψ_{r} y ι_{1}⟩, ⟨x_{1}, Ψ_{r} y′ ι_{1}⟩ ^{∈} ρ[θ_{1}] and
⋯ and ⟨x_{n}, Ψ_{r} y ι_{n}⟩, ⟨x_{n}, Ψ_{r} y′ ι_{n}⟩ ^{∈} ρ[θ_{n}],

iff

⟨Ψ_{r} y ι_{1}, Ψ_{r} y′ ι_{1}⟩ ^{∈} σ[θ_{1}] and ⋯ and ⟨Ψ_{r} y ι_{n}, Ψ_{r} y′ ι_{n}⟩ ^{∈} σ[θ_{n}].

end of proof

In terms of the notion of representation captured by the logical relations:

• ⟨y, y⟩ ^{∈} σ[θ] means that y is a representation of some value of type θ.

• ⟨y, y′⟩ ^{∈} σ[θ] means that y and y′ are representions of the same value of type θ.

Thus, for each θ, the PER σ[θ] defines both the set { y | ⟨y, y⟩ ^{∈} σ[θ] } of “representations” and also, when restricted to this set, an equivalence relation of “representing the same thing”.

In early extrinsic denotational semantics, such as the Sethi-MacQueen model [9, 10], types played only the first of these roles; the insight that they denote PER’s (rather than subsets) on a universal domain of untyped values is due to Scott [5, Section 7], [11, Section 5], [12].

In fact, the basic idea that types represent equivalence relations on subsets of some universe of “realizers” is much older. Two examples are described by Troelstra: the “hereditarily effective operations” (HEO) [13, Section 2.4.11], [14, Section 3.3], where the realizers are natural numbers (used as Gödel numbers), and the “extensional model of hereditarily continuous functionals” (ECF) [13, Section 2.6.5], [14, Section 3.9], where the realizers are functions from natural numbers to natural numbers. Troelstra attributes HEO to Kreisel [15, Section 4.2], and ECF to both Kreisel [15] and, independently, Kleene [16].

The common thread behind all these systems is that, to be continuous (or computable) a typed value must be represented by some realizer. An overview of realizability is given by Amadio and Curien [17, Chapter 15].

The combination of our untyped semantics with the PER’s σ[θ] gives what we have called an extrinsic semantics. The essential connection between these entities is that, when a phrase satisfies a typing judgement, its untyped meaning respects the type-dependent notion of representation described by the σ[θ]. More precisely,

Theorem 6.6 Suppose π ⊢ p : θ, and ε, ε′ ^{∈} I ⇒ U satisfy

∀ι ^{∈} dom π. ⟨ε ι, ε′ ι⟩ ^{∈} σ[π ι].

Then

⟨[[p]]ε, [[p]]ε′⟩ ^{∈} σ[θ].

Proof. If ε and ε′ are related as supposed, then for each ι ^{∈} dom π, there must be an x ^{∈} [[π ι]] such that ⟨x, ε ι⟩, ⟨x, ε′ ι⟩ ^{∈} ρ[π ι]. Thus there must be an environment η ^{∈} [[π]]^{∗} such that

∀ι ^{∈} dom π. ⟨η ι, ε ι⟩, ⟨η ι, ε′ ι⟩ ^{∈} ρ[π ι].

Then by two applications of the logical relations theorem,

⟨[[P(π ⊢ p : θ)]]η, [[p]]ε⟩, ⟨[[P(π ⊢ p : θ)]]η, [[p]]ε′⟩ ^{∈} ρ[θ],

so that

⟨[[p]]ε, [[p]]ε′⟩ ^{∈} σ[θ].

end of proof

Finally, we can connect the σ[θ] with a family of functions defined in terms of the embedding-retraction pairs that bracket the ρ[θ]:

Definition 6.7 For types θ, the function μ[θ] is the composition ψ[θ];ϕ[θ] ^{∈} U ⇒ U.

It is easily seen that each μ[θ] is idempotent, so that its range is its set of fixed points. Morever, it is well known that this set of fixed points, ordered as a sub-partial-ordering of U, is a domain that is isomorphic to [[θ]].

The μ[θ] are related to the σ[θ] by the following theorem, which plays a role at the level of PER’s that is similar to the bracketing theorem:

Theorem 6.8 For each type θ:

1. If ⟨y, y′⟩ ^{∈} σ[θ], then μ[θ]y = μ[θ]y′.

2. ⟨μ[θ]y, μ[θ]y⟩ ^{∈} σ[θ].

3. If ⟨y, y⟩ ^{∈} σ[θ], then ⟨y, μ[θ]y⟩ ^{∈} σ[θ].

Proof.

1. If ⟨y, y′⟩ ^{∈} σ[θ], then there is an x ^{∈} [[θ]] such that ⟨x, y⟩, ⟨x, y′⟩ ^{∈} ρ[θ]. Then the second part of the bracketing theorem gives x = ψ[θ]y = ψ[θ]y′, so that μ[θ]y = μ[θ]y′.

2. We have ⟨ψ[θ]y, μ[θ]y⟩ = ⟨ψ[θ]y, ϕ[θ](ψ[θ]y)⟩ ^{∈} ρ[θ], by the first part of the bracketing theorem. Thus, taking x to be ψ[θ]y, the definition of σ[θ] gives ⟨μ[θ]y, μ[θ]y⟩ ^{∈} σ[θ].

3. If ⟨y, y⟩ ^{∈} σ[θ], then there is an x ^{∈} [[θ]] such that ⟨x, y⟩ ^{∈} ρ[θ]. Then, by the second part of the bracketing theorem, x = ψ[θ]y. Moreover, by the first part of the bracketing theorem, ⟨x, ϕ[θ]x⟩ ^{∈} ρ[θ], which in conjunction with ⟨x, y⟩ ^{∈} ρ[θ] gives ⟨y, ϕ[θ]x⟩ ^{∈} σ[θ]. Then x = ψ[θ]y gives ⟨y, μ[θ]y⟩ ^{∈} σ[θ].

end of proof

The reader may verify that as consequences of the parts of this theorem:

1. Every equivalence class of σ[θ] is a subset of the preimage under μ[θ] of some fixed point of μ[θ].

2. Every fixed point of μ[θ] belongs to an equivalence class of σ[θ]. (Thus, since each preimage of a fixed point contains that fixed point, every preimage of a fixed point contains at least one equivalence class.)

3. Every equivalence class of σ[θ] contains a fixed point of μ[θ]. (Thus, since no preimage contains more than one fixed point, no preimage of a fixed point contains more than one equivalence class.)

7 Future Directions

Obviously, we would like to extend our approach to languages with richer type systems, such as intersection or polymorphic types. During the last year, we made a strenuous attempt to conquer intersection types, but we were unable to find a semantics for which we could prove the bracketing theorem. (This work was described in a talk at the Workshop on Intersection Types and Related Systems [18].)

It is also of interest to try to move in the opposite direction, from extrinsic to intrinsic semantics. In a sense this is straightforward: Given σ[θ], one simply takes [[θ]] to be the set of equivalence classes of σ[θ]. (More precisely, one takes the semantic category to be a category of PER’s [17, Chapter 15].) In general, however, there may be no sensible way to order the set of equivalence classes to make [[θ]] into a domain.

References

[1] John C. Reynolds. Theories of Programming Languages. Cambridge University Press, Cambridge, England, 1998.

[2] Daniel Leivant. Typing and computational properties of lambda expressions. Theoretical Computer Science, 44(1):51–68, 1986.

[3] John C. Reynolds. Using category theory to design implicit conversions and generic operators. In Neil D. Jones, editor, Semantics-Directed Compiler Generation, volume 94 of Lecture Notes in Computer Science, pages 211–258, Berlin, 1980. Springer-Verlag.

[4] Gordon D. Plotkin. Lambda-definability and logical relations. Memorandum SAI–RM–4, University of Edinburgh, Edinburgh, Scotland, October 1973.

[5] Dana S. Scott. Data types as lattices. SIAM Journal on Computing, 5(3):522–587, September 1976.

[6] Pierre-Louis Curien and Giorgio Ghelli. Coherence of subsumption, minimum typing, and type-checking in F_{≤}. Mathematical Structures in Computer Science, 2(1):55–91, March 1992.

[7] David M. R. Park. The Y-combinator in Scott’s lambda-calculus models. Symposium on Theory of Programming, University of Warwick, unpublished; cited in [8], 1970.

[8] Christopher P. Wadsworth. The relation between computational and denotational properties for Scott’s D_{∞}-models of the lambda-calculus. SIAM Journal on Computing, 5(3):488–521, September 1976.

[9] David B. MacQueen and Ravi Sethi. A semantic model of types for applicative languages. In Conference Record of the 1982 ACM Symposium on LISP and Functional Programming, pages 243–252, New York, 1982. ACM.

[10] David B. MacQueen, Gordon D. Plotkin, and Ravi Sethi. An ideal model for recursive polymorphic types. Information and Control, 71(1– 2):95–130, October–November 1986.

[11] Dana S. Scott. Lambda calculus: Some models, some philosophy. In Jon Barwise, H. Jerome Keisler, and Kenneth Kunen, editors, The Kleene Symposium, volume 101 of Studies in Logic and the Foundations of Mathematics, pages 223–265, Amsterdam, 1980. North-Holland.

[12] Andrej Bauer, Lars Birkedal, and Dana S. Scott. Equilogical spaces. To appear in Theoretical Computer Science, 2000.

[13] Anne Sjerp Troelstra, editor. Metamathematical Investigation of Intuitionistic Arithmetic and Analysis, volume 344 of Lecture Notes in Mathematics. Springer-Verlag, Berlin, 1973.

[14] Anne Sjerp Troelstra. Realizability. In Samuel R. Buss, editor, Handbook of Proof Theory, volume 137 of Studies in Logic and the Foundations of Mathematics, pages 407–473. Elsevier, Amsterdam, 1998.

[15] Georg Kreisel. Interpretation of analysis by means of constructive functionals of finite types. In Arend Heyting, editor, Constructivity in Mathematics, pages 101–128. North-Holland, Amsterdam, 1959.

[16] S. C. Kleene. Countable functionals. In Arend Heyting, editor, Constructivity in Mathematics, pages 81–100. North-Holland, Amsterdam, 1959.

[17] Roberto M. Amadio and Pierre-Louis Curien. Domains and Lambda-Calculi, volume 46 of Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, Cambridge, England, 1998.

[18] John C. Reynolds. An intrinsic semantics of intersection types (abstract of invited lecture). In Proceedings of the Workshop on Intersection Types and Related Systems, 2000. The slides for this lecture are available at ftp://ftp.cs.cmu.edu/user/jcr/intertype.ps.gz.

Recent BRICS Report Series Publications

RS-00-32 John C. Reynolds. The Meaning of Types — From Intrinsic to Extrinsic Semantics. December 2000. 35 pp.

RS-00-31 Bernd Grobauer and Julia L. Lawall. Partial Evaluation of Pattern Matching in Strings, revisited. November 2000. 48 pp.

RS-00-30 Ivan B. Damgård and Maciej Koprowski. Practical Threshold RSA Signatures Without a Trusted Dealer. November 2000. 14 pp.

RS-00-29 Luigi Santocanale. The Alternation Hierarchy for the Theory of μ-lattices. November 2000. 44 pp. Extended abstract appears in Abstracts from the International Summer Conference in Category Theory, CT2000, Como, Italy, July 16–22, 2000.

RS-00-28 Luigi Santocanale. Free μ-lattices. November 2000. 51 pp. Short abstract appeared in Proceedings of Category Theory 99, Coimbra, Portugal, July 19–24, 1999. Full version to appear in a special conference issue of the Journal of Pure and Applied Algebra.

RS-00-27 ZoltánÉsik and Werner Kuich. Inductive^{∗}-Semirings. October 2000. 34 pp.

RS-00-26 František Čapkovič. Modelling and Control of Discrete Event Dynamic Systems. October 2000. 58 pp.

RS-00-25 Zoltán Ésik. Continuous Additive Algebras and Injective Simulations of Synchronization Trees. September 2000. 41 pp.

RS-00-24 Claus Brabrand and Michael I. Schwartzbach. Growing Languages with Metamorphic Syntax Macros. September 2000.

RS-00-23 Luca Aceto, Anna Ingólfsdóttir, Mikkel Lykke Pedersen, and Jan Poulsen. Characteristic Formulae for Timed Automata. September 2000. 23 pp.

RS-00-22 Thomas S. Hune and Anders B. Sandholm. Using Automata in Control Synthesis — A Case Study. September 2000. 20 pp. Appears in Maibaum, editor, Fundamental Approaches to Software Engineering: First International Conference, FASE ’00 Proceedings, LNCS 1783, 2000, pages 349–362.