...

ELIZA - A Computer Program For the Study of

by user

on
Category:

translation

0

views

Report

Comments

Transcript

ELIZA - A Computer Program For the Study of
" :i
:
.. :,-.:: . . .
:
,
: ii
•
•
.
•
:
:
"
•
:
. . . . . . . . . .
..
•
.
"
..
•
•
.
•
•
..
.
"
.:
~
. . .
. :
.:
:.
.'~
,
:
.
.
.
...
¢ompu aI cma
•
.:
.
:
:::: :i
1 " 5 . "
-
..
;!,:
i
'...
•
.
:
i
"
" "
:
•
"
:
;
.
i
---":t .7:g~~
•
.
•
.
..
•
:
~..
:
:-: ; ;: i
•
A. G. O E T T I N G E R ,
ELIZA A Computer Program
For the Study of Natural Language
Communication Between Man
And Machine
Editor
Tile object of this paper is to cause just such a reevaln~tion of the program about to be "explained". Few }
programs ever needed it more.
4
7:~.S C:
ELIZA Prograrn
}
E L I Z A is a program which makes naturM hmguage
conversation with a Colnputer possible. Its present imple5)~.;. ~~-!
mentation is oa the MAC time-sharing system at MIT. i:
7?27E
I t is written in 5lAD-SLIP [4] for the IBM 7091. Its name
was chosen to emphasize that it nmy be incrementally
:2:~:
improved by its users, since its language abilities may be
continually improved by a "teacher". Like the Eliza 0!
7~9j ~
Pygmalion fame, it (ran be made to appear even more
civilized, t,he relation of appearance to realiW, however,
remaining in ~he donmin of the playwright.
:7;2: Y :?
For ll~e present purpose it is sufficient to characterize
the ~[A() system as one which permits an individual to
operate a full seale computer from a remotely located type75~.7c_'-5
writer. The individual operator has the illusion thai, he is
the sole riser of the computer complex, while in facl~ others
} :~:<:..
may be "time-sharing" the system with him. What is
important here is that the computer can read messages }:
typed on the typewriter and respond by writing oil the
same instrument. %'he time between the computer's
-.5~::a
receipt of a message and the appearance of its response is
a function of the program controlling the dialogue and of
such MAC system parmneters as the number of users
currently eon'esponding with the system. These latter
parameters generally contribute so little to the overall
response time that conversational interaction with the
computer need never involve truly intolerable delays.
When in conversation with ELIZA, tile user types in :: L 2: .:
some statement or set of statements in natm'al language
using normal punetua.tion and sentence structures. Only i. :::!7:
the question mark may not be used, because it is inter- i
);4p
preted as a line delete character by the MAC system. The
user's sratement is terminated by a double carriage return
>>7which serves to turn eontrol over to ELIZA. E L I Z A Ithen
analyzes the user's statement and generates some response
::
) :2>J2
whieh it types out.. Control is then again with the user.
A ltypieal conversation is the following:
o
,JosEPh
~VEIZENBA UM
Massach.usclls [nshl-ute qf Tcchnu[ogg,* Cambridge, Mass.
ELIZA is a program operating within the MAC time-sharing
system at MIT which makes certain kinds of natural language
conversation between man and computer possible. Input sentences are analyzed on the basis of decomposition rules which
are triggered by key words appearing in the input text.
Responses are generated by reassembly rules associated with
selected decomposition rules. The fundamental technical problems with which ELIZA is concerned are: (1) the identification of
key words, (2) the discovery of minimal context, (3) the choice
of appropriate transformations, (4) generation of responses in
the absence of key words, and (5) the provision of an editing
capability for ELIZA "scripts". A discussion of some psychological issues relevant to the ELIZA approach as well as of future
developments concludes the paper.
Introduction
It is said that• to explain is to explain away. This maxim
is nowhere so well fulfilled as in the area of computer
programming, especially in what is ealled heuristic programming and artifieiM intelligence. For in those realms
machines are made to behave in wondrous ways, often
suftieient to dazzle even the most experim~eed observer.
But once a particular program is unmasked, once its
inner workings are explained in language sufficiently plain
to induce understanding, its magic crumbles away; iL
st~mds revealed as a mere collection of procedures, each
quite comprehensible. The observer says to himself "I
could have written that". With that thought he moves the
program in question from the shelf m~trked "intelligent",
to that reserved for curios, fit to be discussed only with
people less enlightened than he.
W o r k r e p o r t e d h e r e i n was s u p p o r t e d (iu p r o t ) b y P r o j e c t M A C ,
a n _\-lIT r e s e a r c h p r o g r a m s p o n s o r e d b y t h e Advm~ced R e s e a r c h
P r , , j e c t s Aget,cy, l)~l)ar~met~t ~,1" l)ofense, u n d e r Office of N a v a l
R e s e a r c h C o n t r a c t N u m b e r Nora'-4102(01).
* D e p a r t m e n t of E l e e i r i e a l E n g i n e e r i n g .
36
Comnutnieations
o f t h e .~(',M
}
. i :
yL>
{
%
M e n a r e all alike.
IN WHAT WAY
T h e y ' r e a l w a y s b u g g i n g u s a b o u t s o m e t h i n g or o t h e r .
C A N Y()U T H I N K (H: A S P E C I F I C E X A M P L E
Well, m y b o y f r i e n d m a d e me come here.
YOUR BOYFRIEND
MAI)E YOU COME HERE
tie s a y s i ' m d e p r e s s e d m u c h of t h e t i m e .
[ AM SORRY TO HEAR YOU ARE DEPRESSED
%olume 9 / Number
/ / January.,
i::i ::7
G{
• )i :
::.73:
::::,
i:-(-:
1966
2.:
~t s u c h a
) l a i n e d . i.
t r a l langu
~resent, inn:
t e a l at _1[
~94. Its n~
inereme~t:.
ilities mat"
t h e Eli~e.
t r e v e n 1~:
i t y , howe;
) cha.racte
individuai
l o e a t e d t~
i o n that ii
in f a c t off:
tint.
Whai
e a d messy;:
"riting 01i
compute
t s resp0i~
a l o g u e and:
~ b e r of us
T h e s e [~i~
o t h e 0vei
i o n with
.e delays.
u s e r types
u r a l lunge
a e t u r e s . 6t
se it, is b:.:
) svstera. ~
a.rriage ret~.
• ~ L I Z A i?:
.,ornle reset
:h tho
(
7
:
RI~
:
i t ' ~ ~=~e. !. ant t m h a p p y .
i)() ~ 0U TitlNK COMING IIERE WILl, IiELP YOU NOT TO
t@; i T N i I A P P Y
i >cod s o m e help, tidal m,,teh s e e m s certain.
"G'I~AT W O L ' I , D I T M E A N TO Y O U IF YOU G O T S O M E I I E L P
l'c, ri~ ps I c o u l d learn ~o get a h m g v , ith m y m o t h e r .
2-.f::LL 2~ii:: M O R E A B O U T Y O U E F A M I L Y
),[5" - m n h e r t a k e s care of me,
WiI() EI,SE IN ¥0UR FAMILY TAKES CAiIE 0F YOU
),iy f a t h e r .
YO[/R FATHER
5-,)u are like m y f a t h e r in s o m e ways.
WiIAT RESEMBLANCE
DO YOU SEE
Y o u are n o t vet',," aggressive b u t 1 t h i n k y o u d o n ' t wa.t~.t me to
notice that.
W H A T M A K E S Y O U T t t I N K I AM N O T V E R ~ A G G R E S S I V E
~'ou dolt'; a r g u e w i t h me.
W I l Y 1)O Y O U T H I N K I D O N ' T A R G U E W I T H Y O U
"~-(}u are a f r a i d of me,
D O E S i T P L E A S E Y O U T O B E I , I E \ ' E I AM A F R A [ I ) O F Y O U
M y far h e r is a f r a i d of e v e r y b o d y .
W H A T E L S E COMES TO M I N D W t I E N Y O U T H I N K OF
Y()(-II F A T H E R
Bullies.
DOES THAT HA\-E ANYTtIING TO DO WITH THE FACT
TItAT YOUR BOYFR IENI) MADE YOU COME HERE
T h e capitalized lines are the machine responses.
T h e gross procedure of the program is quite simple; the
text: is read and inspected for the presence of a keyword.
i f such a word is found, the sentence is transformed
according to a rule associated with the keyword, if not a
content-free renmrk or, under certain conditions, an earlier
t r a n s f o r m a t i o n is retrieved. The text so computed or
retrieved is then printed out.
In detail, of course, the procedure sketched above is
considerably more complex. Keywords, for example, a m y
h a v e a R A X K or precedence number. The procedure is
sensitive to such numbers in that it will abandon a keyword a.lready found in the left-to-right scan of the text in
fxvor of one having a higher rank. Also, the procedure
reeo~,afizes a comma or a period as a delimiter. Whenever
either one is encountered and a keyword has already been
found, all snbsequent text is deleted from the input message. If no key had yet been found the phrase or sentence
to the left• of the delimiter (as well as the delimiter itself)
is deleted. As a result•, only single phrases or sentences are
ever transformed.
I£eywords and their associated transformation t rules
constitute the S C R I P T for a particular class of conversation. An important property of E L I Z A is that a
script is data; i.e., it is not part of the program itself.
Hence, E L I Z A is not restricted to a particular set of
recognition patterns or responses, indeed not even to any
specific language. E L I Z A scripts exist (at, this writing) in
Welsh attd Gernmn as well as in English.
T h e fundamental technical problems with which E L I Z A
m u s t be preoccupied are the following:
(1) T h e identification of the "most important" keyword
T h e w o r d " t r a n s f o r m a t i o n " is u s e d in its generic s e n s e r a t h e r
t h a n t h a t g i v e n it b y tia.rris a n d C h o m s k y in l i n g u i s t i c c o n t e x t s .
occurring in the input message.
(2) Tile identification of some minimal context within
which the chosen keyword at)pears; e.g., if the keyword is
"you", is it followed by the word " a r e " (in which ease an
assertion is probably being made).
(3) The choice of an appropriate transformation rule
and, of course, the making of the transformation itself.
(4) The provision of mechanism that will permit
E L I Z A to respond "intelligently" when the input text
contained no keywords.
(5) The provision of machinery that facilitates editing,
particularly extension, of the script on the script writing
level.
There are, of course, the usual constraints dictated by
the need to be eeononfical in the use of computer time and
storage space.
The central issue is clearly one of text manipulation,
and at the heart of that issue is the concept of the transformation rule which has been said to be associated with
certain keywords. The meehanisins subsumed under the
sloga.n "transformation rule" are a number of SLIP functions which serve to (1) decompose a data string according
to certain criteria, hence to test the string as to whether it
satisfies these criteria or not, and (2) to reassemble a
decomposed string according to certain assembly specifications.
While this is not the i)lace to discuss these functions in
all their detail (or even to reveal their full power and
generality), it is important to the understanding of the
operation of E L I Z A to describe them in some detail.
Consider the sentence " I ant very unhappy these days".
Suppose a foreigner with only a limited knowledge of
English but with a veer good ear heard that sentence
spoken but understood only the first two words " I am".
Wishing to appear interested, perhaps even sympathetic,
he may reply "How long have you been very unhappy
these days?" What he nmst have done is to apply a kind
of template to the original sentence, one part of which
matched the two words " I aln" and the remainder isolated
the words "very unhat)py these days". He must also have
a reassembly kit specifically associated with that template,
one that specifies that any sentence of the form "I am
B L A H " can be transformed to " H o w long have you been
BLAH", independently of the meaning of BLAH. A
somewhat more complicated example is given by the
sentence " I t seems that you hate me". Here the foreigner
understands only the words " y o u " and " m e " ; i.e., he
applies a template that decomposes the sentence into the
four parts:
(1) It s e e m s t h a t
(2) you
(3) h a t e
(4) me
of which only the second and fourth parts are understood.
The reassembly rule might then be "What makes you
think I hate you"; i.e., it nfight throw away the first
component, translate the two known words ("you" to
" I " and "me" to "you") and tack on a stock phrase
(What makes you think) to the front of the reconstruction.
~o
V(~lume 9 /Numher
J tl tl u arv;[ I:
1 / January,
1966
Communications
of t h e A C M
37
A formal notation in which to represent the decomposition
template is:
(0 YOU 0 ME)
and the reassembly rule
(WHAT M A K E S YOU T H I N K I 3 YOU).
The "0" in the decomposition rule stands for "an indefinite number of words" (analogous to the indefinite
dollar sign of COMIT) [6] while the "3" in the reassembly
rule indicates that the third component of the subject
decomposition is to be inserted in its place. The decomposition rule
almost none of the words in any given sentence are repre.
sented in the keyword dictionary. The other is that of
"associating" both decomposit;ion and reassembly rules
with keyword~-;. The iirst is serious in that the determination that a word is not in a dictionary m a y well require
more computation (i.e., time) than the location of a word
which is represented. The attack on both problems begins
by placing both a keyword trod its associated rules on a
list. The basic format of a typical key list is the following:
(K ((D0 (R~. t) (R~, 2) "'" (Rt . . . . ))
((D2) (R2. ~) (R2.2) " " (R2.,,,~))
:
((D,~) (R,,, ~) (taw, ~) ... (R,~, .~)))
(0 YOU 1 ME)
would have worked just as well in this specific example. A
nonzero integer " n " appearing in a decomposition rule
indicates that the component in question should consist
of exactly " n " words. However, of the two rules shown,
only the first would have matched the sentence, " I t seems
you hate and love me," the second failing because there is
more than one word between " y o u " and "me".
~1 RI,1 R1,2"'" Rl,ml
Fro. 1.
D2 R2J RZ,Z" " "Rz,m2
De Ra,t FIn'2~'" " R%nan
:Keyword and rule list structure
i n ELIZA the question of which decomposition rules to
apply to an input text is of course a crucial one. The input
sentence might have been, for example, " I t seems that
you hate," in which ease the decomposition rule (0 YOU
0 ME) would have failed in that the word " M E " would
not have been found at all, let alone in its assigned place.
Some other decomposition rule would then have to be
tried and, failing that, still another until a match could
be made or a total failure reported. ELIZA must therefm~
have a mechanism to sharply delimit the set of decomposition rules which are potentially applicable to a currently active input sentence. This is the keyword mechanism.
An input sentence is scanned from left to right. Each
word is looked up in a dictionary of keywords. If a word
is identified as a keyword, then (apart from the issue of
precedence of keywords) only decomposition rules containing that keyword need to be tried. The trial sequence
can even be partially ordered. For example, the decomposition rule (0 YOU 0) associated with the keyword
"YOU" (and decomposing an input sentence into (1) all
words in front of "YOU", (2) the word "YOU", and (3)
all words following "YOU") should be the last, one tried
since it is bound to succeed.
Two problems now arise. One stems from the fact t h a t
38
Communications of tile ACM
where K is the keyword, D, the it,h decomposition rule
associated with K and R¢, ~ the j t h reassembly rule ass0.
ciated with the ith decomposition rule.
A common pictorial representation of such a structure
is the tree diagram shown in Figure 1. The top level of
this structure contains the keyword followed by the names
of lists; each one of which is again a list structure beginning
with a decomposition rule and followed by reassembly
rules. Since list structures of this type have no predetermined dimensionality limitations, any number of decomposition rules m a y be associated with a given keyword and
any number of reassembly rules witch any specific decomposition rule. SLiP i8 rich in functions that sequence over
structures of this type efficiently. Hence programmin
problems are minimized.
An ELIZA script consists mainly of a set of list structures of the type shown. The actual keyword dictionary is
constructed when such a script is first read into the
hitherto empty program. The basic structural component
of the keyword dictionary is a vector K E Y of (currently)
128 contiguous computer words. As a particular key list
structure is read the keyword K at its top is randomized
(hashed) by a procedure that produces (currently) a 7
bit integer "i". The word "always", for example, yields
the integer 14. KEY(i), i.e., the ith word of the vector
KEY, is then examined to determine whether it contains
a list. name. If it does not, then an empty list is created,
its name placed in KEY(i), and the key list structure in
question placed on that list. If KEY(i) already contains a
list name, then the name of the key list structure is placed
on the bottom of the list named in KEY(i). The largest
dictionary so far attempted contains about 50 keywords.
No list named in any of the words of the K E Y vector
contains more than two key list structures.
Every word encountered in the scan of an input text,
i.e., during the actual operations of ELIZA, is randomized
by the same hashing algorithm as was originally applied to
the incoming keywords, hence yields an integer which
points to the only possible list structure which could
potentially contain that word as a keyword. Even then,
only the tops of any key list structures that m a y be found
there need be interrogated to determine whether or not a
keyword has been found. By virtue of the various list
Volume 9 / Number 1 / January, 1966
i
:
e repret h a t of
y rule~
arn~inw
require
word
; begim
es
Oil
lowing:
on rule
le asso;
rueLure
[ e v e l Of
ginning
.seInbly
"edeter::
decon>
)rd &nd
deoom:
oe.
over
1TI YV~ irt
:
:: st:t?ue-:
, n a r y is
~to t h e
portent :
rently)
~ey list
onfized
Y) a 7
5~ields
veer.tot
)ntains
reated,}i
t ains
a:
ola~eed:
l~trg-est i
xx-ol-ds.i
\-"e e t o g
t
text,
1hi zed
)liecI to
~vhieln
eoutld :
l then
:::
fol_t ha{
not
a
us
list
Y,
1966:
:i}
....
~,
-.~,~,~.ciT~o.
. . . . ~. .,~, operations_ that SLIP makes available, the
a,:ttta] identification of a keyword leaves as its i)rim:ipal
product a pointer to the list of decomposition (and hence
rc:t~se~bly) rules associated with the identified keyword.
()~e resui~ of this strategy is that often less time is required
to discover that a given word is >_of in the keyword dic~io~ary than to locate it if it. is there. However, tile location
of a keyword yields pointers to all inforntation associated
with that word.
Some conversational protocols require that certain
transformations be made on certain words of .the input text
iiidependel~tly of any contextual considerations. The first
conversation displayed in this paper, for example, requires
that firsb person pronouns be exchanged for second person
pronouns and vice versa throughout tile input text. There
may be further transformations but these minimal substitutions are unconditional. Simple substitution rules
ought not to be elevated to the level of transformations,
nor should the words involved be forced to carry with them
all the structure required for the fully complex case.
],'urthermore, unconditional substitutions of single words
for single words can be accomplished during the text scan
itself, not as a Lransformat.ion of the entire text subsequent
to scanning. To facilitate the realization of these
desiderata, any word in the key dictionary, i.e., at the
top of a key fist, structure., may be followed by an equM
sign followed by whatever word is to be its substitute.
Tranformation rules may, but need not, follow. If none
do follow such a subst, itution rule, then the substitution is
made on the fly, i.e:, during text scanning, but the word
in question is not identified as a keyword for subsequent
purposes. Of course, a word may be both subtituted for
and be a keyword as well. An example of a simple substitution is
(YOUIISELF = MYSELF).
Neither "yourself" nor "myself" are keywords in the
particular script from which this example was chosen.
The fact that keywords can have ranks or precedences
has already been mentioned. The need of a ranking mechanism may be established by an example. Suppose an input
sentence is " I know everybody laughed at me." A script
may tag the word "I" as well as the word "cvetTbody"
as a keyword. Without differential ranking, " I " occurring
first would determine the transformation to be applied.
A typical response might be "You say you know everybody
laughed at. you." But. the important message in the input
sentence begins with the word "everybody". It is very
often true that when a person speaks in terms of universals
such as "everybody", "always" and "nobody" he is really
referring to some quite specific event or person. By giving
"'everybody" a higher rank than "I", the response "Who
in particular are you thinking of" may be generated.
The specific mechanism employed in ranking is that the
rank of every keyword encountered (absence of rank
implies rank equals 0) is compared with the rank of the
highest, ranked keyword already seen. If the rank of the
V o l u m e 9 / N u m b e r 1 / .]anuary, 1966
new word is higher than t h a t of any previously encountered word, the pointer t o tile transformation rules
associated with the new w o r d is placed on top of a list
called the keystack, o t h e r w i s e it is placed on the bottom
of the keystaek. Wizen t h e t e x t scan terminates, the keystack has at its top a p o i n t e r associated with the highest
ranked keyword e n c o u n t e r e d in the scan. The remaining
pointers in the stack m a y n o t be monotonically ordered
with respect to the ranks o f the words from which they
were derived, but they are n e a r l y so--in any event they
are in a useful attd i n t e r e s t i n g order. Figure 2 is a simpli,
~
ke'/steck
'
'
'
*
J
~
!
:
-~ ...... ~.._i
YES
k..!i_IH~[_/~-_
t
YgS
t ~' ~c___F-]:;,:~:o~
1
FIG. 2. Basic flow diagram of keyword detect.ion
fled flow diagram of k e y w o r d detection. The rank of a
keyword must, of course, a!so be associated with the
keyword. Therefore it m u s t appear on the keyword list
structure. It may be f o u n d , if at all, just in front of the
list of transformation r u l e s associated with the keyword.
As an example consider t h e word " M Y " in a particular
script. Its keyword list m a y be as follows:
(MY -- YOUR. 5 (transformation rules)).
Such a list would mean t h a t whenever the word " M Y " is
encountered in any text, it would be replaced by the word
"YOUR". Its rank would b e 5.
Upon completion of a g i v e n text scan, the keystack is
either empty or contains pointers derived from the keywords found in the text. E a c h of such pointers is actually a
sequence reader--a SLip mechanism which facilitates
scanning of lists--pointing into its particular key list in
such a way that one s e q u e n c i n g operation to the right
(SEQLR) will sequence it t o the first set of transformation
rules associated with its k e y w o r d , i.e., to the list
((Dr) (Rt,,) (R,,e) ... (R~,R,.~)).
The top of that list, of course, is a list which serves a
decomposition rule for t h e subject text. The top of the
keystack contains the first, pointer to be activated.
The decomposition r u l e D~ associated with the keyword
K, i.e., {(D0, K}, is n o w tried. It may fail however. For
example, suppose the i n p u t t e x t was:
You are very helpful.
C o n a r n u n i c a t i o n s of t h e ACM
39
Tile lwywor<t, say, is "'you", and I cD,), you} is
(0 I remind you of 0;.
(l-h:call that the " y o u " it, the original sentence has already
b(:(n replaced I%" " I " in the text now analyzed.) This
det:omposilicq~ rule obviously fails to match tile input
sentence. Should i(D0, K} fail to find a match, then
I(D2), K} is tried. Should that too fail, {(Da), K} is
atlempted, and so (m. Of course, lhe set of transformation
rules can be guaranteed to terminate with a decomposition
rule which nmst match. The decomposition rule
(o K o)
will m a t c h any text in which tile word K appears while
(0)
will match any text whaiever. However, there are other
ways to leave a particular set of transformation rules, as
will be shown below. For the present, suppose that some
particular decomposition rule (D,') has lnatehed the input
text. (D~), of course, was found o n a list of the form
((DO(R:, ~)(& ~) --- (R,-..... )).
Sequencing the reader which is presently pointing at
(D,) will retrieve the reassembly rule (R,. ~) which m a y
then be applied to the decomposed input text to yield the
output message.
Consider again the input text
You are very helpful
.:..
in which "you" is the only key word. The sentence is
transformed during scanning to
[ are very hell)ful
(Dr), you} is "(0 i remind your of 0)" and fails to match
as already discussed. However, I (De), you} is "(0 I are 0)"
and obviously ma.tehes the text, decomposing it into the
coltstituents
d) empty
(2) I
.,.3) are
6l) very helpful.
{(Re. I), you} is
(What makes you think I am 4)
thtG decomposition rule. Tl, Js mechanism h~st,res t h a t the
complete set of reassernbly rules ~ssoeiated with a given
deeomposh:ion rule is cycled through before any repetitions
0CCUY,
The system described so far is ess(qltially one which
selects ~t decomposition rule for the highest ranking keyword found in an input text, attempts to m a t c h t h a t text
according to that decomposition rule and, failing to make
a match, selects the next reassembly rule associated with
the matching decomposition rule and applies it. to generate
an output texi. It is, in other words, a system which, for
the highest ranking keyword of a text, selecta a speeifie
decomposition and reassembly rule to be used ill forming
the output message.
Were the system to remain that simple, then keywords
that required identical sets of transformation rules would
each require that a copy of these transformation rules be
associated with them. This woukl be logically sound but
would complicate the task of script writing and would also
make unnecessary storage demands. There are therefore
special types of decomposition and assembly rules charaeterized by the appearance of . . . . . at the top of the
rule list. The word following the equal sign indicates which
new set of transformation rules is to be applied. ]"or example, the keyword " w h a t " m a y have associated with it
a transformation rule set of the form
((0) (Why do you ask) (Is that an important, question) . . .)
which would apply equally well to the keywords "how"
and "when". The entire keyword list for " h o w " may
therefore be
(How (=What))
The keywords "how", " w h a t " and "when" m a y thus be
made to form an equivalence class with respect to the
transformation rules which are to apply to them.
In the above example the rule " ( = w h a t , ) " is in the
place of a decomposition rule, although it causes no
decomposition of tile relevant text. I t m a y also appear,
however, in the place of a reassembly rule. l.'or example,
the keyword "am" m a y have mnong others the following
transformation rule set associated with it:
((0 are you 0) d)o you believe you are 4) . . .
Hence it produces the output text
wtm~ makes you think I am very helpful.
H a v i n g produced it, the integer 1 is put in front of (Re. t)
so that the i ransfonnation rule list in question now appears
...
( R e ..... ) ) .
Next time ~(De), K} matches an input text, the reassembly
rule (R2..2) will be applied and the integer 2 will replace
the 1. After (R2. ,~,) has been exercised, (Re. ,) will again
be invoked. Thus, after the system has been in use for a
time, ex'ery decomposition rule which has matched some
input text has associated with it an integer which corresponds to the last l~assembly rule used in connection with
40
Connnunications
o f tile AkC~I
. .
.)
(it is here assumed that " a r e " has been substituted for
" a m " and "you" for "I" in the initial text seam) Then,
the input text
{
Am I siek
as
((D~)I(Re,~)(R2,~)
(=what)
would elicit either
])o you believe you are siek
or
W h y do yotl a s k
i
depending on how many tinles the general form had
already occurred.
Under still other conditions it m a y be desirable to
Volume
9 / Number
1 / January,
1966
<~--~
mt tb
; give~
'titi0r~z
which
~ texi
:i<<[o:~'iY~ ,::~ p r e l i m i n a r y transformciiiou On tile h t p u t
[ ,, : L,.)i'o ~ u } ) i e c ' { i n o "
i,'..to 1 h e de,.:onuDosP,
~ o : ~ s "" "
<exb
: r o d reti-4senttc"/iles
-<.~ <> ~L m , v y[eid t h e ou[t)ut .:ext. ~¢or e x a m p l e , t h e
~-,v,:{or / " v o u h - e " s h o u l d b a d to the t r a n s f o r m a t i o n r u l e s
~t..... ,.iat,-d with "you" t,)ttt S}tOltld {;;'At })e replaced by a
,,. ~)r,:[ Imir. The dieticmarv e:ttry £~u" "3-ou'rC' is therefore:
make
yo~re = i:m ((0 I'm O) (P1~I; (I _k).[ 3) (:=YOU.)})
:t with
,.~ hic.h has the foiiowit~e~ effect:
l'). -Wherever :'3:ou']'e" is _out~u~'
~ in the input text.., i~ is
r~q,h eed bv I m .
t-/
..ou.re is actually selected as ihe ream%hi,
i<eyword, then the input text: is decomposed late three
e{u:stiluent parts, namely, all text in h'out of the first
oecurre>.ce of " I ' m " , the word " I ' m " itself, and all text
followi~lg tile first occurrc:we of " I ' m " .
(3) The reassembly rule beginning with ih(' eode
' g ? R I 5 " is eneountered at!d the decomposed texk: reassembled such that the words ' I A-Xl" appear in front
of the third constituent, determined by the earlier decompositiou.
(4) Contxol is transferred, so to speak, to the transf o r m m i o n rules associated with the keyword " y o u " ,
where, further decompositions etc. are attempted.
It, is to be noted that the set
tlerate
% for
pecific
rming
words
vould
tes b~:
:l but
t als0
"ef0re
char.
f the;
~hieh
r eli
t.h it,
:
,'P {Ill (I AM 3) (=YOU))
•
.,)
OW"
may:
i~ logically in the place of a reassembly rule attd m a y
therefore be one of really r e a s s e m b l y rules associated with
t h e given decomposition.
Another form of reassembly rule is
(NEWKI::Y)
s be
the
the
no
ear, :
ple,
ing :
•
.)
for
to :;
v..,deh serves the eas{~ in which attempts to nmtch o n the
(:urcently regnant keyword are to be given up and the
end.ire decomposition a~d reassembly process is to s t a r t
a ~ a h t on the basis of the keyword to be found in the
keystack. Whenever this rule is invoked, the top of ttle
k('ysta('k is "popped Ul)" once, i.e., the new regnant keyw o r d recovered and removed from the keystack, att(.l the
e n t i r e process reinitiated as if the initial text scan had jusla
termirmted. This mechanism makes it possible to, in effect,
test on key phrases as opposed to single key words.
A serious problem whieh remains to be discussed is the
reaction of the system in ease no keywords renmin to
s e r v e as transformation triggers. This can arise either in
cas:, the ke3"stack is emI)ty when N E W K E Y is invoked or
w h e u the input text. contained no keywords initially•
T h e simplest meelmnism supplied is in the form of the
special reserved keyword " N O N E " which must be part of
n n y script. The script writer must assoeiate the universally
m a t c h i n g deeomposition rule (0) with it and follow this b y
as m a n y content-h'ee remarks in the form of transformat i e d rules as he pleases. (Exmnples are: "Please go on",
r h a r s very interesting" and " I see".)
T h e r e is, however, another mechanism which causes the
s y s t e m to respond more spectacularly in the absence of a
key. The word " M E M O R Y " is another reserved pseudokeyword. The k e y list structure associated with it differs
• "Volume 9 / N u m b e r 1 / J a n u a r y , 1966
:i
f r o m the ordinary one in some respects. An example
ilIuminat:es this point.
Consider tile following structure:
(MEMORY MY
(0 Y O U R 0 = LETS DISCUSS F U R T H E R WHY YOUR 3)
(0 Y O U R 0 - EARLIER YOU SAID YOUR 3)
T h e word " M Y " (which must be an ordinary keyword
as well) has been selected to serve a special function.
W h e n e v e r it is the highest ranking keyword of a text one
of the transformations on the M E M O R Y list is randomly
selected, a n d a copy of the text is transformed accordingly.
T h i s transformation is stored on a first-in-first-out stack
for later use. The ordinary processes already described are
t h e n carried out. When a text without keywords is encountered later and a certain counting mechanism is in a
particular state and the stack in question is not empty,
then the transformed text is printed out as the reply• I t
is, of course, also deleted from the stack of such transformations.
T h e eurrent version of E L I Z A requires that one keyword
be associated with M E M O R Y and that exactly four
transformations aceoinpany that word in that context. (An
application of a transformation rule of the form
( L E F T H A N D SIDE = t l I G I I T H A N D SIDE)
is equivalent to the successive application of the two forms
( L E F T H A N D SIDE), (RIGIIT HAND SIDE).)
T h r e e more details will complete the formal description
of the E L I Z A program.
T h e transformation rule mechanism of SLIP is such that.
it permits tagging of words in a text and their subsequent
recovery on the basis of one of their tags. The keyword
" M O T H E R ? ' in ELIZA, for example, m a y be identified
as a noun and as a member of the class "family" as follows:
(MOTHER
DLIST
(/NOUN FAMILY)).
Such tagging in no way interferes with other information
(e.g., r a n k or transformation rules) which may be assod a t e d with the given tag word. A decomposition rule nmy
contain a matching constituent of the form ( / T A G I
T A G 2 . - - ) w h i c h will match and isolate a word in the
subject t e x t having any one of the mentioned tags. If, for
example, " M O T H E R " is tagged as indicated and the
i n p u t text
" C O N S I D E R 5IY AGED M O T t I E R AS WELL AS M E "
subjected to the decomposition rule
(0 YOUR, 0 (/FAMILY) 0)
(remembering that " M Y " has been replaced by " Y O U R " ) ,
t h e n the decomposition would be
(1) C O N S I D E R
(2) YOUR
(3) AGED
(5) AS W E L L AS ME.
(4) M O T H E R
A n o t h e r flexibility inherent in the SLiP text manipulation mechanism underlying E L I Z A is tha or-ing of
m a t c h i n g criteria is permitted in decomposition rules•
T h e above input text would have been decomposed
Communications
o f t h e ACM
41
:t
precisely as stated above by the decomposition rule:
i> <i!:,.tk -erves tile spea]<er to n m rain his sense o~ btqng
J
:-:~::rc:
a,qd understood. T h e ~peak,,~r further d<,:fe::d~his
hnpression (which
even h: real Ere m a y be lhn~o
'
by
,
F \) )
.~
ac:iuoutmg to his conversationa: l?ar{n()rah sorts of back!
(0 YOUR 0 (.FATHEII MOTIIEII) 0)
which, by virtue of the presence of " , " in the sublis¢
struc.ture seen above, would have isolated either the word
" F A T I t E R " or " M O T H E R " (in that order) in the input.
text, whichever occurred first after the first appearance of
the word " Y O U R " .
Finally, the script writer nmst begin his script with a
list, i.e., a message enclosed in parentheses, which contains
the statement he wishes EI.IZA to type when the system
is first loaded. This list nmy be empty.
Editing of an E L I Z A script is achieved via appeal to a
contextual editing program (ED) which is part of the
MAC library. This program is called whenever the input
text to E L I Z A consists of the single word " E D I T " .
E H Z A then puts itself in a so-called dormant state and
presents the then stored script for editing. Detailed
d:-scriptio:t of E D is out of place here. Suftice it to say that
changes, additions and deletions of the script m a y be made
with considerable efficiency and on the basis of entirely
contextual cues, i.e., without resort to line numbers or
any other artificial devices. When editing is completed,
: :::4ffs" E D is given the command to F I L E the revised script. The
new script is then stored on the disk and read into ELIZA.
E L I Z A lhen types the word " S T A R T " to signal that the
conversation m a y resume under control of the new script.
An important consequence of the editing facility built
into E L I Z A is that a given E L I Z A script need not start
out to be a large, full-blown scenario. On the contrary, it
should begin as a quite modest set of keywords and
transformation rules and permitted to be grown and
molded as experience with it builds up. This appears to
be the best. way to use a truly, interactive man-machine
facility--i.e., not as a device for rapidly debugging a code
representing a fully thought out solution to a problem, but
S
rather as an aid for the exploration of problem solving
strategies.
Discussion
At this writing, the only serious E L I Z A scripts whieh
exist are seine which cause E L I Z A to respond roughly as
would certain psychotherapists (Rogerians). E L I Z A
performs best when its human correspondent is ilfitially
instructed to "taJk" to it, via the typewriter of course,
just as one would to a psychiatrist. This mode of tonversation was chosen because the psychiatric interview
is one of the few examples of categorized dyadic natural
language comnmnieation in which one of the participating
pair is free to assume the pose of knowing almost nothing
of the real world. If, for exalnple, one were to tell a psvehiatrist " I went for a long boat ride" and he responded
"Tell me about boats", one would not assume that he knew
nothing about boats, but that he had some purpose in so
direeting the subsequent conversation. I t is important to
note that this assumption is one made by the speaker.
Whether it is realistic or not is art altogether separate
question. In any case, it has a crucial psychological utility
42
J
{
Communications of the ACM
.i
.
t
ground kno w!edge, insigl:t s and l'easo~dn o.cabilit 3: But ::radii,
t.hese are the .~pegl,e,'a contribution to the conversation.
Thev. manifest then:selves hfferentialh-., in the _~~:te.@ce{a.h m .~°
he makes of d-to offered responses, -"t rein the purely tec~: ncal
programming poiLU of view then, the t?sychbJ:ric i n t e r v i e w
form of an I';LIZA script has the advantage that it eliminates the need of storing e.~:pUcit inform:tth?n about the
real world.
The human speaker will, a~ has been said, contribute
much to clothe EI,IZA'S responses h: vestmen:s of
plausibility. B u t he will not defend his illusion (that he is
being understood) against all odds. In tmnutn eonversat:on
a speaker will make certain (perhaps generous) assmnl)lions about his conversational partner. As long as ~ it
remains possible to interpret the latter's response~ consistently with those assumptions, the speaker's image of
his partner remains unchanged, in particular, undanmged.
Responses wlfieh are difficult to so interpret m a y well
result in an enhancement of the inmge of the partner, in
additional rationalizations which then make more con>
plicated interpretations of his responses reasonable.
When, however, such rationalizations become too inassive
and even self-contradictory, the entire image m a y erumble
and be replaeed by another ("He is not, after all, as s m a r t
as I thought he was"). When the conversational pa.rtner
is a machine (the distinction between nmchine and prograin
is here not useful) then the idea of credibility m a y weU b e
substituted for that. of pla.'uaibiStfl in the above.
With E L I Z A as the basic vehicle, experiments m a y b e
set up in which the subjects find it credible to believe t h a t
the responses which appear on his typewriter are generated by a h u m a n sitting at a similar instrmnent in a n o t h e r
room. How must the script be written in order to m a i n t a i n
the credibility of this idea over a long period of time?
H o w can the performance of E L I Z A be systematically
degraded in order to achieve controlled and predictable
thresholds of credibility in the subject? What, in all this,
is the role of the initial instruction to the subject? On t h e
other hand, suppose the subject is told he is communicating
with a maehine. W h a t is he led to believe about t h e
machine as a result of his conversational experience w i t h
it? Seine subjects'have been very hm'd to convince t h a t
E L I Z A (with its present script) is not hunmn. This is a
striking form of Turing's test. W h a t experimental design
would make it more nearly rigorous and airtight?
The whole issue of the credibility (to humans) of
machine output demands investigation. I m p o r t a n t decisions increasingly tend to be made in response to c o m puter output. The u h i m a t e l y responsible h u m a n interpreter of " W h a t the machine says" is, not unlike t h e
correspondent with E H Z A , constantly faced with t h e
need to make credibility judgments. E L I Z A shows, if
nothing else, how easy it is to create and nmiutain t h e
illusion of understanding, hence perhaps of j u d g m e n t
l
~
•
i
]
•
Vohunc 9 / Number 1 / January, 1966
tg
de.-erving of eredibilRy. A certain d:u~ge1 lurks there.
~.~: idea ihat the presettt E L I Z A s{:rk)t contains no
infocmation about tl~e real world i:s ,tot. e~tirely true. For
e>:ample, the tran>formation rules which cause ihc input
is
,y
C[I:
Everybody hates me
to be transformed to
Can you think of anyone in particular
w
i~e
[e
)f
is
:
it
=
)f
1.
.11
l-
[e
7t
Lt
;r
n
y
7
h
gt
t~t
,f
f
~3
t
G
<
:: ?
and other such are based on quite specific hypotheses about
the world. The whole script constitutes, in a loose way, a
model of certain aspects of the world. The act of writing a
script is a kind of programming act and has all the advantages of programming, most particularly that it clearly
shows where the progranuner's understanding and con>
mand of his subject leaves off.
A large part of whatever elegance may be credited to
ELIZA lies in the fact that E L I Z A maintains the illusion
of understanding with so little machinery. But. there are
bounds on the extendability of ELIZA's "understanding"
power, which arc a function of the ELIZA program itself
and not a function of any script it may be given. The
crucial test of understanding, as every teacher should
know, is not the subject's ability to continue a conversation, but to draw valid conclusions h'om what. he is being
told. In order for a computer program to be able to do
that, it must at least have the capacity to store 8elected
parts of its inputs. ELIZA throws away each of its inpuls,
except for those few transformed by means of the
:\IIiL\:IOI{Y machinery. Of course, the problem is more
than one of storage. A great part of it is, in fact, subsumed
under the word "selected" used just, above. E L I Z A in its
use so far has had as one of its principal objectives the
cot~cetdment of its lack of understanding. But to encourage
its conversational partner to offer inputs from which it
can select remedial information, it, must ret,eal its mistmderstanding. A switch of objectives from the concealmeat to the revelation of misunderstanding is seen as a
precondition to making an ELIZA-like program the basis
for an effective natural language man machine communication system.
One goal for an augmented ELIZA program is thus a
system which already has access to a store of information
about some aspects of the real world and which, by means
of conversational interaction with people, can reveal both
what it knows, i.e., behave as an infh)rmation retrieval
system, and where its knowledge ends and needs to be
augmented. Hopefully the augmentation of its knowledge
will also be a direct consequence of its conversational
experience. I t is precisely the prospect that. such a program
will converse with many people and learn something from
each of them, which leads to the hope that R will prove an
interesting and even useful conversational partner.
One w~v to state a slightly different intermediate goal is
to say that E L I Z A should be given the power to slowly
build a model of the subject conversing with it. If the
subject mentions that. he is not. married, for example, and
later speaks of his wife, then ELIZA should be able to
Volume 9 / Number 1 / January, 1966
make the tentative inference that he is either a widower
or divorced. Of course, he could simply be confused. In
/:he long run, E L I Z A should be able to build up a belief
structure (to use Abelson's phrase) of the subject and on
that basis detect the subject's rationalizations, contradictions, etc. Conversations with such an ELIZA would
often turn into arguments, hnportant steps in the realization of these goals have ah'cady been taken. Most notable
among these is Abelson's and Carroll's work on simulation
of belief structures [1].
The script that has formed the basis for most of this
discussion happens to be one with an overwhehningly
psychological orientation. The reason for this has already
been discussed. There is a danger, however, that the
example will run away with what it is supposed to illust.rate. I t is useful to remember that the E L I Z A program
itself is merely a translating processor in the technical
programming sense. Gem [2] in a paper on language
systems says:
Given a language which already possesses semantic content, then
a translating processor, even if it operates only syntactically,
generates correspondittg expressions of another language to which
we can attritmte as "meanings" (possibly multiple--the translator
may not be one to one) the "semantic intents" of the generating
source expressions; whether we find the result consistent or useful.
or both is, of course, another problem. It is quite possible that by
this method the same syntactic object language can be usefully
assigned multiple meanings for each expression...
It is striking to note how well his words/fit ELIZA. The
"given language" is English as is the "other language",
expressions of which arc generated. In principle, the given
hmguage could as well be the kind of English in which
"word problems" in algebr~L am given to high school
students and the other language, a machine code allowing
a particular computer to "solve" the stated problems.
(See Bobrow's program S T U D E N T [3].)
The intent of the above remarks is to further rob E L I Z A
of the aura of magic to which its application to psychological subject matter has to some extent contributed.
Seen in the coldest possible light, ELIZA is a translating
processor in Gorn's sense; however, it is one which has
been especially constructed to work well with natural
language text.
REFERENCES
1. ABEl.SON, Pt. P., AND CARROLL, J. D. Computer simulation
of individual belief systems. Amer. Behav. Set. 9 (May 1965),
24-30.
2. Goax, S. Semiotic relationships in ambiguously stratified
bmguage systems. Paper presented at Int. Colloq. Algebraic
Linguistics and Automatic Theory, Hebrew U. of Jerusalem,
Aug. 1964.
3. Bom¢ow, D . G . Natural language input for a computer problem solving system. Doctoral thesis, Math. Dept., MIT.
Cambridge, Mass., 1964.
4. WEIZENB_~UM, J. Symmetric list processor. Comm. A C M 6,
(Sept. 1963), 524-544.
5. ROGEaS, C. Client Centered Therapy: Current Practice, Implications and Theory. Houghton Mifflin, Boston, 1951.
6. YNGVE, J. COMIT Programndng Manual. M[T Press, Cambridge, Mass., 1961.
Communications
o f t h e ACM
43
APPENIOIX.
A~a. E L I Z A
Script
(WOU!D
YOU WANT TO BE ~)
((0)
(WHY O0 YOU SAY ' A M ' )
(ARE ( ( 0
(HOW DO YOU 00.
PLEASETELL ME YOUR PROBLEM)
ARE
(SORRY ( ( 0 )
(PLEASE DON'T A P O L I G I Z E )
(APOLOGIES ARE NOT NECESSARY) (WHAT FEELINGS
DO YOU HAVE WHEN YOU APOLOGIZE)
(lIVE
TOLD YOU
IN WHETHFR I AM ~ OR NOT)
~ WEREN'T ~)
( ( O ARE 0)
(DiD
(YOUR = MY ( ( 0
(CANT = CAN'T)
(WHAT A B O U T
(WONT = WON'T)
(REALLY, MY 3 ) ) )
(PERHAPS i A~ ~ IN YOU~
I AM ~)
(=W~AT))
YOU THINK THEY MIGHT NOT BE 3)
(WOULD YOU LIKE
(DONT = DON'T)
IT
IF THEY WERE NOT 3)
THEY ARE 3 ) )
MY O)
(WHAT !F THEY WPRE NOT 3>
)
(WHY ARE YOU CONCERNED OVER MY 3)
YOUR OWN 3) (ARE YOU W O R R I E D ABOUT SO~.!EONE ELSES 3)
(WAS 2 ((0 WAS YOU 0 )
(REMEMBER S
( ( 0 YOU REMEMBER O) (DO YOU OFTEN THINK OF 4)
(DOES THINKING OF ~ BRING ANYTHING ELSE TO MINO)
(WHAT ELSE OO YOU REMEMBER)
(WHY DO YOU REMEMBER 4 JUST NOW)
(WHAT IN THE PRESENT SITUATION REMINDS YOU OF ~)
(WHAT IS THE CONNECTION BETWEEN ME AND ~))
((0 DO I REMEMBER 0) (DID YOU THINK I WOULD FORGET 5)
(WHY DO YOU THINK I SHOULD RECALL S NOW)
(WHAT ABOUT 5) (=WHAT) (YOU MENTIONED S))
IF 0) (DO YOU THINK ITS LIKELY THAT 3) (DO YOU WISH THAT 3)
(WHAT DO YOU THINK ABOUT 3) (REALLY, 2 3)))
(WHAT DO YOU THINK ABOUT ~) (REALLY, 2 3)))
(WERE YOU k)
(WHAT WOULD IT MEAN IF YOU WERE ~)
(WHAT DOES '
4 ' SUGGEST TO YOU) (=WHAT))
((O YOU WAS O)
(WERE YOU REALLY) (WHy DO YOU TELL ME YOU WERE ~ NOW)
(WERE YOU REALLY) (WHY DO YOU TELL ME YOU WERE ~ NOW)
(PERHAPS I ALREADY KNEW YOU WERE h) )
((O WAS I O) (WOULD YOU LIKE TO BELIEVE { WAS h)
(WHAT SUGGESTS THAT I WAS ~)
(WHAT IF I HAD BEEN ~))
((0)
(NEWKEY)))
(WERE = WAS (=WAS))
(ME = YOU)
(DREAMT ~ ((0 YOU DREAMT O)
(REALLY, ~) (HAVE YOU EVER FANTASIED ~ WWILE YOU WERE AWAKE)
(HAVE YOU DREAMT ~ BEFORE) (=DREAM) (NEWKFY)))
(YOU'RE = I ' M ((0 I'M 0) (PRE ( I ARE S) (=YOU))))
( I ' M = YOU'RE ((0 YOU'RE O) (PRE (YOU ARE 3) ( = I ) ) ) )
(MYSELF = YOURSELF)
(DREAMED = DREAMT ~ (=DREAMT))
(DREAM 3 ((0)
(WHAT IF YOU WERE ~) (DO YOU THINK YOU WERE h)
(WHAT DO YOU THINK) (PERHAPS I WAS q)
(NEWKEY)))
(WHAT DOES THAT DREAM SUODEST TO YOU)
(OO YOU DREAM OFTEN) (WHAT PERSONS APPEAR IN YOUR DREAMS)
(DON'T YOU BELIEVE THAT DREAM HAS SOMETHINC TO ~0 WITH
(YOURSELF = MYSELF)
(MOTHER OLIST(/NOUN FAMILY))
(NON = MOTHER DLIST(/ FAMILY))
(DAD = FATHER DLIST(/ FAMILY))
YOUR PROBLEM) (NEWKEY)))
(FATHER DLIST(/NOUN FAMILY))
(DREAMS = DREAM 3 (=DREAM))
(SISTER BLIST(/FAMILY))
(HOW (=WHAT))
(BROTHER DLIST(/FAMILY))
(WHEN (=WHAT))
(WIFE D L I S T ( / F A M I L Y ) )
(ALIKE 10 (=DIT))
(CHILDREN O L I S T ( / F A M I L Y ) )
(SAME 10 (=DIT))
(I
(CERTAINLY (=YES))
(WHY DO YOU WANT 4) (SUPPOSE YOU GOT ~ SOON) (WHAT
(THINK DLIST(/BELIEF))
IF YOU NEVER GOT ~) (WHAT WOULD GETTING ~ MEAN TO
(BELIEVE DLIST(/BELIEF))
YOU) (WHAT DOES WANTING ~ HAVE TO DO WITH THIS DISCUSSION))
(WISH DLIST(/BELIEF))
(MEMORY MY (0 YOUR 0 = LETS DISCUSS FURTHER WHY YOUR 3)
(0 YOUR 0 = EARLIER YOU SAID YOUR 3)
((0 YOU ARE O (-SAD UNHAPPY DEPRESSED SICK ) 0)
(I
AM SORRY TO HEAR YOU ARE 5) (DO YOU THINK COMING HERE
WILL HELP YOU NOT TO BE 5) ( I ' M SURE ITS NOT PLEASANT TO
(O YOUR 0 = BUT YOUR 3)
(0 YOUR 0 = DOES THAT HAVE ANYTHING TO DO WITH THE FACT THAT YOUR 3))
( I AM NOT SURE I UNDERSTAND YOU FULLY)
BE 5) (CAN YOU EXPLAIN WHAT MADE YOU 5))
((O YOU ARE O (-HAPPY ELATED GLAD BETTER ) 0)
(HOW HAVE I HELPED YOU TO BE 5)
(PLEASE GO ON)
(WHAT DOES THAT SUGGEST TO YOU)
(DO YOU FEEL STRONGLY ABOUT DISCUSSING SUCH THINGS)))
(PERHAPS ((0)
= YOU
((0 YOU ( * WANT NEED) O) (WHAT WOULD IT MEAN TO YOU IF YOU GOT ~)
(FEEL DLIST(/BELIEF))
(NONE ( ( 0 )
IF
(DO YOU SOMETIMES THINK
(POSSIBLY
(IF 3 ( ( 0
(=WHAT))
DON~T UNDERSTgNO T H A T ) ) )
FANTASIES)
THAT APOLOGIES ARE NOT REQUIRED)))
((0)
(I
I 0 )
(WHY ARE YOU iNTERESTED
(WOULD YOU PREFER
START
{YOU WISH I WCUL0 TELL YOU YOU ArE 4)
(WHAT WOULD IT MEAN IF YOU WERE ~)
(YOU DON'T SEEM QUITE CERTAIN)
(HAS YOUR TREATMENT MADE YOU 5) (WHAT MAKES YOU S JUST
NOW) (CAN YOU EXPLAIN WHY YOU ARE SUDDENLY 5))
((0 YOU WAS O) (=WAS))
((0 YOU WAS O) (:WAS))
(WHY THE UNCERTAIN TONE)
(CAN'T YOU BE MORE POSITIVE)
((O YOU (/BELIEF) YOU 0) (DO YOU REALLY THINK SO) (BUT YOU ARE
(YOU AREN'T SURE) (DON~T YOU KNOW)))
NOT SURE YOU 5) (DO YOU REALLY DOUBT YOU 5))
(MAYBE (=PERHAPS))
((0 YOU 0 (/BELIEF)
(NAME 15 ((0)
((0 YOU ARE O)
(I
AM NOT {NTERESTED IN NAMES)
O I 0) (=YOU))
( I ' V E TOLD YOU BEFORE, I DON'T CARE ABOUT NAMES -
(IS
PLEASE CONTINUE)) )
(HOW LONG HAVE YOU BEEN 4 )
PLEASE CONTINUE)) )
(DO YOU B E L I E V E
(DEUTSCH (=XFREMD))
(DO YOU ENJOY BEING 4 ) )
(PRANCAIS (=XFREMD))
((0 YOU ( *
(ITALIAN0
(HAVE YOU TRIED)
(=XFREMD))
(HELLO
((0)
((0)
(COMPUTER
(I
AM SORRY,
I SPEAK ONLY ENGLISH)))
(HOW DO YOU DO,
50 ( ( O )
PLEASE STATE YOUR PRORLFM)))
(DO COMPUTERS WORRY YOU)
(WHY DO YOU MENTION COMPUTERS)
HAVE TO DO WITH YOUR PROBLEM)
HELP PEOPLE)
IT NORMAL TO BE ~)
CANIT CANNOT) G) (HOW DO YOU KNOW YOU CAN'T ~)
(PERHAPS YOU COULD ~ NOW)
(ESPANOL (=XFREMD))
(XFREMD
IT BECAUSE YOU ARE ~ THAT YOU CAME TO ME)
(WHAT DO YOU THINK MACHINES
(DON'T YOU THINK COMPUTERS CAN
(WHAT ABOUT MACHINES WORRIES YOU) (WHAT
(DO YOU REALLY WANT TO BE ABLE TO ~ ) )
((0
YOU DONIT 0 ) ( D O N I T
YOU
REALLY 4)(WHY DON'T YOU ~)
(DO YOU WISH TO BE ABLE TO ~)
((0
YOU FEEL 0)
(DOES THAT TROUBLE YOU))
(TELL ME MORE ABOUT SUCH PEELINGS)
(DO YOU OFTEN FEEL ~)
(DO YOU ENJOY FEELING ~)
DO YOU THINK ABOUT MACHINES)))
(OF WHAT DOES FEELING 4 REMIND YOU))
(MACHINE SO (=COMPUTER))
((0
(MACHINES 50 (=COMPUTER))
(DO YOU WISH TO 3 ME)
(COMPUTERS 50 (=COMPUTER))
(YOU SEEN TO NEED TO 3 ME)
(AM = ARE ((O ARE YOU O) (DO YOU BELIEVE YOU ARE ~)
(DO YOU 3 ANYONE E L S E ) )
44
Communications
o f t h e ACM
YOU G I
0)
(PERHAPS IN YOUR FANTASY WE 3 EACH OTHER)
Volume9
/ Number l / January,
19h6
i/
i:(
((o)
(YOU SAY 1)
(CAN YOU ELABORATE ON THAT) ( ~ 0 Y~U SAY Z FOR SDME S~ECiAL
( T N A T t S QUITE I N T E R E S T I N G ) ) )
(YOU = I
((O
((0
I REWIND YOU OF O)
I ARE O)
(OOES
IT PLEASE YOU TO RELIEVE
NOT ) )
(PERHAPS
((0
ES 3)
YOU W O U L 0
! O YOU)
(YOU
WISH
LIKE
I A~: ~)
YOU W E R E
(WHY DO YOU
YOU
i A~ h )
k)
LIKE TO BE ~))
TO T H I N K
(WHAT M A K E S
THINK
I 3 YOU
THINK
I 3 YOU)
- DON'T
YOU)
I 3 YOU)
(REALLY,
I 3 YOU)
(REALLY,
I 3 YOU) ( 0 0 YOU WISH TO RELIEVE
(SUPPOSE
I DID
(DO YOU WISH
TO R F L I E V F
3 YOU - WHAT W O U L D
(DOES SOMEONE ELSE BELIEVE
((O
T h e , e c h n i q u e c o n s i s t s of t r a n s l a t i n g t h e code for t h e l e t t e r
" O " to tim co<tc for t h e n u m e r a l O w h e n e v e r it is e n e o m t t e r e d in t h e
i n p u t c h a r a c t e r s t r i n g . I f t h e ~,rltlg
"' " conszsts ()lily of i t e m s stleh as
z~ulnbers a n d nanles a n d it is Ilecessary to sort a l p h a b e t i c a l l y on
n a m e s , the o c c u r r e n c e o f a n a l p h a b e t i c c h a r a c t e r w i t h i n a n a m e
field is used to c a u s e t h e code for zero to be r e t r a n s l a t e d to t h e
c(,de fop *he l e t l e r " O " b>" a r e s c a n of l h e c h a r a c t e r s in t h e n a m e
field.
If no s o r t i n g is r e q u i r e d , t h e r e t r a n s l a t i o n c a n be avoided, provided t h a t d e l i m i t e r s s u c h as F O R M A T or GO T O are spelled
w i t h zero w i t h i n t h e r e c o g n i z e r s e g l n e n t of a t r a n s l a t o r . It, is also
n e c e s s a r y to redefine i d e n t i f i e r as
(-DIT))
(WHAT MAKES YOU THINK
(DO YOU S O M E T I M E S
LETTERS--continued from p. 35
REASON)
I 3 YOU)
I
3 YOU)
THAT NEAt])
I 3 YOU))
i O) (WE WERE DISCUSSING YOU - FiOT ME)
(OH, I 3) (YOU'RE NOT REALLY TALKI~;G ABOUT ME - ARE YOU)
(WHAT ARE YOUR FEELINGS NOW)))
(YES ((0)
(!
identifier) : : = (letter::(0) (ident.ifier)
(YOU SEEM QUITE POSITIVE) (YOU AqE SURE)
( i d e n t i f i e r ) (fetter3 i (identifier> (digit'., [
SEE) (I UNDERSTAND)))
(NO ((0)
w h e r e it is u n d e r s t o o d t h a t t h e l e t t e r " O " is r e m o v e d from t h e
s t a n d a r d definition of l e t t e r as in ALGOL 60. T h e redefinition perm i t s t h e i n c l u s i o n of i d e n t i f i e r s s u c h as 017)11) or C O P S b u t p r e v e n t s
the use of an identitier c o n s i s t i n g only of t h e r e p e a t e d i n a r k O.
T h i s t e c h n i q u e r e q u i r e s c o n s i s t e n c y of use a n d m i g h t result in
c h a o s in a w a t ' e h o u s i n g o p e r a t i o n in w h i c h tile l e t t e r " 0 " is used
ili p a r t s labels w i t h c h e c k d i g i t s .
L. RICH:~.RD TUaNER
(ARE YOU SAYING 'NO' JUST TO BE NEGATIVE)
(YOU ARE BEING A BIT NEGATIVE) (WHY NOT) (WHY ' N O ' ) ) )
(MY = YOUR 2 ((D YOUR 0 (/FAMILY)
0)
(TELL ME MORE ABOUT YOUR FAMILY) ( WHO ELSE IN YOUR FAMILY
5) (YOUR ~) (WHAT ELSE COMES TO MIND WHEN YOU THINK OF
YOUR ~))
((0 YOUR O) (YOUR 3) (WHY DO YOU SAY YOUR ) )
(DOES THAT
SUGGEST ANYTHING ELSE WHICH BELONGS TO YOU) (IS IT
IMPORTANT TO YOU THAT 2 3 ) ) )
(CAN ((0 CAN I
O)
//: /
(YOU BELIEVE I CAN ~ DON'T YOU) (:WHAT)
(YOU WANT ME TO BE ABLE TO ~) (PERHAPS YOU WOULD LIKE TO BE
ABLE TO 4 YOURSELF)) ((0 CAN YOU 0) (WHETHER OR NOT YOU CAN
DEPENDS ON YOU MORE THAN ON ME) (DO YOU WANT TO BE ABLE TO ~)
(PERHAPS YOU DON'T WANT TO ~) (=WHAT)))
(WHAT ((O) (WHY DO YOU ASK) (DOES THAT QUESTION INTFRrST YOU)
(WHAT IS IT YOU REALLY WANT TO KNOW)
(ARE SUCH QUESTIONS MUCH ON YOUR MIND)
(WHAT ANSWER WOULD PLEASE YOU MOST)
(WHAT DO YOU THINK) (WHAT COMES TO YOUR MIND WHFN YOU ASK THAT)
(HAVE YOu ASKED SUCH QUESTION BEFORE)
/
~
/
/
/
/
ATASA Lewis Rcsvarch Cente:"
CIeceland, Ohio
/
J
~-~mments
Programming
on
a Problem
Control
in
Concurrent
(HAVE YOU ASKED ANYONE ELSE)))
(BECAUSE ((0)
(IS THAT THE REAL REASON) (nON'T A~!Y OTHER RPASONS
COME TO HIND) (DOES THAT REASON SEEM TO EXPLAIN ANYTHING ELSE)
(WHAT OTHER REASONS MIGHT THERE BE)))
(WHY ((O WHY DON'T I 0) (DO YOU BELIEVE I DONIT 5) (PERHAPS I
WILL 5 IN GOOD TIME) (SHOULD YOU 5 YOURSELF) (YOU WANT ME TO 5)
(:WHAT))
(=WHAT))
((0 WHY CAN'T YOU O) (DO YOU THINK YOU SHOULD BE ABLE TO S)
(DO YOU WANT TO BE ABLE TO 5) (DO YOU BFLIFVE THIS WILL HELP YOU
TO 5) (HAVE YOU ANY IDEA WHY YOU CANfT 5) (=WHAT))
(= WHAT))
(EVERYONE 2 ((O (* EVERYONE EVERYBODY NOBODY NOONF) O )
(REALLY, 2) (SURELY NOT 2) (CAN YOU THINK OF
ANYONE IN PARTICULAR) (WHO, FOR EXAMPLE) (YOU ARE THINKINO OF
A VERY SPECIAL PERSON)
s
(WHO, MAY I ASK) (SOMEONE SPECIAL PERHAPS)
(YOU HAVE A PARTICULAR PERSON IN MINn, DON'T YOU) (WHO DO YOU
THINK YOU'RE TALKING ABOUT)))
(EVERYBODY 2 (= EVERYONE))
(NOBODY 2 (=EVERYONE))
(NOONE 2 (:EVERYONE))
(ALWAYS I
((0)
(CAN YOU THINK OF A SPECIFIC EXAMPLE) (WHEN)
(WHAT INCIDENT ARE YOU THINKING OF) (REALLY, ALWAYS)))
(LIKE 10 ((O (*AM IS ARE WAS) 0 LIKE O) (=DIT))
((0)
(NEWKEY)) )
(DIT
((O)
( I N WHAT WAY)
(WHAT RESEMBLANCE DO YOU SEE)
(WHAT DOES THAT SIMILARITY SUGGEST TO YOU)
(WHAT OTHER CONNECTIONS DO YOU SEE)
Dear E d i t o r :
I would like to c o r n m e n t o n M r . D i j k s t r a ' s s o l u t i o n [Solution
of a p r o b l e m in c o n c u r r e n t p r o g r a m m i n g control. Comm A C M 8
(Sept. 1965), 569] to a m e s s y pr(~hlem t h a t is h a r d l y a c a d e m i c . We
are u s i n g it n o w on a m u l t i p l e c o m p u t e r complex.
W h e n t h e r e are o n l y t w o c o m p u t e r s , t h e a l g o r i t h m m a y be
simplified to t h e f o l l o w i n g :
B o o l e a n array bE0; 1) i n t e g e r k, i, j,
comment
T h i s is t h e p r o g r a m for c o m p u t e r i, w h i c h m a y he
t i t h e r 0 or 1, c o m p u t e r j ~ i is t h e o t h e r one, 1 or 0;
CO: b (i) : = f a l s e ;
CI: if k ~- i t h e n b e g i n
C2: i f not b(j) t h e n go to C2;
e l s e k := i; go t o C1 e n d ;
else critical section;
b(i) := true;
remainder of program;
go to C0;
end
Mr. Dijkstra has come up with a clever solution to a really
practical problem.
HARRIS H Y$.[AN
Munitype
New York, New York
(WHAT DO YOU SUPPOSE THAT RESEMBLANCE MEANS)
(WHAT IS THE CONNECTION,
;7
DO YOU SUPPOSE)
(COULD THERE REALLY BE SOME CONNECTION)
(HOW)))
()
I=~ECEIVi.3D S E P T E M B E R , 1965
966
::
V o h u n e 9 / N u m b e r 1 / J a n u a r y , 1966
Communications
o f t i l e ACM
45
Fly UP