CSC 8310 Lisp Assignment: ELIZA
Villanova University, Fall 2000, David Matuszek

The original ELIZA program was published by Joseph Weizenbaum in 1966. It simulated a Rogerian therapist; that is, most of what it said was merely repeating (with appropriate substitutions) what it was told. Here is a bit of sample dialogue (from Rich & Knight, Artificial Intelligence, 1983):

Person: Men are all alike.
ELIZA: In what way?
Person: They're always bugging us about something or other.
ELIZA: Can you think of a specific example?
Person: Well, my boyfriend made me come here.
ELIZA: Your boyfriend made you come here.
Person: He says I'm depressed much of the time.
ELIZA: I am sorry to hear you are depressed.
Person: It's true. I am unhappy.
ELIZA: Do you think that coming here will help you not to be unhappy?
Person: I need some help, that much seems certain.
ELIZA: What would it mean to you if you got some help?
Person: Perhaps I could learn to get along with my mother.
ELIZA: Tell me more about your family.

ELIZA worked by applying pattern-matching rules. It looked for a rule whose left side matched the last sentence entered by the user, then used the right side of that rule to generate a response. A sample rule might be something like (I REMEMBER X) => (WHY DO YOU REMEMBER X JUST NOW).

Your assignment: Write an ELIZA-like program that interactively "converses" with the user. Your program should have the following features:

  1. It should read in patterns from a text file, not have them hard-wired into the program. (Hint: Reading files in Lisp is not fun: write your data as a simple function or functions, and use LOAD.)

  2. It should do simple pattern matching and substitution: "I remember the first day of school" => "Why do you remember the first day of school just now?"

  3. The pattern matching should include pronoun substitution: "My boyfriend made me come here" => "Your boyfriend made you come here." Note that pronoun substitution should occur in addition to any other pattern matching and substitution.

  4. It should recognize certain keywords and respond to those. For example: "I think I'm in love" => "Love isn't always a simple thing."

  5. It should provide general-purpose responses if no other patterns match, for example: "Tell me more about that." There should be more than one such response, selected randomly.

  6. (Extra credit) "Remember" some topics that were discussed earlier, and incorporate them into your general-purpose responses: "Tell me more about your trip to Brazil."

Do not worry about (1) capitalization, (2) punctuation, or (3) parentheses. It's traditional in Lisp programs to see input and output such as (TELL ME MORE ABOUT THAT).

Turn in a floppy disk (with your name on it) containing:

  1. The source code for your program.
  2. The file of patterns read by your program.
  3. A transcript of a conversation with your program.
  4. A short (1 page or less) documentation file named README describing
    1. how to use your program,
    2. how your program meets each of the above requirements, and
    3. how to add new patterns to your program.

All files should be plain text (unformatted) files.

Due date:
      Monday night section: November 20
      Wednesday night section: November 15