We extend polymorphic type inference to include subtypes. This paper describes the following results:•We prove the existence of (i) principal type property and (ii) syntactic completeness of the type checker, for type inference with subtypes. This result is developed with only minimal assumptions on the underlying theory of subtypes.•For a particular “structured” theory of subtypes, those engendered by coercions between type constants only, we prove that principal types are compactly expressible. This suggests that a practical type checker for the structured theory of subtypes is feasible.•We develop efficient algorithms for such a type checker. There are two main algorithms: MATCH and CONSISTENT. The first can be thought of as an extension to the unification algorithm. The second, which has no analogue in conventional type inference, determines whether a set of coercions is consistent. Thus, an extension of polymorphic type inference that incorporates the “structured” theory of subtypes is practical and yields greater polymorphic flexibility. We have begun work on an implementation.
CITATION STYLE
Fuh, Y. C., & Mishra, P. (1988). Type inference with subtypes. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 300 LNCS, pp. 94–114). Springer Verlag. https://doi.org/10.1007/3-540-19027-9_7
Mendeley helps you to discover research relevant for your work.