Deciding ML typability is complete for deterministic exponential time

  title={Deciding ML typability is complete for deterministic exponential time},
  author={Harry G. Mairson},
  booktitle={POPL '90},
A 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, constructed simple counterexamples consisting of typable ML programs having length n, with principal types having &OHgr;(2cn) distinct type variables and length &OHgr;(22cn). When the types associated with these ML constructions were represented as… 

Figures from this paper

Unification and ML-Type Reconstruction
The generic simulation of any exponential time Turing Machine by ML type reconstruction may be viewed as a nonstandard way of computing with types and its worst-case lower bounds stand in contrast to practical experience, which suggests that commonly used algorithms for type reconstruction do not slow compilation substantially.
On the Complexity of ML Typability with Overloading
It is shown that under a correct notion of well-typed terms, the problem of determining whether a term is well typed with respect to an assumption set in an ML-style type system is undecidable, and a limited form of recursion called parametric recursion is considered.
Inferring Recursive Data Types
The result is that for any xed bound on order and arity Hindley-Milner typability can be determined in pseudo-linear time, i.e., O(nn(n)) where is the inverse Ackerman function and the last two results suggest that let-polymorphism over simple types is fundamentally more tractable than let- poly Morphism over recursive types.
An analysis of ML typability
It is proved that ML typability and acyclic semi-unification can be reduced to each other in polynomial time.
Efficient type inference using ranked type variables
Two ranking systems based on lambda depth, used in the SML/NJ compiler and OCaml, are formalized, both with and without the value restriction, and they are proved correct relative to the classic algorithm W.
Type Inference with Inequalities
This work considers an implicitly typed language equipped with recursive types, multiple inheritance, 1st order parametric polymorphism, and assignments, and type correctness as satisfiability of a possibly infinite collection of inequalities on the types of variables and expressions.
Incremental Polymorphism Incremental Polymorphism
An incremental typing mechanism in which top-level phrases can be compiled one by one, in any order, and repeatedly (due to editing), and it is shown that the incremental type system is sound and complete with respect to the more traditional \batch system.
The Nimble Type Inferencer for Common Lisp-84
Kaplan's algorithm provides the maximal amount of information, but it depends upon a rather simplified model for a programming language: a language with variables and iteration, but no recursion or data structures.
Syntactic Properties of Polymorphic Subtyping
This paper identifies a new instance relation on typing judgements, the halbstark relation, and presents a sound and complete type inference algorithm in the style of Milner's Algorithm W, which provides a generalized correctness argument for Al algorithm W independent of any particular constraint simplification strategy chosen.


Polymorphic unification and ML typing
After observing that ML typing is in DEXPTIME, it is shown that polymorphic unification is PSPACE hard, and it is proved that recognizing the typable core ML programs is also PSPACEhard.
A Theory of Type Polymorphism in Programming
  • R. Milner
  • Computer Science
    J. Comput. Syst. Sci.
  • 1978
On the Sequential Nature of Unification
Partial polymorphic type inference and higher-order unification
  • F. Pfenning
  • Computer Science
    LISP and Functional Programming
  • 1988
It is shown that the problem of partial type inference in the nth-order polymorphic &lgr;-calculus is equivalent to n fourth-order unification, and an implementation in &l gr;Prolog in full is presented.
The undecidability of the semi-unification problem
It is shown that SUP in general is undecidable, by reducing what is called the "boundedness problem of Turing machines to SUP", which is a natural generalization of both first-order unification and matching.
The Design and Analysis of Computer Algorithms
This text introduces the basic data structures and programming techniques often used in efficient algorithms, and covers use of lists, push-down stacks, queues, trees, and graphs.
Proofs and types
Sense, denotation and semantics natural deduction the Curry-Howard isomorphism the normalisation theorem Godel's system T coherence spaces denotational semantics of T sums in natural deduction system
Structure and Interpretation of Computer Programs
Structure and Interpretation of Computer Programs emphasizes the central role played by different approaches to dealing with time in computational models, appropriate for an introduction to computer science courses, as well as programming languages and program design.