SAS 1997: Static Analysis pp 265-277 | Cite as
Satisfying subtype inequalities in polynomial space
Abstract
This paper studies the complexity of type inference in λ-calculus with subtyping. Type inference is equivalent to solving systems of subtype inequalities. We consider simple types ordered structurally from an arbitrary set of base subtype assumptions. In this case, we give a PSPACE upper bound. Together with the known lower bound, this result settles completely the complexity of type inference over simple types, which is PSPACE-complete. We use a technique of independent theoretical interest that simplifies existing methods developed in the literature. Finally the algorithm, although mainly theoretical, can lead to a slight practical improvement of existing implementations.
Keywords
Finite Type Simple Type Type Inference Polynomial Space Conference RecordPreview
Unable to display preview. Download preview PDF.
References
- [AC93]Roberto M. Amadio and Luca Cardelli. Subtyping recursive types. ACM Transactions on Programming Languages and Systems, 15(4):575–631, September 1993.Google Scholar
- [Ben94]Marcin Benke. Efficient type reconstruction in the presence of inheritance. Technical Report TR 94-10(199), Institute of Informatics, Warsaw University, December 1994.Google Scholar
- [Ben95]Marcin Benke. Some complexity bounds for subtype inequalities. Technical Report TR 95-20(220), Institute of Informatics, Warsaw University, 1995.Google Scholar
- [BM97]François Bourdoncle and Stephan Merz. Type checking higher-order polymorphic multi-methods. In Conference Record of the 24th Annual ACM Symposium on Principles of Programming Languages, pages 302–315, Paris, January 1997. ACM.Google Scholar
- [BS94]Franz Baader and Jörg H. Siekmann. Unification theory. In D.M. Gabbay, C.J. Hogger, and J.A. Robinson, editors, Handbook of Logic in Artificial Intelligence and Logic Programming. Oxford University Press, Oxford, UK, 1994.Google Scholar
- [Cou83]Bruno Courcelle. Fundamental properties of infinite trees. Theoretical Computer Science, 25:95–169, 1983.Google Scholar
- [FM88]You-Chin Fuh and Prateek Mishra. Type inference with subtypes. In H. Ganzinger, editor, Proceedings of the European Symposium on Programming, volume 300 of Lecture Notes in Computer Science, pages 94–114. Springer Verlag, 1988.Google Scholar
- [FM89]You-Chin Fuh and Prateek Mishra. Polymorphic subtype inference: Closing the theory-practice gap. In J. Díaz and F. Orejas, editors, Proceedings of the International Joint Conference on Theory and Practice of Software Development: Vol. 2, pages 167–183. LNCS 352. Springer, March 1989.Google Scholar
- [HM95]My Hoang and John C. Mitchell. Lower bounds on type inference with subtypes. In Conference Record of POPL '95: 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 176–185, San Francisco, California, January 1995.Google Scholar
- [KPS93]D. Kozen, J. Palsberg, and M. I. Schwartzbach. Efficient recursive subtyping. In ACM, editor, Conference Record of the Twentieth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 419–428, Charleston, South Carolina, January 1993.Google Scholar
- [Mil78]Robin Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17(3):348–375, December 1978.Google Scholar
- [Mit84]J. Mitchell. Coercion and type inference (summary). In Conference Record of the Eleventh Annual ACM Symposium on Principles of Programming Languages, pages 175–185. ACM, ACM, January 1984.Google Scholar
- [Pap94]Christos H. Papadimitriou. Computational Complexity. Addison-Wesley, 1994.Google Scholar
- [P095]Jens Palsberg and Patrick O'Keefe. A type system equivalent to flow analysis. In Conference Record of POPL '95:22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 367–378, San Francisco, California, January 1995.Google Scholar
- [PT95]Vaughan Pratt and Jerzy Tiuryn. Satisfiability of inequalities in a poset. Technical Report TR 95-15(215), Institute of Informatics, Warsaw University, 1995.Google Scholar
- [Tiu92]Jerzy Tiuryn. Subtype inequalities. In Proceedings, Seventh Annual IEEE Symposium on Logic in Computer Science, pages 308–315, Santa Cruz, California, 22–25 June 1992. IEEE Computer Society Press.Google Scholar
- [TS96]Valery Trifonov and Scott Smith. Subtyping constrained types. In Springer Verlag, editor, Proceedings of the Third International Symposium on Static Analysis (SAS' 96), number 1145 in Lecture Notes in Computer Science, pages 349–365, Aachen, Germany, September 1996.Google Scholar
- [TW93]Jerzy Tiuryn and Mitchell Wand. Type reconstruction with recursive 1655 0699 V 2 types and atomic subtyping. In CARP '93: 18th Colloquium on Trees in Algebra and Programming, July 1993.Google Scholar