home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
aijournl
/
ai_oct86.arc
/
SMALLX1.BBS
< prev
next >
Wrap
File List
|
1986-04-14
|
3KB
|
146 lines
Sophisticated Small-X rule program
Thi≤ i≤ rulσ prograφ i≤ ß primitivσ implementatioε oµ thσ ì
famou≤ ELIZ┴ program(ß prograφ t∩ simulatσ ß Rogeriaε ì
psychologis⌠ writteε orinall∙ b∙ JoesepΦ Weizenbauφ iε 196╢ a⌠ ì
M.I.T.)« Thi≤ examplσ i≤ showε a≤ ß morσ comple° examplσ oµ rulσ ì
capabilities.
ì
% Primitive Elizaì
% Implemented by R. Kaplanì
% in Small-Xì
%ì
if not in-memory(dummy) thenì
{
write clear
write ELIZA
write new-line
write new-line
write Hello
write new-line
write new-line
write 'You can talk to me by typing. Please enclose all of'
write new-line
write 'your sentences in brackets [ ... ].'
write new-line
write 'To exit, enter [bye].'ì
write new-line
write new-line
add respondedì
}ì
[control] if not in-memory(dummy) thenì
{
reset a
reset b
reset c
reset d
reset e
reset f
reset g
reset y
remove responded
read list #textì
}ìè[e] if #text in [Hello] thenì
{
write [How are you today]
write new-line
write new-line
add responded
reset controlì
}ì
[a] if #text in [I want to talk about ?] thenì
{
bind #t !
compute #t <- ...#t
compute #t <- ...#t
compute #t <- ...#t
compute #t <- ...#t
compute #t <- ...#t
compute #t <- [Tell me more about] + #t
write #t
write new-line
write new-line
add responded
reset controlì
}ì
[b] if #text in [I want to talk about my ?] thenì
{
bind #t !
compute #t <- ...#t
compute #t <- ...#t
compute #t <- ...#t
compute #t <- ...#t
compute #t <- ...#t
compute #t <- ...#t
compute #t <- [Tell me more about your] + #t
write #t
write new-line
write new-line
add responded
reset controlì
}ì
[c] if #text in [Men are all alike] thenì
{
write 'In what way ?'
write new-line
write new-line
add responded
reset controlì
}ì
[d] if #text in [My ? made me come here] thenì
{
bind #t !
compute #t <- ...#t
compute #t <- .#t
compute #object <- #t + []
compute #t <- [Are you upset about] + #tè compute #t <- #t + [making you come here]
write #t
write new-line
write new-line
add responded
reset controlì
}ì
[f] if #text in [yes] thenì
{
write [You seem rather agreeable today]
write new-line
write new-line
add responded
reset controlì
}ì
[g] if #text in [no] thenì
{
write [Why not ?]
write new-line
write new-line
add responded
reset controlì
}ì
[h] if in-memory(#object) thenì
{
bind #t [Earlier you mentioned]
compute #t <- #t + #object
write #t
write new-line
write [Do you want to talk about this]
write new-line
write new-line
add responded
reset controlì
}ì
[z] if #text in [bye] then haltì
[y] if not in-memory(responded) thenì
{
write [Could you explain that to me]ì
write new-line
write new-line
add responded
reset controlì
}