(Notably, this is not the only possible approach to problem solving that may be attempted using ELIZA. E.g., the palindrome problem used as an example in the article, doesn't require multiple sets of rules to incorporate state. We could do it also by simple reduction: If the input is a single letter or exactly two instances of the same letter {"A", "B", "A A", "B B"}, it's a palindrome, output this as the final answer. Else, if the first and the last letter are the same {"A … A", "B … B"}, discard them and redo with the remaining middle part. If this rule fails as well, it's not a palindrome, also a final answer.)
; Palindrome test by simple reduction
; "(0)" is a catch-all pattern
; "NONE" matches, where no keyword matches
; - ideal for help phrases
(PALIN
((PALIN 0) (PRE (2) (=REDUCE)))
)
(REDUCE
((A) (=TERM_TRUE))
((B) (=TERM_TRUE))
((A A) (=TERM_TRUE))
((B B) (=TERM_TRUE))
((A 0 A) (PRE (2) (=REDUCE)))
((B 0 B) (PRE (2) (=REDUCE)))
((0) (=TERM_FALSE))
)
(TERM_TRUE
((0) (WELL, THIS IS A PALINDROME))
)
(TERM_FALSE
((0) (NOT A PALINDROME AT ALL))
)
(NONE
((0) (TRY: PALIN A B A))
) (USAGE: PALIN A B B A ...)
START
at the beginning and a MEMORY rule (must have exactly 4 entries) at the end: (MEMORY XYZZY
(0 = A)
(0 = B)
(0 = A A)
(0 = B B)
)
:-)PS: I'm not sure, if the initial welcome message is actually mandatory, but the MEMORY rule definitely is.
And the MEMORY keyword "must be an ordinary keyword as well." So you'd need a (XYZZY ...) rule.
Also, the START symbol appears in the DOCTOR script, but is never mentioned in the body of the paper.
Another thing Weizenbaum doesn't mention in his description is the final empty list in the DOCTOR script. This does seem to be expected by the code.
Other: It has been a while, since I had a closer look at ELIZA, and I have to admit that I forgot most about the intrinsics of the MEMORY rule.
PS: An interesting feature of ELIZA in the context of problem solving may be that, if there is more than a single recomposition rule, ELIZA will cycle through them (e.g., alternating between two expressions.) This may allow for some interesting, even surprising, and still state-dependent behavior, kind of a "Moiré logic". :-)
"Moiré logic" was a joke, meaning, an interference pattern caused by two layers of logical state.
Well, there's actually one thing, I can contribute: The famous photo of Weizenbaum on a terminal (sometimes attributed to the German magazine "Die Zeit") – e.g. here [1] – seems to show Weizenbaum on a Lorenz teletypewriter [2], so there is some probability to the photo actually having been taken in Germany.
[1] https://maeda.pm/2019/02/11/joseph-weizenbaum-humanist-techn...
[2] https://twitter.com/RetroWizzard/status/1419658098210451459 (1st image)
PS: You may find this one (my own doing) amusing: https://masswerk.at/eliza/