We describe the specification and proof of an
(imperative, sequential) hash table implementation. The
usual dictionary operations (insertion, lookup, and so
on) are supported, as well as iteration via folds and
iterators. The code is written in OCaml and verified
using higher-order separation logic, embedded in Coq,
via the CFML tool and library. This case study is part
of a larger project that aims to build a verified OCaml
library of basic data structures.

We present an extension of Separation Logic with a
general mechanism for temporarily converting any
assertion (or “permission”) to a read-only form. No
accounting is required: our read-only permissions can
be freely duplicated and discarded. We argue that, in
circumstances where mutable data structures are
temporarily accessed only for reading, our read-only
permissions enable more concise specifications and
proofs. The metatheory of our proposal is verified in
Coq.

The programming language Mezzo is equipped with a rich
type system that controls aliasing and access to
mutable memory. We give a comprehensive tutorial
overview of the language. Then, we present a modular
formalization of Mezzo's core type system, in the form
of a concurrent λ-calculus, which we
successively extend with references, locks, and
adoption and abandon, a novel mechanism that marries
Mezzo's static ownership discipline with dynamic
ownership tests. We prove that well-typed programs do
not go wrong and are data-race free. Our definitions
and proofs are machine-checked.

Given an LR(1) automaton, what are the states in which
an error can be detected? For each such “error
state”, what is a minimal input sentence that causes
an error in this state? We propose an algorithm that
answers these questions. This allows building a
collection of pairs of an erroneous input sentence and
a (handwritten) diagnostic message, ensuring that this
collection covers every error state, and maintaining
this property as the grammar evolves. We report on an
application of this technique to the CompCert ISO C99
parser, and discuss its strengths and limitations.

Given an LR(1) automaton, what are the states in which
an error can be detected? For each such “error
state”, what is a minimal input sentence that causes
an error in this state? We propose an algorithm that
answers these questions. Such an algorithm allows
building a collection of pairs of an erroneous input
sentence and a diagnostic message, ensuring that this
collection covers every error state, and maintaining
this property as the grammar evolves. We report on an
application of this technique to the CompCert ISO C99
parser, and discuss its strengths and limitations.

Union-Find is a famous example of a simple data
structure whose amortized asymptotic time complexity
analysis is non-trivial. We present a Coq formalization
of this analysis. Moreover, we implement Union-Find as
an OCaml library and formally endow it with a modular
specification that offers a full functional correctness
guarantee as well as an amortized complexity bound.
Reasoning in Coq about imperative OCaml code relies on
the CFML tool, which is based on characteristic
formulae and Separation Logic, and which we extend with
time credits. Although it was known in principle that
amortized analysis can be explained in terms of time
credits and that time credits can be viewed as
resources in Separation Logic, we believe our work is
the first practical demonstration of this approach.

With Mezzo, we set out to design a new, better
programming language. In this modest document, we
recount our adventure: what worked, and what did not;
the decisions that appear in hindsight to have been
good, and the design mistakes that cost us; the things
that we are happy with in the end, and the frustrating
aspects we wish we had handled better.

Using Coq, we mechanize Wegener's proof of Kosaraju's
linear-time algorithm for computing the strongly
connected components of a directed graph. Furthermore,
also in Coq, we define an executable and terminating
depth-first search algorithm.

Type inference---the problem of determining whether a
program is well-typed---is well-understood. In
contrast, elaboration---the task of constructing an
explicitly-typed representation of the program---seems
to have received relatively little attention, even
though, in a non-local type inference system, it is
non-trivial. We show that the constraint-based
presentation of Hindley-Milner type inference can be
extended to deal with elaboration, while preserving its
elegance. This involves introducing a new notion of
“constraint with a value”, which forms an applicative
functor.

The programming language Mezzo is equipped with a rich
type system that controls aliasing and access to
mutable memory. We incorporate shared-memory
concurrency into Mezzo and present a modular
formalization of Mezzo's core type system, in the form
of a concurrent lambda-calculus, which we extend with
references and locks. We prove that well-typed programs
do not go wrong and are data-race free. Our definitions
and proofs are machine-checked.

