next up previous contents index
Next: Controlled Retrieval Up: Special Forms Previous: Declaring Slots and their

Declaring Rules

(:rules  term rule tex2html_wrap_inline1480 )
(:srules  term rule tex2html_wrap_inline1480 )
These two forms add rules, associated with the frame referred to by term, to the knowledge-base. The only difference between them is the way in which the rules are indexed (and therefore in the way they will later be accessed). Consider a query of (r frame1 ?x) (assertions are similar). Such a query will access rules from several sources:
  1. It will access slot rules  (rules added using :srules) associated with the slot r.
  2. It will access `normal' rules  (rules added using :rules) associated with any set which frame1 is a member of (i.e., rules associated with any frame f such that (isa frame1 f) is a fact in the knowledge-base).
  3. Finally, it will access slot rules associated with any set which r is known to be a member of.

As an example of a set of slots, consider the set transitive-relations . For this set one might want a rule like:

(:srules transitive-relations
 ((?r ?x ?z) <- (?r ?x ?y) (?r ?y ?z)))
One could then assert that (isa (:slot less) transitive-relations) and the rule above would enable Algernon to conclude (less frame1 frame3) from (less frame1 frame2) and (less frame2 frame3). (This rule for transitivity is too in-efficient for use in a large knowledge-base. A more efficient variant is used in the background knowledge-base described in section 4.)

Note that this rule for transitive relations has a variable in the slot position. Such rules are called generic rules  and can be associated with sets of frames or slots (though obviously not with individual slots). Such rules pose no computational difficulties for Algernon (since the slot being queried or asserted is always known), and should be considered to be shorthand for repeating the rule once for each slot.



Micheal S. Hewett
Tue Oct 29 11:15:33 CST 1996