A direct algorithm for type inference in the rank-2 fragment of the second-order λ-calculus
Assaf J. Kfoury, J. B. Wells · 1994
We examine the problem of type inference for a family of polymorphic type systems containing the power of Core-ML. This family comprises the levels of the stratification of the second-order λ-calculus (system F) by “rank” of types. We show that typability is an undecidable problem at every rank k≥3. While it was already known that typability is decidable at rank 2, no direct and easy-to-implement algorithm was available. We develop a new notion of λ-term reduction and use it to prove that the problem of typability at rank 2 is reducible to the problem of acyclic semi-unification. We also describe a simple procedure for solving acyclic semi-unification. Issues related to principle types are discussed.