next up previous contents index
Next: Operations on Instances Up: Operations on Frames Previous: Operations on Frames

Operations on Classes

 

See Section 2.4 for an introduction to the theory of classes and instances and definitions of the vocabulary used here.

create-class  name direct-supers &key kb primitive-p template-slots template-facets own-slots own-facets kb-local-only-p

This function creates a class called name as a direct subclass of the list of frames direct-supers. For FRSs that support the distinction between primitive and nonprimitive concepts, primitive-p determines the primitiveness of the created class (default is t). The parameters template-slots, template-facets, own-slots and own-facets have the same meaning as for create-frame .

class-p  thing &key kb kb-local-only-p

Returns true in both of the following cases, otherwise returns nil. Case 1: thing is a frame object of the type appropriate for kb and thing is a class frame. The frame may or may not be in kb. Case 2: thing is a symbol that identifies a frame in kb that is a class frame.

Note that CLOS function instance-p returns true for any CLOS object, including CLOS classes. In contrast, gfp:instance-p and gfp:class-p will only both return t when applied to the same frame if that frame is both an instance (a direct-instance of a class that is not a class of classes) and a class (a direct-instance of a class that is a class of classes, such as :CLASS).

get-class-direct-subs  class &key kb kb-local-only-p

Returns a list of the direct subs of class.

get-class-all-subs  class &key kb kb-local-only-p

Returns a list of the all-subs of class.

get-class-direct-supers  class &key kb kb-local-only-p

Returns a list of the direct supers of class.

get-class-all-supers  class &key kb kb-local-only-p

Returns a list of the all-supers of class.

get-class-direct-instances  class &key kb kb-local-only-p

Returns a list of the direct-instances of class.

get-class-all-instances  class &key kb kb-local-only-p

Returns a list of the all-instances of class.

class-all-sub-of-p  sub super &key kb kb-local-only-p

Returns true if class sub is a subclass of class super.

class-direct-sub-of-p  sub super &key kb kb-local-only-p

Returns true if class sub is a direct subclass of class super.

class-all-super-of-p  super sub &key kb kb-local-only-p

Returns true if class sub is a subclass of class super.

class-direct-super-of-p  super sub &key kb kb-local-only-p

Returns true if class sub is a direct subclass of class super.

class-direct-type-of-p  class instance &key kb kb-local-only-p

Returns true if instance is a direct instance of class class.

class-all-type-of-p  class instance &key kb kb-local-only-p

Returns true if instance is an all-instance of class.

primitive-p  class &key kb kb-local-only-p

Returns true iff class is a class whose definition is primitive. For FRSs that do not support classification (that is, FRSs that do not distinguish primitive from defined classes), we stipulate that primitive-p  must return t for all classes.

equivalent-p  class1 class2 &key kb kb-local-only-p

Return t if the definitions of class1 and class2 are equivalent, i.e., the extension of these two classes are the same.

consistent-classes-p  class1 class2 &key kb kb-local-only-p

Returns true when the definitions of class1 and class2 are consistent in the sense that an instance could satisfy the definitions of both frames simultaneously.

class-disjoint-p  class1 class2 &key kb kb-local-only-p

Returns true if class1 and class2 are mutually incompatible, i.e., if no instance could simultaneously satisfy the definition of both classes.

most-specific-classes  class-list &key kb kb-local-only-p

Given a list of classes, this function returns the most specific members of the list. For example, given the list (a b c), it would remove class a from the list if a subsumed b.

most-general-classes  class-list &key kb kb-local-only-p

Given a list of classes, this function returns the most general members of the list. For example, given the list (a b c), it would remove class a from the list if a was subsumed by b.

remove-redundant-classes  class-list &key kb kb-local-only-p

Given a list of classes, this function returns the minimal nonredundant members of the list. For example, given the list (a b c), it would remove a from the list if a was equivalent to b.

put-class-supers  class new-supers &key kb kb-local-only-p

Changes class to be a subclass of all the classes listed in new-supers.

get-kb-classes  &key kb kb-local-only-p

Returns the list of class frames in the KB. If kb-local-only-p is true, the list returned will contain only the classes defined in kb itself, and classes that might have been inherited from other (included) KBs will not be included.

mapcar-kb-classes  function &key kb kb-local-only-p

Maps function over all classes in the current KB. If kb-local-only-p is true, the mapping will be performed over only the classes defined in kb itself, and classes that might have been inherited from other (included) KBs will be ignored. Generally speaking, GFP functions whose names begin with mapc- always return nil, whereas functions whose names begin with mapcar- always return a list of the results of the map operations.

mapc-kb-classes  function &key kb kb-local-only-p

Maps function over all classes in the current KB. If kb-local-only-p is true, the mapping will be performed over only the classes defined in kb itself, and classes that might have been inherited from other (included) KBs will be ignored. Generally speaking, GFP functions whose names begin with mapc- always return nil, whereas functions whose names begin with mapcar- always return a list of the results of the map operations.

do-kb-classes  (var &key kb kb-local-only-p) &body body Macro

Iteratively binds var to every class in kb, and executes body under those bindings. If kb-local-only-p is true, the iteration will be performed over only the classes defined in kb itself, and classes that might have been inherited from other (included) KBs will be ignored.

mapcar-class-direct-subs  function class &key kb kb-local-only-p

Maps function over the direct subclasses of class.

mapc-class-direct-subs  function class &key kb kb-local-only-p

Maps function over the direct subclasses of class.

do-class-direct-subs  (var class &key kb kb-local-only-p) &body body Macro

Repeatedly executes body with var bound to a different direct subclass of class on each iteration.

mapcar-class-direct-supers  function class &key kb kb-local-only-p

Maps function over the direct superclasses of class.

mapc-class-direct-supers  function class &key kb kb-local-only-p

Maps function over the direct superclasses of class.

do-class-direct-supers  (var class &key kb kb-local-only-p) &body body Macro

Repeatedly executes body with var bound to a different direct superclass of class on each iteration.

mapcar-class-direct-instances  function class &key kb kb-local-only-p

Maps function over the direct instances of class.

mapc-class-direct-instances  function class &key kb kb-local-only-p

Maps function over the direct instances of class.

do-class-direct-instances  (var class &key kb kb-local-only-p) &body body Macro

Repeatedly executes body with var bound to a different direct instance of class on each iteration.

mapcar-class-all-subs  function class &key kb kb-local-only-p

Maps function over the subclasses of class.

mapc-class-all-subs  function class &key kb kb-local-only-p

Maps function over the subclasses of class.

do-class-all-subs  (var class &key kb kb-local-only-p) &body body Macro

Repeatedly executes body for all of the subclasses of class, with var bound to a different subclass for each iteration.

mapcar-class-all-supers  function class &key kb kb-local-only-p

Maps function over the superclasses of class.

mapc-class-all-supers  function class &key kb kb-local-only-p

Maps function over the superclasses of class.

do-class-all-supers  (var class &key kb kb-local-only-p) &body body Macro

Repeatedly executes body for all of the superclasses of class, with var bound to a different superclass for each iteration.

mapcar-class-all-instances  function class &key kb kb-local-only-p

Maps function over the instances of class.

mapc-class-all-instances  function class &key kb kb-local-only-p

Maps function over the instances of class.

do-class-all-instances  (var class &key kb kb-local-only-p) &body body Macro

Repeatedly executes body for all of the instances of class, with var bound to a different instance for each iteration.


next up previous contents index
Next: Operations on Instances Up: Operations on Frames Previous: Operations on Frames

  • Peter Karp