Contractive Signatures with Recursive Types, Type Parameters, and Abstract Types
Although theories of equivalence or subtyping for recursive types have been extensively investigated, sophisticated interaction between recursive types and abstract types has gained little attention. The key idea behind type theories for recursive types is to use syntactic contractiveness, meaning every μ-bound variable occurs only under a type constructor such as → or ∗. This syntactic contractiveness guarantees the existence of the unique solution of recursive equations and thus has been considered necessary for designing a sound theory for recursive types. However, in an advanced type system, such as OCaml, with recursive types, type parameters, and abstract types, we cannot easily define the syntactic contractiveness of types. In this paper, we investigate a sound type system for recursive types, type parameters, and abstract types. In particular, we develop a new semantic notion of contractiveness for types and signatures using mixed induction and coinduction, and show that our type system is sound with respect to the standard call-by-value operational semantics, which eliminates signature sealings. Moreover we show that while non-contractive types in signatures lead to unsoundness of the type system, they may be allowed in modules. We have also formalized the whole system and its type soundness proof in Coq.
Unable to display preview. Download preview PDF.
- 1.OCaml, http://caml.inria.fr/ocaml/
- 4.Crary, K., Harper, R., Puri, S.: What is a recursive module? In: PLDI 1999 (1999)Google Scholar
- 7.Im, H., Nakata, K., Garrigue, J., Park, S.: A syntactic type system for recursive modules. In: OOPSLA 2011 (2011)Google Scholar
- 9.MacQueen, D., Plotkin, G., Sethi, R.: An ideal model for recursive polymorphic types. In: POPL 1984 (1984)Google Scholar
- 11.Milner, R., Tofte, M., Harper, R., MacQueen, D.: The Definition of Standard ML (Revised). The MIT Press (1997)Google Scholar
- 12.Montagu, B.: Programming with first-class modules in a core language with subtyping, singleton kinds and open existential types. PhD thesis, École Polytechnique, Palaiseau, France (December 2010)Google Scholar
- 13.Montagu, B., Rémy, D.: Modeling abstract types in modules with open existential types. In: POPL 2009 (2009)Google Scholar
- 14.Nakata, K., Uustalu, T.: Resumptions, weak bisimilarity and big-step semantics for While with interactive I/O: An exercise in mixed induction-coinduction. In: SOS 2010, pp. 57–75 (2010)Google Scholar
- 15.Rossberg, A., Dreyer, D.: Mixin’ up the ML module system. ACM Transactions on Programming Languages and Systems 35(1), 2:1–2:84 (2013)Google Scholar
- 17.Solomon, M.: Type definitions with parameters (extended abstract). In: POPL 1978 (1978)Google Scholar
- 18.Stone, C.A., Schoonmaker, A.P.: Equational theories with recursive types (2005), http://www.cs.hmc.edu/~stone/publications.html