next up previous contents
Next: Queries Up: Example: Forward- and Backward-Chaining Previous: Rules

Facts

Although our simple theory is obviously inadequate to do justice to the complexities of real life, we create a set of frames to represent some of the members of the British royal family and their relationships.

Consider two alternate ways to make these assertions:

  1. by creating frames, binding them to variables, and asserting the relationships via the variable bindings;
  2. by creating frames with mnemonically-chosen internal names, then relying on the syntactic processor to replace the internal names with references to the frames themselves.

  (tell '((:create ?ch Charles)
          (:create ?di Diana)
          (:create ?ha Harry)
          (:create ?wi William)
          (:create ?ph Philip)
          (:create ?el Elizabeth)
          (:create ?an Andrew)
          (:create ?sa Sarah)

          (wife ?ch ?di)
          (son ?ch ?ha)
          (son ?ch ?wi)
          (son ?di ?ha)
          (son ?di ?wi)
          (father ?ch ?ph)
          (mother ?ch ?el)
          (wife ?ph ?el)
          (son ?ph ?an)
          (son ?el ?an)
          (wife ?an ?sa)))

  (tell '((:create ?ch Charles)
          (:create ?di Diana)
          (:create ?ha Harry)
          (:create ?wi William)
          (:create ?ph Philip)
          (:create ?el Elizabeth)
          (:create ?an Andrew)
          (:create ?sa Sarah)))

  (tell '((wife Charles Diana)
          (son Charles Harry)
          (son Charles William)
          (son Diana Harry)
          (son Diana William)
          (father Charles Philip)
          (mother Charles Elizabeth)
          (wife Philip Elizabeth)
          (son Philip Andrew)
          (son Elizabeth Andrew)
          (wife Sarah Andrew))))


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