Advanced-Topics-in-Types-and-Programming-Languages
Advanced-Topics-in-Types-and-Programming-Languages
net/publication/248499802
CITATIONS READS
147 6,505
1 author:
Benjamin C. Pierce
University of Pennsylvania
261 PUBLICATIONS 12,932 CITATIONS
SEE PROFILE
All content following this page was uploaded by Benjamin C. Pierce on 20 August 2014.
All rights reserved. No part of this book may be reproduced in any form by
any electronic of mechanical means (including photocopying, recording, or
information storage and retrieval) without permission in writing from the
publisher.
This book was set in Lucida Bright by the editor and authors using the LATEX
document preparation system.
10 9 8 7 6 5 4 3 2 1
7 Typed Operational Reasoning
Andrew Pitts
The aim of this chapter is to explain, by example, some methods for reason-
ing about equivalence of programs based directly upon a type system and
an operational semantics for the programming language in question. We will
concentrate on methods for reasoning about equivalence of representations
of abstract data types. This provides an excellent example: it is easy to appre-
ciate why such methods are useful and at the same time non-trivial problems
have to be solved to get a sound reasoning principle in the presence of non-
termination and recursion. Rather than just treat abstract data types, we will
cover full existential types, using a programming language combining a pure
fragment of ML (including records and recursive functions) with System F.
7.1 Introduction
7.2 Overview
In order to get the most out of this chapter you should have some familiarity
with TAPL, Chapters 23 and 24. The material in this chapter is technically
quite intricate (especially the definition and properties of the logical relation
in §7.6) and it is easy to lose sight of the wood for the trees. So here is an
overview of the chapter.
In this section we motivate the use of logical relations for reasoning about
existential types by giving some examples.
To begin, let us recall the syntax for expressions involving existentially
quantified type variables from TAPL, Chapter 24. If T is a type expression and
X is a type variable, then we write {∃X,T} for the corresponding existentially
quantified type. Free occurrences of X in T become bound in this type expres-
sion. We write [X , S]T for the result of substituting a type S for all free
occurrences of X in T, renaming bound type variables as necessary to avoid
capture.1 It t is a term of type [X , S]T, then we can “pack” the type S and
the term t together to get a term
{*S,t} as {∃X,T} (7.1)
of the indicated existential type. To eliminate such terms we use the form
let {*X,x}=t1 in t2 (7.2)
This is a binding construct: free occurrences of the type variable X and the
value variable x in t2 become bound in the term. The typing of such terms
goes as follows:
if t1 has type {∃X,T} and t2 has type T2 when we assume the variable
x has type T, then provided X does not occur free in T2 , we can conclude
that the term in (7.2) has type T2 .
1. Throughout this chapter we will always identify expressions, be they types or terms, up to
renaming of bound variables.
248 7 Typed Operational Reasoning
(Such rules are better presented symbolically, but we postpone doing that
until we give a formal definition of the language we will be using, in the next
section.) The italicized restriction on free occurrences of X in T2 in the above
rule is what distinguishes an existential type from a type-indexed dependent
sum, where there is free access both to the type component as well as the
term component of a “packed” term: see Mitchell and Plotkin (1988), p. 474 et
seq, for a discussion of this point.
Since we wish to consider existential types in the context of an ML-like
language, we adopt an eager strategy for evaluating expressions like (7.1)
and (7.2). Thus to evaluate the first, one evaluates t to canonical form, v say,
and returns the canonical form {*S,v} as {∃X,T}; to evaluate the second,
one evaluates t1 to canonical form, {*S,v} as {∃X,T} say, and then evalu-
ates [X , S][x , v]t2 .
where Int is a type of integers. Values of type Counter consist of some type
together with values of the appropriate types implementing mk, inc, and get.
For example
val counter1 = {*Int, {mk = 0,
inc = λx:Int.x+1,
get = λx:Int.x } as Counter
and
val counter2 = {*Int, {mk = 0,
inc = λx:Int.x-1,
get = λx:Int.0-x } as Counter
(where we use the syntax r.f for selecting field f of record r) are both terms
of type Int which evaluate to 1. By contrast, of the terms
let {*X,x} = counter1 in x.get(x.inc(1))
let {*X,x} = counter2 in x.get(x.inc(1))
the first evaluates to 2, whereas the second evaluates to 0; but in this case
neither term is well-typed. Indeed, it is the case that any well-typed closed
term involving occurrences of the term counter1 will exhibit precisely the
same evaluation behavior if we replace those occurrences by counter2 . In
other words, counter1 and counter2 are equivalent in the following sense. 2
7.3 Motivating Examples 249
but the quantification over all possible contexts t[−] in the definition of =ctx
makes a direct proof of this and similar facts rather difficult. Thus one is
led to ask whether there are proof principles for contextual equivalence that
make proving such equivalences at existential types more tractable. Since
values {*S,v} as {∃X,T} of a given existential type {∃X,T} are specified by
pairs of data S and v, as a first stab at such a proof principle one might
try componentwise equivalence. Equivalence in the second component will of
course mean contextual equivalence; but in the first component, where the
expressions involved are types, what should equivalence mean? If we take
it to mean syntactic identity, =, (which for us includes renaming of bound
variables) we obtain the following proof principle.2
7.3.3 Principle [Extensionality for ∃-types, Version I]: For an existential type
def
E = {∃X,T}, types T1 , T2 , and values v1 , v2 , if T1 = T2 and v1 =ctx v2 :[X ,
T2 ]T, then ({*T1 ,v1 } as E) =ctx ({*T2 ,v2 } as E):{∃X,T}. 2
The hypotheses of Principle 7.3.3 are far too strong for it to be very useful.
For example, it cannot be used to prove (7.3), since in this case T1 = Int = T2 ,
but
2. This and subsequent proof principles for {∃X,T} are called extensionality principles by
analogy with the familiar extensionality principle for functions; it is a convenient terminology,
but perhaps the analogy is a little stretched.
250 7 Typed Operational Reasoning
and
{mk:Int,inc:Int→Int,get:Int→Int}
(for example, we get different integers when evaluating t[v1 ] and t[v2 ] when
t[−] is (−.inc)0). However, they do become contextually equivalent if in
the second term we use a variant of integers in which the roles of positive
and negative are reversed. Such “integers” are of course in bijection with
the usual ones and this leads us to our second version of an extensionality
principle for existential types—in which the use of syntactic identity as the
notion of type equivalence is replaced by the more flexible one of bijection.
A bijection i : T1 T2 means a closed term i : T1 →T2 for which there is
a closed term i−1 : T2 →T1 which is a two-sided inverse up to contextual
equivalence: i−1 (i x1 ) =ctx x1 : T1 and i(i−1 x2 ) =ctx x2 : T2 .
7.3.4 Principle [Extensionality for ∃-types, Version II]: For each existential
def
type E = {∃X,T}, types T1 , T2 , and values v1 , v2 , if there is a bijection
i : T1 T2 such that T(i) v1 =ctx v2 : [X , T2 ]T, then
In stating this principle we have used the notation T(i) for the “action” of
types T on bijections i: given a type T, possibly containing free occurrences
of a type variable X, one can define an induced bijection T(i) : [X , T1 ]T
[X , T2 ]T (with inverse T(i−1 )). For example, if T is the type
then T(i) is
and T(i−1 ) is
(In general, if T is a simple type then the definition of T(i) and T(i−1 ) can
be done by induction on the structure of T; for recursively defined types, the
definition of the induced bijection is not so straightforward.) 2
We can use this second version of the extensionality principle for existen-
tial types to prove the contextual equivalence in (7.3), using the bijection
def
i = (λx:Int.0-x) : Int Int.
This does indeed satisfy T(i) v1 =ctx v2 : Int when v1 , v2 , and T are de-
fined as above. (Of course these contextual equivalences, and indeed the fact
that this particular term i is a bijection, all require proof; but the methods
developed in this chapter render this straightforward.) However, the use of
bijections between types is still too restrictive for proving many common ex-
amples of contextual equivalence of abstract datatype implementations, such
as the following.
7.3.5 Example: Consider the following existentially quantified record type, where
Bool is a type of booleans.
val semaphore1 =
{*Bool, {bit = true
flip = λx:Bool.not x,
read = λx:Bool.x } as Semaphore;
val semaphore2 =
{*Int, {bit = 1,
flip = λx:Int.0-2*x,
read = λx:Int.x >= 0} as Semaphore
There is no bijection Bool Int, so one cannot use Principle 7.3.4 to prove
def
r = {(true, m) | m = (−2)n for some even n ≥ 0}
∪ {(false, m) | m = (−2)n for some odd n ≥ 0}.
• if (t1 , t2 ) ∈ r , then (s1 .read)t1 and (s2 .read)t2 evaluate to the same
boolean value.
The informal argument for the contextual equivalence (7.4) goes as follows:
“any context t[−] which is well-typed whenever its hole ‘−’ is filled with a
term of type Semaphore can only make use of a term placed in its hole by
opening it as an abstract pair {X,x} and applying the methods bit, flip,
and read in some combination; therefore the above observations about r
are enough to show that t[semaphore1 ] and t[semaphore2 ] always have the
same evaluation behavior.” 2
7.3.6 Principle [Extensionality for ∃-types, Final Version]: For each existen-
def
tial type E = {∃X,T}, types T1 , T2 , and values v1 , v2 , if there is a relation
r : T1 ↔ T2 between terms of type T1 and of type T2 , such that (v1 , v2 ) ∈ T[r ],
then ({*T1 ,v1 } as E) =ctx ({*T2 ,v2 } as E) : {∃X,T}. 2
7.3.7 Note: Principle 7.3.4 generalizes Principle 7.3.3, because if T1 = T2 , then the
def
identity function i = λx:T1 .x is a bijection T1 T2 satisfying
Syntax
In Figure 7-1, X and x respectively range over disjoint countably infinite sets
of type variables and value variables; l ranges over a countably infinite set
of field labels; c ranges over the constants true, false and n (for n ∈ Z);
Gnd is either the type of booleans Bool or the type of integers Int; and op
ranges over a fixed collection of arithmetic and boolean operations (such as
+, =, not, etc).
To simplify the definition of the language’s operational semantics we em-
ploy the now quite common device of using a syntax for terms that is in a
“reduced” (or “A-normal”) form, with all sequential evaluation expressed via
let-expressions. For example, the general form of (left-to-right, call-by-value)
function application is coded by
def
t1 t2 = let x1 =t1 in (let x2 =t2 in x1 x2 ). (7.5)
254 7 Typed Operational Reasoning
where f does not occur freely in t (and T2 is the type of t, given f has type
T1 →T2 and x has type T1 ). In what follows we shall use the abbreviations (7.5)
and (7.6) without further comment. We shall also use infix notation for appli-
cation of constant arithmetic and boolean operators such as +, =, etc.
Operational Semantics
3. That Definition uses environments assigning values to value variables. For reasons of tech-
nical convenience we eliminate the use of environments by substituting them into the term
and only considering the evaluation relation between closed terms and values.
256 7 Typed Operational Reasoning
uniquely as E[t] where the evaluation context E[−] is a context with a unique
hole (−) occurring in the place where the next step of evaluation (called a
primitive reduction in Figure 7-2), if any, will take place. With FML ’s reduced
syntax, such evaluation contexts turn out to be just nested sequences of the
let-construct
records this sequence as a list of evaluation frames, xi .ti (with free occur-
rences of xi in ti being bound in xi .ti ). Under this correspondence it can be
shown that E[t] evaluates to some value in the standard evaluation-style (or
“big-step”) structural operational semantics if and only if hS, ti ↓ holds, for
the relation h−, −i ↓ defined in Figure 7-2. Not only does the use of frame
258 7 Typed Operational Reasoning
• hS, t1 i -→ hS, t2 i, if t1 ; t2 .
Show that
Typing
We will consider the termination relation only for frame stacks and terms
that are well-typed. A term t is well-typed with respect to a particular typing
context Γ if a typing judgment
Γ `t:T (7.8)
can be derived for some type T using the rules in Figure 7-1. We identify
typing contexts Γ up to rearranging their constituent hypotheses (“X” or “x :
X”) and eliminating duplicates. Thus a typical typing context looks like
Γ = X1 , . . . , Xm , x1 : T1 , . . . , xn : Tn
where the type variables Xi and the value variables xj are all distinct (and
m = 0 or n = 0 is allowed). The typing judgments that are derivable from
the rules all have the property that the free type variables of T and each Tj
occur in the set {X1 , . . . , Xm }, and the free value variables of t occur in the set
{x1 , . . . , xn }. This is ensured by including some explicit side-conditions about
free variable occurrences in the typing rules (T-Abs) and (T-Unpack). In TAPL,
Chapters 23 and 24, such side-conditions are implicit, being subsumed by
7.4 The Language 259
7.4.4 Theorem [Unwinding]: Given any closed recursive function value F of the
form fun f(x:T1 )=u:T2 , define the followings abbreviations4 :
def
F0 = fun f(x:T1 ) = (f x) : T2
def
Fn+1 = fun f(x:T1 ) = [f , Fn ]u : T2
7.4.5 Exercise [«««, 3]: This exercise leads you through a proof of (7.10). First
prove that
holds for all S and t, by induction on the derivation of h[f , F]S, [f , F]ti ↓
from the rules. To do this, you will first need to prove by induction on n that
holds for all n, S and t; the base case n = 0 involves yet another induction,
this time over the derivation of h[f , F0 ]S, [f , F0 ]ti ↓ from the rules. 2
4. Note that in the definition of Fn+1 , the outer binding instance of f is a dummy, since f does
not occur free in [f , Fn ]u.
7.5 Contextual Equivalence 261
Reflexivity Γ , X ` v R v0 : T X ∉ ftv(Γ )
Γ `t:T Γ ` λX.v R λX.v : ∀X.T 0
Γ `tRt:T Γ ` v1 R v01 : [X , T1 ]T
Symmetry Γ ` {*T1 ,v1 } as {∃X,T} R
Γ ` t R t0 : T {*T1 ,v01 } as {∃X,T} : {∃X,T}
Γ ` t0 R t : T Γ ` v R v0 : Bool
Transitivity Γ ` t1 R t01 : T Γ ` t2 R t02 : T
Γ ` t R t0 : T Γ ` t0 R t00 : T Γ ` if v then t1 else t2 R
Γ ` t R t00 : T if v0 then t01 else t02 : T
Substitutivity op:Gnd1 ,...,Gndn →Gnd
Γ ` v R v0 : T1 Γ , x : T1 ` t R t0 : T2 (Γ ` vi R v0i : Gndi ) i∈1..n
Γ ` [x , v]t R [x , v0 ]t0 : T2 Γ ` op(vi i∈1..n
) R op(v0i i∈1..n
) : Gnd
Γ, X ` t R t : T 0 Γ ` v1 R v01 : T1 →T2 Γ ` v2 R v02 : T1
Γ ` [X , T1 ]t R [X , T1 ]t0 : [X , T1 ]T Γ ` v1 v2 R v01 v02 : T2
Compatibility Γ ` v R v0 : {li :Ti i∈1..n
}
(x:T) ∈ Γ Γ ` v.lj R v0 .l j : Tj
Γ `xRx:T 0
Γ ` v R v : ∀X.T
Γ ` c R c : Typeof (c) Γ ` v T1 R v0 T1 : [X , T1 ]T
Γ , X, x:T ` t R t0 : T1
Γ , f:T1 →T2 , x:T1 ` t R t0 : T2
X ∉ ftv(Γ , T1 ) Γ ` v R v0 : {∃X,T}
Γ ` fun f(x:T1 )=t:T2 R
Γ ` let {*X,x}=v in t R
fun f(x:T1 )=t0 :T2 : T1 →T2
let {*X,x}=v0 in t0 : T1
(Γ ` vi R v0i : Ti ) i∈1..n
Γ ` t1 R t01 : T1 Γ , x:T1 ` t2 R t02 : T2
Γ ` {li =vi i∈1..n
}R {li =v0i i∈1..n
}
Γ ` let x=t1 in t2 R let x=t01 in t02 : T2
: {li :Ti i∈1..n
}
def
(i) The identity relation is Id = {(Γ , t, t, T) | Γ ` t : T}.
def
(ii) The reciprocal of the relation R is R op = {(Γ , t0 , t, T) | Γ ` t R t0 : T}.
def
(iv) The transitive closure of the relation R is the countable union R + =
S
i∈N Ri , where R0 = R and Ri+1 = R ◦ Ri .
(v) The open extension of the relation R is denoted R ◦ and consists of all
quadruples (Γ , t, t0 , T) such that ∅ ` σ (t) R σ (t0 ) : σ (T) holds for all
Γ -closing substitutions σ . If Γ = X1 , . . . ,Xm , x1 : T1 , . . . ,xn : Tn , then a Γ -
closing substitution is given by a function [Xi , Ti | i = 1..m] mapping the
type variables Xi to closed types Ti and by a function [xj , vj | j = 1..n]
mapping the value variables xj to closed values vj of appropriate type,
namely satisfying ∅ ` vj : [Xi , Ti | i = 1..m]Tj .
(Note that R ◦ only depends on the quadruples of the form (∅, t, t0 , T) in
R.) 2
7.5.3 Theorem [FML contextual equivalence, =ctx ]: There exists a largest type-
respecting binary relation between FML terms that is a congruence and ade-
quate. We call it contextual equivalence and write it =ctx . 2
Proof: The proof makes use of the following series of facts, only the last of
which is not entirely straightforward to prove (see Exercise 7.5.4).
(iv) The set of all of compatible relations is closed under the operations
of composition and reciprocation; similarly for the set of all substitutive
relations and the set of all adequate relations.
Let =ctx be the union of the family of relations that are adequate, compatible
and substitutive. Note that this family is non-empty by (i). By (ii), =ctx is ad-
equate. So it suffices to show that it is a congruence relation. It is certainly
reflexive by (i); and (iv) implies that it is also symmetric and transitive. So it
just remains to show that it is compatible and substitutive, and this follows
from (v), whose proof needs (iii). 2
264 7 Typed Operational Reasoning
7.5.4 Exercise [««]: Prove properties (iii) and (v) stated in the above proof. 2
7.5.5 Definition [ciu-Equivalence, =ciu ]: Two closed FML terms belonging to the
same (closed) type are ciu-equivalent if they have the same termination be-
havior when they are paired with any frame stack (a “use” of the terms);
the relation is extended to open terms via closing substitutions (or “closed
instantiations”—thus we arrive at an explanation of the rather cryptic name
for this equivalence).
More formally, we define =ciu to be the type-respecting relation R ◦ (us-
ing the operation from Definition 7.5.2(v)), where R consists of quadruples
(∅, t, t0 , T) satisfying ∅ ` t : T, ∅ ` t0 : T, and ∀S. hS, ti ↓ a hS, t0 i ↓. 2
7.5.6 Lemma: For any frame stack S and term t, define a term S[t] by induction of
the length of the stack S as follows:
def
Id[t] = t
(7.14)
S ◦ (x.t0 )[t] = S[let x=t in t0 ]
def
7.5.7 Theorem [CIU Theorem for FML ]: The contextual and ciu-equivalence rela-
tions coincide. 2
Γ ` t =ctx t0 : T. (7.15)
Since =ctx satisfies the substitutivity and reflexivity properties from Figure 7-4,
it follows that
for any Γ -closing substitution σ . For any frame stack S, since =ctx satisfies
the compatibility (and reflexivity) properties from Figure 7-4, from (7.16) we
deduce that ∅ ` S[σ (t)] =ctx S[σ (t0 )] : σ (T) (using the notation of (7.14)).
Since =ctx is adequate, this means that S[σ (t)] ↓ if and only if S[σ (t0 )] ↓;
hence by Lemma 7.5.6, hS, σ (t)i ↓ if and only if hS, σ (t0 )i ↓. As this holds for
all σ and S, we have Γ ` t =ciu t0 : T, as required.
To complete the proof of the theorem we have to show conversely that
=ciu is contained in =ctx . We can deduce this as a corollary of a stronger
characterisation of =ctx in terms of logical relations (Theorem 7.6.25) that we
establish later; so we postpone the rest of this proof until then. 2
(ii) Γ ` op(ci i∈1..n ) =ctx c : Gnd, where c is the value of op(ci i∈1..n
) and
Typeof (c) = Gnd.
Proof: These are all ciu-equivalences, so we can just apply Theorem 7.5.7 (us-
ing the difficult half of the theorem whose proof we have postponed to §7.6!).
The ciu-equivalences all follow easily from the definition of the termination
relation (Figure 7-2) except for the last one, where one can apply property (7.7)
from Exercise 7.4.2 to reduce proving (viii) for =ciu to the special case when
t1 is a value: see the following exercise. 2
266 7 Typed Operational Reasoning
∅ ` t1 : T1
x1 :T1 ` t2 : T2
x2 :T2 ` t : T
7.5.10 Exercise [««]: Recall from Definition 7.5.1 the notion of an adequate type-
respecting binary relation. Let us call a type-respecting binary relation R
true-adequate if, whenever ∅ ` t R t0 : Bool holds, hId, ti -→∗ hId, truei
holds if and only if hId, t0 i -→∗ hId, truei does. Here -→∗ is the relation de-
fined in Exercise 7.4.2. One can adapt the proof of Theorem 7.5.3 to show that
there is a largest type-respecting binary relation =true
ctx between FML terms that
is a congruence and true-adequate. Show that =true ctx coincides with contex-
tual equivalence, =ctx . 2
We now have a precise definition of contextual equivalence for FML terms. Be-
fore showing that the Extensionality Principle 7.3.6 holds for existential types
in FML , we need a precise definition of the action of types on term-relations,
r , T[r ], mentioned in the principle. That is the topic of this section. We will
end up with a characterisation of =ctx in terms of a logical relation, yielding
several useful extensionality properties of contextual equivalence.
7.6.1 Notation: Let Typ denote the set of closed FML types. Given T ∈ Typ, let
• Term(T) denote the set of closed terms of type T, i.e., those terms t for
which ∅ ` t : T holds;
• Val(T) denote the subset of Term(T) whose elements are values; and
• Stack(T) denote the set of closed frame stacks whose argument type is T,
i.e., those frame stacks S for which ∅ ` S : T Ç T0 for some T0 ∈ Typ.
• VRel(T, T0 ) denote the set of all subsets of Val(T) × Val(T0 ); we call its
elements value-relations;
Note that every value-relation is also a term-relation (since values are par-
ticular sorts of term): VRel(T, T0 ) ⊆ TRel(T, T0 ). On the other hand we can
obtain a value-relation from a term-relation just by restricting attention to
values: given r ∈ TRel(T, T0 ), define r v ∈ VRel(T, T0 ) by
def
r v = {(v, v0 ) ∈ Val(T) × Val(T0 ) | (v, v0 ) ∈ r }. (7.17)
(S, S 0 ) ∈ r s if and only if for all (t, t0 ) ∈ r , hS, ti ↓ holds if and only if
hS 0 , t0 i ↓ does.
(t, t0 ) ∈ s t if and only if for all (S, S 0 ) ∈ s, hS, ti ↓ holds if and only if
hS 0 , t0 i ↓ does.
7.6.4 Note: The operator (−)s t is denoted (−)>> in Pitts (1998; 2000). 2
268 7 Typed Operational Reasoning
7.6.5 Lemma: The operations (−)s and (−)t for turning term-relations into stack-
relations and vice versa, form a Galois connection:
Proof: If s ⊆ r s , then for any (t, t0 ) ∈ r we have for all (S, S 0 ) ∈ s that
(S, S 0 ) ∈ r s , so hS, ti ↓ iff hS 0 , t0 i ↓; hence (t, t0 ) ∈ s t . Thus s ⊆ r s implies
r ⊆ s t . The converse implication holds by a similar argument. Once we have
(7.18), the other properties follow by standard arguments true of any Galois
connection, which we give in case the reader has not seen them before.
Thus for any term-relation r , since r s ⊆ r s , from (7.18) we conclude that
r ⊆ r s t ; so (−)s t is inflationary (and symmetrically, so is the operator (−)t s
on stack-relations).
Now we can deduce that (−)s and (−)t are order-reversing. For if r1 ⊆ r2 ,
then r1 ⊆ r2 ⊆ r2s t , so by (7.18), r2s ⊆ r1s . Similarly, s1 ⊆ s2 implies s2t ⊆ s1t .
Hence (−)s t is monotone (and so is (−)t s ).
Finally, for idempotence, in view of the inflationary property we just have to
show (r s t )s t ⊆ r s t . But applying (7.18) to r s t ⊆ r s t we get r s ⊆ (r s t )s ; applying
the order-reversing operator (−)t to this yields (r s t )s t ⊆ r s t , as required. 2
Proof: Note that because (−)s t is idempotent (by the above lemma), any
term-relation of the form r s t is closed. Thus valuable term-relations (ones
satisfying r = r v s t ) are in particular closed. 2
def
Admissibility Given recursive function values F = fun f(x:T1 )=u:T2 and
def
F0 = fun f(x:T1 )=u0 :T2 , let Fn and F0n (n = 0, 1, . . .) be their “unwindings,”
as in Theorem 7.4.4. If ([x , Fn ]t, [x , F0n ]t0 ) ∈ r for all n = 0, 1, . . ., then
([x , F]t, [x , F0 ]t0 ) ∈ r . 2
hS, [x , F]ti ↓
iff for some n, hS, [x , Fn ]ti ↓ (by Theorem 7.4.4)
iff for some n, hS 0 , [x , F0n ]t0 i ↓ (since (S, S 0 ) ∈ r s and
([x , Fn ]t, [x , F0n ]t0 ) ∈ r )
iff hS, [x , F0 ]t0 i ↓ (by Theorem 7.4.4 again)
7.6.11 Remark: Since it is far from straightforward, the form of Definitions 7.6.9
and 7.6.10 deserves some explanation. These definitions embody certain ex-
7.6 An Operationally Based Logical Relation 271
tensionality and parametricity properties (see §7.7 and Theorem 7.7.8) that
we wish to show hold for FML contextual equivalence: eventually we show
that the above logical relation ∆ coincides with contextual equivalence (Theo-
rem 7.6.25). To get that coincidence we have to formulate the definition of ∆
so that it satisfies the crucial property of Lemma 7.6.17 below (the so-called
fundamental property of the logical relation) and is adequate (Lemma 7.6.24).
The definition of the action of types on term-relations in Definition 7.6.9 is
carefully formulated to ensure these properties hold.
First of all, note the use of closing substitutions to reduce the logical re-
lation for open terms to that for closed ones. This builds in the “instantia-
tion” aspect of ciu-equivalence that we wish to prove of contextual equiva-
lence. (It also means that the logical relation has the “monotonicity” prop-
ertymonotonicity property of logical relations considered in Chapter 6.)
Secondly, we want T[r ] to always be a closed term-relation, because then it
has the equivalence-respecting and admissibility properties noted in Lemma
7.6.8. This accounts for the use of (−)s t in the definition. The (−)s and (−)t
operators build into the logical relation a delicate interplay between terms
and frame stacks. Of course this relies on the formulation of the operational
semantics of FML in §7-3: although more traditional “big-step” or “small-
step” operational semantics lead to the same termination relation (cf. Exer-
cise 7.4.2), the pairing between frame stacks and terms defined in Figure 7-2
is ideal for our purposes.
Lastly, the call-by-value nature of FML dictates that relational parametric-
ity properties of polymorphic types should be with respect to term-relations
that are valuable; but instead of letting r range over such relations in the
definition of (∀X.T)[r ] and {∃X,T}[r ] we have used an equivalent formula-
tion in which r ranges over all term-relations (of appropriate type), but type
variables X are interpreted using the closure of the value-restriction opera-
tor (−)v : for in fact as r ranges over all term-relations, r v s t ranges over all
valuable term-relations. 2
7.6.12 Lemma: Each of the term relations T[r ] defined in Definition 7.6.9 is valuable,
i.e., satisfies T[r ] = T[r ]v s t , and hence in particular by Corollary 7.6.6 is
closed. 2
Proof: It is immediate from the definition that each T[r ] is of the form r s t
for some value-relation r ; so just apply Exercise 7.6.7. 2
The following lemma helps with calculations involving the action on term-
relations of function types. We give its proof in detail since it typifies the kind
272 7 Typed Operational Reasoning
of reasoning needed when working with the Galois connection given by the
(−)s and (−)t operators. (For related properties for record and ∀-types, see
Exercise 7.6.14.)
Proof: To prove (7.19), first note that since (−)s t is inflationary (Lemma 7.6.5)
we have fun(r1 , (r2 )s t ) ⊆ fun(r1 , (r2 )s t )s t ; and since fun(r1 , (r2 )s t ) is a value-
relation, it follows that fun(r1 , (r2 )s t ) ⊆ fun(r1 , (r2 )s t )s t v . For the reverse
inclusion it suffices to prove
and then apply (−)v to both sides (noting that fun(r1 , (r2 )s t ), being a value-
relation, is equal to fun(r1 , (r2 )s t )v ). For (7.21) we use the following simple
property of the termination relation (Figure 7-2) with respect to application:
hS ◦ (f.f v1 ), vi ↓ a hS, v v1 i ↓
and hence
(hS, v v1 i ↓ a hS 0 , v0 v01 i ↓) a
(hS ◦ (f.f v1 ), vi ↓ a hS 0 ◦ (f.f v01 ), v0 i ↓) (7.22)
If (v, v0 ) ∈ fun(r1 , (r2 )s t ) and (v1 , v01 ) ∈ (r1 )v , then we have (v v1 , v0 v01 ) ∈
(r2s )t by definition of the fun(−, −) operation on term-relations (Figure 7-5).
So if (S, S 0 ) ∈ (r2 )s , then
hS, v v1 i ↓ a hS 0 , v0 v01 i ↓
Since this holds for all (v, v0 ) ∈ fun(r1 , (r2 )s t ), we deduce that
it follows that if
which is immediate from the definition in Figure 7-2. From this it follows that
(hS, v v1 i ↓ a hS 0 , v0 v01 i ↓) a
(hS ◦ (x.v x), v1 i ↓ a hS 0 ◦ (x.v0 x), v01 i ↓) (7.25)
If (v, v0 ) ∈ fun(r1 , (r2 )s t ) and (v1 , v01 ) ∈ (r1 )v , then by definition of fun(−, −)
we have (v v1 , v0 v01 ) ∈ (r2 )s t . So if (S, S 0 ) ∈ (r2 )s , then
hS, v v1 i ↓ a hS 0 , v0 v01 i ↓
Since this holds for all (v1 , v01 ) ∈ (r1 )v , we deduce that
So for any (S, S 0 ) ∈ (r2 )s and (v, v0 ) ∈ fun(r1 , (r2 )s t ), since (S ◦ (x.v x), S 0 ◦
(x.v0 x)) ∈ (r1 )v s , it follows for any (v1 , v01 ) ∈ ((r1 )v s t )v ⊆ ((r1 )v s )t that
we have hS ◦ (x.v x), v1 i ↓ a hS 0 ◦ (x.v0 x), v01 i ↓, and hence by (7.25) that
hS, v v1 i ↓ a hS 0 , v0 v01 i ↓. Since this holds for all (S, S 0 ) ∈ (r2 )s , it follows that
(v v1 , v0 v01 ) ∈ (r2 )s t . Hence (v, v0 ) ∈ fun((r1 )v s t , (r2 )s t ) whenever (v, v0 ) ∈
fun(r1 , (r2 )s t ), as required for (7.24). 2
274 7 Typed Operational Reasoning
7.6.14 Exercise [Recommended, «]: Show that constructions (iii) and (iv) in Defini-
tion 7.6.9 satisfy
7.6.15 Lemma: For all ground types Gnd, (Id Gnd )s t v = Id Gnd . 2
Proof: Since (−)s t is idempotent (Lemma 7.6.5), we have Id Gnd ⊆ (Id Gnd )s t ;
and since Id Gnd is a value-relation it follows that Id Gnd ⊆ (Id Gnd )s t v . To prove
the reverse inclusion, for each constant c of type Gnd consider
def
diverge = (fun f(b:Bool) = f b : Bool)true
def
Sc = Id ◦ (x. if x=c then true else diverge).
hSc , c0 i ↓ a c = c0 . (7.28)
Furthermore, since (c0 , c00 ) ∈ Id Gnd iff c0 = c00 , we have that (Sc , Sc ) ∈ (Id Gnd )s ;
so if the constants c and c0 satisfy (c, c0 ) ∈ (Id Gnd )s t , then we have hSc , ci ↓ a
hSc , c0 i ↓. So by (7.28), (c, c0 ) ∈ (Id Gnd )s t implies c = c0 ; thus (Id Gnd )s t v ⊆
Id Gnd . 2
7.6.16 Lemma: The action of types on term-relations of Definition 7.6.9 has the fol-
lowing substitution property. For any types T and T0 with ftv(T) ⊆ X, X and
ftv(T0 ) ⊆ X, it is the case that ([X , T0 ]T)[r ] = T[T0 [r ], r ]. 2
Proof: This follows by induction on the structure of the type T; for the base
case when T = X, use Lemma 7.6.12. 2
7.6.17 Lemma [Fundamental property of the logical relation]: The logical re-
lation ∆ of Definition 7.6.10 has the substitutivity and compatibility proper-
ties defined in Figure 7-4. 2
Proof: The first substitutivity property in Figure 7-4 (closure under substi-
tuting values for value variables) holds for ∆ because of the way it is de-
fined in terms of closing substitutions. The second substitutivity property
(closure under substituting types for types variables) holds for ∆ because of
Lemma 7.6.16.
7.6 An Operationally Based Logical Relation 275
Now consider the compatibility properties given in Figure 7-4. There is one
for each clause in the grammar of FML terms and values (Figure 7-1). We con-
sider each in turn, giving the details in some cases and setting the others as
exercises (with solutions).
Value variables: This case is immediate from the definition of ∆ in Defini-
tion 7.6.10.
Constants: We have to show for each constant c, with Typeof (c) = Gnd
say, that (c, c) ∈ Gnd[r ] = (Id Gnd )s t . But by definition of Id Gnd (Figure 7-5),
(c, c) ∈ Id Gnd ; and Id Gnd ⊆ (Id Gnd )s t by Lemma 7.6.5.
Recursive functions: Using property (7.19) and the fact that each T[r ] is
valuable and hence closed (Lemma 7.6.12), the compatibility property for re-
cursive functions reduces to proving the property in Exercise 7.6.18.
Record values: This case follows from the property in Exercise 7.6.19.
Type abstractions: This case follows from the property in Exercise 7.6.20.
Package values: This case follows easily from the definition of {∃r ,R(r )}
in Figure 7-5, using Lemma 7.6.16.
Conditionals: This case follows from the property in Exercise 7.6.21.
Operations: In view of Lemma 7.6.15, this compatibility property follows
once we prove (op(ci i∈1..n ), op(ci i∈1..n )) ∈ (Id Gnd )s t for any (suitably typed)
constants ci and operator op. But if the value of op(ci i∈1..n ) is the constant c
say, then for any S
i∈1..n
hS, op(ci )i ↓ a hS, ci ↓.
Hence for any (S, S 0 ) ∈ (Id Gnd0 )s (where Gnd0 = Typeof (c)), we have
i∈1..n
hS, op(ci )i ↓ a hS, ci ↓
a hS 0 , ci ↓ (since (c, c) ∈ Id Gnd0 )
0 i∈1..n
a hS , op(ci )i ↓.
(v, v0 ) ∈ fun(r1 , r2 )s t v
= fun(r1 , (r2 )s t )s t v (since r2 is closed)
st
= fun(r1 , (r2 ) ) (by (7.19))
= fun(r1 , r2 ) (since r2 is closed).
276 7 Typed Operational Reasoning
Projections: This case is similar to the previous one, but using property
(7.26) from Exercise 7.6.14 rather than (7.19).
Type applications: This case is similar to the previous one, using property
(7.27) from Exercise 7.6.14.
Unpacking: This case follows from the property in Exercise 7.6.22.
Sequencing: This case follows from the property in Exercise 7.6.23. 2
def
F = fun f(x:T1 )=t:T2 ∈ Val(T1 →T2 )
def
F0 = fun f(x:T01 )=t0 :T02 ∈ Val(T01 →T02 )
r1 ∈ TRel(T1 , T01 )
r2 ∈ TRel(T2 , T02 )
7.6.19 Exercise [««]: Suppose for i ∈ 1..n that vi ∈ Val(Ti ), v0i ∈ Val(T0i ) and ri ∈
TRel(Ti , T0i ) with ri = (ri )s t . Putting
show that if (vi , v0i ) ∈ ri for i ∈ 1..n, then (v, v0 ) is in the value-relation
{li =ri i∈1..n } defined in Figure 7-5. 2
7.6.20 Exercise [««]: Let T and T0 be types with at most X free. For each T1 , T01 ∈ Typ
and r ∈ TRel(T1 , T01 ) suppose we are given a closed term-relation R(r ) in
TRel([X , T1 ]T, [X , T01 ]T0 )) (i.e., R(r ) = R(r )s t ). Show that if the values v
and v0 satisfy
X`v:T
X ` v0 : T0
∀T1 , T01 ∈ Typ, r ∈ TRel(T1 , T01 ). ([X , T1 ]v, [X , T01 ]v0 ) ∈ R(r )
7.6.21 Exercise [««]: Suppose (v, v0 ) ∈ (Id Bool )s t and (t1 , t01 ), (t2 , t02 ) ∈ r , where
r ∈ TRel(T, T0 ) is closed (i.e., r = (r )s t ). Show that
is in r . 2
7.6.22 Exercise [««]: Let T and T0 be types with at most X free. For each T1 , T01 ∈ Typ
and r1 ∈ TRel(T1 , T01 ) suppose we are given a closed term-relation R(r1 ) =
R(r1 )s t in TRel([X , T1 ]T, [X , T01 ]T0 )). Suppose we are also given a closed
term-relation r2 = (r2 )s t ∈ TRel(T2 , T02 ) for some closed types T2 , T02 ∈ Typ.
Show that if the terms t, t0 satisfy
X, x : T ` t : T2
X, x : T0 ` t0 : T02
∀T1 , T01 ∈ Typ, r1 ∈ TRel(T1 , T01 ), (v1 , v01 ) ∈ (r1 )v .
([X , T1 ][x , v1 ]t, [X , T1 ][x , v1 ]t) ∈ r2
then whenever (v, v0 ) ∈ {∃r1 ,R(r1 )}s t v , it is also the case that
is in r2 . 2
7.6.23 Exercise [««]: Suppose we are given r1 ∈ TRel(T1 , T01 ), r2 ∈ TRel(T2 , T02 ) with
r1 valuable (i.e., r1 = (r1 )v s t ) and r2 closed (i.e., r2 = (r2 )s t ). Show that if the
terms t2 , t02 satisfy
x : T1 ` t2 : T2
x : T01 ` t02 : T02
∀(v1 , v01 ) ∈ (r1 )v . ([x , v1 ]t2 , [x , v01 ]t02 ) ∈ r2
is in r2 . 2
Unraveling Definition 7.6.10, the assumption that the closed terms t and t0
of closed type T are ∆-related means that (t, t0 ) ∈ T[], the latter being the
action of the type T on the empty list of term-relations. By Lemma 7.6.12, T[]
is valuable; so (t, t0 ) ∈ T[]v s t . Hence to prove (7.30), it suffices to show that
(Id, Id) ∈ (T[]v )s ; but for any (v, v0 ) ∈ T[]v ,
We are finally able to put all the pieces together and prove the main result
of this section. At the same time we complete the proof of Theorem 7.5.7.
7.6.25 Theorem [=ctx equals ∆ equals =ciu ]: FML contextual equivalence, =ctx , (as
defined in Theorem 7.5.3) coincides with the logical relation ∆ of Defini-
tion 7.6.10 and with ciu-equivalence, =ciu (Definition 7.5.5): Γ ` t =ctx t0 : T
holds if and only if Γ ` t ∆ t0 : T does, if and only if Γ ` t =ciu t0 : T does. 2
(1) This is the half of Theorem 7.5.7 that we have already proved in §7.5.
(2) We have not yet shown that ∆ is an equivalence relation; and in fact we
will only deduce this once we have shown that it coincides with =ctx and
=ciu (which are easily seen to be equivalence relations). However, we have
shown that ∆ is compatible, substitutive and adequate (Lemmas 7.6.17 and
7.6.24). In the proof of Theorem 7.5.3 we constructed =ctx as the union of
all such type-respecting relations, without regard to whether they were
also equivalence relations; therefore ∆ is contained in =ctx .
(3) Noting how =ciu and ∆ are defined on open terms via substitutions, we
can combine the first part of Lemma 7.6.8 with Lemma 7.6.12 to give
5. Packages: For any closed existential type {∃X,T}, closed types T1 , T2 , and
values ∅ ` vi : [X , Ti ]T (i = 1, 2),
Proof:
1. The property for constants follows from Lemma 7.6.15 combined with
Theorem 7.6.25.
and similarly for v0 v01 . Therefore we just need to show: if ∅ ` v1 =ctx v01 :
T1 , then ∅ ` [f , v][x , v1 ]t =ctx [f , v0 ][x , v01 ]t0 : T2 . But this
follows from the assumption (7.32) using the reflexivity and substitutivity
properties of =ctx . So we have established one half (the difficult half) of
the property in 2. For the converse, if ∅ ` v =ctx v0 : T1 →T2 , then for any
∅ ` v1 : T1 , the compatibility properties of =ctx give ∅ ` v v1 =ctx v0 v1 :
T2 ; and then as before, we can compose with (7.33) to get (7.32).
Note that since ∆ coincides with =ctx (Theorem 7.6.25) it is reflexive and
hence X ` v ∆ v : T holds. According to Definition 7.6.10 this means
that for all T1 , T01 ∈ Typ and r ∈ TRel(T1 , T01 ), ([X , T1 ]v, [X , T01 ]v) ∈
T[r ]. Since T[r ] is closed (Lemma 7.6.12), we can combine (7.34) with the
first part of Lemma 7.6.8 (using =ctx in place of =ciu by virtue of Theo-
rem 7.6.25) to conclude that ([X , T1 ]v, [X , T01 ]v0 ) ∈ T[r ] for all r . Then
using the equivalence in Corollary 7.5.8(v), we have
and hence (λX.v, λX.v0 ) is in λr .T[r ]. Since λr .T[r ] ⊆ (λr .T[r ])s t and
the latter is equal to (∀X.T)[] by definition, we have ∅ ` λX.v ∆ λX.v0 :
∀X.T, and hence by Theorem 7.6.25, ∅ ` λX.v =ctx λX.v0 : ∀X.T. So
we have established one half (the difficult half) of the property in 4. The
argument for the other half is similar to that for property 2, using Corol-
lary 7.5.8(v) and the congruence properties of =ctx .
7.7 Operational Extensionality 281
7.7.2 Exercise [««, 3]: Use Theorem 7.6.25, Corollary 7.5.8 and the definition of
the term-relation {li =ri i∈1..n } in Definition 7.6.9 to deduce extensionality prop-
erty 3 of Theorem 7.7.1. 2
7.7.3 Example: Recall the type Semaphore and its values semaphore1 , semaphore2
from Example 7.3.5. To show ∅ ` semaphore1 =ctx semaphore2 : Semaphore
using Theorem 7.7.1(5), it suffices to show that (v1 , v2 ) ∈ T[r ] where
def
T = {bit:X, flip:X→X, read:X→Bool}
def
v1 = {bit=true, flip=λx:Bool.not x, read=λx:Int.x}
def
v2 = {bit=1, flip=λx:Int.0-2*x, read=λx:Int.x >= 0}
def
r = {(true, m) | m = (−2)n for some even n ≥ 0} ∪
{(false, m) | m = (−2)n for some odd n ≥ 0}.
(true, 1) ∈ r
(λx:Bool.not x, λx:Int.0-2*x) ∈ fun(r , r s t )
(λx:Int.x, λx:Int.x >= 0) ∈ fun(r , Id sBool
t
).
282 7 Typed Operational Reasoning
These follow from the definition of r —the first trivially and the second two
once we combine the definition of fun(−, −) with the fact (Lemma 7.6.8)
that closed relations such as r s t and Id sBoolt
respect ciu-equivalence. For ex-
ample, if (v1 , v1 ) ∈ r , then (λx:Bool.not x)v1 and (λx:Int.0-2*x)v01 are
0
ciu-equivalent to r -related values v2 and v02 ; then since (v2 , v02 ) ∈ r ⊆ r s t and
the latter is closed, we have ((λx:Bool.not x)v1 , (λx:Int.0-2*x)v01 ) ∈ r s t .
As this holds for all (v1 , v01 ) ∈ r , we have (λx:Bool.not x, λx:Int.0-2*x) in
fun(r , r s t ). 2
def
P = (X→Bool)→Bool
def
Q = {∃X,P}
def
N = ∀X.X
def
diverge = (fun f(b:Bool) = f b : Bool)true
def
G = fun g(f:N→Bool) = diverge : Bool
def
G0 = fun g(f:Bool→Bool) =
(if f true then
if f false then diverge else true
else diverge) : Bool.
Proof: For (i) note that the definition of N implies that Val(N) = ∅, i.e., there
are no closed values of type N (Exercise 7.7.6). So any r ∈ TRel(N, Bool) satis-
fies r v = ∅. Now
def
P[r ]v = ((X→Bool)→Bool)[r ]v
def
= fun((X→Bool)[r ], Id sBool
t
)s t v
= fun((X→Bool)[r ], Id sBool
t
) using (7.19)
def
= fun(fun(r v s t , Id sBool
t
)s t , Id sBool
t
)
= fun(fun(r v s t , Id sBool
t
)s t v , Id sBool
t
) by definition of fun(−, −)
= fun(fun(r v s t , Id sBool
t
), Id sBool
t
) using (7.19)
= fun(fun(r , Id sBool
t
), Id sBool
t
) using (7.20)
= fun(fun(r v
, Id sBool
t
), Id sBool
t
) by definition of fun(−, −).
However, ∅ ` G v1 =ctx G0 v01 : Bool does not hold if we take v1 and v01 to be
the values
def
v1 = fun f(x:N) = diverge : Bool
def
v01 = fun f(x:Bool) = x : Bool
7.7.5 Lemma: For any value v satisfying X, g:P ` v : X→Bool, evaluation of G0 ([X ,
Bool][g , G0 ]v) does not terminate. 2
Proof: To prove this we can use the logical relation from the previous sec-
tion. Consider the following value-relation in VRel(Bool, Bool):
def
r = {(true, true), (false, false), (true, false)}.
Note that
def
(X→Bool)[r ]v = fun(rv s t , Id sBool
t
)s t v
(7.20) (7.19)
= fun(r, Id sBool
t
)s t v = fun(r , Id sBool
t
) (7.35)
and hence
def
P[r ]v = fun((X→Bool)[r ], Id sBool
t
)s t v = fun((X→Bool)[r ]v , Id sBool
t
)s t v
(7.35) (7.19)
= fun(fun(r , Id sBool
t
), Id sBool
t
)s t v = fun(fun(r , Id sBool
t
), Id sBool
t
). (7.36)
7.7.6 Exercise [«, 3]: By considering the possible typing derivations from the rules
in Figure 7-1, show that there is no value v satisfying ∅ ` v : ∀X.X. (Note
that the syntactic restriction on values of universally quantified type men-
tioned in Remark 7.4.1 plays a crucial role here.) 2
7.7.7 Remark [The role of non-termination]: Example 7.7.4 shows that the log-
ical relation presented here is incomplete for proving contextual equivalence
of FML values of existential type. The example makes use of the fact that, be-
cause of the presence of recursive function values, evaluation of FML terms
need not terminate. However, it seems that the source of the incompleteness
has more to do with the existence of types with no values (such as ∀X.X) than
with non-termination. Eijiro Sumii (private communication) has suggested the
286 7 Typed Operational Reasoning
def
P = (X→Bool)→Bool
def
Q = {∃X,P}
def
N = ∀X.X
def
H = λf:N→Bool. false
def
H0 = λf:Bool→Bool.
(if f true then
if f false then false else true
else false) : Bool.
Proof: By Theorem 7.6.25, we have that ∅ ` λX.v =ctx λX.v0 : ∀X.T iff
∅ ` λX.v ∆ λX.v0 : ∀X.T, i.e., iff (λX.v, λX.v0 ) ∈ (∀X.T)[] = (λr .T[r ])s t .
Since λX.v and λX.v0 are values, the latter is the case iff (λX.v, λX.v0 ) ∈
(λr .T[r ])s t v , and by Lemma 7.6.12 and Exercise 7.6.14 (λr .T[r ])s t v = λr .T[r ].
Hence ∅ ` λX.v =ctx λX.v0 : ∀X.T iff (λX.v, λX.v0 ) ∈ λr .T[r ]. By definition
(Figure 7-5), this is the case iff for all for all closed types T1 , T01 ∈ Typ and
all term-relations r ∈ TRel(T1 , T01 ), ((λX.v)T1 , (λX.v0 )T01 ) ∈ T[r ]; and the
7.7 Operational Extensionality 287
latter holds iff ([X , T1 ]v, [X , T01 ]v0 ) ∈ T[r ], because (λX.v)T1 =ciu [X ,
T1 ]v and (λX.v0 )T01 =ciu [X , T01 ]v0 (so that we can use Lemmas 7.6.8 and
7.6.12). 2
The force of Theorem 7.7.1(4) is to give a method for establishing that two
type abstraction values are contextually equivalent. By contrast, the force of
Theorem 7.7.8 is to give us useful properties of families of values parameter-
ized by type variables. Given such a value, X ` v : T, since =ctx is reflexive,
we have ∅ ` λX.v =ctx λX.v : ∀X.T; hence the theorem has the following
corollary.
7.7.9 Corollary: Given a value X ` v : T, for all T1 , T01 ∈ Typ and all r ∈
TRel(T1 , T01 ), it is the case that ([X , T1 ]v, [X , T01 ]v) ∈ T[r ]. 2
{∃X,T} ∀Y.(∀X.T→Y)→Y
holds in the polymorphic version of PCF (Plotkin, 1977) studied in that pa-
per (where is “bijection up to contextual equivalence”—see Principle 7.3.4).
However this bijection does not hold in general for FML (Exercise 7.7.10).
def
7.7.10 Exercise [«««]: Consider the type N = ∀X.X from Example 7.7.4 that you
showed has no closed values in Exercise 7.7.6. Show that there cannot exist
values
i ∈ Val({∃X,N}→∀Y.(∀X.N→Y)→Y)
j ∈ Val((∀Y.(∀X.N→Y)→Y)→{∃X,N})
7.7.11 Exercise [«««, 3]: Verify the claim made in Note 7.3.7 that Principle 7.3.4 is
a special case of Principle 7.3.6. To do so, you will first have to give a defini-
tion of the action of FML types on bijections mentioned in Principle 7.3.4. 2
288 7 Typed Operational Reasoning
7.8 Notes
This chapter is a revised and expanded version of Pitts (1998) and also draws
on material from Pitts (2000).
In discussing typed operational reasoning we have focused on reasoning
about contextual equivalence of program phrases. Being by construction a
congruence, contextual equivalence permits us to use the usual forms of
equational reasoning (replacing equals by equals) when deriving equivalences
between phrases. However, its definition does not lend itself to establish-
ing the basic laws that are needed to get such reasoning going. We studied
two characterisations of contextual equivalence in order to get round this
problem: ciu-equivalence (Definition 7.5.5) and a certain kind of operationally
based logical relation (Definition 7.6.10).
contextual equivalence!vs. bisimilarity The informal notion of contextual
equivalence (Definition 7.3.2) has been studied for a wide variety of pro-
gramming languages. If the language’s operational semantics involves non-
determinism—usually because the language supports some form of concur-
rent or interactive computation—then contextual equivalence tends to iden-
tify too many programs and various co-inductive notions of bisimilarity are
used instead (see the textbook by Sangiorgi and David, 2001, for example).
But even if we remain within the realm of languages with deterministic oper-
ational semantics, one may ask to what extent the results of this chapter are
stable with respect to adding further features such as recursive datatypes,
mutable state, and object-oriented features à la Objective Caml.
Ciu-equivalence has the advantage of being quite robust in this respect—
it can provide a characterisation of contextual equivalence in the presence
of such features (Honsell, Mason, Smith, and Talcott, 1995; Talcott, 1998).
However, its usefulness is mainly limited to establishing basic laws such as
the conversions in Corollary 7.5.8; it cannot be used directly to establish ex-
tensionality properties such as those in Theorem 7.7.1 without resorting to
tedious “termination inductions” of the kind we sketched in the proof of Ex-
ample 7.7.4. Ciu-equivalence is quite closely related to some notions of “ap-
plicative bisimilarity” that have been applied to functional and object-based
languages (Gordon, 1995, 1998), in that their congruence properties can both
be established using a clever technique due to Howe (1996). The advantage of
applicative bisimilarity is that it has extensionality built into its definition; so
when it does coincide with contextual equivalence, this provides a method of
establishing some extensionality properties for =ctx (such as (1)–(4) in Theo-
rem 7.7.1, but not, as far as I know, property (5) for package values).
The kind of operationally based logical relation we developed in this chap-
ter provides a very powerful analysis of contextual equivalence. We used it
7.8 Notes 289
to prove not only conversions and simple extensionality principles for FML ,
but also quite subtle properties of =ctx such as Theorems 7.7.1(5) and 7.7.8.
Similar logical relations can be used to prove some properties of ML-style
references and of linear types: see Pitts and Stark (1998), Bierman, Pitts, and
Russo (2000), and Pitts (2002). Unfortunately, the characteristic feature of
logical relations—that functions are related iff they map related arguments
to related results—makes it difficult to define them in the presence of “recur-
sive features.” I mean by the latter programming language features which in a
denotational semantics lead one to have to solve domain equations in which
the defined domain occurs both positively (to the left of an even number
of function space constructions) and negatively (to the left of an odd num-
ber of function space constructions). Recursive datatypes involving function
types can lead to such domain equations; as does the use of references to
functions in ML. Suitable logical relations can be defined in the denotational
semantics of languages with such features using techniques such as those in
Pitts (1996), but they tell us properties of denotational equality, which is of-
ten a poor (if safe) approximation to contextual equivalence. For this reason
people have tried to develop syntactical analogs of these denotational logi-
cal relations: see Birkedal and Harper (1999). The unwinding theorem (Theo-
rem 7.4.4) provides the basis for such an approach. However, it seems like a
fresh idea is needed to make further progress. Therefore I set a last exercise,
whose solution is not included.
7.8.1 Exercise [««««. . . , 3]: Extend FML with isorecursive types, µX.T, as in Figure
20-1 of TAPL, Chapter 20. By finding an operationally based logical relation as
in §7.6 or otherwise, try to prove the kind of properties of contextual equiv-
alence for this extended language that we developed for FML in this chapter.
(For the special case of iso-recursive types µX.T for which T contains no neg-
ative occurrences of X, albeit for a non-strict functional language, see Johann
(2002). The generalized ideal model of recursive polymorphic in Vouillon and
Melliès (2004) uses the same kind of Galois connection as we used in §7.6 and
may well shed light on this exercise. Recent work by Sumii and Pierce [2005]
is also relevant.) 2
A Solutions to Selected Exercises 509
come equipped with their own notion of logical equivalence that can be de-
fined independently (i.e., without reference to the general definition of logical
equivalence). Thus, the definition of logical equivalence may refer to arbitrary
candidates and remain well-founded.
by considering the different cases for -→. Deduce the ‘if’ part of (7.7) from
this. For the ‘only if’ part, show that
∗
{(S, t) | (∃S1 , S2 , v) S = S1 @S2 & hS2 , ti -→ hId, vi & hS1 , vi ↓}
is closed under the axiom and rules in Figure 7-2 inductively defining the
termination relation.
Γ ` v1 R v01 : T1 →T2 Γ ` v2 : T1
(A.1)
Γ ` v1 v2 R v01 v2 : T2
and
Γ ` v1 : T1 →T2 Γ ` v2 R v02 : T1
. (A.2)
Γ ` v1 v2 R v1 v02 : T2
From (A.3) and the fact that =ctx is a congruence (so that ∅ ` b =ctx b0 : Bool
implies ∅ ` S[b] =ctx S[b0 ] : Bool) it follows that =ctx is true-adequate;
hence it is contained in =true true
ctx . Similarly, (A.4) and the fact that =ctx is a
congruence implies that it is adequate and hence contained in =ctx .
7.6.7 Solution: Since (−)s t is inflationary we have r ⊆ r s t ; and since r only relates
values, this implies r ⊆ r s t v . Then since (−)s t is monotone, we have r s t ⊆
r s t v s t . Conversely, since (r 0 )v ⊆ r 0 for any r 0 , we have r s t v ⊆ r s t ; and then
since (−)s t is monotone and idempotent, r s t v s t ⊆ r s t s t = r s t .
7.6.14 Hint: The proof of (7.26) is just like the proof of (7.21), using the following
property of the termination relation:
where Fn and F0n are the unwindings associated with F and F0 respectively, as
in Theorem 7.4.4. For if (A.5) holds, then using the fact that (−)s t is inflation-
ary
Induction step: Suppose (Fn , F0n ) ∈ fun(r1 , r2 ). Then for any (v1 , v01 ) ∈ (r1 )v ,
from (7.29) we have
7.6.19 Solution: To show (v, v0 ) ∈ {li =ri i∈1..n } we must show (v.li , v0 .li ) ∈ ri for
each i ∈ 1..n. Since each ri is closed, this is equivalent to showing (v.li , v0 .li ) ∈
(ri )s t , i.e. that hS, v.li i ↓ a hS 0 , v0 .li i ↓ holds for all (S, S 0 ) in (ri )s . But by
definition of v, hS, v.li i ↓ a hS, vi i ↓; and similarly for v0 . So it suffices to
show hS, vi i ↓ a hS 0 , v0i i; and this holds because by assumption (vi , v0i ) ∈ ri
and (S, S 0 ) ∈ (ri )s .
7.6.20 Solution: To show (λX.v, λX.v0 ) ∈ λr .R(r ) we have to show for each T1 , T01 ∈
Typ and r ∈ TRel(T1 , T01 ) that ((λX.v)T, (λX.v0 )T0 ) ∈ R(r ) . Since each
R(r ) is closed, this is equivalent to showing ((λX.v)T, (λX.v0 )T0 ) ∈ R(r )s t ,
i.e. that hS, (λX.v)Ti ↓ a hS 0 , (λX.v0 )T0 i ↓ holds for all (S, S 0 ) ∈ R(r )s . But
hS, (λX.v)Ti ↓ a hS, [X , T1 ]vi ↓; and similarly for v0 . So it suffices to show
hS, [X , T1 ]vi ↓ a hS, [X , T01 ]v0 i ↓; and this holds because by assumption
([X , T1 ]v, [X , T1 ]v) ∈ R(r ) and (S, S 0 ) ∈ R(r )s .
7.6.21 Hint: To show (if v then t1 else t2 , if v0 then t01 else t02 ) ∈ r = (r )s t it
suffices to show for all (S, S 0 ) ∈ (r )s that
or equivalently that
(S ◦ (x.if x then t1 else t2 ), S 0 ◦ (x.if x then t01 else t02 ) ∈ (Id Bool )s .
512 A Solutions to Selected Exercises
7.6.22 Solution: For any (S, S 0 ) ∈ (r2 )s it follows from the assumptions on t, t0 and
the definition of {∃r1 ,R(r1 )} (Figure 7-5) that
is in {∃r1 ,R(r1 )}s . Hence if (v, v0 ) ∈ {∃r1 ,R(r1 )}s t v ⊆ ({∃r1 ,R(r1 )}s )t , then
7.6.23 Solution: For any (S, S 0 ) ∈ (r2 )s it follows from the assumptions on t, t0
that (S ◦ (x.t2 ), S 0 ◦ (x.t02 )) ∈ (r1 )v s . Since ((r1 )v s )t = r1 , if (t1 , t01 ) ∈ r1 then
we get hS ◦ (x.t2 ), t1 i ↓ a hS 0 ◦ (x.t02 ), t01 i ↓, and hence that
7.7.10 Solution: Since N has no closed values, neither does {∃X,N}. On the other
hand
8.2.1 Solution: As of this writing, the question of how far nominal module sys-
tems can be pushed is wide open. A step in this direction was recently taken
by Odersky, Cremet, Rockl, and Zenger (2003).
module m1 = mod {
type X = Int
val c = 0
val f = succ
}
References
Abadi, Martín, Luca Cardelli, Pierre-Louis Curien, and Jean-Jacques Lévy. Explicit sub-
stitutions. Journal of Functional Programming, 1(4):375–416, 1991. Summary in
ACM Symposium on Principles of Programming Languages (POPL), San Francisco,
California, 1990.
Adams, Rolf, Walter Tichy, and Annette Weinert. The cost of selective recompila-
tion and environment processing. ACM Transactions on Software Engineering and
Methodology, 3(1):3–28, January 1994.
Ahmed, Amal, Limin Jia, and David Walker. Reasoning about hierarchical storage.
In IEEE Symposium on Logic in Computer Science (LICS), Ottawa, Canada, pages
33–44, June 2003.
Ahmed, Amal and David Walker. The logical approach to stack typing. In ACM SIG-
PLAN Workshop on Types in Language Design and Implementation (TLDI), New
Orleans, Louisiana, pages 74–85, January 2003.
Aho, Alfred V., Ravi Sethi, and Jeffrey D. Ullman. Compilers: Principles, Techniques,
and Tools. Addison-Wesley, Reading, Massachusetts, 1986.
Aiken, Alexander, Manuel Fähndrich, and Raph Levien. Better static memory man-
agement: Improving region-based analysis of higher-order languages. In ACM SIG-
PLAN Conference on Programming Language Design and Implementation (PLDI),
La Jolla, California, pages 174–185, June 1995.
Aiken, Alexander, Jeffrey S. Foster, John Kodumal, and Tachio Terauchi. Checking
and inferring local non-aliasing. In ACM SIGPLAN Conference on Programming
Language Design and Implementation (PLDI), San Diego, California, pages 129–140,
June 2003.
Aiken, Alexander and Edward L. Wimmers. Type inclusion constraints and type infer-
ence. In ACM Symposium on Functional Programming Languages and Computer
Architecture (FPCA), Copenhagen, Denmark, pages 31–41, June 1993.
Altenkirch, Thorsten. Constructions, Inductive Types and Strong Normalization. PhD
thesis, Laboratory for Foundations of Computer Science, University of Edinburgh,
Edinburgh, Scotland, 1993.
Amadio, Roberto M. and Luca Cardelli. Subtyping recursive types. ACM Transac-
tions on Programming Languages and Systems, 15(4):575–631, 1993. Summary
in ACM Symposium on Principles of Programming Languages (POPL), Orlando,
Florida, pp. 104–118; also DEC/Compaq Systems Research Center Research Report
number 62, August 1990.
Amtoft, Torben, Flemming Nielson, and Hanne Riis Nielson. Type and Effect Systems:
Behaviours for Concurrency. Imperial College Press, 1999.
Ancona, Davide and Elena Zucca. A theory of mixin modules: Basic and derived op-
erators. Mathematical Structures in Computer Science, 8(4):401–446, August 1998.
Ancona, Davide and Elena Zucca. A calculus of module systems. Journal of Functional
Programming, 12(2):91–132, March 2002.
Appel, Andrew W. Foundational proof-carrying code. In IEEE Symposium on Logic in
Computer Science (LICS), Boston, Massachusetts, pages 247–258, June 2001.
Appel, Andrew W. and Amy P. Felty. A semantic model of types and machine instruc-
tions for proof-carrying code. In ACM SIGPLAN–SIGACT Symposium on Principles
of Programming Languages (POPL), Boston, Massachusetts, pages 243–253, January
2000.
Aspinall, David. Subtyping with singleton types. In International Workshop on Com-
puter Science Logic (CSL), Kazimierz, Poland, volume 933 of Lecture Notes in Com-
puter Science, pages 1–15. Springer-Verlag, September 1994.
Aspinall, David and Martin Hofmann. Another type system for in-place update. In
European Symposium on Programming (ESOP), Grenoble, France, volume 2305 of
Lecture Notes in Computer Science, pages 36–52. Springer-Verlag, April 2002.
Augustsson, Lennart. Cayenne—A language with dependent types. In ACM SIGPLAN
International Conference on Functional Programming (ICFP), Baltimore, Maryland,
pages 239–250, 1998.
Baader, Franz and Jörg Siekmann. Unification theory. In D. M. Gabbay, C. J. Hogger,
and J. A. Robinson, editors, Handbook of Logic in Artificial Intelligence and Logic
Programming, volume 2, Deduction Methodologies, pages 41–125. Oxford Univer-
sity Press, 1994.
Baker, Henry G. Lively linear Lisp—look ma, no garbage! ACM SIGPLAN Notices, 27
(8):89–98, 1992.
Barendregt, Henk P. The Lambda Calculus. North Holland, revised edition, 1984.
Barendregt, Henk P. Introduction to generalized type systems. Journal of Functional
Programming, 1(2):125–154, 1991.
References 537
Birkedal, Lars, Mads Tofte, and Magnus Vejlstrup. From region inference to von Neu-
mann machines via region representation inference. In ACM SIGPLAN–SIGACT
Symposium on Principles of Programming Languages (POPL), St. Petersburg Beach,
Florida, pages 171–183, 1996.
Blume, Matthias. The SML/NJ Compilation and Library Manager, May 2002. Available
from http://www.smlnj.org/doc/CM/index.html.
Bracha, Gilad and William R. Cook. Mixin-based inheritance. In ACM SIGPLAN Confer-
ence on Object Oriented Programming: Systems, Languages, and Applications (OOP-
SLA)/European Conference on Object-Oriented Programming (ECOOP), Ottawa, On-
tario, pages 303–311, October 1990.
Breazu-Tannen, Val, Thierry Coquand, Carl Gunter, and Andre Scedrov. Inheritance
as implicit coercion. Information and Computation, 93(1):172–221, July 1991. Also
in C. A. Gunter and J. C. Mitchell, editors, Theoretical Aspects of Object-Oriented
Programming: Types, Semantics, and Language Design, MIT Press, 1994.
Bruce, Kim B., Luca Cardelli, Giuseppe Castagna, the Hopkins Objects Group
(Jonathan Eifrig, Scott Smith, Valery Trifonov), Gary T. Leavens, and Benjamin
Pierce. On binary methods. Theory and Practice of Object Systems, 1(3):221–242,
1996.
Bruce, Kim B., Luca Cardelli, and Benjamin C. Pierce. Comparing object encodings.
In International Symposium on Theoretical Aspects of Computer Software (TACS),
September 1997. An earlier version was presented as an invited lecture at the Third
International Workshop on Foundations of Object Oriented Languages (FOOL 3),
July 1996; full version in Information and Computation, 155(1–2):108-133, 1999.
References 539
Damas, Luis and Robin Milner. Principal type schemes for functional programs. In
ACM Symposium on Principles of Programming Languages (POPL), Albuquerque,
New Mexico, pages 207–212, 1982.
Danvy, Olivier. Functional unparsing. Journal of Functional Programming, 8(6):621–
625, 1998.
DeLine, Rob and Manuel Fähndrich. Enforcing high-level protocols in low-level soft-
ware. In ACM SIGPLAN Conference on Programming Language Design and Imple-
mentation (PLDI), Snowbird, Utah, pages 59–69, June 2001.
Donahue, James and Alan Demers. Data types are values. ACM Transactions on
Programming Languages and Systems, 7(3):426–445, July 1985.
Došen, Kosta. A historical introduction to substructural logics. In K. Došen and
P. Schroeder-Heister, editors, Substructural Logics, pages 1–30. Oxford University
Press, 1993.
Dreyer, Derek, Karl Crary, and Robert Harper. A type system for higher-order mod-
ules. In ACM SIGPLAN–SIGACT Symposium on Principles of Programming Lan-
guages (POPL), New Orleans, Louisiana, pages 236–249, New Orleans, January
2003.
Dussart, Dirk, Fritz Henglein, and Christian Mossin. Polymorphic recursion and sub-
type qualifications: Polymorphic binding-time analysis in polynomial time. In Inter-
national Symposium on Static Analysis (SAS) , Paris, France, volume 983 of Lecture
Notes in Computer Science, pages 118–135. Springer-Verlag, July 1995.
Emms, Martin and Hans LeiSS. Extending the type checker for SML by polymor-
phic recursion—A correctness proof. Technical Report 96-101, Centrum für
Informations- und Sprachverarbeitung, Universität München, 1996.
Erhard, Thomas. A categorical semantics of constructions. In IEEE Symposium on
Logic in Computer Science (LICS), Edinburgh, Scotland, pages 264–273, July 1988.
Fähndrich, Manuel. Bane: A Library for Scalable Constraint-Based Program Analysis.
PhD thesis, University of California at Berkeley, Berkeley, California, 1999.
Fähndrich, Manuel and Rob DeLine. Adoption and focus: Practical linear types for
imperative programming. In ACM SIGPLAN Conference on Programming Language
Design and Implementation (PLDI), Berlin, Germany, pages 13–24, June 2002.
Fähndrich, Manuel, Jakob Rehof, and Manuvir Das. Scalable context-sensitive flow
analysis using instantiation constraints. In ACM SIGPLAN Conference on Program-
ming Language Design and Implementation (PLDI), Vancouver, British Columbia,
Canada, pages 253–263, June 2000.
Felleisen, Matthias and Robert Hieb. A revised report on the syntactic theories of
sequential control and state. Theoretical Computer Science, 103(2):235–271, 1992.
Fisher, Kathleen and John H. Reppy. The design of a class mechanism for Moby. In
ACM SIGPLAN Conference on Programming Language Design and Implementation
(PLDI), Atlanta, Georgia, pages 37–49, May 1999.
References 543
Flanagan, Cormac and Shaz Qadeer. A type and effect system for atomicity. In
ACM SIGPLAN Conference on Programming Language Design and Implementation
(PLDI), San Diego, California, pages 338–349, June 2003.
Flatt, Matthew and Matthias Felleisen. Units: Cool modules for HOT languages. In
ACM SIGPLAN Conference on Programming Language Design and Implementation
(PLDI), Montréal, Québec, pages 236–248, 1998.
Fluet, Matthew. Monadic regions. In Workshop on Semantics, Program Analysis and
Computing Environments for Memory Management (SPACE), informal proceedings,
January 2004.
Fluet, Matthew and Riccardo Pucella. Phantom types and subtyping. In IFIP Interna-
tional Conference on Theoretical Computer Science (TCS), pages 448–460, August
2002.
Foster, Jeffrey S., Tachio Terauchi, and Alex Aiken. Flow-sensitive type qualifiers. In
ACM SIGPLAN Conference on Programming Language Design and Implementation
(PLDI), Berlin, Germany, pages 1–12, June 2002.
Frey, Alexandre. Satisfying subtype inequalities in polynomial space. In International
Symposium on Static Analysis (SAS) , Paris, France, volume 1302 of Lecture Notes
in Computer Science, pages 265–277. Springer-Verlag, September 1997.
Fuh, You-Chin and Prateek Mishra. Type inference with subtypes. In European Sym-
posium on Programming (ESOP), Nancy, France, volume 300 of Lecture Notes in
Computer Science, pages 94–114. Springer-Verlag, March 1988.
Furuse, Jun P. and Jacques Garrigue. A label-selective lambda-calculus with optional
arguments and its compilation method. RIMS Preprint 1041, Kyoto University,
October 1995.
Garcia, Ronald, Jaakko Jarvi, Andrew Lumsdaine, Jeremy Siek, and Jeremia h Will-
cock. A comparative study of language support for generic programming. In ACM
SIGPLAN Conference on Object Oriented Programming: Systems, Languages, and
Applications (OOPSLA), Anaheim, California, pages 115–134, October 2003.
Garrigue, Jacques. Programming with polymorphic variants. In ACM SIGPLAN Work-
shop on ML, informal proceedings, September 1998.
Garrigue, Jacques. Code reuse through polymorphic variants. In Workshop on Foun-
dations of Software Engineering (FOSE), November 2000.
Garrigue, Jacques. Simple type inference for structural polymorphism. In Interna-
tional Workshop on Foundations of Object-Oriented Languages (FOOL), informal
proceedings, January 2002.
Garrigue, Jacques. Relaxing the value restriction. In International Symposium on
Functional and Logic Programming (FLOPS), Nara, Japan, volume 2998 of Lecture
Notes in Computer Science, pages 196–213. Springer-Verlag, April 2004.
Garrigue, Jacques and Hassan Aït-Kaci. The typed polymorphic label-selective
lambda-calculus. In ACM SIGPLAN–SIGACT Symposium on Principles of Program-
ming Languages (POPL), Portland, Oregon, pages 35–47, 1994.
544 References
Gordon, Andrew D. and Alan Jeffrey. Authenticity by typing for security protocols. In
IEEE Computer Security Foundations Workshop (CSFW), Cape Breton, Nova Scotia,
pages 145–159, 2001a.
Gordon, Andrew D. and Alan Jeffrey. Typing correspondence assertions for commu-
niation protocols. In Workshop on the Mathematical Foundations of Programming
Semantics (MFPS), Aarhus, Denmark, volume 45 of Electronic Notes in Theoretical
Computer Science, pages 379–409. Elsevier, May 2001b.
Gordon, Andrew D. and Alan Jeffrey. Types and effects for asymmetric cryptographic
protocols. In IEE Computer Security Foundations Workshop (CSFW) , Cape Breton,
Nova Scotia, pages 77–91, 2002.
Gordon, Andrew D. and Don Syme. Typing a multi-language intermediate code.
In ACM SIGPLAN–SIGACT Symposium on Principles of Programming Languages
(POPL), London, England, pages 248–260, January 2001.
Gordon, Michael J., Robin Milner, and Christopher P. Wadsworth. Edinburgh LCF,
volume 78 of Lecture Notes in Computer Science. Springer-Verlag, 1979.
Gough, John. Compiling for the .NET Common Language Runtime. .NET series. Pren-
tice Hall, 2002.
Grossman, Dan, Greg Morrisett, Trevor Jim, Michael Hicks, Yanling Wang, and James
Cheney. Region-based memory management in Cyclone. In ACM SIGPLAN Con-
ference on Programming Language Design and Implementation (PLDI), Berlin, Ger-
many, pages 282–293, 2002.
Gustavsson, Jörgen and Josef Svenningsson. Constraint abstractions. In Symposium
on Programs as Data Objects (PADO), Aarhus, Denmark, volume 2053 of Lecture
Notes in Computer Science, pages 63–83. Springer-Verlag, May 2001.
Hallenberg, Niels, Martin Elsman, and Mads Tofte. Combining region inference and
garbage collection. In ACM SIGPLAN Conference on Programming Language De-
sign and Implementation (PLDI), Berlin, Germany, pages 141–152, June 2002.
Hallgren, Thomas and Aarne Ranta. An extensible proof text editor (abstract). In
International Conference on Logic for Programming and Automated Reasoning
(LPAR), Reunion Island, volume 1955 of Lecture Notes in Computer Science, pages
70–84. Springer-Verlag, 2000.
Hamid, Nadeem, Zhong Shao, Valery Trifonov, Stefan Monnier, and Zhaozhong Ni.
A syntactic approach to foundational proof-carrying code. In IEEE Symposium on
Logic in Computer Science (LICS), pages 89–100, July 2002.
Hanson, David R. Fast allocation and deallocation of memory based on object life-
times. Software—Practice and Experience, 20(1):5–12, 1990.
Hardin, Thérèse, Luc Maranget, and Bruno Pagano. Functional runtimes within the
lambda-sigma calculus. Journal of Functional Programming, 8(2):131–172, March
1998.
Harper, Robert, Furio Honsell, and Gordon Plotkin. A framework for defining logics.
Journal of the ACM, 40(1):143–184, 1993. Summary in IEEE Symposium on Logic in
Computer Science (LICS), Ithaca, New York, 1987.
546 References
Hofmann, Martin. Safe recursion with higher types and BCK-algebra. Annals of Pure
and Applied Logic, 104(1–3):113–166, 2000.
Honsell, Furio, Ian A. Mason, Scott F. Smith, and Carolyn L. Talcott. A variable typed
logic of effects. Information and Computation, 119(1):55–90, 1995.
Huet, Gérard. Résolution d’equations dans les langages d’ordre 1,2, ...,ω. Thèse de
Doctorat d’Etat, Université de Paris 7, Paris, France, 1976.
Igarashi, Atsushi and Naoki Kobayashi. A generic type system for the Pi-calculus.
In ACM SIGPLAN–SIGACT Symposium on Principles of Programming Languages
(POPL), London, England, pages 128–141, January 2001.
Igarashi, Atsushi and Naoki Kobayashi. Resource usage analysis. In ACM SIGPLAN–
SIGACT Symposium on Principles of Programming Languages (POPL), Portland,
Oregon, pages 331–342, January 2002.
548 References
Igarashi, Atsushi and Benjamin C. Pierce. Foundations for virtual types. In European
Conference on Object-Oriented Programming (ECOOP), Lisbon, Portugal, June 1999.
Also in informal proceedings of the Workshop on Foundations of Object-Oriented
Languages (FOOL), January 1999. Full version in Information and Computation,
175(1): 34–49, May 2002.
Ishtiaq, Samin and Peter O’Hearn. BI as an assertion language for mutable data
structures. In ACM SIGPLAN–SIGACT Symposium on Principles of Programming
Languages (POPL), London, England, pages 14–26, January 2001.
Jacobs, Bart. Categorical Logic and Type Theory. Studies in Logic and the Foundations
of Mathematics 141. Elsevier, 1999.
Jategaonkar, Lalita A. ML with extended pattern matching and subtypes. Master’s
thesis, Massachusetts Institute of Technology, August 1989.
Jategaonkar, Lalita A. and John C. Mitchell. ML with extended pattern matching and
subtypes (preliminary version). In ACM Symposium on Lisp and Functional Pro-
gramming (LFP), Snowbird, Utah, pages 198–211, Snowbird, Utah, July 1988.
Jensen, Kathleen and Niklaus Wirth. Pascal User Manual and Report. Springer-Verlag,
second edition, 1975.
Jim, Trevor. What are principal typings and what are they good for? In ACM SIGPLAN–
SIGACT Symposium on Principles of Programming Languages (POPL), St. Petersburg
Beach, Florida, pages 42–53, 1996.
Jim, Trevor, J. Greg Morrisett, Dan Grossman, Michael W. Hicks, James Cheney, and
Yanling Wang. Cyclone: A safe dialect of C. In General Track: USENIX Annual
Technical Conference, pages 275–288, June 2002.
Jim, Trevor and Jens Palsberg. Type inference in systems of recursive types with sub-
typing, 1999. Manuscript, available from http://www.cs.purdue.edu/homes/
palsberg/draft/jim-palsberg99.pdf.
Johann, Patricia. A generalization of short-cut fusion and its correctness proof.
Higher-Order and Symbolic Computation, 15(4):273–300, 2002.
Jones, Mark P. Qualified Types: Theory and Practice. Cambridge University Press,
1994.
Jones, Mark P. Typing Haskell in Haskell. In ACM Haskell Workshop, informal pro-
ceedings, October 1999.
Jones, Mark P. and John C. Peterson. The Hugs 98 user manual, 1999. Available from
http://www.haskell.org/hugs/.
Jones, Mark P. and Simon Peyton Jones. Lightweight extensible records for Haskell.
In ACM Haskell Workshop, informal proceedings, October 1999.
References 549
Lassen, Søren Bøgh. Relational Reasoning about Functions and Nondeterminism. PhD
thesis, Department of Computer Science, University of Aarhus, Aarhus, Denmark,
1998.
Lassez, Jean-Louis, Michael J. Maher, and Kim G. Marriott. Unification revisited. In
J. Minker, editor, Foundations of Deductive Databases and Logic Programming,
pages 587–625. Morgan Kaufmann, 1988.
Lee, Oukseh and Kwangkeun Yi. Proofs about a folklore let-polymorphic type infer-
ence algorithm. ACM Transactions on Programming Languages and Systems, 20
(4):707–723, July 1998.
Leivant, Daniel. Stratified functional programs and computational complexity.
In ACM SIGPLAN–SIGACT Symposium on Principles of Programming Languages
(POPL), Charleston, South Carolina, pages 325–333, January 1993.
Leroy, Xavier. Polymorphic typing of an algorithmic language. Research Report 1778,
INRIA, October 1992.
Leroy, Xavier. Manifest types, modules and separate compilation. In ACM SIGPLAN–
SIGACT Symposium on Principles of Programming Languages (POPL), Portland,
Oregon, pages 109–122, January 1994.
Leroy, Xavier. Applicative functors and fully transparent higher-order modules.
In ACM SIGPLAN–SIGACT Symposium on Principles of Programming Languages
(POPL), San Francisco, California, pages 142–153, January 1995.
Leroy, Xavier. A syntactic theory of type generativity and sharing. Journal of Func-
tional Programming, 6(5):667–698, September 1996.
Leroy, Xavier. The Objective Caml system: Documentation and user’s manual, 2000.
With Damien Doligez, Jacques Garrigue, Didier Rémy, and Jérôme Vouillon. Avail-
able from http://caml.inria.fr.
Leroy, Xavier and François Pessaux. Type-based analysis of uncaught exceptions.
ACM Transactions on Programming Languages and Systems, 22(2):340–377, March
2000. Summary in ACM SIGPLAN–SIGACT Symposium on Principles of Program-
ming Languages (POPL), San Antonio, Texas, 1999.
Loader, Ralph. Finitary PCF is not decidable. Theoretical Computer Science, 266(1–2):
341–364, September 2001.
Lucassen, John M. Types and Effects towards the Integration of Functional and Impera-
tive Programming. PhD thesis, Massachusetts Institute of Technology, Cambridge,
Massachusetts, August 1987. Technical Report MIT-LCS-TR-408.
Lucassen, John M. and David K. Gifford. Polymorphic effect systems. In ACM Sympo-
sium on Principles of Programming Languages (POPL), San Diego, California, pages
47–57, 1988.
Luo, Zhaohui. Computation and Reasoning: A Type Theory for Computer Science.
Number 11 in International Series of Monographs on Computer Science. Oxford
University Press, 1994.
Luo, Zhaohui and Robert Pollack. The LEGO proof development system: A user’s
manual. Technical Report ECS-LFCS-92-211, University of Edinburgh, May 1992.
MacQueen, David. Modules for Standard ML. In ACM Symposium on Lisp and Func-
tional Programming (LFP), Austin, Texas, pages 198–207, 1984.
MacQueen, David. Using dependent types to express modular structure. In ACM
Symposium on Principles of Programming Languages (POPL), St. Petersburg Beach,
Florida, pages 277–286, January 1986.
MacQueen, David B. and Mads Tofte. A semantics for higher-order functors. In Eu-
ropean Symposium on Programming (ESOP), Edinburgh, Scotland, volume 788 of
Lecture Notes in Computer Science, pages 409–423. Springer-Verlag, April 1994.
Magnusson, Lena and Bengt Nordström. The ALF proof editor and its proof engine. In
International Workshop on Types for Proofs and Programs (TYPES), Nijmegen, The
Netherlands, May, 1993, volume 806 of Lecture Notes in Computer Science, pages
213–237. Springer-Verlag, 1994.
Mairson, Harry G., Paris C. Kanellakis, and John C. Mitchell. Unification and ML type
reconstruction. In J.-L. Lassez and G. Plotkin, editors, Computational Logic: Essays
in Honor of Alan Robinson, pages 444–478. MIT Press, 1991.
Makholm, Henning. Region-based memory management in Prolog. Master’s thesis,
University of Copenhagen, Department of Computer Science, March 2000. Techni-
cal Report DIKU-TR-00/09.
Makholm, Henning. A Language-Independend Framework for Region Inference. PhD
thesis, University of Copenhagen, Department of Computer Science, Copenhagen,
Denmark, 2003.
Makholm, Henning and Kostis Sagonas. On enabling the WAM with region support.
In International Conference on Logic Programming (ICLP), volume 2401 of Lecture
Notes in Computer Science, pages 163–178. Springer-Verlag, July 2002.
Martelli, Alberto and Ugo Montanari. Unification in linear time and space: A struc-
tured presentation. Internal Report B76-16, Istituto di Elaborazione delle Infor-
mazione, Consiglio Nazionale delle Ricerche, Pisa, July 1976.
552 References
Martelli, Alberto and Ugo Montanari. An efficient unification algorithm. ACM Trans-
actions on Programming Languages and Systems, 4(2):258–282, 1982.
Martin-Löf, Per. Intuitionistic Type Theory. Bibliopolis, 1984.
Mason, Ian A., Scott F. Smith, and Carolyn L. Talcott. From operational semantics to
domain theory. Information and Computation, 128(1):26–47, 1996.
Mason, Ian A. and Carolyn L. Talcott. Equivalence in functional languages with effects.
Journal of Functional Programming, 1:287–327, 1991.
McAllester, David. On the complexity analysis of static analyses. Journal of the ACM,
49(4):512–537, July 2002.
McAllester, David. A logical algorithm for ML type inference. In International Con-
ference on Rewriting Techniques and Applications (RTA), Valencia, Spain, volume
2706 of Lecture Notes in Computer Science, pages 436–451. Springer-Verlag, June
2003.
McBride, Conor. Dependently Typed Functional Programs and their Proofs. PhD thesis,
LFCS, University of Edinburgh, Edinburgh, Scotland, 2000.
McBride, Conor and James McKinna. The view from the left. Journal of Functional
Programming, 14(1):69–111, 2004.
McKinna, James and Robert Pollack. Pure Type Sytems formalized. In International
Conference on Typed Lambda Calculi and Applications (TLCA), Utrecht, The Nether-
lands, volume 664 of Lecture Notes in Computer Science, pages 289–305. Springer-
Verlag, March 1993.
Melski, David and Thomas Reps. Interconvertibility of a class of set constraints
and context-free language reachability. Theoretical Computer Science, 248(1–2),
November 2000.
Milner, Robin. A theory of type polymorphism in programming. Journal of Computer
and System Sciences, 17:348–375, August 1978.
Milner, Robin, Mads Tofte, and Robert Harper. The Definition of Standard ML. MIT
Press, 1990.
Milner, Robin, Mads Tofte, Robert Harper, and David MacQueen. The Definition of
Standard ML, Revised edition. MIT Press, 1997.
Minamide, Yasuhiko. A functional representation of data structures with a hole.
In ACM SIGPLAN–SIGACT Symposium on Principles of Programming Languages
(POPL), San Diego, California, pages 75–84, January 1998.
Minamide, Yasuhiko, Greg Morrisett, and Robert Harper. Typed closure conversion.
In ACM SIGPLAN–SIGACT Symposium on Principles of Programming Languages
(POPL), St. Petersburg Beach, Florida, pages 271–283, January 1996.
Miquel, Alexandre. Le calcul des constructions implicite: syntaxe et sémantique. PhD
thesis, University Paris 7, Paris, France, 2001.
Mitchell, John C. Coercion and type inference. In ACM Symposium on Principles
of Programming Languages (POPL), Salt Lake City, Utah, pages 175–185, January
1984.
References 553
Müller, Martin and Susumu Nishimura. Type inference for first-class messages with
feature constraints. In Asian Computer Science Conference (ASIAN), Manila, The
Philippines, volume 1538 of Lecture Notes in Computer Science, pages 169–187.
Springer-Verlag, December 1998.
Necula, George C. Compiling with Proofs. PhD thesis, Carnegie Mellon University,
Pittsburgh, Pennsylvania, September 1998. Technical report CMU-CS-98-154.
Necula, George C. and Peter Lee. Safe kernel extensions without run-time checking.
In USENIX Symposium on Operating Systems Design and Implementation (OSDI),
Seattle, Washington, pages 229–243, October 1996.
Necula, George C. and Peter Lee. The design and implementation of a certifying
compiler. In ACM SIGPLAN Conference on Programming Language Design and
Implementation (PLDI), Montréal, Québec, pages 333–344, June 1998a.
Necula, George C. and Peter Lee. Efficient representation and validation of logical
proofs. In IEEE Symposium on Logic in Computer Science (LICS), Indianapolis, Indi-
ana, pages 93–104, June 1998b.
Niehren, Joachim, Martin Müller, and Andreas Podelski. Inclusion constraints over
non-empty sets of trees. In Theory and Practice of Software Development (TAP-
SOFT), Lille, France, volume 1214 of Lecture Notes in Computer Science, pages
217–231. Springer-Verlag, April 1997.
Nielson, Flemming and Hanne Riis Nielson. From CML to its process algebra. Theo-
retical Computer Science, 155:179–219, 1996.
Nielson, Flemming, Hanne Riis Nielson, and Christopher L. Hankin. Principles of Pro-
gram Analysis. Springer-Verlag, 1999.
Nielson, Flemming, Hanne Riis Nielson, and Helmut Seidl. A succinct solver for ALFP.
Nordic Journal of Computing, 9(4):335–372, 2002.
Nielson, Hanne Riis and Flemming Nielson. Higher-order concurrent programs with
finite communication topology. In ACM SIGPLAN–SIGACT Symposium on Principles
of Programming Languages (POPL), Portland, Oregon, pages 84–97, January 1994.
References 555
Niss, Henning. Regions are Imperative: Unscoped Regions and Control-Flow Sensi-
tive Memory Management. PhD thesis, University of Copenhagen, Department of
Computer Science, Copenhagen, Denmark, 2002.
Nöcker, Erick and Sjaak Smetsers. Partially strict non-recursive data types. Journal
of Functional Programming, 3(2):191–215, 1993.
Nöcker, Erick G. M. H., Sjaak E. W. Smetsers, Marko C. J. D. van Eekelen, and Mari-
nus J. Plasmeijer. Concurrent clean. In Symposium on Parallel Architectures and
Languages Europe, Volume I: Parallel Architectures and Algorithms (PARLE), Eind-
hoven, The Netherlands, volume 505 of Lecture Notes in Computer Science, pages
202–219. Springer-Verlag, June 1991.
Odersky, Martin, Vincent Cremet, Christine Rockl, and Matthias Zenger. A nominal
theory of objects with dependent types. In International Workshop on Foundations
of Object-Oriented Languages (FOOL), informal proceedings, 2003.
Odersky, Martin, Martin Sulzmann, and Martin Wehr. Type inference with constrained
types. Theory and Practice of Object Systems, 5(1):35–55, 1999. Summary in Inter-
national Workshop on Foundations of Object-Oriented Languages (FOOL), informal
proceedings, 1997.
O’Hearn, Peter and David Pym. The logic of bunched implications. Bulletin of Symbolic
Logic, 5(2):215–244, 1999.
Ohori, Atsushi. A polymorphic record calculus and its compilation. ACM Transac-
tions on Programming Languages and Systems, 17(6):844–895, November 1995.
Ohori, Atsushi and Peter Buneman. Type inference in a database programming lan-
guage. In ACM Symposium on Lisp and Functional Programming (LFP), Snowbird,
Utah, pages 174–183, July 1988.
Ohori, Atsushi and Peter Buneman. Static type inference for parametric classes. In
Conference on Object Oriented Programming: Systems, Languages, and Applica-
tions (OOPSLA), New Orleans, Louisiana, pages 445–456, October 1989. Also in C.
A. Gunter and J. C. Mitchell, editors, Theoretical Aspects of Object-Oriented Pro-
gramming: Types, Semantics, and Language Design, MIT Press, 1994.
Owre, Sam, Sreeranga Rajan, John M. Rushby, Natarajan Shankar, and Mandayam K.
Srivas. PVS: Combining specification, proof checking, and model checking. In
International Conference on Computer Aided Verification (CAV), New Brunswick,
New Jersey, volume 1102 of Lecture Notes in Computer Science, pages 411–414.
Springer-Verlag, July 1996.
Palsberg, Jens. Efficient inference of object types. Information and Computation, 123
(2):198–209, 1995.
Palsberg, Jens. Type-based analysis and applications. In ACM SIGPLAN–SIGSOFT
Workshop on Program Analysis for Software Tools and Engineering (PASTE), Snow-
bird, Utah, pages 20–27, June 2001.
Palsberg, Jens and Patrick O’Keefe. A type system equivalent to flow analysis. In ACM
SIGPLAN–SIGACT Symposium on Principles of Programming Languages (POPL), San
Francisco, California, pages 367–378, 1995.
Palsberg, Jens and Michael Schwartzbach. Type substitution for object-oriented
programming. In ACM SIGPLAN Conference on Object Oriented Programming:
Systems, Languages, and Applications (OOPSLA)/European Conference on Object-
Oriented Programming (ECOOP), Ottawa, Ontario, volume 25(10) of ACM SIGPLAN
Notices, pages 151–160, October 1990.
Palsberg, Jens and Michael I. Schwartzbach. Object-Oriented Type Systems. Wiley,
1994.
Palsberg, Jens, Mitchell Wand, and Patrick M. O’Keefe. Type inference with non-
structural subtyping. Formal Aspects of Computing, 9:49–67, 1997.
Parnas, David. The criteria to be used in decomposing systems into modules. Com-
munications of the ACM, 14(1):221–227, 1972.
Paterson, Michael S. and Mark N. Wegman. Linear unification. Journal of Computer
and System Sciences, 16:158–167, 1978.
Paulin-Mohring, Christine. Extracting Fω ’s programs from proofs in the calculus
of constructions. In ACM Symposium on Principles of Programming Languages
(POPL), Austin, Texas, pages 89–104, January 1989.
Petersen, Leaf, Perry Cheng, Robert Harper, and Chris Stone. Implementing the TILT
internal language. Technical Report CMU-CS-00-180, Department of Computer Sci-
ence, Carnegie Mellon University, 2000.
Petersen, Leaf, Robert Harper, Karl Crary, and Frank Pfenning. A type theory for
memory allocation and data layout. In ACM SIGPLAN–SIGACT Symposium on Prin-
ciples of Programming Languages (POPL), New Orleans, Louisiana, pages 172–184,
January 2003.
Peyton Jones, Simon. Special issue: Haskell 98 language and libraries. Journal of
Functional Programming, 13, January 2003.
Pfenning, Frank and Rowan Davies. A judgmental reconstruction of modal logic.
Mathematical Structures in Computer Science, 11(4):511–540, 2001.
References 557
Pfenning, Frank and Carsten Schürmann. Algorithms for equality and unification
in the presence of notational definitions. In T. Altenkirch, W. Naraschewski,
and B. Reus, editors, International Workshop on Types for Proofs and Programs
(TYPES), Kloster Irsee, Germany, volume 1657 of Lecture Notes in Computer Sci-
ence. Springer-Verlag, 1998.
Pitts, Andrew M. and Ian D. B. Stark. Observable properties of higher order functions
that dynamically create local names, or: What’s new? In International Symposium
on Mathematical Foundations of Computer Science, Gdańsk, Poland, volume 711 of
Lecture Notes in Computer Science, pages 122–141. Springer-Verlag, 1993.
Pitts, Andrew M. and Ian D. B. Stark. Operational reasoning for functions with local
state. In A. D. Gordon and A. M. Pitts, editors, Higher-Order Operational Techniques
in Semantics, Publications of the Newton Institute, pages 227–273. Cambridge Uni-
versity Press, 1998.
Plotkin, Gordon D. and Martín Abadi. A logic for parametric polymorphism. In In-
ternational Conference on Typed Lambda Calculi and Applications (TLCA), Utrecht,
The Netherlands, volume 664 of Lecture Notes in Computer Science, pages 361–375.
Springer-Verlag, March 1993.
558 References
Polakow, Jeff and Frank Pfenning. Natural deduction for intuitionistic non-
commutative linear logic. In International Conference on Typed Lambda Calculi
and Applications (TLCA), L’Aquila, Italy, volume 1581 of Lecture Notes in Computer
Science, pages 295–309. Springer-Verlag, April 1999.
Poll, Erik. Expansion Postponement for Normalising Pure Type Systems. Journal of
Functional Programming, 8(1):89–96, 1998.
Pollack, Robert. The Theory of LEGO: A Proof Checker for the Extended Calculus of
Constructions. PhD thesis, University of Edinburgh, Edinburgh, Scotland, 1994.
Popkorn, Sally. First Steps in Modal Logic. Cambridge University Press, 1994.
Pottier, François. A versatile constraint-based type inference system. Nordic Journal
of Computing, 7(4):312–347, November 2000.
Pottier, François. A semi-syntactic soundness proof for HM(X). Research Report
4150, INRIA, March 2001a.
Pottier, François. Simplifying subtyping constraints: a theory. Information and Com-
putation, 170(2):153–183, November 2001b.
Pottier, François. A constraint-based presentation and generalization of rows. In IEEE
Symposium on Logic in Computer Science (LICS), Ottawa, Canada, pages 331–340,
June 2003.
Pottier, François and Vincent Simonet. Information flow inference for ML. ACM Trans-
actions on Programming Languages and Systems, 25(1):117–158, January 2003.
Pottier, François, Christian Skalka, and Scott Smith. A systematic approach to static
access control. In European Symposium on Programming (ESOP), Genova, Italy,
volume 2028 of Lecture Notes in Computer Science, pages 30–45. Springer-Verlag,
April 2001.
Pratt, Vaughan and Jerzy Tiuryn. Satisfiability of inequalities in a poset. Fundamenta
Informaticae, 28(1–2):165–182, 1996.
Pugh, William and Grant Weddell. Two-directional record layout for multiple in-
heritance. In ACM SIGPLAN Conference on Programming Language Design and
Implementation (PLDI), White Plains, New York, pages 85–91, June 1990.
Rajamani, Sriram K. and Jakob Rehof. A behavioral module system for the pi-calculus.
In International Symposium on Static Analysis (SAS) , Paris, France, volume 2126 of
Lecture Notes in Computer Science, pages 375–394. Springer-Verlag, July 2001.
Rajamani, Sriram K. and Jakob Rehof. Conformance checking for models of asyn-
chronous message passing software. In International Conference on Computer
Aided Verification (CAV), Copenhagen, Denmark, pages 166–179, July 2002.
Rehof, Jakob. Minimal typings in atomic subtyping. In ACM SIGPLAN–SIGACT Sym-
posium on Principles of Programming Languages (POPL), Paris, France, pages 278–
291, January 1997.
Rehof, Jakob and Manuel Fähndrich. Type-based flow analysis: From polymorphic
subtyping to CFL reachability. In ACM SIGPLAN–SIGACT Symposium on Principles
of Programming Languages (POPL), London, England, pages 54–66, 2001.
References 559
Reid, Alastair, Matthew Flatt, Leigh Stoller, Jay Lepreau, and Eric Eide. Knit: Com-
ponent composition for systems software. In USENIX Symposium on Operating
Systems Design and Implementation (OSDI), San Diego, California, pages 347–360,
October 2000.
Rémy, Didier. Algèbres Touffues. Application au Typage Polymorphe des Objets Enreg-
istrements dans les Langages Fonctionnels. PhD thesis, Université Paris VII, 1990.
Rémy, Didier. Extending ML type system with a sorted equational theory. Research
Report 1766, Institut National de Recherche en Informatique et Automatisme, Roc-
quencourt, BP 105, 78 153 Le Chesnay Cedex, France, 1992a.
Rémy, Didier. Projective ML. In ACM Symposium on Lisp and Functional Programming
(LFP), San Francisco, California, pages 66–75, June 1992b.
Rémy, Didier. Syntactic theories and the algebra of record terms. Research Report
1869, Institut National de Recherche en Informatique et Automatisme, Rocquen-
court, BP 105, 78 153 Le Chesnay Cedex, France, 1993.
Rémy, Didier and Jérôme Vouillon. Objective ML: An effective object-oriented exten-
sion to ML. Theory And Practice of Object Systems, 4(1):27–50, 1998. Summary
in ACM SIGPLAN–SIGACT Symposium on Principles of Programming Languages
(POPL), Paris, France, 1997.
van Renesse, Robbert, Kenneth P. Birman, Mark Hayden, Alexey Vaysburd, and David
Karr. Building adaptive systems using Ensemble. Software: Practice and Experience,
28(9):963–979, August 1998.
Restall, Greg. Relevant and substructural logics. In D. Gabbay and J. Woods, editors,
Handbook of the History and Philosophy of Logic, volume 6, Logic and the Modalities
in the Twentieth Century. Elsevier, 2005. To appear.
Russo, Claudio V. Types for Modules. PhD thesis, Edinburgh University, Edinburgh,
Scotland, 1998. LFCS Thesis ECS–LFCS–98–389.
Russo, Claudio V. Non-dependent types for standard ML modules. In ACM SIGPLAN
International Conference on Principles and Practice of Declarative Programming
(PPDP), Paris France, pages 80–97, September 1999.
Russo, Claudio V. Recursive structures for Standard ML. In ACM SIGPLAN Interna-
tional Conference on Functional Programming (ICFP), Firenze, Italy, pages 50–61,
September 2001.
Sangiorgi, Davide and David. The π -Calculus: a Theory of Mobile Processes. Cam-
bridge University Press, 2001.
Sannella, Donald, Stefan Sokolowski, and Andrzej Tarlecki. Toward formal develop-
ment of programs from algebraic specifications: Parameterisation revisited. Acta
Informatica, 29(8):689–736, 1992.
Schneider, Fred B. Enforceable security policies. ACM Transactions on Information
and System Security, 3(1):30–50, February 2000.
Schwartz, Jacob T. Optimization of very high level languages (parts I and II). Com-
puter Languages, 1(2–3):161–194, 197–218, 1975.
References 561
Smith, Geoffrey S. Principal type schemes for functional programs with overloading
and subtyping. Science of Computer Programming, 23(2–3):197–226, December
1994.
Smith, Jan, Bengt Nordström, and Kent Petersson. Programming in Martin-Löf’s Type
Theory: An Introduction. Oxford University Press, 1990.
Statman, Richard. Logical relations and the typed λ-calculus. Information and Con-
trol, 65(2–3):85–97, May–June 1985.
Steele, Guy L., Jr. Common Lisp: The Language. Digital Press, 1990.
Stone, Christopher A. Singleton Kinds and Singleton Types. PhD thesis, Carnegie
Mellon University, Pittsburgh, Pennsylvania, August 2000.
Stone, Christopher A. and Robert Harper. Deciding type equivalence in a language
with singleton kinds. In ACM SIGPLAN–SIGACT Symposium on Principles of Pro-
gramming Languages (POPL), Boston, Massachusetts, pages 214–227, January 2000.
Stone, Christopher A. and Robert Harper. Extensional equivalence and singleton
types. 2005. To appear.
Streicher, Thomas. Semantics of Type Theory. Springer-Verlag, 1991.
Su, Zhendong, Alexander Aiken, Joachim Niehren, Tim Priesnitz, and Ralf Treinen.
The first-order theory of subtyping constraints. In ACM SIGPLAN–SIGACT Sym-
posium on Principles of Programming Languages (POPL), Portland, Oregon, pages
203–216, January 2002.
Sulzmann, Martin. A General Framework for Hindley/Milner Type Systems with Con-
straints. PhD thesis, Yale University, Department of Computer Science, New Haven,
Connecticut, May 2000.
Sulzmann, Martin, Martin Müller, and Christoph Zenger. Hindley/Milner style type
systems in constraint form. Research Report ACRC–99–009, University of South
Australia, School of Computer and Information Science, July 1999.
Sumii, Eijiro and Benjamin C. Pierce. A bisimulation for type abstraction and re-
cursion. In ACM SIGPLAN–SIGACT Symposium on Principles of Programming Lan-
guages (POPL), Long Beach, California, 2005.
Sun. JavaT M 2 Platform Micro Edition (J2MET M ) Technology for Creating Mobile
Devices—White Paper. Sun Microsystems, May 2000. Available from http://java.
sun.com/products/kvm/wp/KVMwp.pdf.
Tait, William W. Intensional interpretations of functionals of finite type I. Journal of
Symbolic Logic, 32(2):198–212, June 1967.
Talcott, C. Reasoning about functions with effects. In A. D. Gordon and A. M. Pitts,
editors, Higher Order Operational Techniques in Semantics, Publications of the
Newton Institute, pages 347–390. Cambridge University Press, 1998.
Talpin, Jean-Pierre and Pierre Jouvelot. Polymorphic type, region and effect inference.
Journal of Functional Programming, 2(2):245–271, 1992.
References 563
Talpin, Jean-Pierre and Pierre Jouvelot. The type and effect discipline. Information
and Computation, 111:245–296, 1994.
Tarditi, David, Greg Morrisett, Perry Cheng, Christopher Stone, Robert Harper, and
Peter Lee. TIL: A type-directed optimizing compiler for ML. In ACM SIGPLAN Con-
ference on Programming Language Design and Implementation (PLDI), Philadephia,
Pennsylvania, pages 181–192, May 1996.
Tarjan, Robert Endre. Efficiency of a good but not linear set union algorithm. Journal
of the ACM, 22(2):215–225, April 1975.
Tarjan, Robert Endre. Applications of path compression on balanced trees. Journal
of the ACM, 26(4):690–715, October 1979.
Terlouw, J. Een nadere bewijstheoretische analyse van GSTTs. Manuscript, University
of Nijmegen, Netherlands, 1989.
Thorup, Kresten Krab. Genericity in Java with virtual types. In European Confer-
ence on Object-Oriented Programming (ECOOP), Jyväskylä, Finland, volume 1241
of Lecture Notes in Computer Science, pages 444–471. Springer-Verlag, June 1997.
Tiuryn, Jerzy. Subtype inequalities. In IEEE Symposium on Logic in Computer Science
(LICS), Santa Cruz, California, pages 308–317, June 1992.
Tiuryn, Jerzy and Mitchell Wand. Type reconstruction with recursive types and
atomic subtyping. In Theory and Practice of Software Development (TAPSOFT),
Orsay, France, volume 668 of Lecture Notes in Computer Science, pages 686–701.
Springer-Verlag, April 1993.
Tofte, Mads. Operational Semantics and Polymorphic Type Inference. PhD thesis,
Computer Science Department, Edinburgh University, Edinburgh, Scotland, 1988.
Tofte, Mads and Lars Birkedal. A region inference algorithm. ACM Transactions on
Programming Languages and Systems, 20(4):724–767, 1998.
Tofte, Mads, Lars Birkedal, Martin Elsman, and Niels Hallenberg. Region-based mem-
ory management in perspective. In ACM SIGPLAN International Conference on
Principles and Practice of Declarative Programming (PPDP), Firenze, Italy, pages
175–186, September 2001a.
Tofte, Mads, Lars Birkedal, Martin Elsman, Niels Hallenberg, Tommy Højfeld Olesen,
and Peter Sestoft. Programming with regions in the ML Kit (for version 4). Technical
report, IT University of Copenhagen, October 2001b.
Tofte, Mads and Jean-Pierre Talpin. Implementing the call-by-value lambda-calculus
using a stack of regions. In ACM SIGPLAN–SIGACT Symposium on Principles of
Programming Languages (POPL), Portland, Oregon, January 1994.
Tofte, Mads and Jean-Pierre Talpin. Region-based memory management. Information
and Computation, 132(2):109–176, February 1997.
Torgersen, Mads. Virtual types are statically safe. In International Workshop on Foun-
dations of Object-Oriented Languages (FOOL), informal proceedings, January 1998.
564 References
Trifonov, Valery and Scott Smith. Subtyping constrained types. In International Sym-
posium on Static Analysis (SAS) , Aachen, Germany, volume 1145 of Lecture Notes
in Computer Science, pages 349–365. Springer-Verlag, September 1996.
Turner, David N. and Philip Wadler. Operational interpretations of linear logic. The-
oretical Computer Science, 227:231–248, 1999. Special issue on linear logic.
Turner, David N., Philip Wadler, and Christian Mossin. Once upon a type. In ACM
Symposium on Functional Programming Languages and Computer Architecture
(FPCA)San Diego, California, pages 1–11, June 1995.
Vouillon, Jerome and Paul-André Melliès. Semantic types: A fresh look at the ideal
model for types. In ACM SIGPLAN–SIGACT Symposium on Principles of Program-
ming Languages (POPL), Venice, Italy, pages 52–63, 2004.
Wadler, Philip. Theorems for free! In ACM Symposium on Functional Programming
Languages and Computer Architecture (FPCA), London, England, pages 347–359,
September 1989.
Wadler, Philip. Linear types can change the world. In IFIP TC 2 Working Conference
on Programming Concepts and Methods, Sea of Galilee, Israel, pages 546–566, April
1990.
Wadler, Philip. The marriage of effects and monads. ACM Transactions on Computa-
tional Logic, 4(1):1–32, 2003.
Wahbe, Robert, Steven Lucco, Thomas E. Anderson, and Susan L. Graham. Efficient
software-based fault isolation. In ACM Symposium on Operating Systems Principles
(SOSP), Asheville, North Carolina, pages 203–216, December 1993.
Walker, David, Karl Crary, and Greg Morrisett. Typed memory management via static
capabilities. ACM Transactions on Programming Languages and Systems, 22(4):
701–771, July 2000.
Walker, David and Greg Morrisett. Alias types for recursive data structures. In ACM
SIGPLAN Workshop on Types in Compilation (TIC), Montréal, Québec, September,
2000, volume 2071, pages 177–206. Springer-Verlag, 2001.
Walker, David and Kevin Watkins. On regions and linear types. In ACM SIGPLAN
International Conference on Functional Programming (ICFP), Firenze, Italy, pages
181–192, September 2001.
Wand, Mitchell. Complete type inference for simple objects. In IEEE Symposium on
Logic in Computer Science (LICS), Ithaca, New York, pages 37–44, June 1987a.
Wand, Mitchell. A simple algorithm and proof for type inference. Fundamenta Infor-
maticae, 10:115–122, 1987b.
Wand, Mitchell. Corrigendum: Complete type inference for simple objects. In IEEE
Symposium on Logic in Computer Science (LICS), Edinburgh, Scotland, page 132,
1988.
Wand, Mitchell. Type inference for objects with instance variables and inheritance.
In C. A. Gunter and J. C. Mitchell, editors, Theoretical Aspects of Object-Oriented
References 565
Programming: Types, Semantics, and Language Design, pages 97–120. MIT Press,
1994.
Wang, Daniel C. and Andrew W. Appel. Type-preserving garbage collectors. In ACM
SIGPLAN–SIGACT Symposium on Principles of Programming Languages (POPL),
London, England, pages 166–178, January 2001.
Wansbrough, Keith and Simon Peyton Jones. Once upon a polymorphic type. In ACM
SIGPLAN–SIGACT Symposium on Principles of Programming Languages (POPL), San
Antonio, Texas, pages 15–28, January 1999.
Wells, Joe B. Typability and type checking in system F are equivalent and undecidable.
Annals of Pure and Applied Logic, 98(1–3):111–156, 1999.
Wells, Joe B. The essence of principal typings. In International Colloquium on Au-
tomata, Languages and Programming (ICALP), volume 2380 of Lecture Notes in
Computer Science, pages 913–925. Springer-Verlag, 2002.
Werner, Benjamin. Une Théorie des Constructions Inductives. PhD thesis, Université
Paris 7, Paris, France, May 1994.
Wirth, Niklaus. Systematic Programming: An Introduction. Prentice Hall, 1973.
Wirth, Niklaus. Programming in Modula-2. Texts and Monographs in Computer Sci-
ence. Springer-Verlag, 1983.
Wright, Andrew K. Simple imperative polymorphism. Lisp and Symbolic Computation,
8(4):343–355, 1995.
Wright, Andrew K. and Robert Cartwright. A practical soft type system for Scheme.
In ACM Symposium on Lisp and Functional Programming (LFP), Orlando, Florida,
pages 250–262, June 1994. Full version available in ACM Transactions on Program-
ming Languages and Systems, 19(1):87–52, January 1997.
Wright, Andrew K. and Matthias Felleisen. A syntactic approach to type soundness.
Information and Computation, 115(1):38–94, November 1994.
Xi, Hongwei. Dependent Types in Practical Programming. PhD thesis, Carnegie Mellon
University, Pittsburgh, Pennsylvania, 1998.
Xi, Hongwei and Robert Harper. A dependently typed assembly language. In ACM SIG-
PLAN International Conference on Functional Programming (ICFP), Firenze, Italy,
pages 169–180, September 2001.
Xi, Hongwei and Frank Pfenning. Dependent types in practical programming. In ACM
SIGPLAN–SIGACT Symposium on Principles of Programming Languages (POPL), San
Antonio, Texas, pages 214–227, January 1999.
Zenger, Christoph. Indexed types. Theoretical Computer Science, 187:147–165, 1997.
Zwanenburg, Jan. Pure type systems with subtyping. In International Conference
on Typed Lambda Calculi and Applications (TLCA), L’Aquila, Italy, volume 1581 of
Lecture Notes in Computer Science, pages 381–396. Springer-Verlag, April 1999.
View publication stats