STS 350

An Exercise in CLIPS

Due: Friday, April 7


A short exercises in expert systems.

In groups of no more than 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 to either advise a student thinking of going into some area you are interested in or to do some other expert task.

2.    The following problem is from Grarratano and Riley, Expert Systems, PWS, 1994. It appears there as problem 8-13 on page 440. It requires you to use some input and output.

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!