Advertisement

Polymorphic type inference with overloading and subtyping

  • Geoffrey S. Smith
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 668)

Abstract

We show how the Hindley/Milner polymorphic type system can be extended to incorporate overloading and subtyping, by using constrained quantification. We describe an algorithm for inferring principal types and outline a proof of its soundness and completeness. We find that it is necessary in practice to simplify the inferred types, and we describe techniques for type simplification that involve shape unification, strongly connected components, transitive reduction, and the monotonicities of type formulas.

References

  1. [1]
    Pavel Curtis. Constrained Quantification in Polymorphic Type Analysts. PhD thesis, Cornell University, January 1990.Google Scholar
  2. [2]
    Luis Damas and Robin Milner. Principal type-schemes for functional programs. In 9th ACM Symposium on Principles of Programming Languages, pages 207–212, 1982.Google Scholar
  3. [3]
    You-Chin Fuh and Prateek Mishra. Polymorphic subtype inference: Closing the theory-practice gap. In TAPSOFT '89, volume 352 of Lecture Notes in Computer Science, pages 167–183. Springer-Verlag, 1989.Google Scholar
  4. [4]
    You-Chin Fuh and Prateek Mishra. Type inference with subtypes. Theoretical Computer Science, 73:155–175, 1990.CrossRefGoogle Scholar
  5. [5]
    J. Roger Hindley. The principal type-scheme of an object in combinatory logic. Transactions of the American Mathematical Society, 146:29–60, December 1969.Google Scholar
  6. [6]
    Stefan Kaes. Parametric overloading in polymorphic programming languages. In H. Ganzinger, editor, ESOP '88, volume 300 of Lecture Notes in Computer Science, pages 131–144. Springer-Verlag, 1988.Google Scholar
  7. [7]
    Robin Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17:348–375, 1978.CrossRefGoogle Scholar
  8. [8]
    John C. Mitchell. Coercion and type inference (summary). In Eleventh ACM Symposium on Principles of Programming Languages, pages 175–185, 1984.Google Scholar
  9. [9]
    John C. Reynolds. Transformational systems and the algebraic structure of atomic formulas. Machine Intelligence, 5:135–151, 1970.Google Scholar
  10. [10]
    John C. Reynolds. Three approaches to type structure. In Mathematical Foundations of Software Development, volume 185 of Lecture Notes in Computer Science, pages 97–138. Springer-Verlag, 1985.Google Scholar
  11. [11]
    Geoffrey S. Smith. Polymorphic Type Inference for Languages with Overloading and Subtyping. PhD thesis, Cornell University, August 1991.Google Scholar
  12. [12]
    Ryan Stansifer. Type inference with subtypes. In Fifteenth ACM Symposium on Principles of Programming Languages, pages 88–97, 1988.Google Scholar
  13. [13]
    Dennis M. Volpano and Geoffrey S. Smith. On the complexity of ML typability with overloading. In Conference on Functional Programming Languages and Computer Architecture, volume 523 of Lecture Notes in Computer Science, pages 15–28. Springer-Verlag, August 1991.Google Scholar
  14. [14]
    Philip Wadler and Stephen Blott. How to make ad-hoc polymorphism less ad hoc. In 16th ACM Symposium on Principles of Programming Languages, pages 60–76, 1989.Google Scholar
  15. [15]
    Mitchell Wand and Patrick O'Keefe. On the complexity of type inference with coercion. In Conference on Functional Programming Languages and Computer Architecture, 1989.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1993

Authors and Affiliations

  • Geoffrey S. Smith
    • 1
  1. 1.Cornell UniversityUSA

Personalised recommendations