foundations of computational agents
The third edition of Artificial Intelligence: foundations of computational agents, Cambridge University Press, 2023 is now available (including full text).
Given a logical representation language, such as the one developed in the previous chapter, and a world to reason about, the people designing knowledge bases have to choose which individuals and relations to represent. It may seem that they can just refer to the individuals and relations that exist in the world. However, the world does not determine which individuals there are. How the world is divided into individuals is invented by whomever is modeling the world. The modeler divides up the world up into things so that the agent can refer to parts of the world that make sense for the task at hand.
It may seem as though “” is a reasonable property to ascribe to things in the world. You may do this because you want to tell the delivery robot to go and get the red parcel. In the world, there are surfaces absorbing some frequencies and reflecting other frequencies of light. Some user may have decided that, for some application, some particular set of reflectance properties should be called . Some other modeler of the domain might decide on another mapping of the spectrum and use the terms , , , and , and yet another modeler may divide the spectrum into regions that do not correspond to words in any language but are those regions most useful to distinguish different categories of individuals.
Just as modelers choose which individuals to represent, they also choose which relations to use. There are, however, some guiding principles that are useful for choosing relations and individuals. These will be demonstrated through a sequence of examples.
Suppose you decide that “red” is an appropriate category for classifying individuals. You could treat the name as a unary relation and write that parcel is red:
If you represent the color information in this way, then you can easily ask what is red:
The returned are the red individuals.
With this representation, it is hard to ask the question, “What color is parcel ?” In the syntax of definite clauses, you cannot ask
because, in languages based on first-order logic, predicate names cannot be variables. In second-order or higher-order logic, this would return any property of , not just its color.
There are alternative representations that allow you to ask about the color of parcel . There is nothing in the world that forces you to make a predicate. You could just as easily say that colors are individuals too, and you could use the constant to denote the color red. Given that is a constant, you can use the predicate where means that physical individual has color . “Parcel is red” can now be written as
What you have done is reconceive the world: the world now consists of colors as individuals that you can name, as well as parcels. There is now a new binary relation between physical individuals and colors. Under this new representation you can ask, “What color red?” with the query
and ask “What color is block ?” with the query
To make an abstract concept into an object is to reify it. In the preceding example, we reified the color .
It seems as though there is no disadvantage to the new representation of colors in the previous example. Everything that could be done before can be done now. It is not much more difficult to write than , but you can now ask about the color of things. So the question arises of whether you can do this to every relation, and what do you end up with?
You can do a similar analysis for the predicate as for the predicate in Example 14.3. The representation with as a predicate does not allow you to ask the question, “Which property of parcel has value ?” where the appropriate answer is “color.” Carrying out a similar transformation to that of Example 14.3, you can view properties such as as individuals, and you can invent a relation and write “individual has the of ” as
This representation allows for all of the queries of this and the previous example. You do not have to do this again, because you can write all relations in terms of the relation.
The individual–property–value representation is in terms of a single relation where
means that individual has value for property . This is also called the triple representation because all of the relations are represented as triples. The first element of the triple is called the subject, the second is the verb, and the third is the object, using the analogy that a triple is a simple three word sentence.
Sometimes we will write a triple as a simple three word sentence:
meaning the atom
or in functional notation as
The verb of a triple is a property. The domain of property is the set of individuals that can appear as the subject of a triple when is the verb. The range of a property is the set of values that can appear as the object of a triple that has as the verb.
An attribute is a property–value pair. For example, an attribute of a parcel may be that its color is red.
There are some predicates that may seem to be too simple for the triple representation:
To transform , which means that is a parcel, there do not seem to be appropriate properties or values. There are two ways to transform this into the triple representation.
The first is to reify the concept parcel and to say that is a parcel:
Here is a special property that relates an individual to a class. The constant denotes the class that is the set of all, real or potential, things that are parcels. This triple specifies that the individual is in the class , or more simply as the triple “a is_a parcel”. Type is often written as is_a.
The second is to make parcel a property and write “ is a parcel” as
In this representation, is a Boolean property which is true of things that are parcels.
A Boolean property is a property whose range is , , where and are constant symbols in the language.
On the other hand, some predicates may seem to be too complicated for the triple representation:
Suppose you want to represent the relation
which is to mean that section of course is scheduled to start at time in room . For example, “section of course is scheduled to start at 10:30 in room ” is written as
To represent this in the triple representation, you can invent a new individual, a booking. Thus, the relationship is reified into a booking individual.
A booking has a number of properties, namely a course, a section, a start time, and a room. To represent “section of course is scheduled at 10:30 in room ,” you name the booking, say, the constant , and write
This new representation has a number of advantages. The most important is that it is modular; which values go with which properties can easily be seen. It is easy to add new properties such as the instructor or the duration. With the new representation, it is easy to add that “Fran is teaching section of course , scheduled at 10:30 in room ” or that the duration is 50 minutes:
With as a predicate, it was very difficult to add the instructor or duration because it required adding extra arguments to every instance of the predicate.