next up previous contents
Next: Queries - Slightly Less Up: A Simple Expert System: Previous: Queries Based on Simple

Rules - Slightly Less Simple

It might be desirable to organize the knowledge in the Algernon KB in a more modular way.

We will exploit the backlink from the set Diseases to the individual known diseases. The :taxonomy form asserts explicit links from sets to the specified elements, Flu and Plague. However, in case we learn about more diseases, we provide a rule to assert the backlink from an isa relation.

  (tell '((:rules Diseases
           ((isa ?d Diseases) -> (member Diseases ?d)))))

In general, the ``upward'' isa relation, pointing from an element to a set it belongs to, is not backlinked to the ``downward'' member relation. Some sets (e.g. Things or People) could have large numbers of elements. The access-limited philosophy of Algernon discourages inferences that scan over large numbers of elements.

We can then formulate a single general-purpose rule that says that a person has a disease if he or she has every symptom of the disease. (Obviously, neither of these approaches is very realistic.)

  (tell '((:rules People
           ((has-disease ?x ?d)
            <-
            (member Diseases ?d)
            (:all-paths ((symptom ?d ?s)) ((has-symptom ?x ?s)))))))

Within this approach, we can specify the symptoms caused by a disease, not in a rule associated with the set People, but as part of the declarative description of the disease itself.

  (tell '((symptom Flu Fever)          (symptom Plague High-Fever)
          (symptom Flu Nausea)         (symptom Plague Nodules)))



Micheal S. Hewett
Tue Oct 29 10:54:13 CST 1996