A Programming Language for Feasible Solutions

📅 2025-07-25
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This paper addresses the fundamental question: “How can one design a programming language whose definable functions exactly coincide with all polynomial-time computable problems?” We introduce Polylang—the first imperative language that is both expressively complete for PTIME and equipped with rigorous complexity guarantees. Its core innovation is a static, hierarchy-based resource-sensitive type system that ensures, at compile time, that all well-typed programs terminate within polynomial time. We formally prove that Polylang is Turing-equivalent to PTIME under polynomial-time reductions. We provide a full implementation—including an interpreter and a sound type checker—and validate its expressiveness and analyzability on canonical algorithms (e.g., sorting, bipartite matching, dynamic programming). This work establishes, for the first time in an imperative setting, a precise definability correspondence between a programming language and PTIME, thereby offering a theoretically sound and practically implementable foundation for feasible computation.

Technology Category

Knowledge Representation and Reasoning: Computational Complexity of ReasoningPlanning, Routing, and Scheduling: Planning with Language ModelsNatural Language Processing: Code Generation / Program Synthesis from Natural Language

Application Category

Graph Algorithms and Modeling for the Web: Efficient manipulation of static and dynamic Web-related graphsSearch and Retrieval-Augmented AI: Multilingual and cross-lingual Web searchSemantics and Knowledge: Data modeling to support human-machine intelligence, including LLMs agents, intelligent system behavior, explanations, and user-friendly interactions
📝 Abstract
Runtime efficiency and termination are crucial properties in the studies of program verification. Instead of dealing with these issues in an ad hoc manner, it would be useful to develop a robust framework in which such properties are guaranteed by design. This paper introduces a new imperative programming language whose design is grounded in a static type system that ensures the following equivalence property: All definable programs are guaranteed to run in polynomial time; Conversely, all problems solvable in polynomial time can be solved by some programs of the language. The contribution of this work is twofold. On the theoretical side, the foundational equivalence property is established, and the proof of the equivalence theorem is non-trivial. On the practical side, a programming approach is proposed that can streamline program analysis and verification for feasible computations. An interpreter for the language has been implemented, demonstrating the feasibility of the approach in practice.
Problem

Research questions and friction points this paper is trying to address.

Ensures all programs run in polynomial time
Guarantees solvability of polynomial-time problems
Provides a robust framework for program verification
Innovation

Methods, ideas, or system contributions that make the work stand out.

Static type system ensures polynomial runtime
Language guarantees feasible program termination
Interpreter demonstrates practical implementation feasibility
W
Weijun Chen
BASICS, Shanghai Jiao Tong University, Shanghai, China.
Y
Yuxi Fu
BASICS, Shanghai Jiao Tong University, Shanghai, China.
H
Huan Long
BASICS, Shanghai Jiao Tong University, Shanghai, China.