Complete and tractable machine-independent characterizations of second-order polytime

Emmanuel Hainry,Bruce M. Kapron,Jean-Yves Marion,Romain Péchoux
2024-01-15
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.
Logic in Computer Science,Computational Complexity,Programming Languages
What problem does this paper attempt to address?
### The problems the paper attempts to solve This paper aims to solve the problem of complete and tractable machine - independent representation of the class of second - order polynomial - time computable functions (BFF, Basic Feasible Functionals). Specifically, the authors hope to find a programming language and its type system that can: 1. **Completeness**: This programming language can express all second - order functions belonging to BFF. 2. **Tractability**: Type inference and termination checking can be completed within polynomial time. 3. **Implicitness**: Programmers do not need to explicitly specify complexity bounds. This problem has remained unsolved for more than 20 years until this paper presents the first solution that meets the above conditions. ### Key background information - **BFF class**: Proposed by Mehlhorn and Constable, representing the class of second - order polynomial - time computable functions. - **Existing challenges**: Previous attempts were either incomplete, not tractable, or required explicit complexity bounds. ### Main contributions of the paper 1. **Programming language design**: A higher - order programming language is introduced, which includes a simply - typed term level and a non - recursive command - procedure level following hierarchical type rules. 2. **Type system**: A type system is designed to ensure that type inference can be completed within polynomial time and that each procedure only needs to be typed once. 3. **Termination checking**: A termination criterion called SCP_S is proposed, which can be verified within quadratic time and maintains the completeness and correctness of the representation. 4. **Theoretical results**: It is proved that this new programming language and its type system can accurately capture all functions in the BFF class and are complete and tractable. Through these contributions, the paper solves the long - standing problem in this field and provides new tools and methods for understanding second - order polynomial - time computation.