CASAP: A Testbed for Program Flexibility

Robert Balzer

Introduction

In the early 1970s, Robert M. Balzer introduced CASAP, a system designed to address the inherent rigidity of early artificial intelligence. At the time, AI systems were often caught between two extremes: highly abstract general-purpose problem solvers that lacked domain-specific depth, and rigid procedural languages that required every detail to be explicitly hard-coded. CASAP proposed a middle ground by decoupling the execution of an action ("how to do something") from the retrieval of the necessary data ("what data is needed").

The Problem of Rigidity

The primary challenge Balzer identified was the "caller-knows-all" paradigm. In traditional procedural programming, a calling routine must provide every parameter required by a sub-routine. For example, to "pass a card," a program would typically require the caller to specify the exact card, the source hand, and the destination player. This "pointwise applicability" makes software brittle; any change in context requires a change in the calling logic. Balzer argued that programs should instead behave more like humans, using context to fill in missing information dynamically.

The CASAP Architecture

CASAP’s flexibility is rooted in three core components:

  1. The Interpreter: This component executes high-level actions.
  2. The Information Retriever: Acting as a mediator between action routines and a global database, the Retriever resolves ambiguous terms (e.g., "your hand") using a "context stack." Instead of a routine searching for data itself, it queries the Retriever.
  3. Pattern-Directed Invocation: Rather than being called by name, routines are invoked based on the results they promise to deliver.

The system utilizes a pre-parsed English interface, allowing it to process English-like concepts and verbs to trigger actions within the simulated environment.

Case Study: The Game of Hearts

To test these concepts, Balzer used the card game Hearts as a domain. Hearts provides a rich environment of complex rules, ordered sets (hands), and context-dependent actions, such as "passing the highest heart."

Figure 1: A dialogue trace showing the system defining terms like "pass" and "lowest" through user interaction to resolve ambiguity.

As shown in the interaction above, the system can handle definitions and resolve ambiguities through dialogue. When the system encounters a term it does not fully understand in context—such as "pass" or "lowest"—it prompts the user for a definition. This allows the system to build its internal logic dynamically rather than relying on a static, pre-defined codebase.

Results and Insights

The qualitative evaluation of CASAP playing Hearts revealed several key strengths:

  • Dynamic Resolution: If a command is incomplete (e.g., "insert card 2"), the system recognizes the hand as an ordered set and pauses to ask for the suit and value to determine the correct position, rather than failing.
  • Ambiguity Handling: The system successfully processed complex, multi-agent commands like "Each player passes the highest heart." It iterated through players, identified the specific context for each (their individual hand), and correctly identified the target card for each person.
  • Distributed Intelligence: By centralizing knowledge about the database within the Retriever, CASAP allows low-level routines to find their own parameters. This keeps high-level logic clean and adaptable.

Limitations and Conclusion

Despite its innovations, CASAP had notable limitations. A planned "Modification" component, intended to alter actions to fit dynamic contexts, remained unimplemented. Furthermore, the system relied on manual linguistic parsing, bypassing the complexities of natural language processing to focus on logic.

Balzer’s work on CASAP was prophetic. His emphasis on moving toward context-dependent languages and the "intelligence of retrieval" prefigured modern developments in AI, where context windows and dynamic data retrieval are central to the functionality of Large Language Models. CASAP remains a foundational exploration of how software can be made more flexible by embracing, rather than avoiding, contextual ambiguity.

Summary updated

BibTeX
@inproceedings{balzer1973casap,
  author = {Robert Balzer},
  title = {{CASAP: A Testbed for Program Flexibility}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1973},
}
Figure