NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

PROW: A Step Toward Automatic Program Writing

Richard J. Waldinger, Richard C. T. Lee

Abstract

PROW (Program Writing) is an early AI system that automatically generates LISP programs from logical specifications. By treating program synthesis as a theorem-proving task, it ensures that the resulting code is mathematically guaranteed to be free of logical errors. This paper explores the transition from formal logic to executable code, introducing techniques like primitive resolution and induction axioms to bridge the gap between specification and implementation.

Introduction

In the late 1960s, programming was a fraught process prone to two types of errors: syntactic (grammar mistakes) and logical (flawed algorithms). While higher-level languages were helping with syntax, the "logical" burden remained entirely on the human programmer. The authors of PROW argue that a programmer should only have to describe what a program should do (the specification), while the computer should figure out how to do it (the algorithm). PROW addresses this by bridging the gap between formal logic and executable code, aiming for a future where "debugging" is a relic of the past.

Methodology

The core of PROW is built on Automatic Theorem Proving. The process begins with a specification where the user defines the relationship between input and output variables using first-order predicate calculus. PROW then constructs a theorem stating that for every input, there exists an output that satisfies the specification.

To prove this theorem, PROW utilizes Robinson’s resolution principle. A key innovation introduced is "primitive resolution." Standard theorem provers might use non-executable concepts in a proof; PROW restricts the prover to use only "primitive symbols"—functions and constants actually available in LISP—ensuring the resulting proof can be translated into a working program. To handle loops and recursion, the authors introduce an induction axiom, allowing PROW to break a problem into a base case and an inductive step, generating sub-programs for each and weaving them into a recursive LISP function.

Key Insights: Proof-as-Program

The most profound insight of this work is that a formal mathematical proof of a program's existence contains all the information needed to actually write that program. The proof tree is essentially a flowchart, where logical branches correspond to conditional execution paths in the code.

A logic flow diagram derived from a formal proof, illustrating the 'Proof-as-Program' concept.

Because the program is derived directly from a formal proof, it is "correct" by definition relative to its specification. If the proof is valid, the code is bug-free. This approach forces the AI to think only in terms of the "tools" (functions) available in the target programming language, ensuring practical executability.

Key Results and Evaluation

As a foundational paper in symbolic AI, PROW was evaluated through several classic computational and logic puzzles rather than modern datasets. The system successfully demonstrated the ability to:

  • Generate recursive LISP code for the factorial function.
  • Solve the member function (determining if an element is in a list).
  • Produce "conditional expressions" (if-then-else logic) for planning problems, such as a monkey-and-banana task.
  • Synthesize machine-level instructions to swap register values.
Synthesized conditional logic for a list membership function, showing branches for 'X in L' and 'X not in L'.

Limitations and Future Work

Despite its promise, PROW faced significant hurdles. Writing a perfect specification in first-order predicate calculus is often as difficult as writing the code itself. The authors suggested moving toward "easier-to-use" languages like English in the future. Furthermore, the system's power is strictly limited by the efficiency of the underlying theorem prover; as problems grow in complexity, the search space for a proof expands exponentially. Finally, some complex recursive examples still required manual human intervention to provide induction axioms, indicating that fully autonomous synthesis remained a long-term goal.

Summary updated

BibTeX
@inproceedings{waldinger1969prow,
  author = {Richard J. Waldinger and Richard C. T. Lee},
  title = {{PROW: A Step Toward Automatic Program Writing}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1969},
}
Figure