Abstract

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.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call