Structured Planning and Debugging

Mark L. Miller, Ira P. GoldsteinIJCAI 1977

Introduction

The 1977 paper from the MIT AI Lab introduces SPADE (Structured Planning and Debugging Environment), a theoretical framework that conceptualizes programming as a linguistic process involving planning and error recovery. By applying formalisms from computational linguistics to cognitive problem-solving, the authors aimed to develop tools for teaching, automating, and analyzing the programming process.

The Problem: Modeling the Programming Process

In the 1970s, the "Structured Programming" movement, championed by figures like Dijkstra, focused on modular code. However, Miller and Goldstein argued that this movement lacked a formal model of the process—the sequence of design decisions made before coding begins.

They identified two primary gaps:

  1. AI Gap: Automated systems often lacked a representation of "intent," making self-debugging difficult.
  2. Education Gap: Students in environments like Logo often struggled because their planning was "tacit." There was no mechanism to articulate why a specific approach was chosen or where logic failed.

Methodology: The Linguistic Analogy

The core innovation of SPADE is the Linguistic Analogy: if programming is a language, then planning is its grammar.

Planning Grammar

The authors developed a context-free grammar for plans. A top-level PLAN expands into categories such as IDENTIFY (utilizing a known solution), DECOMPOSE (breaking the problem down), or REFORMULATE (altering the problem description).

Taxonomy of Planning Concepts

The Derivation Tree

SPADE shifts focus from final code to the "derivation tree"—a hierarchical record of design choices. This formalizes the "black box" of human problem-solving into an inspectable structure.

Hierarchical annotation of a wishingwell solution

System Components

  • PATN (The Planner): An Augmented Transition Network (ATN) that acts as an automated problem solver, using registers and arc predicates to apply planning rules.
  • PAZATN (The Parser): A chart-based parser that maps human programming logs (protocols) back to the formal planning grammar, allowing the system to "understand" student strategies.

Key Insights: Debugging and Articulation

  • Debugging as Re-Parsing: Debugging is defined as localizing and repairing errors in the application of grammar rules. Failures are traced back through the derivation tree to find the "culpable decision."
  • The Power of Articulation: The authors hypothesize that explicitly naming plans (e.g., "I am now doing a decomposition") enhances programming skill. Their tool, SPADEE-0, serves as a bookkeeper for this goal tree.
  • Rational Bugs: Errors are viewed as "rational bugs"—reasonable but imperfect choices made with limited information. This shifts debugging from "fixing mistakes" to "refining plans."

Key Results and Implementation

  • Theoretical Unification: SPADE unified previous work on planning and debugging into a single linguistic framework.
  • Tool Implementation: The authors developed SPADEE-0, a structured editor promoting top-down design.
  • Diagnostic Capability: Assistants like RAID and DAPR could identify missing steps (e.g., interface procedures) that lead to semantic bugs.
  • Protocol Analysis: PAZATN proved that chart-based parsing could handle the non-linear nature of human problem-solving.

Limitations and Future Work

The planning grammar remains incomplete, particularly regarding complex disjunctions. While tested in Logo and "Blocks World," the theory requires application in more complex domains. Furthermore, the empirical impact of the SPADEE-0 editor on student learning was, at the time, a hypothesis awaiting longitudinal validation.

Summary updated

BibTeX
@inproceedings{miller1977structured,
  author = {Mark L. Miller and Ira P. Goldstein},
  title = {{Structured Planning and Debugging}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1977},
}
Figure