Abstract
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.
- ~CHANDRA, A. K., KOZEN, D., AND STACKMEYER, L., 1981. Alternation. J. ACM 28, 1, 114 133 Google Scholar
- ~CLEMENT, D., DESPEYROUX, J., DESPEYROUX, T., AND KAHN, G., 1986. A s~mple applicative ~language: Mim-ML In Proceedings of the 1986 ACM Conference on LISP anti Functional ~Programming (Cambridge, Mass., Aug. 4-5). ACM, New York, pp. 13-27. Google Scholar
- ~DAM&S, L., AND MILNER, R., 1982. Principal type-schemes for functional programs. In Proceed- ~tngs of the 9th ACM Symposatm Principles of Programming Language3 (Albuquerque, N.M., Jan. ~25 27). ACM, New York. pp. 207-212. Google Scholar
- ~DWORK, C., KANELAKIS, P., AND MITCItELL, J. C., 1984. On the sequential nature of unification. ~J. Logic Prog. 1, 35-50. Google Scholar
- ~HENGLHN, F., 1988. Type inference and semi-unification. In Proceedings of the ACM &'mpostum ~on LISP and Functional Programming (Snowbird, Ut., July 25 27). ACM, New York, pp. ~184 197. Google Scholar
- ~HENGLEIN, F., AND MAiRSON, H. G., 1991. The complexity of type reference for higher-order ~lambda calculi. In Proceedings of the 18th A CM Symposium Principles o{ Programming Languages' ~(Orlando, Fla., Jan. 21-23). ACM, New York, pp. 119 130. Google Scholar
- ~HOOVER, P. K., 1966. The undeeidabfiity of the Turing machine immortality problem. J. $~vmb. ~Logic 31, 2, 219-234.Google Scholar
- ~KANELLAKIS, P., AND MITCHELL, J C., 1989. Polymorphic unification and ML typing. In Proceed- ~rags of the 16th ACM Symposium on Principles of Programming Language~ (Austin, Tex, Jan. ~11-13). ACM, New York, pp. 105-115. Google Scholar
- ~KANELLAKIS, P., MAIRSON, H. G., AND MITCHELL, J. C., 1990. Umfication and ML type recon- ~struction. In Computational Logic: Essays tn Honor of Alan Robinson. J.-L. Lassez and G. ~Plotkin, eds. MIT Press, Cambridge, Mas~., 1990Google Scholar
- ~KAPUR, D., MUSSER, D., NARENDRAN, P., AND STILLMAN, J., 1988. Semi-unification. In Proceed- ~rags of the 8th Conference on Foundations of Software Technolo~' and Theoretical Computer ~Science (Pune, India, Dec.). Lecture Notes m Computer Science, vol. 338. Springer-Verlag, ~Berlin/New York, pp. 435-454. Google Scholar
- ~KFOURY, A. J., TIURYN, J., AND URZYCZYN, P., 1989. Computational consequences and partial ~solutions of a generalized unification problem. In Proceedings of the 4th Annual IEEE Sympo- ~sium on Logic in Computer Science. IEEE, New York, pp. 93-105. Google Scholar
- ~KFOURY, A. J., T~URYN, J., AND URZYCZYN, P., 1993. The undecidabihty of the semi-unification ~problem. Inf. Computation 102, 1 (Jan.), 83-101. Google Scholar
- ~MAIRSON, H. G., 1990. Deciding ML typability is complete for deterministic exponential time. In ~Proceedings of 17th A CM Symposium on the Pnnciples of Programming Languages (San Francisco, ~Calif., Jan. 17-19). ACM, New York, pp. 382-401. Google Scholar
- ~MILNER, R., 1978. A theory of type polymorpMsm in programming. J. Compat. Syst. Sci., 17, ~348-375.Google Scholar
- ~MILNER, }~.~ 198.5 The standard ML core language. Polvmorphism, 11, 2 (Oct.), 1-16.Google Scholar
- ~PATERSON, M. S., AND WEGMAN, M. N., 1978. Linear unification. J. Comput. Syst. Set., 16, ~158-167.Google Scholar
- ~PEYTON JONES, S. L., 1987. The hnplementation of Funcnonal Programming Languages. Prentice- ~Hall, Englewood Cliffs, N.J. Google Scholar
- ~TYSZKIEWICZ, J., 1987. Typability in the finitely typed lambda calculus in PTIME-complete. MS ~dissertation. Univ. Warsaw, Warsaw, Poland.Google Scholar
Index Terms
- An analysis of ML typability
Recommendations
Deciding ML typability is complete for deterministic exponential time
POPL '90: Proceedings of the 17th ACM SIGPLAN-SIGACT symposium on Principles of programming languagesA well known but incorrect piece of functional programming folklore is that ML expressions can be efficiently typed in polynomial time. In probing the truth of that folklore, various researchers, including Wand, Buneman, Kanellakis, and Mitchell, ...
Relating typability and expressiveness in finite-rank intersection type systems (extended abstract)
ICFP '99: Proceedings of the fourth ACM SIGPLAN international conference on Functional programmingWe investigate finite-rank intersection type systems, analyzing the complexity of their type inference problems and their relation to the problem of recognizing semantically equivalent terms. Intersection types allow something of type τ1 Λ &...
Relating typability and expressiveness in finite-rank intersection type systems (extended abstract)
We investigate finite-rank intersection type systems, analyzing the complexity of their type inference problems and their relation to the problem of recognizing semantically equivalent terms. Intersection types allow something of type τ1 Λ &...
Comments