get-instances [Function]


Purpose

The get-instances function finds all instances that satisfy a given concept.

Syntax

get-instances concept &key direct-p asserted-p

Arguments

The concept argument is the concept, or the name of the concept, whose instances are to be found.

If the direct-p argument is t, then Loom returns those instances that belong to concept, but not to any of its subconcepts.

If the asserted-p argument is t, then only instances which have been explicitly asserted to belong to concept are returned.

Value

The get-instances function returns a list of instances that satisfy concept.

Examples

(defconcept Woman :is (:and Person Female)) 
(tellm (Person Joe) (Woman Sue) (:about Mary Person Female)) 
(get-instances 'Person) ==> (|I|JOE |I|SUE |I|MARY) 
(get-instances (fc Person) :direct-p t) ==> (|I|JOE) 
(get-instances 'Woman) ==> (|I|SUE |I|MARY) 
(get-instances (fc Woman) :asserted-p t) ==> (|I|SUE)

See Also

Last modified: Jun 1 1995