foundations of computational agents
Typically, you know more about a domain than a database of facts; you know general rules from which other facts can be derived. Which facts are explicitly given and which are derived is a choice to be made when designing and building a knowledge base.
Primitive knowledge is knowledge that is specifies explicitly in terms of facts. Derived knowledge is knowledge that can be inferred from other knowledge. Derived knowledge is typically specified using rules.
The use of rules allows for a more compact representation of knowledge. Derived relations allow for conclusions to be drawn from observations of the domain. This is important because you do not directly observe everything about a domain. Much of what is known about a domain is inferred from the observations and more general knowledge.
A standard way to use derived knowledge is to put individuals into classes, and then give general properties to classes so that individuals inherit the properties of classes. Grouping individuals into classes enables a more concise representation because the members of a class can share the attributes they have in common (see the box). This is the same issue that was discussed in the context of probabilistic classifiers.
A class is the set of those actual and potential individuals that would be members of the class. This is typically an intensional set, defined by a characteristic function that is true of members of the set and false of other individuals. The alternative to an intensional set is an extensional set, which is defined by listing its elements.
For example, the class is the set of all things that would be chairs. We do not want the definition to be the set of things that are chairs, because chairs that have not yet been built also fall into the class of chairs. We do not want two classes to be equivalent just because they have the same members. For example, the class of green unicorns and the class of chairs that are exactly 124 meters high are different classes, even though they may contain the same elements; they are both empty. A 124 meter high chair would not be a green unicorn.
The definition of class allows any set that can be described to be a class. For example, the set consisting of the number 17, the Tower of London, and the Prime Minister of Canada’s left foot may be a class, but it is not very useful. A natural kind is a class such that describing individuals using the class is more succinct than describing individuals without the class. For example, “mammal” is a natural kind, because describing the common attributes of mammals makes a knowledge base that uses “mammal” more succinct than one that does not use “mammal” and instead repeats the attributes for every individual.
Class is a subclass of class means that is a subset of . That is, every individual of type is of type .
Example 14.7 explicitly specified that the logo for computer was a lemon icon. You may, however, know that all Lemon brand computers have this logo. An alternative representation is to associate the logo with and derive the logo of . The advantage of this representation is that if you find another Lemon brand computer, you can infer its logo. Similarly each Lemon Laptop 10000 may weigh 1.1 kg.
An extended example is shown in Figure 14.2, where the shaded rectangles are classes, and arcs from classes are not the properties of the class but properties of the members of the class. The class of Lemon laptop 10000s would weigh much more than 1.1 kg.
The relationship between types and subclasses can be written as a definite clause:
You can treat and as special properties that allow property inheritance. Property inheritance occurs when a value for a property is specified at the class level and inherited by the members of the class. If all members of class have value for property , this can be written in Datalog as
which, together with the aforementioned rule that relates types and subclasses, can be used for property inheritance.
All Lemon computers have a lemon icon as a logo and have color yellow and color green (see the and arcs in Figure 14.2). All Lemon laptops 10000 have a weight of 1.1 kg. Lemon laptop 10000 is a subclass of Lemon computers. Computer is a Lemon laptop 10000. This knowledge can be represented by the following Datalog program:
From this Datalog program, and the clause involving above, the logo, colors and weight of can be derived. With the structured representation, to incorporate a new Lemon Laptop 10000, you only declare that it is a Lemon laptop 10000 and the colors, logo and weight can be derived through inheritance.
Some general guidelines are useful for deciding what should be primitive and what should be derived:
When associating an attribute with an individual, select the most general class that the individual is in, where all members of have that attribute, and associate the attribute with class . Inheritance can be used to derive the attribute for the individual and all other members of class . This representation methodology tends to make knowledge bases more concise, and it means that it is easier to incorporate new individuals because members of automatically inherit the attribute.
Do not associate a contingent attribute of a class with the class. A contingent attribute is one whose value changes when circumstances change. For example, it may be true of the current computer environment that all of the computers come in cardboard boxes. However, it may not be a good idea to put that as an attribute of the class, because it would not be expected to be true as other computers are bought.