Parametric overloading in polymorphic programming languages

  • Stefan Kaes
3. Algebraic Specification And Type Concepts
Part of the Lecture Notes in Computer Science book series (LNCS, volume 300)

Abstract

The introduction of unrestricted overloading in languages with type systems based on implicit parametric polymorphism generally destroys the principal type property: namely that the type of every expression can uniformly be represented by a single type expression over some set of type variables. As a consequence, type inference in the presence of unrestricted overloading can become a NP-complete problem. In this paper we define the concept of parametric overloading as a restricted form of overloading which is easily combined with parametric polymorphism. Parametric overloading preserves the principal type property, thereby allowing the design of efficient type inference algorithms. We present sound type deduction systems, both for predefined and programmer defined overloading. Finally we state that parametric overloading can be resolved either statically, at compile time, or dynamically, during program execution.

References

  1. [ASU86]
    A.V. Aho, R. Sethi and J.D. Ullman: Compilers: Principles, Techniques, and Tools, p384, 1986.Google Scholar
  2. [BaSne86]
    R. Bahlke and G. Snelting: The PSG-System: From Formal Language Definitions to Interactive Programming Environments, TOPLAS 8,4, p547–576, October 1986.Google Scholar
  3. [BMQS80]
    R. Burstall, D.B. MacQueen and D. Sanella: HOPE: An Experimental Applicative Language, 1st International LISP Conference, Stanford 1986.Google Scholar
  4. [Coppo80]
    M. Coppo: An Extended Polymorphic Type System for Applicative Languages, LNCS 88, p194–204, September 1980.Google Scholar
  5. [DaMi82]
    L. Damas and R.Milner: Principal Type Schemes for Functional Programs, IX POPL, p207, January 1982.Google Scholar
  6. [CDDK86]
    D. Clement, J. Despeyroux, T. Despeyroux and G. Kahn: A simple applicative language: Mini-ML, 1986 ACM Symposium on LISP and Functional Programming, p13–27, 1986.Google Scholar
  7. [FuhMi87]
    Y. Fuh and P. Mishra: Type Inference With Subtypes, Manuscript, SUNY at Stony Brook, July 1987.Google Scholar
  8. [JGK87]
    M. Jäger, M. Gloger and S. Kaes: SAMPLE — A Functional Language, Report PI-R5/87, TH-Darmstadt, Fachbereich Informatik.Google Scholar
  9. [Kaes87]
    S. Kaes: Parametric Overloading in Polymorphic Programming Languages, Report PI-R7/87, TH-Darmstadt, Fachbereich Informatik.Google Scholar
  10. [Letsch86]
    T. Letschert: Typinferenzsysteme, Doctoral Thesis, TH Darmstadt, Fachbereich Informatik, 1986.Google Scholar
  11. [Milner78]
    R. Milner: A Theory of Type Polymorphism in Programming, JCCS 17,3, p348–375, 1978.Google Scholar
  12. [Milner84]
    R. Milner: A Proposal for Standard ML, 1984 ACM Symposium on LISP and Functional Programming, p184–197, Austin, August 1984.Google Scholar
  13. [Mitchell84]
    J.C. Mitchell: Coercion and Type Inference, XI POPL, p175–185, 1984.Google Scholar
  14. [MQPS84]
    D.B. MacQueen, G.D. Plotkin and R. Sethi: An Ideal Model for Recursive Polymorphic Types, XI POPL, p165–174, 1984.Google Scholar
  15. [Str67]
    C. Strachey: Fundamental Concepts in Programming Languages, International Summer School in Computer Programming, Kopenhagen 1967.Google Scholar
  16. [Turner85]
    D.A. Turner: Miranda: A non-strict Functional Language with Polymorphic Types, LNCS 201, September 1985.Google Scholar

Copyright information

© Springer-Verlag 1988

Authors and Affiliations

  • Stefan Kaes
    • 1
  1. 1.Fachbereich InformatikTechnische Hochschule DarmstadtDarmstadt

Personalised recommendations