Article View: comp.lang.prolog
Article #3142Re: An Eliza-like problem solving assistant (400+ lines).
From: Richard A. O'Keefe
Date: Thu, 24 Mar 1988 02:37
Date: Thu, 24 Mar 1988 02:37
74 lines
3259 bytes
3259 bytes
In article <7845@agate.BERKELEY.EDU>,
lagache@violet.berkeley.edu (Edouard Lagache) distributed
an "Eliza-like problem solving assistant".
(1) In the tables at the end of the program, the pattern
word_class([...],
[
[...],
...
[...],
*--------------------^
]).
occurs quite often. While C allows extra commas in initialisers,
many Prolog systems will be unhappy about that extra comma.
(2) In order to test whether any of a given list of Keywords occurs in
a given Sentence, the program does
intersection(Keywords, Sentence, List),
List \== [],
This is correct, but there isn't a lot of point in constructing List.
A more efficient approach (effiency is not a concern in this program)
would be to call
intersect(Keywords, Sentence)
where for example
intersect(Set1, Set2) :-
member(X, Set1),
member(X, Set2),
!.
(3) I thought I'd try the program. This is what I got:
Please describe your problem. Type 'quit.' to resume work.
e> My nematodes have been eaten by the peripatus.
Could you say more about your problem.
e> Yes.
Could you please elaborate on one aspect of your problem.
e> Well, the peripatus crawled out of its box last night, and it got into
e> another box on the same bench, where we keep nematodes, and well, it
e> ate the lot of them.
Is there anything else that you know about this problem?
e> I suppose there are two problems, really. One problem is how do I
e> stop this sort of thing in the future, and the other is where do I
e> get some more nematodes right now. I want your help with the second
e> part of the problem.
What can you learn from doing this?
e> From doing WHAT?
Could you say more about your problem.
e> I just told you everything there was to say.
Could you say more about your problem.
e> You're getting a bit repetitious, aren't you?
I do not quite understand the situation; could you elaborate it for me?
e> Gods below, what is there to understand? I need some nematodes, I
e> had some nematodes, but Hodgkins' wretched peripatus ate them.
Is there anything else that you know about this problem?
e> Oh forget it.
Could you say more about your problem.
e> quit.
In case you were wondering, the e> lines do make sense.
(4) Part of the reason for the frustrating and unhelpful nature of the
conversation shown is that the program is not Eliza-like. One of
the things that Eliza would do is pick up phrases of yours and
throw them back at you. For example, after my third input, an
Eliza-like program might say
Tell me more about the box.
^^^^^^^----- copied from input
or after the last input but two,
Why did Hodgkins' wretched peripatus eat them?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ transformed input
Technical Details
Message-ID:
<808@cresswell.quintus.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!quintus!okReferences:
<7845@agate.BERKELEY.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!quintus!ok From: ok@quintus.UUCP (Richard A. O'Keefe) Newsgroups: comp.lang.prolog Subject: Re: An Eliza-like problem solving assistant (400+ lines). Message-ID: <808@cresswell.quintus.UUCP> Date: 24 Mar 88 02:37:00 GMT References: <7845@agate.BERKELEY.EDU> Organization: Quintus Computer Systems, Mountain View, CA Lines: 74 Keywords: Source code, Eliza-like