Assignment 2
CSE 415: Introduction to Artificial Intelligence
The University of Washington, Seattle, Winter 2003
The reading for this assignment is Chapters 3 and 4 in The Elements of Artificial Intelligence Using Common Lisp. Read Chapter 3 by Monday, January 27 and Chapter 4 by Monday, February 3.
Part A. Do exercises 2 and 6 on page 131. Also do exercises 3, 4, and 5 on page 194. Turn in Part A as hardcopy on Friday, January 31 in class.
 
Part B. Starting with the Lisp code for the SHRINK, make substantial modifications, add new function definitions, etc., as necessary to implement a ``talking agent'' with a definite, different ``personality.'' Begin by writing a description of the personality you wish to create and make up several sample conversations that you might like your agent to be able to take part in. Determine key words and phrases that you would like your agent to respond to in particular ways. Think about how to help your agent keep a conversation going even when it can't make much sense of the input.

In addition to the new personality, your agent should make use of some new techniques -- techniques not already used in the SHRINK. Choose at least two of the following techniques to implement and incorporate them into your agent:

  • Memory: The agent remembers various words and phrases that have been input by the user, and it later refers to them with either questions, opinions, or observations. For example, it might say, "EARLIER YOU MENTIONED THAT YOU LOVE RED FERRARIS SO COULD YOU PLEASE ELABORATE ON THAT?"
  • Paraphrasing: The agent has a way of rephrasing the user's input by making word substitutions. If it cannot change at least 25 percent of the words in the input, then it doesn't use this response method on the given input.
  • Goal inference and focus: The agent has rules that attempt to identify the user's goals. For example, the user may state, "I WANT ..." and the agent registers what the user wants as a goal. If the agent does not find any goals within 5 turns, then it asks the user directly the next chance it gets for a ``punt.'' Once it has a user goal, it then asks questions about how to achieve that goal.
  • Recognizing logical relations such as IF - THEN; BOTH; AND; OR, and producing questions that involve the user's sentence components but that question the logical relationships given by the user.
  • Implement your agent in a file named GAB.CL, and produce a separate file of documentation: GAB.TXT. Use these file names exactly as given. You will be turning them in using an automated system that will look for files with these names. It should be possible for a user to start your agent by calling a function called TALK, called with no arguments in the form (TALK), and to exit by entering the input (BYE).

    There should be another way to run your program. This way will help make it easy for two agents to have a conversation. Provide a function REPLY-TO that takes one argument (this should be a list representing an input sentence) and returns a list representing an output sentence.

    In order to make it possible to load two agents into a single session with no interference between the functions and variables of one agent with those of another, we have two choices: one is to try to have each program use special names for functions and any symbols that must have global scope. The other is to have each program declare a unique ``package'' and export only the functions TALK and REPLY-TO. This latter approach is simpler, and it allows each program's code to be clear and unfettered with strange symbol names and function names. However, to simplify the development of your program, it is recommended that you encapsulate your program in a package only when it is fully working without any special package. Part B is due Monday, February 3 at midnight. Use electronic turn-in over the web at the following URL: turn-in page.