Coercion and type inference

  • Authors:
  • John C. Mitchell

  • Affiliations:
  • Bell Laboratories, Murray Hill, New Jersey

  • Venue:
  • POPL '84 Proceedings of the 11th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
  • Year:
  • 1984

Quantified Score

Hi-index 0.00

Visualization

Abstract

A simple semantic model of automatic coercion is proposed. This model is used to explain four rules for inferring polymorphic types and providing automatic coercions between types. With the addition of a fifth rule, the rules become semantically complete but the set of types associated with an expression may be undecidable. An efficient type checking algorithm based on the first four rules is presented. The algorithm is guaranteed to find a type whenever a type can be deduced using the four inference rules. The type checking algorithm may be modified so that calls to type conversion functions are inserted at compile time.