Complete and tractable machine-independent characterizations of second-order polytime
Emmanuel Hainry, Bruce M. Kapron, Jean-Yves Marion, Romain Péchoux
TL;DR
This work addresses the problem of machine-independent, tractable characterization of the second-order polynomial-time class ${\tt BFF}$. It develops a higher-order programming language with a two-layer type system that enforces safe/terminating behavior, and proves that typable and terminating programs characterize ${\tt BFF}$, even without lambda-abstraction. A rank-based variant (rank-0) shows lambda-abstraction is not essential for completeness, and type inference is shown to be polynomial-time in the safe settings. To ensure practical feasibility, the authors introduce ${\rm SCP}_{\rm S}$, a termination criterion computable in quadratic time that preserves completeness, yielding a tractable, complete, and implicit characterization of ${\tt BFF}$ via ${\rm SCP}_{\rm S} \cap SAFE$. The results notably advance automation in verifying second-order time bounds and open pathways for extensions to broader SCT-inspired techniques or purely functional formulations.
Abstract
The class of Basic Feasible Functionals BFF is the second-order counterpart of the class of first-order functions computable in polynomial time. We present several implicit characterizations of BFF based on a typed programming language of terms. These terms may perform calls to non-recursive imperative procedures. The type discipline has two layers: the terms follow a standard simply-typed discipline and the procedures follow a standard tier-based type discipline. BFF consists exactly of the second-order functionals that are computed by typable and terminating programs. The completeness of this characterization surprisingly still holds in the absence of lambda-abstraction. Moreover, the termination requirement can be specified as a completeness-preserving instance, which can be decided in time quadratic in the size of the program. As typing is decidable in polynomial time, we obtain the first tractable (i.e., decidable in polynomial time), sound, complete, and implicit characterization of BFF, thus solving a problem opened for more than 20 years.
