The code

The program

SHRDLU is best understood not as a single program but as a layered system, a stack of cooperating components written in MacLisp under the ITS operating system, with its deductive and problem-solving work expressed in Micro-Planner. Terry Winograd assembled four interacting parts: a parser, a systemic recognition grammar called PROGRAMMAR, a set of semantic-analysis programs, and a Micro-Planner deductive problem-solver. Each part is a piece of working code, and the system's apparent fluency in conversation about its toy world of blocks is the visible surface of these layers passing control and partial results between one another.

The architecture matters because it carries an argument. Winograd's central thesis was that meaning could be represented as procedures rather than as static tables of facts or grammatical rules. Knowledge, in this account, is something a program does, not something it merely stores. Grammar becomes a program that recognises sentences, semantics becomes a program that builds meanings, and reasoning becomes a program that pursues goals. To read SHRDLU as a cultural text, then, is to read a wager about the nature of understanding inscribed directly into its control flow.

Procedures as representation
The core claim

Procedures as representation

The title of Winograd's 1971 MIT thesis states the doctrine plainly: Procedures as a Representation for Data in a Computer Program for Understanding Natural Language. The claim, which the literature came to call procedural semantics1, is that the meaning of a linguistic expression is best captured by the procedure that would compute or verify it, rather than by a declarative description sitting passively in memory. To know what "the red block" refers to is, on this view, to possess a program that can find it; to understand "is the block on the table" is to hold a procedure that can test the relation in the model and return an answer.

This is the conceptual hinge on which the whole system turns, and it is where SHRDLU becomes most interesting for Critical Code Studies. The decision to encode meaning as executable code rather than as inert data is not a neutral engineering convenience. It folds the question of understanding into the question of execution, so that comprehension and computation become, for the duration of a query, indistinguishable. The system understands a sentence by running it. Meaning here is performative in a quite literal sense: it is the trace left by a procedure as it executes against a world model, and the boundary between representing a fact and acting upon it dissolves into the call stack.

Comprehension and computation become, for the duration of a query, indistinguishable. The system understands a sentence by running it.

On procedural semantics

1 The term predates SHRDLU: it was introduced by W. A. Woods, "Procedural Semantics for a Question-Answering Machine" (1968). Winograd's own statement of the doctrine is his MIT thesis, Procedures as a Representation for Data in a Computer Program for Understanding Natural Language (1971), and Understanding Natural Language (1972).

PROGRAMMAR and systemic grammar
The parser

PROGRAMMAR and systemic grammar

Winograd's parser, PROGRAMMAR, is the clearest expression of the procedural doctrine at the level of syntax. Rather than treating a grammar as a fixed list of rewrite rules to be matched against an input string, PROGRAMMAR expresses each grammatical rule as a small program, a "procedural grammar" in which the act of parsing is the act of running these programs. A rule does not simply assert that a noun phrase may consist of a determiner followed by adjectives and a noun; it actively attempts to build that structure, branching, backtracking, and consulting context as it goes. Grammar becomes a collection of little procedures that know how to recognise the constituents they describe.

The grammatical theory underneath PROGRAMMAR is M.A.K. Halliday's systemic grammar, and SHRDLU stands as the first major computational application of systemic theory. Halliday's framework treats grammatical choices as networks of options, "systems" of features from which a speaker selects, and this orientation towards choice and function rather than towards static phrase-structure trees lent itself naturally to a procedural rendering. The recognition grammar asks, at each point, which systemic options are in play and what evidence would resolve them, so that the parse is driven by functional questions rather than by mechanical pattern application.

The rule below is the real thing: the opening of PROGRAMMAR's noun-group (NG) rule, from the original source (gramar, preserved in this project; an excerpt, lightly trimmed). A rule is a program: it examines the systemic features of the current node (CQ) and of the next word (NQ) and jumps (GO) to the block that handles each case, so the parse is driven by functional questions rather than by matching a fixed pattern. Winograd's own comments are kept:

;; NG (noun group), opening of the real PROGRAMMAR rule (gramar, excerpt). ;; CQ tests a feature of the current node; NQ tests the next word; GO jumps. (PDEFINE NG NIL NGSTART ; examine initial features, then jump (COND ((CQ RELWD) (GO RELWD)) ((CQ QUEST) (GO QUEST)) ((OR (NQ QDET) (NQ QPRON)) (FQ QUEST) (GO QUEST)) ((CQ TIME) (GO TIME)) ((NQ PROPN) (GO PROPN)) ((NQ PRON) (GO PRON))) LOOK ; entry for each new constituent (COND ((NQ DET) (GO DET)) ; "the", "a", "two" ... ((NQ NUM) (GO NUM)) ((OR (NQ ING) (NQ EN) (NQ ADJ)) (GO ADJ)) ; "red", "small" ... ((NQ NOUN) (GO NOUN))) ; the head noun ;; ... the DET, NUM, ADJ, NOUN blocks below build the structure and SETR it ... )
Micro-Planner and the goal stack
The reasoner

