Satisfying subtype inequalities in polynomial space

This paper studies the complexity of type inference in l-calculus with subtyping. Infering types is equivalent to solving systems of subtype inequalities. These inequalities are solved over simple types ordered structurally from an arbitrary set of base subtype assumptions. In this case, we give a new PSPACE upper bound. Together with the previously known lower bound, this result settles completely the complexity of the problem, which is PSPACE-complete. We use a technique of independent theoretical interest that simplifies existing methods developed in the literature. Finally, we show how our polynomial space algorithm, although mainly theoretical, can lead to a slight practical improvement of existing implementations. Copyright 2002 Elsevier Science B.V.

[1]  Scott F. Smith,et al.  Subtyping Constrained Types , 1996, SAS.

[2]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[3]  John C. Mitchell,et al.  Lower bounds on type inference with subtypes , 1995, POPL '95.

[4]  Marcin Benke,et al.  Some Complexity Bounds for Subtype Inequalities , 1999, Theor. Comput. Sci..

[5]  Franz Baader,et al.  Unification theory , 1986, Decis. Support Syst..

[6]  Jerzy Tiuryn,et al.  Satisfiability of Inequalities in a Poset , 1996, Fundam. Informaticae.

[7]  Prateek Mishra,et al.  Type Inference with Subtypes , 1990, Theor. Comput. Sci..

[8]  Prateek Mishra,et al.  Polymorphic Subtype Inference: Closing the Theory-Practice Gap , 1989, TAPSOFT, Vol.2.

[9]  Jerzy Tiuryn,et al.  Type Reconstruction with Recursive Types and Atomic Subtyping , 1993, TAPSOFT.

[10]  Jens Palsberg,et al.  A type system equivalent to flow analysis , 1995, TOPL.

[11]  John C. Mitchell,et al.  Coercion and type inference , 1984, POPL.

[12]  Luca Cardelli,et al.  Subtyping recursive types , 1993 .

[13]  Marcin Benke Efficient Type Reconstruction in the Presence of Inheritance , 1993, MFCS.

[14]  Jerzy Tiuryn Subtype inequalities , 1992, [1992] Proceedings of the Seventh Annual IEEE Symposium on Logic in Computer Science.

[15]  Stephan Merz,et al.  Type checking higher-order polymorphic multi-methods , 1997, POPL '97.

[16]  Luca Cardelli,et al.  Subtyping recursive types , 1991, POPL '91.

[17]  B. Courcelle Fundamental properties of infinite trees , 1983 .

[18]  Jens Palsberg,et al.  Efficient recursive subtyping , 1992, POPL '93.

[19]  Bruno Courcelle,et al.  Fundamental Properties of Infinite Trees , 1983, Theor. Comput. Sci..