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.
Similar content being viewed by others
References
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.
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.
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.
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.
Cardelli, L. and Wegner, P. On understanding types, data abstraction and polymorphism. Computing Surverys, 17(4):471–522, December 1985.
Courcelle, B. Infinite trees in normal form and recursive equations having a unique solution. Mathematical Systems Theory, 13:131–180, 1979.
Curtis, P. Constrained quantification in polymorphic type analysis. Technical Report CSL-90-1, Xerox Parc, February 1990.
Eifrig, J., Smith, S., and Trifonov, V. Sound polymorphic type inference for objects. In OOPSLA' 96. 1995.
Fähndrich, M. and Aiken, A. Making set-constraint program analyses scale. In CP96 Workshop on Set Constraints. August 1996.
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.
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.
Koenig, A. An anecdote about ML type inference. In Proceedings of the USENIX 1994 Symposium on Very High Level Languages, October 1994.
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.
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.
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.
Pottier, F. Simplifying subtyping constraints. In Proceedings of the 1996 ACM SIGPLAN International Conference on Functional Programming, May 1996, pp. 122–133.
Smith, G.S. Principal type schemes for functional programs with overloading and subtyping. Science of Computer Programming, 23:197–226, 1994.
Author information
Authors and Affiliations
Rights 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
Issue Date:
DOI: https://doi.org/10.1023/A:1010056315933