Abstract
Developed at the University of Toronto in the early 1970s, $l.pak$ is a programming language designed to enhance Artificial Intelligence (AI) research efficiency. By extending the string-processing capabilities of SNOBOL, $l.pak$ introduces graph-based data structures and pattern-directed retrieval, offering a flexible framework for searching complex relational data with built-in backtracking.
Introduction
In the early 1970s, AI researchers faced challenges in representing and querying complex knowledge. While languages like PLANNER and CONNIVER were developed for these tasks, they were often computationally expensive and slow. $l.pak$ was created to address the need for a language that could handle relational databases and pattern-directed search without the overhead of existing systems. The authors chose to extend SNOBOL, leveraging its powerful pattern-matching logic for traversing and querying graphs that represent real-world objects and their relationships.
Core Architecture and Methods
The fundamental innovation of $l.pak$ lies in its integration of graph structures into the SNOBOL environment, allowing for sophisticated data representation and control flow.
Graph-Based Data Base
Unlike traditional languages that rely on simple variables, $l.pak$ utilizes a collection of directed, labeled graphs. Edges in these graphs represent properties or relations between nodes. For instance, an edge might denote that one object is "ABOVE" or "NEXT" to another.
Edge labels are composed of an "attribute" and optional "modifiers," allowing for nuanced descriptions of relationships, such as "ABOVE_FAR_VERY" or "LEFT_NEAR."
Graph Pattern Matching
The language adapts SNOBOL’s string pattern matching to work on graph paths. A pattern like <$X, (LEFT_AARB?Y), (FAR).$W> instructs the system to start at node $X$, find an edge with the attribute LEFT, store its modifier in $Y$, traverse a FAR edge, and terminate at node $W$. This allows for complex queries over relational data using a syntax familiar to SNOBOL users.
Implicit Function Requests
$l.pak$ features "lazy evaluation" through implicit function requests. If a pattern match fails because a specific edge is missing from the database, the system can automatically trigger a function to calculate that relationship—for example, by checking geometric coordinates—and update the database accordingly. This allows for a "virtual" database where relationships are computed only when needed.
Control Flow: Generators and Scoped Backtracking
Drawing inspiration from CONNIVER, $l.pak$ employs "generators"—code blocks capable of returning multiple alternative values. This is crucial for exploring different possibilities within a problem space. Furthermore, the language provides granular control over state through scoped backtracking. Programmers can define variables or database changes as local to a specific function call. If the function fails, the system automatically reverts these specific states, avoiding the performance hits of global backtracking.
Key Insights
- SNOBOL as a Foundation: By treating graph paths as sequences for matching, the authors utilized highly optimized pattern-matching logic for AI search.
- Procedural Attachment: The implicit function request mechanism allows the system to store rules for computing relationships rather than storing every possible connection explicitly.
- Granular State Control: $l.pak$ offers surgical control over state restoration, facilitating easier debugging and better performance compared to contemporary global backtracking systems.
Implementation and Performance
$l.pak$ was implemented using SPITBOL, an efficient SNOBOL compiler. The system was relatively lightweight, requiring approximately 140K of memory, with 50K dedicated to the $l.pak$ system itself. The authors reported that the system was significantly faster than standard SNOBOL implementations, making it a practical tool for AI research in fields like computer vision and natural language understanding.
Limitations and Future Work
The $l.pak$ database provides "partial associativity," which may be less convenient for certain highly interconnected data queries compared to more complex systems like PLANNER. Additionally, its performance is tied to the SPITBOL environment. Future work aimed to apply $l.pak$ to more complex scene analysis and natural language processing tasks to further refine its feature set for AI researchers.
Summary updated