An analysis of ML typability

We carry out an analysis of typability of terms in ML. Our main result is that this problem is DEXPTIME-hard, where by DEXPTIME we mean DTIME(2n0(1)). This, together with the known exponential-time algorithm that solves the problem, yields the DEXPTIME-completeness result. This settles an open problem of P. Kanellakis and J. C. Mitchell. Part of our analysis is an algebraic characterization of ML typability in terms of a restricted form of semi-unification, which we identify as acyclic semi-unification. We prove that ML typability and acyclic semi-unification can be reduced to each other in polynomial time. We believe this result is of independent interest.

[1]  Mike Paterson,et al.  Linear unification , 1976, STOC '76.

[2]  Jerzy Tiuryn,et al.  The Undecidability of the Semi-unification Problem , 1993, Inf. Comput..

[3]  Simon Peyton Jones,et al.  The Implementation of Functional Programming Languages (Prentice-hall International Series in Computer Science) , 1987 .

[4]  John C. Mitchell,et al.  On the Sequential Nature of Unification , 1984, J. Log. Program..

[5]  Dominique Clément,et al.  A simple applicative language: mini-ML , 1986, LFP '86.

[6]  Jerzy Tiuryn,et al.  The undecidability of the semi-unification problem , 1990, STOC '90.

[7]  Philip K. Hooper The undecidability of the Turing machine immortality problem , 1966, Journal of Symbolic Logic.

[8]  Fritz Henglein,et al.  Type inference and semi-unification , 1988, LISP and Functional Programming.

[9]  Harry G. Mairson,et al.  The complexity of type inference for higher-order lambda calculi , 1991, POPL '91.

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

[11]  John C. Mitchell,et al.  Polymorphic unification and ML typing , 1989, POPL '89.

[12]  Paliath Narendran,et al.  Semi-Unification , 1991, Theor. Comput. Sci..

[13]  Robin Milner The standard ML core language , 1984 .

[14]  Jerzy Tiuryn,et al.  Computational consequences and partial solutions of a generalized unification problem , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[15]  Harry G. Mairson Deciding ML typability is complete for deterministic exponential time , 1989, POPL '90.

[16]  Harry G. Mairson,et al.  Unification and ML-Type Reconstruction , 1991, Computational Logic - Essays in Honor of Alan Robinson.

[17]  Simon L. Peyton Jones,et al.  The Implementation of Functional Programming Languages , 1987 .

[18]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.