:CHILD
Purpose
Verifies that one frame is a child of another, or returns all
children of a frame. A child is a subclass or instance.
Optionally includes the class given as the first parameter.
Parameters
- parent
- The parent frame.
- child
- Either a frame to be tested or a variable to be bound.
- :INCLUSIVE (optional)
- If the :INCLUSIVE keyword is present and the child argument
is a variable, the parent will be included as one of the
bindings of the variable.
Examples
(:CHILD Physical_Objects Rover) ;; succeeds because Rover (a dog) is a physical object.
(:CHILD Physical_Objects Rover ?rover) ;; succeeds if Rover is a child of Physical_Objects and binds a variable to Rover.
(:CHILD Mammals ?child) ;; retrieves all children of Mammals
(:CHILD Mammals ?child :INCLUSIVE) ;; retrieves Mammals and all children of Mammals
Success criteria
The argument parent must be a class.
If the clause is ground, succeeds if the relationship is true.
If the clause is not ground, succeeds if it retrieves at least one child.
Failure criteria
Fails if the parent is not a class, if the parent-child relationship is not true,
or if the parent has no children.
Notes
This can generate a lot of bindings. If you know that parent is a
class, use :DIRECT-SUBCLASS, :DIRECT-INSTANCE, :INSTANCE or :SUBCLASS instead.
Related commands
Back to...
Algernon commands
Algernon Documentation Central
Algernon home page