A class is a set of entities, which are called the instances of the class. An entity can be an instance of many classes, which are called its types, and a class can be a type of many classes. A frame denoting a class is called a class frame, and a frame denoting an entity that is an instance of a class is called an instance frame. A class can also be an instance, i.e., an instance of a class of classes (a metaclass). The relation that holds between a instance and a class is a primitive, akin to set membership. With this primitive we can define the sub relation that holds between classes. A class is a sub of class iff all instances of are also instances of . In other words, all instances of the subclass are instances of the superclass, and the superclass may have other instances.
It is often important when reasoning about instance-of (and sub-of) relationships to distinguish between the case where an instance frame is a direct-instance-of a particular class C, and where the instance might be a direct-instance-of some other class C, that in turn is a sub of C. We use the relations direct-instance-of and all-instance-of to distinguish between the direct, and direct or indirect, cases. An instance i is a direct instance of a class C if i is an instance of C and the system knows of no other class C' that is a subclass of C such that i is an instance of C. In other words, to say a frame is a direct instance of a class means that the class is the most specific class in the KB that includes the instance. All-instance-of is the transitive closure of direct-instance-of, therefore, i is an all-instance-of C if either i is a direct-instance-of C, or i is a direct-instance-of a class C that in turn is a sub of C.
Similarly, a class is a direct sub of class if is a sub-of and the system knows of no other class C' of which is a sub and which is, in turn, a sub-of . Again, the intuition is that is the most specific ancestor of . The relations direct-super-of and all-super-of are the inverses of direct-sub-of and all-sub-of, for example, if is a direct-sub-of , the is a direct-super-of . All-types-of is the inverse of all-instance-of, and direct-type-of is the inverse of direct-instance-of, for example, if instance i is an all-instance-of class C, then C is an all-type-of i.
The relation sub-of is transitive, and if we know is a subclass of and is a subclass of , then is also a subclass of . The direct-sub-of relation is not transitive, although a direct-sub-of a superclass is also a sub-of the superclass. Furthermore, If is a direct-sub of and is a sub-of , then is also a sub-of .
In the Generic Frame Protocol, the direct instance relationship is specified with a pair of functions, direct-instances and direct-types. The direct-instances of a class are its direct instances, and the direct-types of an instance are the classes of which it is a direct instance. The functions all-instances and all-types are used to describe the more general instance relationship. The names of relationships end in ``-of'', whereas the names of functions do not. Relationships correspond to links in a taxonomic hierarchy, whereas functions return the nodes (frames) at the ends of these links. The all-instances of a class are all those entities that are instances of the class.
The functions direct-subs and direct-supers capture the direct subclass relationship between classes. The direct-subs of a class are its subclasses, and the direct-supers are those classes for which it is a subclass. The more general subclass relationship is specified with the relations all-subs and all-supers. The all-subs of a class are its subclasses and its all-supers are the classes of which it is a subclass.
Some FRSs require the direct-instance-of relationship to be given by the the user when the instance frame is created, and don't allow this relationship to change. Other FRSs, which perform automatic classification, may infer the direct-instance-of relationship. Similarly, the direct-subclass-of relationship must be stated explicitly in some FRSs and is inferred in others. In any case, these relations are nonmonotonic, since new subclasses may be added that are more specific than existing classes. In the Generic Frame Protocol, one specifies direct-instance-of relationships at instance creation time, but the systems may also infer them. However, systems are not required to maintain these relationships as new classes are added. This is just one of many ways in which FRSs are incomplete inference engines. Applications can avoid depending on this behavior by defining the class structure of a KB before creating instances, or by only relying on the all-instances function instead of direct-instances. In the Generic Frame Protocol, answering a query about whether a frame is an instance may require more computation than a direct-instance-of query, but this answer is required to be correct. The same holds for all-class-of and direct-sub-of; one may assert either relation but should only count on the former to be accurately maintained.