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]  Mitchell Wand,et al.  Type Inference for Partial Types is Decidable , 1992, ESOP.

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

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

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

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

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

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

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