Objects of meta-classes other than standard-class
may be made available to KnowledgeWorks by including the KnowledgeWorks mixin standard-kb-object
. This requires
validate-superclass
method allowing standard-kb-object
(meta-class standard-class
) to be a superclass of the class being defined with a different meta-class
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)))
I can reason about class FOO
KnowledgeWorks and Prolog User Guide (Windows version) - 26 Feb 2015