Abstract
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].
The authors acknowledge joint support from the NSF and DARPA under grant ASC-88-00465.
This is a preview of subscription content, log in via an institution.
Preview
Unable to display preview. Download preview PDF.
References
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.
Harper, R., Milner, R. and Tofte, M., The definition of Standard ML. Version 2, ECS-LFCS-88-62, University of Edinburgh, August 1988.
Hindley, R., The principal type scheme of an object in combinatory logic. Trans. Amer. Math. Soc., 146, pp. 29–60, December 1969.
Hopcroft, J. and Ullman, J., Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, 1979.
Hudak, P. and Wadler, P., Report on the Programming Language Haskell. Version 1.0, Yale University, April 1990.
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.
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.
Milner, R., A theory of type polymorphism in programming. J. Comp. System Sci., 17, pp. 348–375, 1978.
Mitchell, J. and Harper, R., The essence of ML. Proc. 15th Annual ACM Symp. on Principles of Prog. Lang., pp. 28–46, January 1988.
Smith, G.S., Overloading and bounded polymorphism. TR 89-1054, Department of Computer Science, Cornell University, November 1989.
Turner, D.A., An overview of Miranda. SIGPLAN Notices, December 1986.
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.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Volpano, D.M., Smith, G.S. (1991). On the complexity of ML typability with overloading. In: Hughes, J. (eds) Functional Programming Languages and Computer Architecture. FPCA 1991. Lecture Notes in Computer Science, vol 523. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3540543961_2
Download citation
DOI: https://doi.org/10.1007/3540543961_2
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-54396-1
Online ISBN: 978-3-540-47599-6
eBook Packages: Springer Book Archive