Figure 2.4 KnowledgeWorks Objects Browser
The Objects Browser is for exploring the contents of the KnowledgeWorks object base. Start it by choosing
KnowledgeWorks >
Objects
. The system knows about the CLOS objects that make up the object base. One class of CLOS objects in this example is the
node
class so choose
NODE
from the
Preset query/pattern
drop-down. All the node objects in the object base will be displayed in the pane below. Click on one of these objects and the bottom pane will display the slots and slot values of the object.
To make the display clearer and allow input without explicit package qualifiers, change the package of the Objects Browser. Do this via
Works > Tools > Preferences... > Objects Browser > Package
. Edit the Package pane so that it says
KW-USER
and press
OK
.
Now change the
Query
field to read
(node ?object animal ?a)
and press
Return
. The animals associated with each node are displayed. In this game there is a tree of questions with each node object representing a question. Some nodes have a
nil
value for the animal slot; these are the non-terminal nodes in the question tree. The program learns your new animals by adding new nodes to the tree.
Now type
?a
into the
Pattern
field (and press
Return
). This displays only the animals. The values displayed in the topmost of the two panes is the
Pattern
field instantiated with every possible object that matches the
Query
field. However, if the
Pattern
field is empty then the value of the
Query
field is taken to be the pattern.
Change the
Query
field to read
(and (node ?n animal ?a) (test ?a))
and press
Return
.
Figure 2.5 Objects Browser matching animals
Only the non-nil animals are displayed.
KnowledgeWorks and Prolog User Guide (Unix version) - 6 Dec 2011