Deciding Type Equivalence in a Language with Singleton Kinds,
CARNEGIE-MELLON UNIV PITTSBURGH PA SCHOOL OF COMPUTER SCIENCE
Pagination or Media Count:
Work on the TILT compiler for Standard ML led us to study a language with singleton kinds SA is the kind of all types provably equivalent to the type A. Singletons are interesting because they provide a very general form of definitions for type variables and allow fine-grained control of type computations. Internally, TILT represents programs using a predicative variant of Girards Fomega enriched with singleton kinds, dependent product and function kinds sigma and II, and a sub-kinding relation. An important benefit of using a typed language as the representation of programs is that typechecking can detect many common compiler implementation errors. However, the decidability of typechecking for our particular representation is not obvious. In order to typecheck a term, we 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 paper we concentrate on the key issue for decidability of typechecking determining the equivalence of well-formed type constructors. We show this problem decidable by presenting a sound, complete, and terminating decision algorithm. These properties are established by a novel Kripke-style logical relations argument inspired by Coquands result for type theory.
- Computer Programming and Software