(clear)
(reset)
(defglobal ?*w* = (assert (a)))
(defglobal ?*x* = (assert (b)))
(defglobal ?*y* = (assert (c)))
(defglobal ?*z* = (assert (d)))
(retract 3 4)
(fact-existp ?*w*)
(fact-existp ?*x*)
(fact-existp ?*y*)
(fact-existp ?*z*)
(fact-existp 1)
(fact-existp 2)
(fact-existp 3)
(fact-existp 4)
(fact-existp 5)
(fact-existp -1)
(fact-existp a)
(fact-existp 1 2)
(clear)
(reset)
(deftemplate foo (slot x) (slot y))
(defglobal ?*w* = (assert (foo (x 1) (y 2))))
(defglobal ?*x* = (assert (a)))
(fact-relation)
(fact-relation a)
(fact-relation 2 3)
(fact-relation ?*w*)
(fact-relation ?*x*)
(fact-relation 1)
(fact-relation 2)
(fact-relation 3)
(retract 1 2)
(fact-relation ?*w*)
(fact-relation ?*x*)
(clear)
(reset)
(deftemplate foo (slot x) (multislot y))
(defglobal ?*w1* = (assert (foo (x 1) (y))))
(defglobal ?*w2* = (assert (foo (x 1) (y 1))))
(defglobal ?*w3* = (assert (foo (x 1) (y 1 2))))
(defglobal ?*x1* = (assert (a)))
(defglobal ?*x2* = (assert (a b)))
(defglobal ?*x3* = (assert (a b c)))
(fact-slot-value)
(fact-slot-value 1)
(fact-slot-value ?*w1*)
(fact-slot-value a)
(fact-slot-value 1 2)
(fact-slot-value 1 x 3)
(fact-slot-value 1 z)
(fact-slot-value 4 z)
(fact-slot-value 1 x)
(fact-slot-value ?*w2* x)
(fact-slot-value 3 x)
(fact-slot-value ?*w1* y)
(fact-slot-value 2 y)
(fact-slot-value ?*w3* y)
(fact-slot-value 4 implied)
(fact-slot-value ?*x2* implied)
(fact-slot-value 6 implied)
(retract 1 4)
(fact-slot-value 1 x)
(fact-slot-value 4 implied)
(clear)
(reset)
(deftemplate foo1)
(deftemplate foo2 (slot x))
(deftemplate foo3 (slot x) (multislot y))
(deftemplate foo4 (slot x) (multislot y) (slot z))
(defglobal ?*w1* = (assert (foo1)))
(defglobal ?*w2* = (assert (foo2)))
(defglobal ?*w3* = (assert (foo3)))
(defglobal ?*w4* = (assert (foo4)))
(defglobal ?*x1* = (assert (a)))
(defglobal ?*x2* = (assert (b c)))
(fact-slot-names) 
(fact-slot-names a)
(fact-slot-names 1 a)
(fact-slot-names ?*w1*)
(fact-slot-names 2)
(fact-slot-names ?*w3*)
(fact-slot-names 4)
(fact-slot-names ?*x1*)
(fact-slot-names 6)
(retract 1 5)
(fact-slot-names 1)
(fact-slot-names 5)
(clear)
