:CLASS

Purpose

Verifies that one frame is a direct or indirect instance of another, or returns all direct or indirect classes of an instance.

Parameters

instance
The instance frame.
class
Either a class to be tested or a variable to be bound.
:INCLUSIVE (optional)
If the :INCLUSIVE keyword is present and the class argument is a variable, the instance will be included as one of the bindings of the variable.

Examples

  (:CLASS Rover Canines)         ;; Succeeds because Canines is a superclass of Rover
  (:CLASS Rover ?x)              ;; Retrieves all direct and indirect superclasses of Rover
  (:CLASS Rover ?x :INCLUSIVE)   ;; Retrieves Rover and all superclasses of Rover

 ;; The following path is guaranteed to be true
 ((:INSTANCE Canines ?canine)
  (:CLASS    ?canine Canines))

Success criteria

The argument instance must be an instance. If the clause is ground, succeeds if the relationship is true. If the clause is not ground, succeeds if it retrieves at least one class.

Failure criteria

Fails if instance is not an instance, if the instance-class relationship is not true, or if the instance has no class (which is impossible in many KBMS).

Notes

Related commands


Back to...

Algernon commands
Algernon Documentation Central
Algernon home page