11
/nformntion .Sy.~kvt~s Vol. 15, No. 1. pp. 9-19, 1990 0306-4379190 $3.00 + 0.00 Printed in Great Britain. All rights reserved Copyright Q 1990 Pergamon Press pit PRACTICAL, OBJECT-BASED KNOWLEDGE REPRESENTATION FOR KNOWLEDGE-BASED SYSTEMSI PETER F. PATEL-SCHNEIDER AI Principles Research Department, AT&T Bell Labs, 600 Mountain Ave. Murray Hill, NJ 07974. U.S.A. (Received _for publication I8 October 1989) AbstraeG-Object-based knowledge representation systems are systems expressly designed for representing knowledge in the form of objects and classes. These systems derive their behavior from a forma1 specification of the meaning of objects and classes and, because of this firm representational foundation and their increased expressive power, are better suited for providing represent&on services for knowledge-based systems than are object-oriented programming systems. However, object-based knowl- edge representation systems are hard to implement correctly, and also suffer from tractability problems. These problems can be circumvented by using a weaker semantics, resulting in practical object-based knowledge representation systems for use in knowledge-based systems. 1. INTRODUCTION Knowledge-based systems-systems that explicitly represent and reason with large amounts of knowl- edge-are generally built on some substrate that provides knowledge representation services for them. These representation services include the storage and retrieval of facts required by the knowledge-based system and also domain-independent reasoning on these facts (as opposed to the domain- and appli- cation-specific reasoning performed by the main body of the knowledge-based system). When this knowledge is naturally expressed in terms of objects that are grouped into classes, these services are often provided by object-oriented programming systems, such as SMALLTALK [I], STROBE [2], LOOPS [3] or the proposed Common LISP Object System, CLOS [4]. Object-oriented programming systems are useful in building knowledge-based systems that represent and reason about objects and classes. They allow facts about a single object to be grouped together and objects to be collected into classes; they allow data and procedures to be inherited and combined in various ways; they allow procedures to be attached to classes. In general, object-oriented programming sys- tems provide an interesting and fruitful approach to programming knowledge-based systems. However, object-oriented programming systems are programming systems-not representation sys- terns-and are not themselves very good at represent- ing knowledge. They are not adequately concerned with the representational aspects of these objects and classes: they provide no formal, non-operational _.” TThis paper is a substantially revised and extended version of a paper entitled “An approach to practical object- based knowledge representation systems” that appears in the Proceedings qf the 21~1 Hawaii International Coizferenca on S,wtem Sciences. semantics for objects and classes, and thus lack an adequate representational basis for truly representing objects and classes; they are expressively limited, and thus cannot declaratively represent many aspects of domains; they allow user procedures to modify their data structures, and thus are hard to describe and understand. Any system providing representational services for knowledge-based systems is only a computer pro- gram and thus can only store data structures-not facts. Before the system can be considered to repre- sent facts, there must be some external, represen- tational semantics that provides a clear meaning for the system--turning data structures into facts and thus turning the system into a knowledge represen- tation system. The semantics also provides an independent specification for the entire system, including its operations. The approach described here is in stark contrast to the situation in object- oriented programming systems, where any represen- tational description of the system is subordinate to its operational definition. The semantic approach to defining knowledge representation systems has been advocated by many researchers in artificial intelligence. Hayes PI, Moore [6] and Frisch [7], among others, have argued that an external denotational semantics is required for all knowledge representation systems. In particu- lar, Moore states that “Whatever else a formalism may be. at least some of its expressions must have referential semantics if the formalism is really to be a representation of knowledge” [6; p. 4281. If there is no such semantics for a system, then the system cannot be said to represent anything, and thus is a poor choice for a representational substrate. Examples of knowledge representation systems under this definition of knowledge representation are KRYPTON [8], KANDOR [9] and, to some extent, KL-ONE [lo] and NIKL [ll, 121.

Practical, object-based knowledge representation for knowledge-based systems

Embed Size (px)

Citation preview

Page 1: Practical, object-based knowledge representation for knowledge-based systems

/nformntion .Sy.~kvt~s Vol. 15, No. 1. pp. 9-19, 1990 0306-4379190 $3.00 + 0.00 Printed in Great Britain. All rights reserved Copyright Q 1990 Pergamon Press pit

PRACTICAL, OBJECT-BASED KNOWLEDGE REPRESENTATION FOR KNOWLEDGE-BASED SYSTEMSI

PETER F. PATEL-SCHNEIDER

AI Principles Research Department, AT&T Bell Labs, 600 Mountain Ave. Murray Hill, NJ 07974. U.S.A.

(Received _for publication I8 October 1989)

AbstraeG-Object-based knowledge representation systems are systems expressly designed for representing knowledge in the form of objects and classes. These systems derive their behavior from a forma1 specification of the meaning of objects and classes and, because of this firm representational foundation and their increased expressive power, are better suited for providing represent&on services for knowledge-based systems than are object-oriented programming systems. However, object-based knowl- edge representation systems are hard to implement correctly, and also suffer from tractability problems. These problems can be circumvented by using a weaker semantics, resulting in practical object-based knowledge representation systems for use in knowledge-based systems.

1. INTRODUCTION

Knowledge-based systems-systems that explicitly represent and reason with large amounts of knowl- edge-are generally built on some substrate that provides knowledge representation services for them. These representation services include the storage and retrieval of facts required by the knowledge-based system and also domain-independent reasoning on these facts (as opposed to the domain- and appli- cation-specific reasoning performed by the main body of the knowledge-based system). When this knowledge is naturally expressed in terms of objects that are grouped into classes, these services are often provided by object-oriented programming systems, such as SMALLTALK [I], STROBE [2], LOOPS [3] or the proposed Common LISP Object System, CLOS [4].

Object-oriented programming systems are useful in building knowledge-based systems that represent and reason about objects and classes. They allow facts about a single object to be grouped together and objects to be collected into classes; they allow data and procedures to be inherited and combined in various ways; they allow procedures to be attached to classes. In general, object-oriented programming sys- tems provide an interesting and fruitful approach to programming knowledge-based systems.

However, object-oriented programming systems are programming systems-not representation sys- terns-and are not themselves very good at represent- ing knowledge. They are not adequately concerned with the representational aspects of these objects and classes: they provide no formal, non-operational

_.” TThis paper is a substantially revised and extended version

of a paper entitled “An approach to practical object- based knowledge representation systems” that appears in the Proceedings qf the 21~1 Hawaii International Coizferenca on S,wtem Sciences.

semantics for objects and classes, and thus lack an adequate representational basis for truly representing objects and classes; they are expressively limited, and thus cannot declaratively represent many aspects of domains; they allow user procedures to modify their data structures, and thus are hard to describe and understand.

Any system providing representational services for knowledge-based systems is only a computer pro- gram and thus can only store data structures-not facts. Before the system can be considered to repre- sent facts, there must be some external, represen- tational semantics that provides a clear meaning for the system--turning data structures into facts and thus turning the system into a knowledge represen- tation system. The semantics also provides an independent specification for the entire system, including its operations. The approach described here is in stark contrast to the situation in object- oriented programming systems, where any represen- tational description of the system is subordinate to its operational definition.

The semantic approach to defining knowledge representation systems has been advocated by many researchers in artificial intelligence. Hayes PI, Moore [6] and Frisch [7], among others, have argued that an external denotational semantics is required for all knowledge representation systems. In particu- lar, Moore states that “Whatever else a formalism may be. at least some of its expressions must have referential semantics if the formalism is really to be a representation of knowledge” [6; p. 4281. If there is no such semantics for a system, then the system cannot be said to represent anything, and thus is a poor choice for a representational substrate. Examples of knowledge representation systems under this definition of knowledge representation are KRYPTON [8], KANDOR [9] and, to some extent, KL-ONE [lo] and NIKL [ll, 121.

Page 2: Practical, object-based knowledge representation for knowledge-based systems

10 PETER F. PATEL~CHNEIDER

Many knowledge representation systems deal with facts as sets of unconnected sentences and are based on some assertional logic, such as first-order logic. (For a good introduction to assertional logics, includ- ing Tarskian semantics for assertional logic, see [ 131.) But the same rationale that motivates object-oriented programming can also motivate an object-oriented approach to knowledge representation. An object- based knowledge representation system is then a knowledge representation system that represents knowledge in terms of structured objects and classes (as opposed to representing knowledge in terms of collections of first-order sentences, for example). These systems formalize and extend the represen- tational ideas underlying traditional (in artificial intelligence) semantic networks and frame-based systems. They are based on an external semantics that provides meaning to objects, classes, roles and other related notions. Because of their overt representa- tional concern, object-based knowledge representa- tion systems provide better representational support for knowledge-based systems than do object-oriented programming systems.

However, object-based knowledge representation systems have several problems that have limited their use in knowledge-based systems. These systems are hard to implement correctly and some of their oper- ations are computationally intractable when correctly performed, characteristics not conducive to use in knowledge-based systems. Also, the commonly used operations of current object-based knowledge rep- resentation systems are considerably slower than the equivalent operations in object-oriented program- ming systems. Finally, current object-based knowl- edge representation systems do not have the facilities for attaching procedures to classes and combining these procedures that object-oriented programming systems have, making it harder to write large collec- tions of programs using object-based knowledge representation systems. These problems are being overcome, and object-based knowledge represen- tation systems that are usable in knowledge-based systems are under development.

The rest of this paper elaborates the difficulties inherent in using object-oriented programming systems for representing knowledge, describes the representational advantages and implementational problems of object-based knowledge representation systems, and presents a way of avoiding some of the problems of standard object-based knowledge representation systems.

*Of course it is always possible to write procedures to perform these tasks. However, this would be using an object-oriented programming system to impfement an object-based knowledge representation system, and would not turn an object-oriented programming system into an object-based knowledge representation system. This kind of support is exactly what an object-based knowledge representation system is supposed to provide -fact and description management.

2. REPRESENTATIONAL PROBLEMS WITH OBJECT-ORIENTED PROGRAM~G SYSTEMS

Although object-oriented programming systems are used to provide representation services (storing facts and performing some domain-independent reasoning) for knowledge-based systems, they are not as well suited for representing knowledge as might first appear. This is in spite of the fact that object- oriented pro~amming systems are described in terms of objects and classes, and the descriptions often carry decided representational overtones. On closer examination, however, the non-representational basis of object-oriented programming systems shows through, as does their expressive weakness. These problems show up clearly when considering classes, defaults and exceptions, and inheritance.

The intuitive notion of a class is quite simple. A class is simply a description of a set of objects, called its instances, and provides a set of constraints on these instances.

Classes in object-oriented programming systems are expressively limited. For example, an object can be a member of such a class only if the class or one of its subclasses is explicitly mentioned in the object. There is no way to provide other conditions that are sufficient for an object to be an instance of a class. For example, there is no way to define the class of all people with at least two children, which has as in- stances precisely those instances of the class of all people that are related to at least two objects by the child relation. This means that there is no way to use classes as recognizers, such as by creating the class of all people with at least two children and then searching for all people with at least two children by simply retrieving the instances of this class.?

The types of constraints that can be placed on instances is rather limited-ssentially only existence and type information for atomic slots associated with the instances. There is usually no way of specifying that a slot has to have a certain number of fillers, or that the fillers that meet a certain condition must also meet another condition, such as saying that all of one’s children who are lawyers are also doctors. Thus many domains cannot be adequately represented in object-oriented programming systems.

Also, in many object-oriented programming sys- tems the information specifiable in classes includes information about non-representational aspects of the system. For example, in CLOS, slot desc~ptions can specify whether the value of the slot is to be stored in instances or stored in the class. Information about where the values of a slot are to be stored is information about implementation-not about what is being represented. Of course, if the value is stored in the class, there can only be one common value for the slot in instances of the class. If the system were

Page 3: Practical, object-based knowledge representation for knowledge-based systems

Practical, object-based knowledge representation 11

truly representational, then this inference would be made the other way around-given that there can only be one common value for the slot in instances of the class, then the value can be stored in the class. This, however, may not even always be an optimal implementation decision.

This reversal is more than just a matter of view-

point-inferences from implementation details to representational consequences can be invalidated by changes in the implementation, and also may be subject to non-local conditions, as is this particular inference. These inferences are thus unreliable, as opposed to the case where the representational im- port is directly specified. Unfortunately, this sort of reasoning from implementational specifications to representational implications is common in object- oriented programming systems.

2.2. Defaults and e.uceptions

Just about all object-oriented programming sys- tems allow a class to specify a default value for a slot. In some systems, such as CLOS, this default value is given to an instance when the instance is created, provided that no explicit value is given, whereas in others, such as STROBE, the default value is used whenever the value is requested and no value is stored locally. In both cases, there is no representational status afforded to this mechanism. This leads to defaults being used for several incompatible pur- poses. For example, defaults have been used as typical (but not necessarily correct) values, as values to be (correctly) inferred if no explicit value is given, or even as a way to allow changes to the class to easily filter down to instances. These multiple purposes lead to confusion about the meaning of any particular default, and seriously reduce the utility of defaults for representing knowledge.

Many object-oriented programming systems allow

the conditions specified in a class to be overriden in instances of the class or in more specific classes. In STROBE, the type restriction on the value of a slot can be violated in instances, and a more-specific class can change the type restriction of a slot to an unrelated type, and also change other aspects of the slot in an incompatible manner. This allows the creation of instances of a class that do not conform to the original description of instances given by the class, and makes it impossible to draw conclusions about instances of a class based solely on the information in the class.

Similarly. on CLOS, even if a class specifies that

the value of a slot is to be stored in the class, a more-specific class can change the storage location for the value of that slot to itself or even to its instances. In this way even the reasoning from storage location in the class to the fact that all instances of the class share the same value for the slot can be defeated. The only way of validating this inference is to investigate all the more-specific classes.

2.3. Inheritance

Inheritance is a mechanism for taking information from one class and making it part of another class or part of an object. It forms a central part of object- based knowledge representation systems, being used to transfer information from more-general classes to more-specific classes, thus allowing easier specifi- cation of classes (because most classes will inherit a large portion of their specification from more-general aclasses).

Intuitively, almost all uses of inheritance in object- oriented programming systems can be viewed as a way of inferring information about more-specific classes from information about more-general ones, or inferring information about objects from information about the classes of which they are instances. How- ever, inheritance is an operational notion-pro- cedurally specified-that takes information from one class to another without any concern for the meaning

of the classes, of the relationship between the classes, or the information inherited. Any attempt to provide a complete representational description for inherit- ance must encompass all the features of its oper- ational definition, including the ability to override inherited information, leading to an extremely com- plicated description that is very hard to understand, and is useless for representational purposes.

The operational basis of object-oriented program- ming systems is a general problem as any represen- tational description for them must be derived from their basic operational behavior, and must account for all the quirks of this operational behavior. If these systems were knowledge representation systems, the opposite would be true-their operational behavior would be derived from their representational specifi- cation. For example, in a system oriented towards representing knowledge, inheritance would be a derived description of how information flows between related classes, and not an operationally specified primitive.

Also, inheritance in object-oriented programming systems is controlled by information that is non-rep- resentational. In both STROBE and CLOS, the order in which information is inherited is determined by the order in which the generalizations of a class are specified when the class is created. The fact that one class occurs before another in a list of more-general classes is certainly not representationally significant, but ends up having important consequences, due to the operational details of inheritance, such as dictat- ing which of several different defaults or types will be inherited. In STROBE, other operational aspects of inheritance can be specified, such as performing depth-first or breadth-first search in inheritance, caching inheritance results in instances for later use, and inheriting information from places other than generalizations.

While providing a flexible and powerful program- ming methodology, these aspects of inheritance in

Page 4: Practical, object-based knowledge representation for knowledge-based systems

12 PETER F. P~~L-SC~E~DER

object-oriented programming systems have the effect that the meaning of a class can be determined only by a very close examination of the operational details of the inheritance mechanism, the data structures in the class that control inheritance, and the data structures in more-specific classes. If classes were governed by a separate, representational definition, as in knowl- edge representation systems, then these operational details would not be important, and would not have to be investigated.

These representationai problems with object- oriented programming systems make them ill-suited for use as knowledge representation systems. The design of object-oriented programming systems is appropriate for programming, but what is appropri- ate in programming systems often is inappropriate for knowledge representation.

3. OBJECT-BASED KNOWLEDGE REPRESENTATION SYSTEMS

An object-based knowledge representation system is a knowledge representation system that represents its knowledge in terms of structured objects and c1asses.t A structured object is an object plus infor- mation associated with the object via roles, which are similar to the slots or instance variables of object- oriented programming systems. For example, John, a male person whose age is 28, whose spouse is Susan, and who has three children including Matthew and Mary is an informal description of a structured object. A structured class is a description of a set of objects, known as its instances, such as the class of all people who have at least two children. This class would include John as one of its instances.

Since an object-based knowledge representation system is a knowledge representation system, it is based on a representation logic that defines the meaning of classes, objects and roles. An object-based knowledge representation system also includes a set of operations which determine how the system acts. Of these two, the representation logic is the most important, as the operations are all defined in terms of the logic, and just serve to define and interface to the logic.

The representation logic consists of a syntactic language for objects, classes, roles and any other syntactic constructs the logic may have, plus a rep- resentational semantics for these constructs that serves to define their meaning. The syntactic language

tin this paper, the objects of object-based knowledge rep- resentation systems are individuals, and are never classes. Some object-based knowledge representation systems, on the other hand, allow objects to also be classes.

$The true role of inheritance (and the reason that it is useful) is that it is a way of calculating what is inherent in a taxonomy of classes. This way of looking at inherit- ance-and no other-is the one that should underlie specific inheritance mechanisms.

defines how classes, objects, etc. are formed. For example, it may allow the definition of the class multiple-parent:

multiple-parent = (and person (atleast 2 child)),

and the definition of the object John,

John instance (and person male (atleast 3 child))

values (age 28) (spouse Susan) (child Matthew Mary),

3.1. Semapl tics

The semantics of object-based knowledge represen- tation systems are commonly based on semantic structures, also called worlds, that consist of a set of entities, plus mappings which take classes, objects, etc. into their meanings in the world. In this sort of semantics, a class is usually mapped into a set-the set of entities that belong to it+alled the extension of the class. In this way the syntactic notion of a class is mapped into the representational notion of a set of entities. Similarly, a role is mapped into a set of ordered pairs of entities, again called the extension of the role. Thus the syntactic notion of a role is mapped into the representational notion of a two-place re- lation between entities, Finally, objects are mapped into entities.

The mappings must meet certain conditions, which fill out the formal meaning for the syntactic con- structs. For example, the definition of multiple- parent given above would, in a normal semantics, result in the condition that the extension of multiple- parent must be precisely the set of entities that both belong to the extension of parent and also are related to at least two entities by the child relation. This, of course, matches and formalizes the intuitive meaning of multiple-parent. But, most importantly, it forces the system to conform to this intuition.

The semantics, aside from determining the map ping of syntactic units into their representational meaning, also defines what can be deduced from a set of facts. For example, the semantics may dictate that the statement “John is an instance of multiple- parent” can be deduced from the above definitions. A valid deduction is generally defined as one in which the query, in this case whether John is an instance of multiple-parent, fo~Io~s~o~ a set of definitions (or knowledge base), where a query follows from a knowledge base if it is true in all worlds that satisfy the knowledge base. (The semantics also determines when worlds satisfy knowledge bases.) Query oper- ations, then, are not defined in terms of what is explicit in a knowledge base, but instead are defined in terms of what is implicit in a knowledge base.$

The operations of an object-based knowledge representation system provide a means of creating a knowledge base in this logic, for querying the knowledge base and for modifying the knowledge

Page 5: Practical, object-based knowledge representation for knowledge-based systems

Practical, object-based knowledge representation 13

base. They are defined in terms of the logic, which thus serves as a spec$cation for the entire system. Implementing an object-based knowledge representa- tion system is simply a matter of implementing these operations. Generally this turns out to be mostly a matter of implementing deducibility relationships of the logic, as the interesting part of most operations reduces to determining deducibility relationships.

The representation logic of an object-based knowl- edge representation system thus determines both the expressive power and the deductive power of the system. The system can only express classes that can be constructed using the syntactic language, which thus defines its expressive power. Similarly, it can only perform inferences that are sanctioned by the semantics, which thus defines its deductive power. Developing a usable object-based knowledge representation system thus consists mostly of finding or inventing a representational logic with the appropriate expressive and deductive power, and then implementing the desired deducibility relation- ships of the logic.

3.2. A simple object-based knowledge representation sys ten?

The simple system described in this section gives a brief overview of the distinctive features of object- based knowledge representation systems. This system does not exist as an implemented system, but serves to describe typical aspects of object-based knowledge representation systems. It is closely related to systems such as KANDOR and NIKL.

The representation logic of this system has a syntactic language with constructs for structured classes, roles and objects, as well as for defining atomic (named) classes, roles and objects. The semantics of the logic is a simple extensional semantics, with worlds similar to the Tarskian worlds for first-order logic. This brief overview of the system does not give a complete description of either the syntax or the semantics of this logic. They are instead described by means of examples and informal explanations.

The syntactic language of this system includes several ways of constructing structured classes. There are several types of restrictions on roles that can be specified in a class. For example, restrictions like (atleast 2 child), which requires at least two fillers of the child role, are allowed.? Similarly, restrictions on the maximum number of fillers of a role are allowed, as are type restrictions on the fillers of a role. There is also a conjunction operation for classes, allowing the construction of classes like (and person (atleast 2 child))-the conjunction of person and (atleast 2 child). Structured roles can also be created, such as (restrict child lawyer), which is the specialization of

tThe linear syntax used here is derived from the one used in [14]. It is used in preference to the more common graphical syntax because it is easier to define.

child in which the fillers (values) are restricted to be instances of the class lawyer.

Named objects can be defined as identical to structured objects, as in multiple-parent = (and per- son (atleast 2 child)), which makes multiple-parent be the same as (and person (atleast 2 child)). Named classes can be given a definition that is both necessary and sufficient for an object to be an in- stance, as above, or just necessary but not sufficient, as in person < mammal, which makes person be an otherwise unspecified specialization of mammal. Named roles can also be defined in these two ways. Finally, named objects can be defined as instances of a class, as in Mary instance multiple-parent, which defines Mary to be an instance of the class multiple- parent.

The semantics of the logic follows the method outlined above. Its worlds consist of a set of entities, plus mappings from objects, classes and roles into their meaning or extension in the world. The mapping for objects takes an object into the entity that it represents in the world. The mapping for classes takes a class into the set of entities that belong to it in the world. The mapping for roles takes a role into a two-place relation over the entities that specifies which entities are related by the role.

These semantic mappings must satisfy certain con- ditions. First, the mapping of a constructed class, role or object is some combination of the mappings of its parts. For example, the extension of a conjunction of two classes must be the intersection of the extensions of these two classes, so that the extension of (and person (atleast 2 child)) must be the intersection of the extensions of person and (atleast 2 child). Second, a defined class, role or object must match its definition. For example, a defined object must map into an element of the extension of the class of which it is an instance. Thus Mary must map into an element of the extension of multiple-parent. Also, a class defined via a necessary and sufficient definition must have the same extension as its definition, and a class defined via a necessary but not sufficient defi- nition must have its extension be a subset of the extension of its definition. Thus, if person is defined by person < mammal, then the extension of person must be a subset of the extension of mammal.

In this way, meaning is given to the syntactic constructs and relationships of the language- instance relationships become set memberships, conjunction constructs become set intersections, and class definitions become set equalities or set inclusions.

To further illustrate this mapping, consider the class:

three-input-and-gate = (and and-gate (exactly 3 input)).

The properties of the semantic mapping for defini- tions and from classes to their extensions ensures that the extension of this class, three-input-and-gate,

Page 6: Practical, object-based knowledge representation for knowledge-based systems

14 Peter F. Patel-Schneider

will be precisely the intersection of the extensions of the classes and-gate and (exactly 3 input). The extension of (exactly 3 input) consists of those entities that have exactly three inputs. Therefore, the extension of three-input-and-gate is the set of all and-gates with three inputs, provided that the class and-gate and the role input have their expected meanings.

Also, the object:

and-gate-4 instance and-gate values (input port-5 port-7 port-8),

which is an and-gate that has inputs port-5, port-7 and port-8, would be an instance of the class three- input-and-gate, because the semantics dictates that the extension of and-gate-4 is an element of the extension of three-input-and-gate.?

As a final illustration of the mapping from con- structs to extensions, the extension of the class:

(and person (all child lawyer) (all (restrict child lawyer) doctor)),

is the intersection of (1) the extension of the class person; (2) those entities whose fillers for child all belong to the extension of lawyer; and (3) those entities whose fillers for child that also belong to the extension of lawyer all belong to the extension of doctor. This class is thus the class of people whose children are all lawyers and whose children who are lawyers are all doctors.

One very important relationship in object-based knowledge representation systems is the relationship between a class and its generalizations. Here this relationship is formalized as subsumption. One class is subsumed by another if, in all worlds, the extension of the first is a subset of the extension of the second. Therefore if a class is subsumed by another, an instance of the subsumed (first) class will always be an instance of the subsuming (second) class, and thus subsumption captures the intuitive notion of class generalization.

Subsumption is a non-trivial relationship in object-based knowledge representation systems. For example, the class given immediately above is sub- sumed by the class:

(and person (all child doctor)),

because anyone whose children are all lawyers and whose children who are lawyers are all doctors must also have all their children be doctors.

The operations of this system consist of book- keeping operations to add knowledge to a knowledge base, and to retract and modify knowledge in a knowledge base, plus query operations that

TThere is a dependence on closed world and unique name assumptions in this example. These assumptions are generally part of object-based knowledge representation systems, but have not been mentioned in the preceding discussion.

determine whether a query follows from a knowledge base.

The most representationally interesting operations of the system are the query operations. These oper- ations are not defined in terms of data structure operations, but instead are defined in terms of the semantics that underlies the system. The two main query operations in this system determine whether one class subsumes another and whether an object is an instance of a class, given a knowledge base. Other operations return all the defined (atomic) classes which are more specific than a class or all the known instances of a class. All these operations are defined in terms of semantic relationships, so implementing them consists of implementing the semantic relationships.

One very important group of query operations in the system returns the properties of objects, such as the fillers of a role for an object or the classes of which an object is an instance. These operations will be the most frequently invoked operations of the system. If the system is to be usable as a part of knowledge- based systems, these operations must execute rapidly; otherwise the knowledge-based system will be un- bearably slow. It is possible to implement object- based knowledge representation systems is such a way that they have this property, essentially by determining which classes objects belong to and what are the values of roles when changes are made to the knowledge base. Then, these commonly used oper- ations can be implemented by simple data retrieval operations.

3.3. Strengths

One main strength of object-based knowledge rep- resentation systems is that they completely hide the implementation details of the system. The system has a representational semantics that defines the meaning of the constructs and operations of the system. It must adhere to this meaning, resulting in a trans- parent implementation that does not result in added complexity that needs to be considered when design- ing and analyzing large knowledge-based systems.

For example, neither the taxonomy of classes nor inheritance are primitive notions in object-based knowledge representation systems. The taxonomy of classes is derived from the subsumption relationships between classes, and is not directly specified by users, as opposed to the case in object-oriented program- ming systems. Similarly, the non-locally specified properties of classes and objects in an object-based knowledge representation system are a consequence of their being subsumed by a more-general class or being an instance of a class, not a consequence of an inheritance mechanism. An inheritance mechanism may be used to implement this behavior, but it is not part of the specification.

The meaning of classes in object-based knowledge representation systems is entirely specified by the semantics of the system; it is in no way dependent on

Page 7: Practical, object-based knowledge representation for knowledge-based systems

Practical, object-based knowledge representation 15

operationally specified mechanisms, such as inherit- ance and thus is easy to understand. Further, non- representational aspects of the system cannot affect the behavior of classes, as opposed to the normal case in object-oriented programming systems where, among other things, the order in which superclasses are stated affects the behavior of classes.

The other main strength of object-based knowledge representation systems is that they generally are expressively more powerful than object-oriented pro- gramming systems. This can be seen in the classes of the system described above, which are much more expressive than classes in object-oriented programming systems. The additional expressive power can be used to capture more of a domain than can be captured in object-oriented programming systems without resorting to user procedures. Thus a knowledge-based system using an object-based knowledge representation system does not need to represent as much domain knowledge in the form of procedures, which makes knowledge-based systems using object-based knowledge representation systems easier to build and to analyze than knowl- edge-based systems using object-oriented program- ming systems.

As a side effect of their extra expressive power, object-based knowledge representation systems such as the one above have to recognize when a class is subsumed by another class and when an object is an instance of a class. Both of these are non-trivial in the presence of non-primitive, defined classes, and add considerably to the representational power of the system.

These recognition capabilities can be put to good use when designing large knowledge bases by show- ing where proposed descriptions of classes would fit in the taxonomy of classes. This allows knowledge base designers to navigate through complex tax- onomies, and aids in maintaining large collections of classes [ 151. The recognition service can also be used to determine what objects have certain properties, such as finding all the three-input and-gates. This can be done in the system described above by simply

tThe translation from query to class sometimes lost infor- mation, because ARGON queries were more expressive than KANDOR classes. This meant that sometimes the list of instances had to be filtered to remove instances that did not match the query. For a large group of queries the translation was indeed exact, and the filtering was not required. Even when filtering was required, the use of KANDOR reduced the number of instances that had to be considered.

JARGON performs a KANDOR classification operation, tem- porarily placing a new class in the class taxonomy, for every query. Classification requires determining the sub- sumption relationships between the new class and all the other classes in the current knowledge base. Therefore, ARGON depends heavily on the fact that subsumption in KANDOR can be determined quickly. (The incompleteness of KANDOR'S subsumption algorithm and the intract- ability of subsumption in the logic underlying KANDOR

were not discovered until later.)

asking for all instances of the appropriate class, here three-input-and-gate.

The recognition capabilities can also be used as the basis of a retrieval system. For example, the ARGON query system [16] heavily used the recognition capabilities of the object-based knowledges represen- tation system KANDOR. Queries in ARGON were trans- lated into KANDOR classes and placed in the knowledge base. Then the instances of the class were retrieved, thus finding the objects that matched the query.t

3.4. Implementation problems

Unfortunately, implementing object-based knowl- edge representation systems is difficult to do correctly and, moreover, certain operations of theirs can be impossible to implement efficiently. The correctness part of the problem is a result of having to implement the deducibility relationship for a complex logic. The logics underlying object-based knowledge representa- tion systems tend to be complicated and non-stan- dard, including classes, roles and objects, each of which have idiosyncratic constructs. This results in a complicated deducibility relationship that can be very hard to implement correctly.

For example, when a semantics was being specified for the constructs in KL-ONE, it was thought that a simple algorithm would suffice for determining whether one class subsumes another. However, it was quickly determined that subsumption in the logic underlying KL-ONE was not as simple as previously thought [17]. In fact, no complete subsumption algorithm has yet been developed for this logic, even in NIKL, the successor to KL-ONE.

Even expressively limited object-based knowledge representation systems may have computational problems. KANDOR is a small object-based knowledge representation system, specifically designed to be simple to implement. However, the implementation of subsumption in KANDOR is incomplete, as was discovered by Nebel [ 181.

The efficiency problem with object-based knowl- edge representation systems is not just a matter of constant factors, but a fundamental intractability in the operations that these systems have to perform. In particular, the subsumption relationship turns out to be co-NP-complete, or worse, even for simple object-based knowledge representation systems [ 141. For example, subsumption for the logic underlying KANDOR is NP-hard [18], even when numbers are represented in unary notation. Subsumption in more expressive teminological logics, such as the termino- logical logic of NIKL, is undecidable [19,20]. Any object-based knowledge representation system with reasonable expressive power will have intractable or undecidable subsumption.

Determining subsumption relationships is a very important operation in object-based knowledge rep- resentation systems, and is frequently used.1 Thus, this problem makes it hard to use object-based

Page 8: Practical, object-based knowledge representation for knowledge-based systems

16 PETER F. PATEL-SCHNEIDER

knowledge representation systems as the basis of knowledge-based systems, since frequently used oper- ations could end up taking a very long time or even taking forever, a property that is not desirable in knowledge-based systems. (See [21] for a full account of the problems with tractability in knowledge representation.)

3.5. Overcoming intractability

Since subsumption in expressively powerful object- based knowledge representation systems is in- tractable or undecidable and, for object-based knowledge representation systems to be practical they must be tractable, some way must be found to get out of this dilemma. Limiting expressive power is not a solution since object-based knowledge representa- tion systems with tractable subsumption are much too weak to be of practical use. The only approach left is to limit deduction-that is, to provide an incomplete but tractable algorithm for subsumption. One way of producing an incomplete subsumption algorithm is to use a different semantic for the logic underlying the system, one that sanctions tractable subsumption. This results in an object-based knowl- edge representation system that corresponds to some representational logic-not the intuitive logic for objects and classes discussed above, but some related logic. Such a system, because of its tractability, would be more suitable for use in knowledge representation systems than object-based knowledge representation systems based on standard logics.

Care has to be taken in this approach to ensure that the resultant semantics is reasonable for purposes of representation and that it also sanctions an interest- ing and useful set of inferences. One semantics that meets these conditions is based on four truth values that have been used in simple relevance logics [22]. The four truth values are true, false, unknown and contradictory. Logics based on these four truth values can represent missing information, with the truth value unknown, and also do not propagate local incon- sistencies throughout a knowledge base, since an inconsistency can be represented using the truth value contradictory. This semantics has been proposed as suitable for use as the basis of knowledge representa- tion systems by several researchers [22-271.

Using these four truth values results in weak logics-where no chaining can be performed and only a set of obvious deductions can be made. For example, modus ponens is not a valid rule of deduc- tion in these logics, so it is not permissible to conclude B from A and A 3 B. However, performing deduction in these logics is easier than in logics built from the intuitive two-valued semantics and the set of valid deductions is still interesting. All the operations of the system will be tractable and its most common operations will be very efficient, so the system will be usable in knowledge-based systems.

The logic of the system is very close to the standard logic described above, modulo the change from two

to four truth values-a change that does have a large impact on the deductive power of the logic. (For a more detailed description of this logic see [27].) The semantic structures of the logic consist of a set of entities plus mappings from classes, roles and objects into their extensions, and the conditions on the extensions of structured classes, roles and objects are the same as in standard logic. The only difference is that extensions are not just sets, but instead are two sets, the positive extension and the negative extension. The former is the set of entities that are known to belong to the class and the latter is the set of entities that are known not to belong to the class. There is no requirement that these two sets be exhaustive or exclusive. Entities belonging to neither are entities for which insufficient information is known to place them either in or not in the classes, and entities belonging to both are entities for which contradictory infor- mation is known concerning their membership in the class.

Because of its basis in this weak logic, the system will not perform all the deductions valid in a standard object-based knowledge representation system. For example, it will not be able to deduce that:

(and person (all child doctor))

subsumes

(and person (all child lawyer) (all (restrict child lawyer) doctor)),

because this deduction (a type of modusponens) is not valid in the logic. However, it will be able to deduce that

(and person (all (restrict child lawyer) doctor))

subsumes

(and person (all child (and doctor lawyer))),

as this is a valid deduction in its underlying logic. The subsumptions that are valid in the system form

a sort of “structural” subsumption, where each piece of one concept has a related piece in the other. This is the sort of subsumption that is performed by KL-ONE and NIKL. For example, (and C, . C,) is subsumed by (and C; . . CL), where each C, and Cl are not conjunctions and in any conjunct of the form (all R D), D is not a conjunction, if and only if for each C; there is some C, such that C, is subsumed by Cl. Also, (atleast n R) is subsumed by (atleast m R’) if and only if n > m and R is subsumed by R’, and (restrict S C) is subsumed by (restrict S’ C’), where S and S’ are conjunctions of atomic roles, if and only if each atomic role in S’ is also in S and C is subsumed by C’. It is possible to determine whether one concept subsumes another in time proportional to the product of their sizes, provided that there are no definitions to be accounted for, indicating that this logic does not suffer from the intractability that plagues terminological logics based on standard two-valued semantics.

Page 9: Practical, object-based knowledge representation for knowledge-based systems

Practical, object-based knowledge representation 17

The system has retreated from determining all subsumptions valid in a standard logic because of the computational problems inherent in this task. Instead, it determines a set of simple subsumptions that derive from a four-valued semantic, thus main- taining a firm representational basis for the system while allowing tractable operation. The fact that this set of subsumptions can be descriptively character- ized (as structural subsumption) and also is ciose to the subsumptions computed by KL-ONE and NIKL are additional indicators that this subsumption relation- ship is useful.

Although basing partial subsumption algorithms on non-standard semantics is promising in the long term, developing such semantics is a compli- cated endeavour. The semantics described here extends the limits of tractability but, since it has not yet been analyzed for logics with the expressive power required for useful object-based knowledge representation systems, tractable, expressive, seman- tically rational logics for object-based knowledge representation systems have not yet been shown to exist.

Another way of providing incomplete subsumption is to just write a sound but incomplete function for determining subsumption. This approach has the advantage of being easy to do; the subsumption functions for KL-ONE, NIKL and LOOM [28] are ah of this form.

There are several severe problems with this ap- proach. First, the function, although incomplete, may turn our to have exponential time complexity, or perhaps even never return in some cases. Second, the function may be hard to describe, except by referring to a large, complicated piece of code. (The subsump- tion functions of KL-ONE and NIKL suffer from this problem.) Third, even if the function can be de- scribed, it may bear very little relationship to the semantics. For example, the algorithm may depend on the order of conjuncts, or on similar information that does not derive from the semantics. If this is the case, then the relationship between the object-based knowledge representation system and its underlying logic is lost, destroying one of the major reasons to use an object-based knowledge representation system.

Nevertheless, this approach appears to have short- term appeal-at least until the semantic approach bears fruit. If care is taken to ensure that the sub- sumption algorithm can be understood and defended on semantic grounds, then the resultant system can be of considerable use.

tSome facilities for attached procedures have been incor- porated in earlier object-based knowledge representation systems, such as KL-ONE. However, the method combi- nation facilities of modern object-oriented programming systems have not previously appeared in semantically- based knowledge representation systems.

3.6. Procedural considerations

A knowledge representation system is more than just a system for representing and retrieving knowl- edge. It exists as part of a larger, procedural system. There must be an effective means of communication between it and the rest of the system.

Object-based knowledge representation systems have several useful avenues of communication. The knowledge stored in an object-based knowledge rep- resentation system can be viewed as a representation- ally rationalized variant of the class and instance data stored in an object-oriented programming system. This view makes it natural to allow the sorts of procedural interaction that are allowed in object- oriented programming systems.

Procedures can be attached to classes and run in response to events in the system. For example, a procedure could be provided that would be executed whenever an object was detemined to be an instance of a particular class. Also, attached procedures or “methods” can be provided by object-based knowl- edge representation systems. These methods could look just like the methods of object-oriented pro- gramming systems.t

None of these procedures will have any special access to the system-they will be able to interact with the ~presentations of objects and classes only via the generally available operations---and so cannot compromise the semantics of the system. In this way the advantages of object-oriented programming sys- tems for supporting large programming systems can be added without destroying the representational basis of the system.

It is also possible to use the object-based knowl- edge representation systems as the representational component of rule-based systems 1291.

The left-hand side of rules, instead of matching against tuples in working memory, can instead be classes in an object-based knowledge representation system and match against individuals in working memory. Because classes can be more general than others, this way of creating rules provides a simple, declarative way of creating general and specific rules, thus reducing the complexity of rule-sets.

4. SUMMARY

Object-oriented programming systems, although they are used in the knowledge representation portion of knowledge-based systems, are not very good for representing knowledge. They suffer from being oper- ationa~~y defined, and thus force users to be con- cerned with implementation details, when they should only have to worry about representational aspects of the knowledge being captured, at least so far as their representational support is concerned. They are also expressively weak, and cannot, without user-provided procedural extensions, represent many sorts of object-based knowledge.

Page 10: Practical, object-based knowledge representation for knowledge-based systems

18 PETER F.PATEL-SCHNEIDER

Object-based knowledge representation systems to a large extent solve these problems, being based on a representational semantics that hides implementation details, and also provide more expressive power. This extra power does come at a price-some of the operations of standard object-based knowledge representation systems are hard to implement correctly and are also computationally intractable or undecidable. This intractability makes it impossible to build such systems that are usable in knowledge- based systems, where answers must be returned in a reasonable amount of time. Practical, expressively powerful object-based knowledge representation systems thus have to be based on partial subsumption algorithms.

One approach to providing partial subsumption is to use a non-standard logic that sanctions a partial but interesting set of deductions that can be efficiently implemented. (The four-valued semantics described here is one possibility for this.) This approach has the benefit of being totally based on a logic-just not a logic with the standard semantics. The other approach is to design a sound but incomplete sub- sumption algorithm that is easy to describe, and easy to work with. Such subsumption algorithms, although they are not totally semantically based, can be useful in providing practical subsumption in the absence of semantically-justified partial subsumption.

Object-based knowledge representation systems can also effectively use the procedural attachment techniques of object-oriented programming systems to provide procedural components for complete sys- tems. Thus they integrate knowledge representation strengths with the programming strengths of object- oriented programming systems.

Acknowledgements-Ron Brachman has been instrumental in the development of this paper-both as a proponent of principled knowledge representation and as a discerning reader of several drafts of the paper and its predecessors. Without his comments and encouragement the paper would not be nearly as good as it now is. Comments from Reid Smith and several anonymous reviewers also helped make the paper more readable and informative.

REFERENCES

[l] A. Goldberg and D. Robson. Small talk-80: The Language and its Implementation. Addison-Wesley, Reading, Mass. (1983).

[2] R. G.-Smith and P. Carando. Structured object programming in STROBE. Research Note SYS-86-26. Schiumbergei-Doll Research (1986).

[3] D. G. Bobrow and M. Stefik. The Loops Manual. Technical Report KB-VLSI-81-13, Knowledge Systems Area, Xerox-Palo Alto Research Centers (1981).

141 D. G. Bobrow. L. G. DeMichiel. R. P. Gabriel. S. _ - Keene, G. Kiczales and D. A. Moon. Common Lisp object system specification. Xerox Palo Alto Research Centers (1988).

[5] P. J. Hayes. In defence of logic. Proceedings of the Fifth International Joint Conference on Arttficial Intelligence, Cambridge, Massachusetts, pp. 559-565. International Joint Committee on Artificial Intelligence (1977).

[6] R. C. Moore. The role of logic in knowledge represen- tation and commonsense reasoning. Proceedings of the Second National Conference on Artificial Intelligence, Pittsburgh, Pennsylvania, pp. 428433. American Association for Artificial Intehigence (1982).

171 A. M. Frisch. Usine model theorv to suecifv AI . - programs. Proceedin& of the Ninth In;erna;ional Joint Conference on Artificial Intelligence, Los Angeles, California, pp. 148-154. International Joint Committee for Artificial Intelligence (1985).

[8] R. J. Brachman, R. E. Fikes and H. J. Levesque. KRYPTON: a functional approach to knowledge rep- resentation. IEEE Comout. 16(10). 67-73 (1983).

[9] P. F. Patel-Schneider. Small can be beautifnl in knowl- edge representation. Proceedings of the IEEE Workshop on Principles of Knowledge-Based Systems, Denver, Colorado, pp. 1 I-16. A revised and extended version is available as AI Technical Report Number 37, Schlum- berger Palo Alto Research (i984).

1101 R. J. Brachman and J. G. Schmolze. An overview of the _ _ KL-ONE knowledge representation system. Cognitive Sci. 9(2), 171-216 (1985).

[ll] G. Robins. The NIKL Manual. The Knowledge Rep- resentation Project, Information Sciences Institute, University of Southern California (1986).

[12] T. S. Kaczmarek, R. Bates and G. Robbins. Recent developments in NIKL. Proceedings of the Fifth National Conference on Artificial Intelligence. Phila- delphia, Pennsylvania, pp. 978-985. American Associ- ation for Artificial Intelligence (1986).

[13] H. B. Enderton. A Mathematical Introduction to Logic. Academic Press, New York (1972).

[14] H. J. Levesque and R. J. Brachman. Expressiveness and tractability in knowledge representation and reasoning. Computl Intell. 3(2), 78-93 (1987).

151 T. Finin and D. Silverman. Interactive classification: a technique for building and maintaining knowledge bases. Proceedings of the IEEE Workshop on Principles of Knowledge-Based Systems, Denver, Colorado, pp. 107-I 14. IEEE Computer Society (1984).

161 P. F. Patel-Schneider, R. J. Brachman and H. J. Levesque. ARGON: knowledge representation meets information retrieval. Proceedings of The First Con- ference on Artificial Intelligence Applications, Denver, Colorado, pp. 280-286. IEEE Computer Society (1984).

[17] J. G. Schmolze and D. J. Israel. KL-ONE: seman- tics and classification. Technical Report 5421, BBN Laboratories (1983).

[18] B. Nebel. Computational complexity of terminological reasoning in BACK. Artificial Intell. 34(3), 371-383 (1988).

[19] P. F. Patel-Schneider. Undecidability of subsumption in NIKL. Artificial Intell. 39(2), 263-272 (1989).

[20] M. Schmidt-Schauss. Subsumption in KL-ONE is undecidable. Proceedings of the First International Conference on Principles of Knowledge Representation and Reasoning, DD. 421431. Morgan Kaufmann. San

1211

1221

1231

_ __ Mateo, Calif. (1989). H. J. Levesque and R. J. Brachman. A fundamental tradeoff in knowledge representation and reasoning (revised version). Readings in Knowledge Representation (Edited by R. J. Brachman and H. J. Levesque), pp. 42-70. Morgan Kaufmann, San Mateo, Calif. (1985). N. D. Belnap Jr. How a computer should think. Contemporary Aspects of Philosophy: Proceedings of the Oxford International Symposium, pp. 3&56 (1975). H. J. Levesque. A logic of implicit and explicit belief. Proceedings of the Fourth National Conference on Artificial Intelligence, Austin, Texas, pp. 198-202. American Association for Artificial Intelligence (1984).

Page 11: Practical, object-based knowledge representation for knowledge-based systems

Practical, object-based knowledge representation 19

[24] P. F. Patel-Schneider. A hybrid, decidable, logic-based terminological logics. Arrificiul Inlell. 38(3), 3 19-35 1 knowledge representation system. Corn@ Intell. 3(2), (1989). 6477 (1987). [28] R. M. MacGregor and R. Bates. The Loom knowledge

[25] A. M. Frisch. Inference without chaining. Proceedings representation language. Technical Report ISI/RS-87- of the Tenth International Joint Conference on Artificial 188, Information Sciences Institute, University of Intelligence, Milan, Italy, pp. 515-519. International Southern California (1987). Joint Committee on Artificial Intelligence (1987). [29] J. Yen, R. Neches and R. MacGregor. Classification-

[26] P. F. Pate]-Schneider. A decidable first-order logic based programming: a deep integration of frames and for knowledge representation. J. Automaf. Reasoning. rules. Technical Report ISI/RR-88-213, Information To appear (1990). Sciences Institute, University of Southern California

[27] P. F. Patel-Schneider. A four-valued semantics for (1988).