Type Reconstruction with Recursive Types and Atomic Subtyping

We consider the problem of type reconstruction for A-terms over a type system with recursive types and atomic subsumptions. This problem reduces to the problem of solving a finite set of inequalities over infinite trees. We show how to solve such inequalities by reduction to an infinite but well-structured set of inequalities over the base types. This infinite set of inequalities is solved using Buchi automata. The resulting algorithm is in DEXPTIME. This also improves the previous NEXPTIME upper bound for type reconstruction for finite types with atomic subtyping. We show that the key steps in the algorithm are PSPACE-hard.

[1]  Mitchell Wand,et al.  Type Inference for Partial Types is Decidable , 1992, ESOP.

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

[3]  Kim B. Bruce A paradigmatic object-oriented programming language: Design, static typing and semantics , 1994, Journal of Functional Programming.

[4]  M. Rabin Weakly Definable Relations and Special Automata , 1970 .

[5]  Pierre Wolper,et al.  Automata theoretic techniques for modal logics of programs: (Extended abstract) , 1984, STOC '84.

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

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

[8]  D. Kozen,et al.  Efficient Inference of Partial Types , 1992 .

[9]  William R. Cook,et al.  Inheritance is not subtyping , 1989, POPL '90.

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

[11]  Mitchell Wand,et al.  On the complexity of type inference with coercion , 1989, FPCA.

[12]  John C. Mitchell,et al.  Algorithmic aspects of type inference with subtypes , 1992, POPL '92.

[13]  John C. Mitchell,et al.  Type inference with simple subtypes , 1991, Journal of Functional Programming.

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

[15]  Satish R. Thatte,et al.  Type Inference with Partial Types , 1988, Theor. Comput. Sci..