We present Mezzo, a typed programming language of ML
lineage. Mezzo is equipped with a novel static
discipline of duplicable and affine permissions, which
controls aliasing and ownership. This rules out certain
mistakes, including representation exposure and data
races, and enables new idioms, such as gradual
initialization, memory re-use, and (type)state changes.
Although the core static discipline disallows sharing a
mutable data structure, Mezzo offers several ways of
working around this restriction, including a novel
dynamic ownership control mechanism which we dub
“adoption and abandon”.

This paper presents a formal definition and
machine-checked soundness proof for a very expressive
type-and-capability system, that is, a low-level type
system that keeps precise track of ownership and side
effects.

The programming language has first-class
functions and references. The type system's features
include: universal, existential, and recursive types;
subtyping; a distinction between affine and
unrestricted data; support for strong updates; support
for naming values and heap fragments, via singleton and
group regions; a distinction between ordinary values
(which exist at runtime) and capabilities (which
don't); support for dynamic re-organizations of the
ownership hierarchy, by dis-assembling and
re-assembling capabilities; support for temporarily or
permanently hiding a capability, via frame and
anti-frame rules.

One contribution of the paper is
the definition of the type-and-capability system
itself. We present the system as modularly as possible.
In particular, at the core of the system, the treatment
of affinity, in the style of dual intuitionistic linear
logic, is formulated in terms of an arbitrary monotonic
separation algebra, a novel axiomatization of
resources, ownership, and the manner in which they
evolve with time. Only the peripheral layers of the
system are aware that we are dealing with a specific
monotonic separation algebra, whose resources are
references and regions. This semi-abstract organization
should facilitate further extensions of the system with
new forms of resources.

The other main
contribution is a machine-checked proof of type
soundness. The proof is carried out in Wright and
Felleisen's syntactic style. This offers evidence that
this relatively simple-minded proof technique can scale
up to systems of this complexity, and constitutes a
viable alternative to more sophisticated semantic proof
techniques. We do not claim that the syntactic
technique is superior: we simply illustrate how it is
used and highlight its strengths and shortcomings.

Atoms and de Bruijn indices are two well-known
representation techniques for data structures that
involve names and binders. However, using either
technique, it is all too easy to make a programming
error that causes one name to be used where another was
intended.

We propose an abstract interface to names
and binders that rules out many of these errors. This
interface is implemented as a library in Agda. It
allows defining and manipulating term representations
in nominal style and in de Bruijn style. The programmer
is not forced to choose between these styles: on the
contrary, the library allows using both styles in the
same program, if desired.

Whereas indexing the
types of names and terms with a natural number is a
well-known technique to better control the use of de
Bruijn indices, we index types with worlds. Worlds are
at the same time more precise and more abstract than
natural numbers. Via logical relations and
parametricity, we are able to demonstrate in what sense
our library is safe, and to obtain theorems for free
about world-polymorphic functions. For instance, we
prove that a world-polymorphic term transformation
function must commute with any renaming of the free
variables. The proof is entirely carried out in Agda.

An LR(1) parser is a finite-state automaton,
equipped with a stack, which uses a combination of its
current state and one lookahead symbol in order to
determine which action to perform next. We present a
validator which, when applied to a context-free grammar
G and an automaton A, checks
that A and G agree. Validating
the parser provides the correctness guarantees required
by verified compilers and other high-assurance software
that involves parsing. The validation process is
independent of which technique was used to construct
A. The validator is implemented and proved
correct using the Coq proof assistant. As an
application, we build a formally-verified parser for
the C99 language.

We extend a static type-and-capability system with new
mechanisms for expressing the promise that a certain
abstract value evolves monotonically with time; for
enforcing this promise; and for taking advantage of
this promise to establish non-trivial properties of
programs. These mechanisms are independent of the
treatment of mutable state, but combine with it to
offer a flexible account of “monotonic state”.

We
apply these mechanisms to solve two reasoning
challenges that involve mutable state. First, we show
how an implementation of thunks in terms of references
can be assigned types that reflect time complexity
properties, in the style of Danielsson (2008). Second,
we show how an implementation of hash-consing can be
assigned a specification that conceals the existence of
an internal state yet guarantees that two pieces of
input data receive the same code if and only if they
are equal.

We present a store-passing translation of System F
with general references into an extension of System
Fω with certain well-behaved recursive kinds.
This seems to be the first type-preserving
store-passing translation for general references. It
can be viewed as a purely syntactic account of a
possible worlds model.

A wide range of computer programs, including compilers
and theorem provers, manipulate data structures that
involve names and binding. However, the design of
programming idioms which allow performing these
manipulations in a safe and natural style has, to a
large extent, remained elusive.

In this paper, we
present a novel approach to the problem. Our proposal
can be viewed either as a programming language design
or as a library: in fact, it is currently implemented
within Agda. It provides a safe and expressive means of
programming with names and binders. It is abstract
enough to support multiple concrete implementations: we
present one in nominal style and one in de Bruijn
style. We use logical relations to prove that
“well-typed programs do not mix names with different
scope”. We exhibit an adequate encoding of Pitts-style
nominal terms into our system.

We present the first complete soundness proof of the
anti-frame rule, a recently proposed proof rule for
capturing information hiding in the presence of
higher-order store. Our proof involves solving a
non-trivial recursive domain equation. It helps
identify some of the key ingredients for soundness, and
thereby suggests how one might hope to relax some of
the restrictions imposed by the rule.

This “not quite functional” pearl describes an
algorithm for computing the least solution of a system
of monotone equations. It is implemented in imperative
ocaml code, but presents a purely functional,
lazy interface. It is simple, useful, and has good
asymptotic complexity. Furthermore, it presents a
challenge to researchers interested in modular formal
proofs of ML programs.

This informal note presents three comments about the
anti-frame rule, which respectively regard: its
interaction with polymorphism; its interaction with the
higher-order frame axiom; and a problematic lack of
modularity.

This informal note presents generalized versions of
the higher-order frame and anti-frame rules. The main
insights reside in two successive generalizations of
the “tensor” operator . In the first
step, a form of “local invariant”, which allows
implicit reasoning about “well-bracketed state
changes”, is introduced. In the second step, a form of
“local monotonicity” is added.

Reasoning about imperative programs requires the
ability to track aliasing and ownership properties. We
present a type system that provides this ability, by
using regions, capabilities, and singleton types. It is
designed for a high-level calculus with higher-order
functions, algebraic data structures, and references
(mutable memory cells). The type system has
polymorphism, yet does not require a value restriction,
because capabilities act as explicit store typings.

We exhibit a type-directed, type-preserving, and
meaning-preserving translation of this imperative
calculus into a pure calculus. Like the monadic
translation, this is a store-passing translation. Here,
however, the store is partitioned into multiple
fragments, which are threaded through a computation
only if they are relevant to it. Furthermore, the
decomposition of the store into fragments can evolve
dynamically to reflect ownership transfers.

The
translation offers deep insight about the inner
workings and soundness of the type system. If coupled
with a semantic model of its target calculus, it leads
to a semantic model of its imperative source calculus.
Furthermore, it provides a foundation for our long-term
objective of designing a system for specifying and
certifying imperative programs with dynamic memory
allocation.

We present a Hoare logic for a call-by-value
programming language equipped with recursive,
higher-order functions, algebraic data types, and a
polymorphic type system in the style of Hindley and
Milner. It is the theoretical basis for a tool that
extracts proof obligations out of programs annotated
with logical assertions. These proof obligations,
expressed in a typed, higher-order logic, are
discharged using off-the-shelf automated or interactive
theorem provers. Although the technical apparatus that
we exploit is by now standard, its application to
functional programming languages appears to be new, and
(we claim) deserves attention. As a sample application,
we check the partial correctness of a balanced binary
search tree implementation.

Separation logic involves two dual forms of
modularity: local reasoning makes part of the store
invisible within a static scope, whereas hiding local
state makes part of the store invisible outside a
static scope. In the recent literature, both idioms are
explained in terms of a higher-order frame rule. I
point out that this approach to hiding local state
imposes continuation-passing style, which is
impractical. Instead, I introduce a higher-order
anti-frame rule, which permits hiding local state in
direct style. I formalize this rule in the setting of a
type system, equipped with linear capabilities, for an
ML-like programming language, and prove type soundness
via a syntactic argument. Several applications
illustrate the expressive power of the new rule.

FreshML extends ML with constructs for declaring and
manipulating abstract syntax trees that involve names
and statically scoped binders. It is impure: name
generation is an observable side effect. In practice,
this means that FreshML allows writing programs that
create fresh names and unintentionally fail to bind
them. Following in the steps of early work by Pitts and
Gabbay, this paper defines Pure FreshML, a subset of
FreshML equipped with a static proof system that
guarantees purity. Pure FreshML relies on a rich
binding specification language, on user-provided
assertions, expressed in a logic that allows reasoning
about values and about the names that they contain, and
on a conservative, automatic decision procedure for
this logic. It is argued that Pure FreshML can express
non-trivial syntax-manipulating algorithms.

We study HMG(X), an extension of the
constraint-based type system HM(X) with deep
pattern matching, polymorphic recursion, and guarded
algebraic data types. Guarded algebraic data types
subsume the concepts known in the literature as indexed
types, guarded recursive datatype constructors,
(first-class) phantom types, and equality qualified
types, and are closely related to inductive types.
Their characteristic property is to allow every branch
of a case construct to be typechecked under different
assumptions about the type variables in scope. We prove
that HMG(X) is sound and that, provided recursive
definitions carry a type annotation, type inference can
be reduced to constraint solving. Constraint solving is
decidable, at least for some instances of X, but
prohibitively expensive. Effective type inference for
guarded algebraic data types is left as an issue for
future research.

Cαml is a tool that turns a so-called “binding
specification” into an Objective Caml compilation
unit. A binding specification resembles an algebraic
data type declaration, but also includes information
about names and binding. Cαml is meant to help
writers of interpreters, compilers, or other
programs-that-manipulate-programs deal with
α-conversion in a safe and concise style. This
paper presents an overview of Cαml's binding
specification language and of the code that Cαml
produces.

Defunctionalization is a program transformation
that eliminates functions as first-class values. We
show that defunctionalization can be viewed as a
type-preserving transformation of an extension
of with guarded algebraic data types into
itself. We also suggest that defunctionalization is an
instance of concretization, a more general
technique that allows eliminating constructs other than
functions. We illustrate this point by presenting two
new type-preserving transformations that can be viewed
as instances of concretization. One eliminates
Rémy-style polymorphic records; the other eliminates
the dictionary records introduced by the standard
compilation scheme for Haskell's type classes.

The LR parser generators that are bundled with many
functional programming language implementations produce
code that is untyped, needlessly inefficient, or both.
We show that, using generalized algebraic data types,
it is possible to produce parsers that are well-typed
(so they cannot unexpectedly crash or fail) and
nevertheless efficient. This is a pleasing result as
well as an illustration of the new expressiveness
offered by generalized algebraic data types.

We offer a solution to the type inference problem for
an extension of Hindley and Milner's type system with
generalized algebraic data types. Our approach is in
two strata. The bottom stratum is a core language that
marries type inference in the style of Hindley and
Milner with type checking for generalized algebraic
data types. This results in an extremely simple
specification, where case constructs must carry an
explicit type annotation and type conversions must be
made explicit. The top stratum consists of (two
variants of) an independent shape inference algorithm.
This algorithm accepts a source term that contains some
explicit type information, propagates this information
in a local, predictable way, and produces a new source
term that carries more explicit type information. It
can be viewed as a preprocessor that helps produce some
of the type annotations required by the bottom stratum.
It is proven sound in the sense that it never inserts
annotations that could contradict the type derivation
that the programmer has in mind.

This work sets the formal bases for building tools
that help retrieve classes in object-oriented
libraries. In such systems, the user provides a query,
formulated as a set of class interfaces. The tool
returns classes in the library that can be used to
implement the user's request and automatically builds
the required glue code. We propose subtyping of
recursive types in the presence of associative and
commutative products---that is, subtyping modulo a
restricted form of type isomorphisms---as a model of
the relation that exists between the user's query and
the tool's answers. We show that this relation is a
composition of the standard subtyping relation with
equality up to associativity and commutativity of
products and we present an efficient decision algorithm
for it. We also provide an automatic way of
constructing coercions between related types.

The Java Security Architecture includes a dynamic
mechanism for enforcing access control checks, the
so-called stack inspection process. While the
architecture has several appealing features, access
control checks are all implemented via dynamic method
calls. This is a highly non-declarative form of
specification which is hard to read, and which leads to
additional run-time overhead. This paper develops type
systems which can statically guarantee the success of
these checks. Our systems allow security properties of
programs to be clearly expressed within the types
themselves, which thus serve as static declarations of
the security policy. We develop these systems using a
systematic methodology: we show that the
security-passing style translation, proposed by
Wallach, Appel and Felten as a dynamic
implementation technique, also gives rise to
static security-aware type systems, by
composition with conventional type systems. To define
the latter, we use the general HM(X) framework, and
easily construct several constraint- and
unification-based type systems.

Guarded algebraic data types subsume the
concepts known in the literature as indexed
types, guarded recursive datatype constructors,
and first-class phantom types, and are closely
related to inductive types. They have the
distinguishing feature that, when typechecking a
function defined by cases, every branch may be checked
under different assumptions about the type variables in
scope. This mechanism allows exploiting the presence of
dynamic tests in the code to produce extra static type
information.

We propose an extension of the
constraint-based type system HM(X) with deep
pattern matching, guarded algebraic data types, and
polymorphic recursion. We prove that the type system is
sound and that, provided recursive function definitions
carry a type annotation, type inference may be reduced
to constraint solving. Then, because solving arbitrary
constraints is expensive, we further restrict the form
of type annotations and prove that this allows
producing so-called tractable constraints. Last,
in the specific setting of equality, we explain how to
solve tractable constraints.

To the best of our
knowledge, this is the first generic and
comprehensive account of type inference in the
presence of guarded algebraic data types.

We study a type system equipped with universal types
and equirecursive types, which we refer to as Fmu.
We show that type equality may be decided in time
O(nlogn), an improvement over the previous known
bound of O(n2). In fact, we show that two more
general problems, namely entailment of type equations
and type unification, may be decided in time O(nlog
n), a new result. To achieve this bound, we associate,
with every Fmu type, a first-order canonical
form, which may be computed in time O(nlogn). By
exploiting this notion, we reduce all three problems to
equality and unification of first-order
recursive terms, for which efficient algorithms are
known.

Defunctionalization is a program transformation
that aims to turn a higher-order functional program
into a first-order one, that is, to eliminate the use
of functions as first-class values. Its purpose is thus
identical to that of closure conversion. It
differs from closure conversion, however, by storing a
tag, instead of a code pointer, within every
closure. Defunctionalization has been used both as a
reasoning tool and as a compilation technique.

Defunctionalization is commonly defined and studied in
the setting of a simply-typed λ-calculus, where
it is shown that semantics and well-typedness are
preserved. It has been observed that, in the setting of
a polymorphic type system, such as ML or System F,
defunctionalization is not type-preserving. In this
paper, we show that extending System F with
guarded algebraic data types allows recovering
type preservation. This result allows adding
defunctionalization to the toolbox of type-preserving
compiler writers.

We present functional implementations of Koda and
Ruskey's algorithm for generating all ideals of a
forest poset as a Gray code. Using a continuation-based
approach, we give an extremely concise formulation of
the algorithm's core. Then, in a number of steps, we
derive a first-order version whose efficiency is
comparable to that of a C implementation given by
Knuth.

We study the combination of possibly conditional
non-structural subtyping constraints with rows. We give
a new presentation of rows, where row terms disappear;
instead, we annotate constraints with filters.
We argue that, in the presence of subtyping, this
approach is simpler and more general. In the case where
filters are finite or cofinite sets of row labels, we
give a constraint solving algorithm whose complexity is
O(n3mlogm), where n is the size of the
constraint and m is the number of row labels that
appear in it. We point out that this allows efficient
type inference for record concatenation. Furthermore,
by varying the nature of filters, we obtain several
natural generalizations of rows.

This paper presents a type-based information flow
analysis for a call-by-value lambda-calculus equipped
with references, exceptions and let-polymorphism, which
we refer to as Core ML. The type system is
constraint-based and has decidable type inference. Its
non-interference proof is reasonably light-weight,
thanks to the use of a number of orthogonal techniques.
First, a syntactic segregation between values and
expressions allows a lighter formulation of the type
system. Second, non-interference is reduced to subject
reduction for a non-standard language extension.
Lastly, a semi-syntactic approach to type soundness
allows dealing with constraint-based polymorphism
separately.

The HM(X) framework is a constraint-based type
framework with built-in let-polymorphism. This paper
establishes purely syntactic type soundness for the
framework, treating an extended version of the language
containing state and recursive binding. These results
demonstrate that any instance of HM(X), comprising a
specialized constraint system and possibly additional
functional constants and their types, enjoys syntactic
type soundness.

One way of enforcing an information flow
control policy is to use a static type system capable
of guaranteeing a noninterference property.
Noninterference requires that two processes with
distinct “high”-level components, but common
“low”-level structure, cannot be distinguished by
“low”-level observers. We state this property in
terms of a rather strict notion of process equivalence,
namely weak barbed reduction congruence.

Because
noninterference is not a safety property, it is
often regarded as more difficult to establish than a
conventional type safety result. This paper aims to
provide an elementary noninterference proof in the
setting of the π-calculus. This is done by reducing
the problem to subject reduction -- a safety
property -- for a nonstandard, but fairly natural,
extension of the π-calculus, baptized the
<π>-calculus.

This paper presents a type-based information flow
analysis for a call-by-value lambda-calculus equipped
with references, exceptions and let-polymorphism, which
we refer to as Core ML. The type system is
constraint-based and has decidable type inference. Its
non-interference proof is reasonably light-weight,
thanks to the use of a number of orthogonal techniques.
First, a syntactic segregation between values and
expressions allows a lighter formulation of the type
system. Second, non-interference is reduced to subject
reduction for a non-standard language extension.
Lastly, a semi-syntactic approach to type soundness
allows dealing with constraint-based polymorphism
separately.

This paper offers a theoretical study of constraint
simplification, a fundamental issue for the designer of
a practical type inference system with subtyping.

In the simpler case where constraints are equations, a
simple isomorphism between constrained type schemes and
finite state automata yields a complete constraint
simplification method. Using it as a guide for the
intuition, we move on to the case of subtyping, and
describe several simplification algorithms. Although no
longer complete, they are conceptually simple,
efficient, and very effective in practice.

Overall,
this paper gives a concise theoretical account of the
techniques found at the core of our type inference
system. Our study is restricted to the case where
constraints are interpreted in a non-structural lattice
of regular terms. Nevertheless, we highlight a small
number of general ideas, which explain our algorithms
at a high level and may be applicable to a variety of
other systems.

We present a generic constraint-based type system for
the join-calculus. The key issue is type
generalization, which, in the presence of concurrency,
must be restricted. We first define a liberal
generalization criterion, and prove it correct. Then,
we find that it hinders type inference, and propose a
cruder one, reminiscent of ML's value
restriction.

We establish type safety using a
semi-syntactic technique, which we believe is of
independent interest. It consists in interpreting
typing judgements as (sets of) judgements in an
underlying system, which itself is given a syntactic
soundness proof. This hybrid approach allows giving
pleasant logical meaning to high-level notions such as
type variables, constraints and generalization, and
clearly separating them from low-level aspects
(substitution lemmas, etc.), which are dealt with in a
simple, standard way.

The Java JDK 1.2 Security Architecture includes a
dynamic mechanism for enforcing access control checks,
so-called stack inspection. This paper studies
type systems which can statically guarantee the success
of these checks. We develop these systems using a new,
systematic methodology: we show that the
security-passing style translation, proposed by Wallach
and Felten as a dynamic implementation
technique, also gives rise to static
security-aware type systems, by composition with
conventional type systems. To define the latter, we use
the general HM(X) framework, and easily construct
several constraint- and unification-based type systems.
They offer significant improvements on a previous type
system for JDK access control, both in terms of
expressiveness and in terms of readability of type
specifications.

This document gives a soundness proof for the generic
constraint-based type inference framework HM(X).
Our proof is semi-syntactic. It consists of two
steps. The first step is to define a ground type
system, where polymorphism is extensional, and
prove its correctness in a syntactic way. The second
step is to interpret HM(X) judgements as (sets of)
judgements in the underlying system, which gives a
logical view of polymorphism and constraints. Overall,
the approach may be seen as more modular than a purely
syntactic approach: because polymorphism and
constraints are dealt with separately, they do not
clutter the subject reduction proof. However, it yields
a slightly weaker result: it only establishes type
soundness, rather than subject reduction, for
HM(X).

The combination of subtyping, conditional
constraints and rows yields a powerful
constraint-based type inference system. We
illustrate this claim by proposing solutions to three
delicate type inference problems: “accurate” pattern
matchings, record concatenation, and first-class
messages. Previously known solutions involved a
different technique in each case; our theoretical
contribution is in using only a single set of tools. On
the practical side, this allows all three problems to
benefit from a common set of constraint simplification
techniques, a formal description of which is given in
an appendix.

This paper shows how to systematically extend an
arbitrary type system with dependency information, and
how the new system's soundness and non-interference
proofs may rely upon, rather than duplicate, the
original system's soundness proof. This allows
enriching virtually any of the type systems known today
with information flow analysis, while requiring only a
minimal proof effort.

Our approach is based on an
untyped operational semantics for a labelled calculus
akin to core ML. Thus, it is simple, and should be
applicable to other computing paradigms, such as object
or process calculi.

The paper also discusses access
control, and shows it may be viewed as entirely
independent of information flow control. Letting the
two mechanisms coexist, without interacting, yields a
simple and expressive type system, which allows, in
particular, “selective” declassification.

Extending a subtyping-constraint-based type
inference framework with conditional
constraints and rows yields a powerful type
inference engine. We illustrate this claim by proposing
solutions to three delicate type inference problems:
“accurate” pattern matchings, record concatenation,
and “dynamic” messages. Until now, known solutions
required significantly different techniques; our
theoretical contribution is in using only a single (and
simple) set of tools. On the practical side, this
allows all three problems to benefit from a common set
of constraint simplification techniques, leading to
efficient solutions.

François Pottier.
A framework for type inference with
subtyping.
In Proceedings of the third ACM SIGPLAN International
Conference on Functional Programming (ICFP'98), pages 228--238, September
1998.
[ bib |
DOI |
PostScript |
At publisher's ]

This paper describes a full framework for type
inference and simplification in the presence of
subtyping. We give a clean, simple presentation of the
system and show that it leads to an efficient
implementation. Previous inference systems had severe
efficiency problems, mainly by lack of a systematic
substitution algorithm, but also because the issue of
data representation was not settled. We explain how to
solve these problems and obtain a fully integrated
framework.

From a purely theoretical point of view, type
inference for a functional language with parametric
polymorphism and subtyping poses no difficulties.
Indeed, it suffices to generalize the inference
algorithm used in the ML language, so as to deal with
type inequalities, rather than equalities. However, the
number of such inequalities is linear in the program
size; whence, from a practical point of view, a serious
efficiency and readability problem.

To solve this
problem, one must simplify the inferred constraints.
So, after studying the logical properties of subtyping
constraints, this work proposes several simplification
algorithms. They combine seamlessly, yielding a
homogeneous, fully formal framework, which directly
leads to an efficient implementation. Although this
theoretical study is performed in a simplified setting,
numerous extensions are possible. Thus, this framework
is realistic, and should allow a practical appearance
of subtyping in languages with type inference.

This paper studies type inference for a functional,
ML-style language with subtyping, and focuses on the
issue of simplifying inferred constraint sets. We
propose a powerful notion of entailment between
constraint sets, as well as an algorithm to check it,
which we prove to be sound. The algorithm, although
very powerful in practice, is not complete. We also
introduce two new typing rules which allow simplifying
constraint sets. These rules give very good practical
results.

This paper studies type inference for a functional
language with subtyping, and focuses on the issue of
simplifying inferred types. It does not attempt to give
a fully detailed, formal framework; instead, it tries
to explain the issues informally and suggest possible
solutions by providing examples.

This work is based on a proposal by Läufer and
Odersky. They show that it is possible to add
existential types to an ML-like language without even
modifying its syntax. ML's strong typing properties are
of course retained. We implemented their proposal into
Caml-Light, thus making it possible to write real-sized
programs using existential types.

This paper is
divided into three parts. First, we give a definition
of existential types and show how to use them in our
enhanced version of Caml-Light. We then give
interesting examples demonstrating their usefulness.
Finally, a more technical section gives an overview of
the changes made to the compiler and discusses some
technical issues.