Type inference with subtypes

  • Authors:
  • R. Stansifer

  • Affiliations:
  • Department of Computer Sciences, Purdue University, West Lafayette, IN

  • Venue:
  • POPL '88 Proceedings of the 15th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
  • Year:
  • 1988

Quantified Score

Hi-index 0.00

Visualization

Abstract

We give an algorithm for type inference in a language with functions, records, and variant records. A similar language was studied by Cardelli who gave a type checking algorithm. This language is interesting because it captures aspects of object-oriented programming using subtype polymorphism. We give a type system for deriving types of expressions in the language and prove the type inference algorithm is sound, i.e., it returns a type derivable from the proof system. We also prove that the type the algorithm finds is a “principal” type, i.e., one which characterizes all others. The approach taken here is due to Milner for universal polymorphism. The result is a synthesis of subtype polymorphism and universal polymorphism.