Skip to main content
Log in

Optimal Representations of Polymorphic Types with Subtyping

  • Published:
Higher-Order and Symbolic Computation

Abstract

Many type inference and program analysis systems include notions of subtyping and parametric polymorphism. When used together, these two features induce equivalences that allow types to be simplified by eliminating quantified variables. Eliminating variables both improves the readability of types and the performance of algorithms whose complexity depends on the number of type variables. We present an algorithm for simplifying quantified types in the presence of subtyping and prove it is sound and complete for non-recursive and recursive types. We also show that an extension of the algorithm is sound but not complete for a type language with intersection and union types, as well as for a language of constrained types.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Aiken, A. and Murphy, B. Implementing regular tree expressions. In Proceedings of the 1991 Conference on Functional Programming Languages and Computer Architecture. August 1991, pp. 427–447.

  2. Aiken, A. and Wimmers, E. Type inclusion constraints and type inference. In Proceedings of the 1993 Conference on Functional Programming Languages and Computer Architecture. Copenhagen, Denmark, June 1993, pp. 31–41.

  3. Aiken, A., Wimmers, E., and Lakshman, T.K. Soft typing with conditional types. In Twenty-First Annual ACM Symposium on Principles of Programming Languages. Portland, Oregon, January 1994, pp. 163–173.

  4. Amadio, R.M. and Cardelli, L. Subtyping recursive types. ACM Transactions on Programming Languages and Systems, 15(4):575–631, 1993. Also in Proc. POPL'91.

    Google Scholar 

  5. Cardelli, L. and Wegner, P. On understanding types, data abstraction and polymorphism. Computing Surverys, 17(4):471–522, December 1985.

    Google Scholar 

  6. Courcelle, B. Infinite trees in normal form and recursive equations having a unique solution. Mathematical Systems Theory, 13:131–180, 1979.

    Google Scholar 

  7. Curtis, P. Constrained quantification in polymorphic type analysis. Technical Report CSL-90-1, Xerox Parc, February 1990.

  8. Eifrig, J., Smith, S., and Trifonov, V. Sound polymorphic type inference for objects. In OOPSLA' 96. 1995.

  9. Fähndrich, M. and Aiken, A. Making set-constraint program analyses scale. In CP96 Workshop on Set Constraints. August 1996.

  10. Henglein, F. and Mossin, C. Polymorphic binding-time analysis. In Proceedings of European Symposium on Programming, D. Sannella (Ed.) vol. 788, April 1994, Lecture Notes in Computer Science, Springer-Verlag, pp. 287–301.

  11. Kaes, S. Type inference in the presence of overloading, subtyping and recursive types. In 1992 ACM Conference on Lisp and Functional Programming. San Francisco, California. LISP Pointers V, 1, June 1992, pp. 193–204.

    Google Scholar 

  12. Koenig, A. An anecdote about ML type inference. In Proceedings of the USENIX 1994 Symposium on Very High Level Languages, October 1994.

  13. MacQueen, D., Plotkin, G., and Sethi, R. An ideal model for recursive polymophic types. In Eleventh Annual ACM Symposium on Principles of Programming Languages, January 1984, pp. 165–174.

  14. Mitchell, J.C. and Harper, R. The essence of ML. In Fifteenth Annual ACM Symposium on Principles of Programming Languages, January 1988, pp. 28–46.

  15. Palsberg, J. and O'Keefe, P. A type system equivalent to flow analysis. ACM Transactions on Programming Languages and Systems, 17(4):576–599, 1995. Preliminary version in Proc. POPL'95, 22nd Annual SIGPLAN–SIGACT Symposium on Principles of Programming Languages. San Francisco, California, January 1995, pp. 367–378.

    Google Scholar 

  16. Pottier, F. Simplifying subtyping constraints. In Proceedings of the 1996 ACM SIGPLAN International Conference on Functional Programming, May 1996, pp. 122–133.

  17. Smith, G.S. Principal type schemes for functional programs with overloading and subtyping. Science of Computer Programming, 23:197–226, 1994.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Aiken, A., Wimmers, E.L. & Palsberg, J. Optimal Representations of Polymorphic Types with Subtyping. Higher-Order and Symbolic Computation 12, 237–282 (1999). https://doi.org/10.1023/A:1010056315933

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/A:1010056315933

Navigation