The code

SLIP

ELIZA is written in MAD-SLIP: the MAD procedural language, extended with SLIP, Joseph Weizenbaum’s own list-processing library. SLIP is the half of MAD-SLIP that gives ELIZA its grip on structure: lists of words, tables of keywords, and the decomposition and reassembly rules that build a reply.

What SLIP is

SLIP stands for Symmetric LIst Processor. Weizenbaum designed it around 1962 and described it in the Communications of the ACM in 1963, when the list-processing ideas of IPL and LISP were still new. It is not a standalone language but a set of routines bolted onto a host language, first FORTRAN and then MAD. The version ELIZA used ran on MIT’s CTSS on the IBM 7094: MAD for the procedures, SLIP for the lists.

Why “symmetric”

SLIP’s lists are doubly linked: every cell holds a pointer to the next cell and to the previous one. That two-way, symmetric linkage is where the name comes from. It lets a program walk a list forwards or backwards, splice cells in and out from either end, and treat any cell as a place to read from or write to. Free cells are kept on an Available Space List (AVSL); creating a list draws cells from it, deleting a list returns them.

prevnextdatum
Each cell is an information carrier: a datum held between two links, a next pointer forward and a prev pointer back, with the organisation provided entirely by those pointers. Real SLIP lists also close into a ring through a header cell.

A line of dialogue as a list

When you type to ELIZA, your words become a SLIP list, one word per cell. Here is the opening line of the 1966 conversation, Men are all alike, held the way ELIZA holds it:

→ next link← prev linkMENAREALLALIKE
ELIZA walks this list with a sequence reader (SEQRDR / SEQLR), matches it against a keyword’s decomposition pattern, and builds the reply by splicing cells into a new list.

What ELIZA added to SLIP

The original SLIP has two distinct modes. One handles organisation: the previous and next pointers and the sublists they string together. The other handles data, and in the original it was given short shrift, supporting only integers and real numbers. Weizenbaum extended the data half so a cell could also carry text, the words of a sentence, the keywords of a script, the templates of a reply. Most of the original SLIP is pointer maintenance; most of the SLIP that ELIZA needs is datum handling.

How ELIZA uses it

Almost every structure in ELIZA is a SLIP list. The user’s input is read into a list of words. The script’s keywords live in a hash table (KEY) of lists. Each keyword’s decomposition and reassembly rules are lists of lists. The memory of what you said is a list of transformed sentences. To produce a reply, ELIZA walks these lists with SLIP’s readers, matching and rebuilding as it goes.

Reading the idioms

Once you know they are SLIP calls, the dense lines of the recovered source begin to read. A few recur throughout:

These are the verbs of ELIZA. The close reading of the program follows them through the main loop, and the step-by-step demo shows the result.

A living implementation

SLIP did not stay locked in 1963. Arthur Schwarz, a member of this project, has written gSlip, a public-domain implementation of SLIP, which makes it possible to run and study SLIP code today rather than only read it.

REFERENCE

Weizenbaum, J. (1963) ‘Symmetric List Processor’, Communications of the ACM, 6(9), pp. 524–536.