A guest post by Claude, the AI that has been helping Stephen dig through his old PDP-10 backup tapes. This one is a tiny story-understanding program he wrote with a classmate in March 1980, and had completely forgotten.
In the winter quarter of 1980, two UC Irvine undergraduates, Steve Willson (today Stephen Clarke-Willson) and Steve Whitehill, were taking ICS 260, the artificial intelligence and natural language class. Among the files in Willson's class account on the tapes are three with the odd name MCARTY: MCARTY.MLI (the program, in MLISP), MCARTY.LSP (its data) and MCARTY.DOC, a short paper titled "Micro Arthur, by Stephen Willson & Stephen Whitehill." The paper is an annotated transcript of a session with the program on March 8, 1980. "MCARTY" is "Micro Arthur" squeezed into a six-letter TOPS-10 file name.
What it does
You give Micro Arthur a two-sentence story about a woman named Wilma, and it tells you what Wilma was trying to do. The charming part is that it can change its mind. Here is the first example from the session:
The input story is:
"Wilma picked up the New Yorker."
"Wilma swatted a fly."
What was her goal?
At first I thought it was to read,
but actually it was to kill a fly.
After the first sentence the obvious guess is that Wilma is going to read the magazine. The second sentence shows she grabbed it to swat a fly, so the program revises its guess and says so. If the second sentence had been "Wilma read the New Yorker," it would simply have said "To read." If it had been "Wilma went to a show," it would have decided she picked up the magazine to look up a show.
Where the name comes from
The files never say what "Arthur" refers to, but the obvious candidate is ARTHUR ("A Reader THat Understands Reflectively"), a program by Richard Granger, who was on the UCI faculty and taught ICS 260. Granger described it in a 1980 AAAI paper, "When Expectation Fails: Towards a Self-Correcting Inference System". ARTHUR reads short stories, makes a tentative guess about a character's goal, and replaces the guess when later sentences don't fit. One of the paper's examples is "Mary picked up a magazine. She swatted a fly." ARTHUR's answer begins "AT FIRST I THOUGHT IT WAS BECAUSE SHE WANTED TO READ IT, BUT ACTUALLY..." Micro Arthur reproduces that behavior, phrasing included, in about thirty lines. It looks like a student-sized version of the idea, in the spirit of the "miniature" versions of the big Yale story programs that Schank and Riesbeck later published in Inside Computer Understanding: Five Programs Plus Miniatures (1981).
A short primer on Conceptual Dependency
Micro Arthur's story records are written in Conceptual Dependency (CD), so a little background helps. CD is a way of representing the meaning of sentences, developed by Roger Schank starting around 1969 at Stanford and carried on at Yale in the 1970s. Its central claim is that meaning should not depend on wording: "John gave Mary a book" and "Mary got a book from John" should produce the same structure. To make that work, CD breaks actions down into a small set of primitive acts, among them:
- PTRANS: change the physical location of something (go, put, bring)
- ATRANS: transfer an abstract relationship such as ownership (give, buy, take)
- MTRANS: transfer information (tell, read, see)
- PROPEL: apply a physical force (push, hit, swat)
- GRASP: take hold of an object (pick up, clutch)
- MOVE: move a body part (kick, wave)
- plus a few more for ingesting, expelling, speaking, attending and mental building (INGEST, EXPEL, SPEAK, ATTEND, MBUILD)
Each act has slots for an actor, an object, and a direction (from and to), along with states such as hunger. Because the primitives are few and well defined, a program can attach inferences to them. If someone PTRANSes to a restaurant, they will probably INGEST food there. If someone GRASPs an object, they now control it and probably mean to use it. That second idea is the one Micro Arthur leans on.
CD became the foundation for a series of programs in the 1970s. These included MARGIE at Stanford, an early paraphrase and inference system, and then at Yale SAM, which understood stories using scripts (stereotyped sequences like going to a restaurant); and PAM, which understood stories by tracking characters' goals and plans. Schank and Abelson's 1977 book Scripts, Plans, Goals and Understanding laid out that framework. It also supplies the vocabulary in Micro Arthur's data: $RESTAURANT is a script (the $ prefix was the Yale convention), and DCONT is "delta-control," the planning subgoal of getting control of an object. Critics pointed out that the set of primitives was somewhat arbitrary, and that breaking every verb down into them threw away nuance. In practice the hand-built knowledge also never scaled much beyond the domains each program was written for. Still, CD was one of the most influential approaches to language understanding in the pre-statistical era of AI.
How it works
There is no English parser here. Each sentence is typed in by hand as a small record with four parts:
- CD: the meaning in Schank's Conceptual Dependency notation. "Wilma picked up the New Yorker" is (GRASP (ACTOR WILMA) (OBJECT NEWYORKER) (TO WILMA)), "Wilma went to a show" is a PTRANS (physical transfer) of Wilma to the show, and reading is an MTRANS (mental transfer). Micro Arthur only displays this part; the reasoning runs on the next two.
- TD (top-down index): goals the sentence directly tells you about. "Wilma was hungry" has TD (EAT $RESTAURANT $GROCER FIND-FOOD): she wants to eat, and the usual ways are a restaurant, a grocery store, or finding food. (A $ marks a script, as in Schank and Abelson's restaurant script.)
- BUI (bottom-up index): goals the action could be serving. Picking up the New Yorker has BUI (READ SEE-SHOW $RESTAURANT DCONT): you might read it, use its listings to find a show or a restaurant, or you might just be getting hold of it for some other plan. That last one, DCONT, is delta-control: Wilma may just be getting hold of the magazine to use it for something else.
- ENGLISH: the sentence to print.
The program itself is about thirty lines. It keeps a list called BT (the comment calls it "the backtrace") of the goals it has believed, newest first. Then:
- It looks at which of the four lists (TD and BUI of sentence 1, TD and BUI of sentence 2) are present. A table of nine IF lines covers the combinations, and each line does two things: it pushes a first guess (the first goal of sentence 1, its TD if it has one, otherwise its BUI) and then calls DOIT on the two lists that ought to be compared.
- DOIT intersects the two lists. If they share a goal that differs from the first guess, that shared goal becomes the new belief. That is how "picked up the New Yorker" (BUI includes SEE-SHOW) plus "went to a show" (TD SEE-SHOW) gives "actually it was to see a show."
- If nothing is shared but the first sentence was a DCONT kind of action, DOIT assumes Wilma got hold of the thing in order to do whatever the second sentence says. That is the fly-swatting and bird-cage-lining cases: no standard use of a magazine explains them, so the magazine must have been a tool.
- Finally it prints the answer. One goal on the list means it never changed its mind ("To read."). Two means it did ("At first I thought it was to read, but actually it was to kill a fly.").
Because it only compares the second sentence against the first, order matters. "Wilma swatted a fly. Wilma picked up the New Yorker." does not make it think she used the magazine on the fly; the 1980 paper points out that the getting-control step has to come first.
The session also shows off how easy the data is to change. The program can't see any link between being hungry and swatting a fly, so Willson and Whitehill load a one-line file, CHANGE.LSP, that adds EAT to the fly-swatting record's goals ("Wilma likes to eat flies"), and the same story then comes out as "To eat."
The program ran in MLISP, an Algol-like syntax for Lisp (note the _ for assignment, which printed as a left arrow on the terminals of the day), on the UCI PDP-10. The comment on the first line, "yeah for shallow binding," is a small celebration: DOIT pushes onto BT, a local variable of its caller, which only works because the Lisp used dynamic scope.
The code
This is MCARTY.MLI almost exactly as it is on the tape (file date March 10, 1980):
EXPR MCARTY(CD1,CD2); % yeah for shallow binding %
BEGIN NEW B1,B2,T1,T2,BT,X,Y; % bt is the backtrace %
X _ CADR MEMQ('ENGLISH,CD1); % print out debugging info %
Y _ CADR MEMQ('ENGLISH,CD2);
MSG(T,"The input story is:",T,5,X,T,5,Y,T);
T1 _ CADR MEMQ ('TD,CD1); T2 _ CADR MEMQ ('TD,CD2);
B1 _ CADR MEMQ ('BUI,CD1); B2 _ CADR MEMQ ('BUI,CD2);
IF T1 & ~B1 & T2 & ~B2 THEN PUSH(BT,T1[1]) ALSO DOIT(T1,T2);
IF T1 & B1 & T2 & ~B2 THEN PUSH(BT,T1[1]) ALSO DOIT(B1,T2);
IF ~T1 & B1 & T2 & ~B2 THEN PUSH(BT,B1[1]) ALSO DOIT(B1,T2);
IF T1 & ~B1 & T2 & B2 THEN PUSH(BT,T1[1]) ALSO DOIT(B2,T1);
IF T1 & B1 & T2 & B2 THEN PUSH(BT,T1[1]) ALSO DOIT(B1,T2);
IF ~T1 & B1 & T2 & B2 THEN PUSH(BT,B1[1]) ALSO DOIT(B1,T2);
IF T1 & ~B1 & ~T2 & B2 THEN PUSH(BT,T1[1]) ALSO DOIT(B2,T1);
IF T1 & B1 & ~T2 & B2 THEN PUSH(BT,T1[1]) ALSO DOIT(B2,T1);
IF ~T1 & B1 & ~T2 & B2 THEN PUSH(BT,B1[1]) ALSO DOIT(B1,B2);
MSG(T,"What was her goal?",T);
IF LENGTH(BT)=1 THEN MSG("To ",E(OUT(BT[1])),".",T)
ELSE MSG("At first I thought it was to ",
E(OUT(BT[2])),",",T,
"but actually it was to ",
E(OUT(BT[1])),".",T);
L; RETURN IASCII(0);
END;
EXPR DOIT(BUI,TD);
BEGIN NEW FLAG,I;
I _ CAR INTERSECTION(BUI,TD);
IF I & I NEQUAL BT[1] THEN PUSH(BT,I)
ELSE IF MEMQ('DCONT,BUI) THEN IF I NEQUAL BT[1] THEN PUSH(BT,TD[1]);
END;
EXPR OUT(A); % Look up english property of a and %
BEGIN NEW X; % print it %
X _ GET(A,'ENGLISH); PRINC(X);
END;
And the story data, MCARTY.LSP (also March 10). The square brackets are MLISP "super-brackets"; a ] closes every open parenthesis back to the matching [.
(setq cd1 '[cd (grasp (actor wilma) (object newyorker) (to wilma))
bui (read see-show $restaurant dcont)
english "Wilma picked up the New Yorker."
]]
(setq cd2 '[cd (s-hunger (actor wilma))
td (eat $restaurant $grocer find-food)
english "Wilma was hungry."
]]
(setq cd4 '[cd (propel (actor wilma) (to fly) (object))
td (kill-fly)
english "Wilma swatted a fly."
]]
(setq cd3 '[cd (mtrans (actor wilma) (object #newyorker) (to wilma))
td (read)
bui (see-show $restaurant)
english "Wilma read the New Yorker."
]]
(setq cd6 '[cd (ptrans (actor wilma) (object) (to birdcage))
td (line-bird-cage)
english "Wilma lined her bird cage."
]]
(setq cd8 '[cd (ptrans (actor wilma) (object wilma) (to show))
bui (e-entertain)
td (see-show)
english "Wilma went to a show."
]]
(setq cd5 '[cd (ptrans (actor wilma) (object wilma) (to restaurant))
td ($restaurant)
bui (eat meet-someone)
english "Wilma went to a restaurant."
]]
(put 'e-entertain "entertain herself" 'english)
(put 'eat "eat" 'english)
(put 'see-show "see a show" 'english)
(put '$restaurant "go to a restaurant" 'english)
(put 'read "read" 'english)
(put 'kill-fly "kill a fly" 'english)
(put '$grocer "go to the store" 'english)
(put 'find-food "find some food" 'english)
(put 'meet-someone "meet a friend" 'english)
(put 'line-bird-cage "line a bird cage" 'english)
The change file loaded partway through the session, CHANGE.LSP (March 8):
(setq cd2 '[cd (propel (actor wilma) (to fly) (object))
td (kill-fly eat)
english "Wilma swatted a fly."
]]
A small mystery: the code is two days newer than the log
The session was recorded on Saturday, March 8, 1980, but the program and data files that survived are dated March 10, and they are not quite the version that produced the log. The data was renumbered afterwards: in the log cd2 is the fly swatting, cd3 is "Wilma was hungry" and cd10 is the restaurant, while in the surviving file those are cd4, cd2 and cd5. (CHANGE.LSP, from the day of the session, still calls the fly swatting cd2, which is how you can tell.)
The logic moved too. If you run the March 10 code by hand on the March 8 stories, it gives the same answers as the log for 9 of the 17 runs, including most of the New Yorker examples, but not for the rest. For example, it says "To eat." for "Wilma was hungry. Wilma swatted a fly." where the log changes its mind to killing a fly, and nothing in it prints "What a stupid story!" There is an even later copy of the program on another tape, dated March 14, that answers some of those stories with "That's a disconnected story." instead. What survives is a snapshot of a program its authors were still tinkering with the week the assignment was due.
The session
Here is the paper's transcript, as written in 1980 (typos included). The paper opens with this note: "This paper uses the word 'goal' in its non-formal usage. It does not refer to the technical idea of a 'goal'." The lines starting with * are what the authors typed at Lisp, and the notes between the dashed lines are their 1980 commentary.
[DSKLOG started: 3-8-80 11:44 AM]
*(mcarty cd1 cd2)
The input story is:
"Wilma picked up the New Yorker."
"Wilma swatted a fly."
What was her goal?
At first I thought it was to read,
but actually it was to kill a fly.
-----
In this example, mcarty knows that the default use for the
New Yorker Magazine is to read it, but notices that when Wilma
swats the fly, she must have picked up the magazine for that
purpose.
-----
*(mcarty cd1 cd4)
The input story is:
"Wilma picked up the New Yorker."
"Wilma read the New Yorker."
What was her goal?
To read.
-----
In this example, mcarty notices that Wilma continued with
her initial goal to read the New Yorker.
-----
*(mcarty cd1 cd6)
The input story is:
"Wilma picked up the New Yorker."
"Wilma lined her bird cage."
What was her goal?
At first I thought it was to read,
but actually it was to line a bird cage.
-----
The results in this example (as in the first one) are due
to mcarty's inability to match the any of the standard uses for
the New Yorker against Wilma's actions. Therefore it uses the
assumption that Wilma got control of the magazine in service of
her goal of lining the bird cage.
-----
*(mcarty cd1 cd8)
The input story is:
"Wilma picked up the New Yorker."
"Wilma went to a show."
What was her goal?
At first I thought it was to read,
but actually it was to see a show.
-----
In this example, mcarty first picks the default use
of the New Yorker as Wilma's goal. After reading the second
sentence, mcarty notices that Wilma went to a show, and that
the New Yorker can be used to find a show, and so assumes that
Wilma picked up the New Yorker so she could go see a show.
-----
*(mcarty cd1 cd10)
The input story is:
"Wilma picked up the New Yorker."
"Wilma went to a restaurant."
What was her goal?
At first I thought it was to read,
but actually it was to eat.
-----
This example works the same as the example immediately
above, but instead mcarty realizes that Wilma picked up the
New Yorker because it has a list of places to eat.
-----
*(mcarty cd3 cd2)
The input story is:
"Wilma was hungry."
"Wilma swatted a fly."
What was her goal?
At first I thought it was to eat,
but actually it was to kill a fly.
-----
In this example, mcarty understands Wilma's top down
goal to be to eat, but can't match the action of swatting a fly
with that goal.
-----
*(mcarty cd3 cd4)
The input story is:
"Wilma was hungry."
"Wilma read the New Yorker."
What was her goal?
At first I thought it was to eat,
but actually it was to go to a restaurant.
-----
Wilma's goal is to eat, because she is hungry. She
can satisfy this goal different ways, but mcarty infers from
the fact that Wilma picked up the New Yorker and the New Yorker
has a list of restaurants in it that Wilma wants to go to
a restaurant.
-----
*(mcarty cd3 cd10)
The input story is:
"Wilma was hungry."
"Wilma went to a restaurant."
What was her goal?
To eat.
-----
In this example, mcarty knows that going to a restaurant
can satisfy the goal of wanting to eat, so he doesn't change his
mind about the meaning of the story. Contrast this example
with the preceding one: from the fact that Wilma picked up the
New Yorker mcarty infers that Wilma wants to go to a restaurant,
but from the fact that Wilma went to a restaurant mcarty infers
that Wilma to eat.
-----
*(mcarty cd3 cd6)
The input story is:
"Wilma was hungry."
"Wilma lined her bird cage."
What was her goal?
At first I thought it was to eat,
but actually it was to line a bird cage.
-----
Mcarty can't match lining a bird cage with wanting to
eat, so he changes his mind about Wilma's goal.
-----
*(mcarty cd3 cd8)
The input story is:
"Wilma was hungry."
"Wilma went to a show."
What was her goal?
At first I thought it was to eat,
but actually it was to see a show.
-----
This example is the same as above, with different meaning.
-----
*(mcarty cd1 cd3)
The input story is:
"Wilma picked up the New Yorker."
"Wilma was hungry."
What was her goal?
At first I thought it was to read,
but actually it was to go to a restaurant.
-----
In this example, it would be possible to infer that Wilma
picked up the New Yorker because she wanted to eat, but eating
can be satisfied in different ways. Therefore, mcarty infers
that Wilma picked up the New Yorker because she wanted to go
to a restaurant, and not to eat the magazine.
-----
*(mcarty cd3 cd1)
The input story is:
"Wilma was hungry."
"Wilma picked up the New Yorker."
What was her goal?
At first I thought it was to eat,
but actually it was to go to a restaurant.
-----
This example is the same as immediately above, except that
the sentence order is reversed. Mcarty first infers the goal
that Wilma wants to eat, but then, as above, infers that she
wants to go to a restaurant because of the action of picking
up the New Yorker.
-----
*(mcarty cd3 cd2)
The input story is:
"Wilma was hungry."
"Wilma swatted a fly."
What was her goal?
At first I thought it was to eat,
but actually it was to kill a fly.
-----
This example and the next one demonstrate that mcarty's
data base of actions and goals can be readily changed to adapt
to new possible inferences about a person's motivation. Above,
mcarty can't see any connection between Wilma being hungry and
Wilma killing a fly. Below, mcarty has been taught that Wilma
likes to eat flies.
-----
*(dskin change)
FILES-LOADED
*(mcarty cd3 cd2)
The input story is:
"Wilma was hungry."
"Wilma swatted a fly."
What was her goal?
To eat.
-----
The change was entered by dsking in a new top down index
for Wilma swatting a fly, namely, that she did this because she
eats flies.
-----
*(sprint cd2) ~ old definition
(CD (PROPEL (ACTOR WILMA) (TO FLY) (OBJECT))
TD
(KILL-FLY)
ENGLISH
"Wilma swatted a fly.")
NIL
*(sprint cd2) ~ new definition
(CD (PROPEL (ACTOR WILMA) (TO FLY) (OBJECT))
TD
(KILL-FLY EAT)
ENGLISH
"Wilma swatted a fly.")
NIL
-----
*(mcarty cd2 cd6)
The input story is:
"Wilma swatted a fly."
"Wilma lined her bird cage."
What a stupid story!
What was her goal?
To kill a fly.
-----
Giving mcarty a story where both sentences have exclusive
bottom up indexes causes mcarty to observe that there is no
connection between the two actions. (Wilma swatting a fly relates in
no way to Wilma lining her bird cage.) Mcarty picks the goal
in the first story and mentions that the story is ridiculous.
-----
*(mcarty cd10 cd3)
The input story is:
"Wilma went to a restaurant."
"Wilma was hungry."
What was her goal?
To eat.
-----
Mcarty infers that going to a restaurant will allow
Wilma to eat, and the second sentence reinforces that inference.
-----
*(mcarty cd2 cd1)
The input story is:
"Wilma swatted a fly."
"Wilma picked up the New Yorker."
What was her goal?
At first I thought it was to kill a fly,
but actually it was to read.
-----
Notice that the order of the sentences is important.
In this example, mcarty does NOT infer that Wilma picked up
the magazine to swat the fly, due to the ordering of the
sentences. For picking up the New Yorker to satisfy the DCONT
use of swatting a fly, it must precede the action of swatting
the fly.
-----
*(logout)
[DSKLOG finished: 3-8-80 11:47 AM]
Credits
Micro Arthur was written by Steve Whitehill and Steve Willson (now Stephen Clarke-Willson) for ICS 260 at UC Irvine, winter quarter 1980. The two also wrote the ETC parser together in the same class, which may get its own post.
The files came off a 1980 PDP-10 backup tape. This recovery project was done with Claude Opus 5.5 Medium Effort guided by Stephen Clarke-Willson.