Christopher Allan Stone

Thesis Title: Singleton Kinds and Singleton Types
Degree Type: Ph.D. in Computer Science
Advisor(s): Robert Harper
Graduated: August 2000

Abstract:

In this dissertation I study the properties of singleton kinds and singleton types. These are extremely precise classifiers for types and values, respectively: the kind of all types equal to [a given type], and the type of all values equal to [a given value]. Singletons are interesting because they provide a very general and modular form of definition, allow fine-grained control of type computations, and allow many equational constraints to be expressed within the type system. This is useful, for example, when modeling the type sharing and type definition constraints appearing in module signatures in the Standard ML language; singletons are used for this purpose in the TILT compiler for Standard ML.

However, the decidability of typechecking in the presence of singletons is not obvious. In order to typecheck a term, one must be able to determine whether two type constructors are provably equivalent. But in the presence of singleton kinds, the equivalence of type constructors depends both on the typing context in which they are compared and on the kind at which they are compared.

In this dissertation I present MIL-0, a lambda calculus with singletons that is based upon the representation used by the TILT compiler. I prove important properties of this language, including type soundness and decidability of typechecking. The main technical result is decidability of equivalence for well-formed type constructors. Inspired by Coquand's result for type theory, I prove decidability of constructor equivalence for MIL-0 by exhibiting a novel -- though slightly inefficient -- type-directed comparison algorithm. The correctness of this algorithm is proved using an interesting variant of Kripke-style logical relations: unary relations are indexed by a single possible world (in our case, a typing context), but binary relations are indexed by two worlds. Using this result I can then show the correctness of a natural, practical algorithm used by the TILT compiler.

Thesis Committee:
Robert Harper (Chair)
Peter Lee
John Reynolds
Jon Riecke (Bell Lab oratories, Lucent Technologies)

Randy Bryant, Head, Computer Science Department
James Morris, Dean, School of Computer Science

Keywords:
Singleton Kinds, Singleton Types, type theory, typechecking, typed compilation lambda calculus

CMU-CS-00-153.pdf (1000.78 KB) ( 177 pages)
Copyright Notice