Efficient recursive subtyping

Subtyping in the presence of recursive types for the λ-calculus was studied by Amadio and Cardelli in 1991 [1]. In that paper they showed that the problem of deciding whether one recursive type is a sub-type of another is decidable in exponential time. In this paper we give an O(n2) algorithm. Our algorithm is based on a simplification of the definition of the subtype relation, which allows us to reduce the problem to the emptiness problem for a certain finite automaton with quadratically many states. It is known that equality of recursive types and the covariant Bo¨hm order can be decided efficiently by means of finite automata. Our results extend the automata-theoretic approach to handle orderings based on contravariance.

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

[2]  Bruno Courcelle,et al.  Fundamental Properties of Infinite Trees , 1983, Theoretical Computer Science.

[3]  Luca Cardelli,et al.  On understanding types, data abstraction, and polymorphism , 1985, CSUR.

[4]  Bernard Robinet,et al.  Combinators and Functional Programming Languages , 1986 .

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

[6]  Jens Palsberg,et al.  Efficient inference of partial types , 1992, Proceedings., 33rd Annual Symposium on Foundations of Computer Science.

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

[8]  Luca Cardelli,et al.  Typeful Programming , 1989, Formal Description of Programming Concepts.

[9]  Jeffrey D. Ullman,et al.  Introduction to Automata Theory, Languages and Computation , 1979 .

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