Table of Contents
Fetching ...

A Programming Language for Feasible Solutions

Weijun Chen, Yuxi Fu, Huan Long

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.

A Programming Language for Feasible Solutions

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.

Paper Structure

This paper contains 48 sections, 22 theorems, 42 equations, 9 figures, 1 algorithm.

Key Result

lemma 1

The following statements are valid. $\blacktriangleleft$$\blacktriangleleft$

Figures (9)

  • Figure 1: The syntax of CorePolyC.
  • Figure 2: Semantics of CorePolyC.
  • Figure 3: The typing rules of CorePolyC.
  • Figure 4: Two CorePolyC implementations of fast multiplication. The left one violates the rules $\Gamma\mathtt{-Loop}$ and $\Gamma\mathtt{-Asgmt}$, while the right one is well-typed.
  • Figure 5: The dependency graph for the proof of Theorem \ref{['thm:main']}.
  • ...and 4 more figures

Theorems & Definitions (42)

  • remark 1
  • remark 2
  • lemma 1
  • lemma 2
  • theorem 1: Type Safety
  • proposition 1: Loop Invariant
  • theorem 2: Main Theorem
  • lemma 3
  • corollary 1
  • lemma 4
  • ...and 32 more