|
Abstract : |
We analyze the computational complexity of type inference for untyped-terms in the second-order polymorphic typed-calculus (F 2) invented by Girard and Reynolds, as well as higher-order extensions F 3; F 4; : : : ; F! proposed by Girard. We prove that recognizing the F 2-typable terms requires exponential time, and for F! the problem is nonelementary. We show as well a sequence of lower bounds on recognizing the F k-typable terms, where the bound for F k+1 is exponentially larger than that for F k. 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-normalizing 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., |