On the complexity of ML typability with overloading
We examine the complexity of type checking in an ML-style type system that permits functions to be overloaded with different types. In particular, we consider the extension of the ML type system proposed by Wadler and Blott in the appendix of [WB89], with global overloading only, that is, where the only overloading is that which exists in an initial type assumption set; no local overloading via over and inst expressions is allowed. It is shown that under a correct notion of well-typed terms, the problem of determining whether a term is well typed with respect to an assumption set in this system is undecidable. We then investigate limiting recursion in assumption sets, the source of the undecidability. Barring mutual recursion is considered, but this proves too weak, for the problem remains undecidable. Then we consider a limited form of recursion called parametric recursion. We show that although the problem becomes decidable under parametric recursion, it appears harder than conventional ML typability, which is complete for DEXPTIME [Mai90].
Unable to display preview. Download preview PDF.
- [DM82]Damas, L. and Milner, R., Principal type-schemes for functional programs. Proc. 9th Annual ACM Symp. on Principles of Prog. Lang., pp. 207–212, January 1982.Google Scholar
- [HMT88]Harper, R., Milner, R. and Tofte, M., The definition of Standard ML. Version 2, ECS-LFCS-88-62, University of Edinburgh, August 1988.Google Scholar
- [Hin69]Hindley, R., The principal type scheme of an object in combinatory logic. Trans. Amer. Math. Soc., 146, pp. 29–60, December 1969.Google Scholar
- [HU79]Hopcroft, J. and Ullman, J., Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, 1979.Google Scholar
- [HW90]Hudak, P. and Wadler, P., Report on the Programming Language Haskell. Version 1.0, Yale University, April 1990.Google Scholar
- [Kae88]Kaes, S., Parametric overloading in polymorphic programming languages. In Lecture Notes in Comp. Sci., Proc. of the 2nd European Symp. on Programming, 300, pp. 131–144, 1988.Google Scholar
- [Mai90]Mairson, H., Deciding ML typability is complete for deterministic exponential time. Proc. 17th Annual ACM Symp. on Principles of Prog. Lang., pp. 382–401, January 1990.Google Scholar
- [Mil78]Milner, R., A theory of type polymorphism in programming. J. Comp. System Sci., 17, pp. 348–375, 1978.Google Scholar
- [MH88]Mitchell, J. and Harper, R., The essence of ML. Proc. 15th Annual ACM Symp. on Principles of Prog. Lang., pp. 28–46, January 1988.Google Scholar
- [Smi89]Smith, G.S., Overloading and bounded polymorphism. TR 89-1054, Department of Computer Science, Cornell University, November 1989.Google Scholar
- [Tur86]Turner, D.A., An overview of Miranda. SIGPLAN Notices, December 1986.Google Scholar
- [WB89]Wadler, P. and Blott, S., How to make ad-hoc polymorphism less ad-hoc. Proc. 16th Annual ACM Symp. on Principles of Prog. Lang., pp. 60–76, January 1989.Google Scholar