Designing Programs That Check Their Work

Manuel Blum, Sampath KannanSTOC 1989

TL;DR

This paper introduces the formal concept of a "program checker" – an algorithm that verifies the output of another program on a specific input. The authors demonstrate how to construct efficient checkers for problems in P, including graph isomorphism and group theoretic computations, often using probabilistic interactive proofs as a foundation. This work offers a practical alternative to full program verification, providing a way to gain confidence in a program's correctness for individual computations.

What Problem Does This Paper Address?

In computing, we often rely on programs to perform complex calculations. While we've made great strides in automating the calculation process, the task of verifying the correctness of the result has largely been left to human programmers. This is problematic because manual checking is tedious, error-prone, and doesn't scale. The paper addresses this gap by proposing a formal definition and construction method for "program checkers." These checkers are designed to mechanically verify the output of a given program for a specific input, offering a more accessible and practical approach to ensuring computational reliability than full program verification.

Methods

The core contribution is the formal definition of a program checker $C$ for a problem $\pi$. A checker $C$ takes an input $I$ and a program $P$ (supposedly for $\pi$) and outputs "CORRECT" or "BUGGY." Crucially, $C$ must correctly identify bugs with high probability if $P$ has them, and with high probability confirm correctness if $P$ is bug-free. The paper emphasizes the "little oh property," meaning the checker's running time should be asymptotically smaller than the program it checks, ensuring the checker is distinct from the program itself.

The authors employ several key techniques:

  • Probabilistic Interactive Proofs: Inspired by work in cryptography, these are used as a "scaffolding" for constructing checkers, particularly for more complex problems like graph isomorphism.
  • Randomized Algorithms: Techniques from randomized algorithms, like those by Freivald, are adapted for checker design.
  • Specific Problem Constructions: The paper provides concrete checker designs for:
  • Graph Isomorphism (GI): Adapting interactive proof systems to use the program being checked as the "prover."
    • Group Theoretic Problems: Leveraging interactive protocols and adapting them into checkers, often through a "1-2 approach" (designing an interactive protocol, then modifying it into a checker).
  • Extended GCD: A simple checker requiring only a few arithmetic operations.
  • Sorting: A checker that verifies both the sorted order and multiset equality of the output.
  • Matrix Rank: A more complex checker involving checking rank from both above and below.
  • Beigel's Trick: A crucial theoretical result that allows constructing a checker for a problem $\pi_2$ if a checker exists for a polynomial-time equivalent problem $\pi_1$. This is used to extend checker existence to a broader class of problems.

Datasets

Not discussed in the paper. The paper focuses on theoretical constructions and algorithms rather than empirical evaluation on specific datasets.

Key Insights and Ideas

  • Formalizing "Checking": The paper provides a rigorous mathematical definition for what it means for a program to "check" another program's output, moving beyond informal notions.
  • Checkers as a Practical Alternative: The core idea is that while proving a program entirely correct is often infeasible, checking its output on specific inputs is achievable and provides valuable confidence.
  • The "Little Oh" Property: This is a critical design principle. It ensures the checker is not just a slightly modified version of the program being checked, preventing trivial solutions and encouraging genuine verification logic.
  • Interactive Proofs as a Blueprint: The paper demonstrates a powerful paradigm shift: using the structure of interactive proof systems (designed for proving properties) to build algorithms that check computations.
  • Universality of Checkers: Beigel's trick shows that if we can check one problem in a polynomial-time equivalence class, we can check all of them, significantly broadening the applicability of checker technology.
  • Checkers for Problems in P: The paper shows that many fundamental problems in P, which are computationally tractable but still prone to bugs, can indeed have efficient checkers.

Key Results

  • Formal Definition of Program Checkers: A precise probabilistic definition is provided.
  • Efficient Checkers for Specific Problems: The paper constructs efficient checkers for:
  • Graph Isomorphism.
  • Various group theoretic problems (e.g., Group Intersection, Canonical Element Problem).
  • Extended GCD.
  • Sorting.
  • Matrix Rank.
  • Theoretical Guarantees: The checkers are proven to be correct with high probability, and their running times are shown to be efficient (often polynomial in the input size and security parameter $k$, and satisfying the "little oh" property).
  • Checker Existence for NP-Search Problems: A theorem establishes that if a problem is in function-restricted co-IP, an efficient checker exists for it. This has implications for the non-existence of checkers for NP-complete problems.

Limitations and Future Work

  • Proving the Checker Correct: The paper acknowledges that a truly robust system would require proving the checker itself correct. This paper focuses on the "pure checking" aspect, assuming the checker is correctly implemented.
  • Practical Implementation of Hash Functions: For multiset equality testing, finding "easy-to-compute random-enough hash functions" remains a challenge, though a specific method is proposed.
  • "Little Oh" Property for Complex Operations: Achieving the "little oh" property for operations like forming random linear combinations of matrix columns can be difficult due to their inherent computational cost.
  • Future Work: The paper suggests that the theory could be further developed by requiring checkers to be proven correct. It also hints at the potential for checkers for NP-complete problems if they are in function-restricted co-IP, but notes that this is unlikely. The authors also suggest that the techniques could be applied to a wider range of problems.

Summary updated

BibTeX
@inproceedings{blum1989designing,
  author = {Manuel Blum and Sampath Kannan},
  title = {{Designing Programs That Check Their Work}},
  booktitle = {STOC},
  year = {1989},
  doi = {10.1145/73007.73015},
}

Loading related content...

Figure