Satisfying Subtype Inequalities in Polynomial Space

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.

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

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

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

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

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

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

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

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

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

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

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

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

[13]  F. Baader,et al.  Uniication Theory , 1999 .

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

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

[16]  Jerzy Tiuryn,et al.  Satissability of Inequalities in a Poset , .

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

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

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