Next Prev Up Top Contents Index

6.3.0.4 Example

A meta-class standard-kb-class could be defined as a KnowledgeWorks class. New KnowledgeWorks classes (or even ordinary non-KnowledgeWorks classes) could be defined with this meta-class. KnowledgeWorks could then reason about the instances of the classes and about the class objects themselves. The code below implements this:

(def-kb-class standard-kb-class (standard-class) ())
(defmethod validate-superclass
           ((class standard-kb-class)
            (superclass standard-class))
           t)
(def-kb-class foo () ((slot))
                    (:metaclass standard-kb-class))

Then when the following rule fires:

(defrule find-kb-class :forward
  (standard-kb-class ? clos::name ?n)
  -->
  ((format t "~%I can reason about class ~s" ?n)))

it will output:

I can reason about class FOO

 


LispWorks KnowledgeWorks and Prolog User Guide - 14 Dec 2001

Next Prev Up Top Contents Index