Micro-Planner and the goal stack

The deductive heart of SHRDLU is Micro-Planner, a practical subset of Carl Hewitt's PLANNER language, implemented at MIT by Gerald Sussman, Terry Winograd, and Eugene Charniak and documented in the Micro-Planner Reference Manual (MIT AI Memo 203, July 1970, revised as 203A in December 1971). PLANNER introduced a goal-directed, theorem-proving style of programming in which one does not call a procedure by name but instead states a goal and lets the system search for assertions and "theorems", themselves procedures, that can satisfy it. Micro-Planner brought a workable portion of this vision into MacLisp, and SHRDLU used it to reason about the blocks world.

The mechanism that gives SHRDLU much of its conversational depth is the goal stack. Because the system pursues goals by invoking subgoals, the chain of goals active at any moment is preserved as an explicit structure. This is why SHRDLU can answer questions about its own behaviour, including the famous "why" questions in the dialogue. When asked why it did something, the system does not reconstruct a plausible story after the fact; it reads back up the record of goals that motivated the action, so that "why did you do that" is answered by "to get rid of it" or "to clear off that cube", each answer a node retrieved from the deductive history. The capacity for explanation is here a side effect of the architecture rather than a separately engineered feature. You can follow this in the canonical dialogue, where the chain of "why" exchanges walks step by step back up the goal stack.

The Micro-Planner theorem below is the real thing, from the original SHRDLU source (the file blockp, preserved in this project; lightly reindented for the page). It clears the top of a block, and shows the goal stack at work: to clear X, find whatever supports it and recursively GET-RID-OF that, then assert the result and record the event with MEMOREND, the memory SHRDLU later reads back to answer "why":

;; TC-CLEARTOP, from the original SHRDLU source (blockp). ;; To clear X: get rid of whatever supports it, then record the result. (DEFPROP TC-CLEARTOP (THCONSE (X Y (WHY (EV)) EV) (#CLEARTOP $?X) (ATOM $?X) (THOR (THGOAL (#SUPPORT $?X ?)) (THAND (THASSERT (#CLEARTOP $?X)) (THSUCCEED THEOREM))) (MEMORY) GO (THCOND ((THGOAL (#SUPPORT $?X $_Y)) (THGOAL (#GET-RID-OF $?Y) (THNODB) (THUSE TC-GET-RID-OF)) (THGO GO)) ((THASSERT (#CLEARTOP $?X)) (MEMOREND (#CLEARTOP $?EV $?X)) (THSUCCEED THEOREM)))) THEOREM)
The machine it ran on
Material conditions

The machine it ran on

MacLispimplementation language
ITSoperating system
PDP-6host computer (DEC)
DEC-340display

By Winograd's own account, SHRDLU was written in MacLisp for the ITS system, vintage 1970, and ran on a DEC PDP-6 of the kind in use at the MIT Artificial Intelligence Laboratory, with the blocks world rendered as a line drawing on a DEC-340 display attached to the machine and the dialogue conducted over a teletype. These are not incidental details. The toy world's restriction to a handful of blocks and pyramids, and the patience the conversation demands, are partly conditions of the hardware, a time-shared research machine driving a vector display in an era when every cycle and every word of core counted.2

The MIT AI Lab context is equally formative. SHRDLU belongs to the microworlds research programme overseen by Marvin Minsky and Seymour Papert, the latter of whom supervised Winograd. The lab's culture of building integrated, demonstrable systems, and its commitment to symbolic reasoning over a sharply bounded domain, shaped what SHRDLU could be. The program is in this sense a precipitate of its institution: its ambitions, its confidence that intelligence could be assembled from procedures, and its strategic decision to make a small world work completely rather than a large world work badly can all be read in the choices the code makes.

2 Cf. Friedrich Kittler, "There Is No Software" (1997) and Gramophone, Film, Typewriter (1999), on the materiality of media technologies and the hardware that conditions what can be shown, sensed and done; and, on media archaeology, Wolfgang Ernst, Digital Memory and the Archive (2013).

Reconstructions
Afterlives

Reconstructions

SHRDLU survives in several forms, and the distinctions between them matter for anyone wishing to read or run the code. The original source is preserved; alongside it are independent modern efforts that re-create the system on contemporary platforms. None of the modern reimplementations should be attributed to Winograd himself.

For what these afterlives reveal about SHRDLU's reception, its status as a "Potemkin village" demonstration, and its place in the longer history of artificial intelligence, see Critique & legacy. To explore the bounded domain in which all of this machinery operates, see The blocks world.