add-type [Function]


Purpose

The add-type function adds a concept to the type of a given instance.

Syntax

add-type instance concept &key context no-error-p

Arguments

The instance argument is an instance, or an instance identifier.

The concept argument is the concept, or the name of the concept, being added.

The context argument is the context, or the symbol or string that names the context, where the lookup of instance and concept begins. This defaults to the current context.

If the no-error-p argument is t, then error messages are suppressed.

Value

If the update is successful, the newly-added concept is returned. If no-error-p is set and instance (or concept) cannot be found, the two values nil and :missing-instance (or :missing-concept) are returned.

Remarks

If instance is classifiable, add-type places it on the reclassify queue. However, the type of instance is not recomputed until the instance classifier is called (by tellm or new-time-point, for example).

Examples

(add-type 'Joe 'Man) ==> |C|MAN 
(add-type (fi Joe) (fc Married) :context "CL-USER-THEORY") ==> |C|MARRIED 
(add-type 'Joe 'xxx :no-error-p t) ==> NIL :MISSING-CONCEPT 
(new-time-point) 
(pi Joe) --> (TELL (:ABOUT JOE MARRIED MAN))

See Also

Last modified: Jun 1 1995