Computer Science Tutorial

Expert Systems

Goal: This laboratory exercise introduces two expert systems: a simple version of Weizenbaum's ELIZA program and the student placement program used by the Department of Mathematics and Computer Science.

ELIZA

The ELIZA program is a famous program, written by Joseph Weizenbaum at M. I. T. between 1964 and 1966, to carry on conversations with people. The following descriptions comes from pages 2-3 of Weizenbaum's classic book, "Computer Power and Human Reason," W. H. Freeeman, 1976.

I composed a computer program with which one could "converse" in English. The human conversationalist partner would type his portion of the conversation on a typewriter connected to a computer, and the computer, under control of my program, would analyze the message that had so been transmitted to it, compose a response to it in English, and cause the response to be typed on the computer's typewriter.

I chose the name ELIZA for the language analysis program because, like the Eliza of Pygmalion fame, it could be taught to "speak" increasingly well. Because conversations must be about something, that is, because they must take place within some context, the program was constructed in a two-tier arrangement, the first tier consisting of the language analyzer and the second of a script. The script is a set of rules rather like those that might be given to an actor is to use them to improvise around a certain theme. Thus ELIZA could be given a script to enable it to maintain a conversation about cooking eggs or about managing a bank checking account, and so on. Each specific script thus enabled ELIZA to plan a specific conversational role.

To run ELIZA on the HP computers, follow these steps:
  1. Log onto the HP system, entering your user name and password.

  2. Move the mouse to the picture of a computer and screen on the bottom control panel. Click the left mouse button on this icon to open a new window for your work. Finally, move the mouse this new window for typing.

  3. Type
           emacs
    
    and press the "return" key.

  4. Move the mouse (if necessary) to the new window created and type
          ESC x doctor
    
    where ESC is the escape key that appears at the upper left of the keyboard. Note that ESC appears as "M-" when you type.

  5. Type in your conversation with ELIZA. After each response you enter, hit the "return" key twice.
  6. When you are ready to finish, type
          C-x C-c
    
    This means, "hold down the 'control' key while you type the letter 'x'". Then, hold down the 'control' key while you type the letter 'c'.

  7. To log off of the HP system, move the mouse arrow to the lower right corner of the control panel at the bottom of the screen, and click on the "Exit" icon with the left mouse button. A menu will appear. Confirm you want to quit by clicking on the appropriate mouse button.

Student Placement

The Department of Mathematics and Computer Science uses an expert system to help advise students about which mathematics and computer science courses they might take first. The program was first developed in the Spring, 1993, as a student-faculty project; students Vikram Subramaniam and Ivan Sykes worked with faculty member Henry Walker. The program has been refined and expanded several times over the years to reflect new or revised courses.

Input includes high school transcript information and standardized test scores; the program then suggests a first mathematics course and a first computer science course for a student. The program can be used interactively with the user entering needed data, or the program can process information received electronically from the Registrar. In this latter mode, the program can generate letters for students.

To run the student placement program on the HP computers, follow these steps:

  1. Log onto the HP system and open a terminal window, as before.

  2. Run Allegro Common Lisp by typing
           acl
    
    and pressing the "return" key.

  3. At the new prompt, type
           (load "~walker/placement/newstudents.lsp")
           (placement) 
    

  4. When the menu appears, use the "I" option to run the program interactively. Then, enter data for yourself or for a hypothetical student as requested.

  5. When you are done, type "Q" to quit the menu. Then at the "USER" prompt, type
           (exit)
    

  6. The expert system itself has two basic parts: Each part is written in LISP, the most common computer language for artificial intelligence. The inference engine is based on the program TMYCIN, written by Gordon Novak at the Artificial Intelligence Laboratory of the University of Texas at Austin.

  7. To view the rules, move your mouse to a terminal window and type
           more ~walker/placement/newstudents.lsp
    
    This command displays the first screen of the rule base. Hit the space bar to view subsequent screens.
    While the programming details may be somewhat obscure, the general organization of the rule base is reasonably straightforward: A certainty factor is associated with each rule, based on a 1000 point scale. A factor of 1000 indicates great confidence with the conclusion, while 700 or 500 shows must less certainty in the result.


This document is available on the World Wide Web as
http://www.math.grin.edu/~walker/courses/tutorial/labs/lab-eliza.html

created August 19, 1997
last revised August 20, 1997