The complexity of type inference for higher-order typed lambda calculi
- 1 April 1994
- journal article
- research article
- Published by Cambridge University Press (CUP) in Journal of Functional Programming
- Vol. 4 (4) , 435-477
- https://doi.org/10.1017/s0956796800001143
Abstract
We analyse the computational complexity of type inference for untyped λ-terms in the second-order polymorphic typed λ-calculus (F2) invented by Girard and Reynolds, as well as higher-order extensionsF3,F4, …,Fωproposed by Girard. We prove that recognising theF2-typable terms requires exponential time, and forFωthe problem is non-elementary. We show as well a sequence of lower bounds on recognising theFk-typable terms, where the bound forFk+1is exponentially larger than that forFk.The lower bounds are based on generic simulation of Turing Machines, where computation is simulated at the expression and type level simultaneously. Non-accepting computations are mapped to non-normalising reduction sequences, and hence non-typable terms. The accepting computations are mapped to typable terms, where higher-order types encode reduction sequences, and first-order types encode the entire computation as a circuit, based on a unification simulation of Boolean logic. A primary technical tool in this reduction is the composition of polymorphic functions having different domains and ranges.These results are the first nontrivial lower bounds on type inference for the Girard/Reynolds system as well as its higher-order extensions. We hope that the analysis provides important combinatorial insights which will prove useful in the ultimate resolution of the complexity of the type inference problem.Keywords
This publication has 25 references indexed in Scilit:
- A theory of type polymorphism in programmingPublished by Elsevier ,2003
- Quantifier elimination and parametric polymorphism in programming languagesJournal of Functional Programming, 1992
- On the sequential nature of unificationThe Journal of Logic Programming, 1984
- The circuit value problem is log space complete for PACM SIGACT News, 1975
- The Principal Type-Scheme of an Object in Combinatory LogicTransactions of the American Mathematical Society, 1969
- Intensional interpretations of functionals of finite type IThe Journal of Symbolic Logic, 1967
- The next 700 programming languagesCommunications of the ACM, 1966
- On the Computational Complexity of AlgorithmsTransactions of the American Mathematical Society, 1965
- On the computational complexity of algorithmsTransactions of the American Mathematical Society, 1965
- A Machine-Oriented Logic Based on the Resolution PrincipleJournal of the ACM, 1965