Computer Science 431

An Exercise in CLIPS

Due: Monday, May 3


A short exercises in expert systems.

In groups of about 3, do one of the following expert system exercises:

In each of the following, write a CLIPS program that contains at least the following:

The entire program should probably not be more than a page (and certainly not more than two).  Be sure to include the names of the individuals in the group.

1.    Adapt the student.CLP example we have looked at over the past two days to either advise a student thinking of going into some area you are interested in or to do some other expert task.

2.    Modify the example on page 130 of Dawson to turn it into an expert system.  For example, you might have

(deftemplate mushroom "a musroom template"

    (slot name)

    (slot odor)

    (slot spore_print)

    (slot gill_size)

    (slot stalk_surface)

    (slot bruises))

With a sample deffact something like

    (mushroom (name mushroom_1) (odor nil) (spor_print black)) 

        (you'd want some more to try out as well)

Please be sure to include a note saying that the expert system is for a course exercise only and not to be relied upon to distinguish poisonous and non-poisonous mushrooms!

3.    The following problem is from Grarratano and Riley, Expert Systems, PWS, 1994. It appears there as problem 8-13 on page 440.

CLIPS program

Write a CLIPS program that accepts the blood types of a patient in need of a blood transfusion and a donor. The program should then determine if the transfusion should proceed based upon the blood types. Type O blood can only be transfused with type O blood. Type A blood can be transfused with either type A or type O blood. (i.e., if the patient has type A blood, then the donor can be either type A or type O). Type B blood can be transfused with either type B or type O blood. Type AB blood can be transfused with type AB, type A, type B, or type O blood.

 Any facts in your CLIPS program should be deftemplate facts. Include deftemplates for patient and donor with slots for name and blood type. Include a deffacts item with sufficient donors to test your program. When initial-fact is asserted (as with (reset)), your first rule should ask the user for the name and blood type of a patient, and then search the database (via the remaining rules) looking for a donor or donors for the patient.

Should you have any questions on any of these please let me know. Many thanks!