I. Mixing knowledge representations Large, robust AI systems typically don't rely on just one approach to knowledge representation. We see this in the example we began in the last lecture -- that of trying to understand a simple story in English. This problem can be decomposed into at least three distinct problems (there are plenty more, but we'll leave it at three for our purposes), each of which benefits from a different knowledge representation approach. Ultimately, the goal in language understanding is to derive the meaning, both explicit and implicit, contained in a given text. Often the first big step in such an endeavour is to find the grammatical structure of the individual sentences. Knowing the structure of the sentence (and there may be many different structures possible) helps constrain the search for meaning of a that sentence. The process of decomposing a sentence into its structural constituents is called parsing, and a program that does so is a parser. In our example, we represented simple knowledge about the structure of sentences as a collection of rules written in CILOG. Combined with CILOG's built-in reasoning system, we have a simple example of a parser. This example was adapted from Chapter 3.7 in your textbook. The code is still a bit buggy; I haven't fixed it as I said I should, but you can still get some sense of how things work. It does run however, and you might want to play with it a bit. This example also introduces the use of function symbols which were explained in Chapter 2.8, so you might want to read that soon. Then we introduced the notion of the relational or semantic network as a means of representing the meanings of individual words. II. Welcome to the relational network We've been looking at tree-like data structures a lot lately, and by now you're probably wondering what is the big fascination with these things. The reason we get all tingly about trees, or any sort of hierarchical data structure, is that they're great ways to organize knowledge. Traditional linear structures, like files with lots of records, or even to some extent simple linear linked lists like those we've been using in this class, make it difficult to represent the wide variety of relationships which exist between entities in the world. Trees get us a step closer to representing the complexities of relationships between things in the real world because they get us closer to that notion of a relational network mentioned above. Usually when we're building AI systems, we're really trying to build models of some aspect of the real world, and structures like trees help us make more useful models. Yet trees are a bit constraining in the kinds of relationships they permit between objects; a more general representation is the network. A network is a labelled directed graph. That is, it has nodes and arcs (or links), the links are both directed and labelled, and there's no prohibition against cycles. We can represent hierarchies in networks, but more often we represent "tangled hierarchies". III. Networks in the dictionary We see hierarchical organizations in the real world all the time. They may not be "pure" hierarchies, but they're hierarchical in spirit at least. It might be easier to think of these things as "networks" instead of hierarchies. Take for example the common dictionary. At first glance, it looks like a very linear organization of the words in our language. But what a dictionary really specifies is a very complex and somewhat hierarchical map of the relationships between the words in our language. Here are some sample definitions: dog: any of a large and varied group of domesticated animals related to the fox, wolf, and jackal chihuahua: any of an ancient Mexican breed of very small dog with large, pointed ears bird: any of a class of warm-blooded, two-legged, egg-laying vertebrates with feathers and wings penguin: any of an order of flight-less birds found in the Southern Hemisphere, having webbed feet and paddle-like flippers for swimming and diving ostrich: a large, swift-running bird of Africa and the Near East; the largest and most powerful of living birds; it has a long neck, long legs, two toes on each foot, and small useless wings canary: a small yellow songbird of the finch family, native to the Canary Islands Notice that these definitions all relate the thing being defined to some larger class of things, and then goes on to try to distinguish that thing from other similar things. Note also that as the things being described stray further and further from what we might think of as being norms or stereotypes, the definitions get longer and more detailed. For example, compare the canary (a stereotypical bird) to an ostrich (an extremely non-stereotypical bird). When we take the time to look at the dictionary in this way, we uncover what is essentially a bunch of pointers from one word to others. Because I'm trying to prove a point here, I've focused on the animal kingdom, knowing that zoologists spend a lot of time building these "taxonomies", or hierarchies of what is related to what. But it works for things other than animals: chair: a piece of furniture for one person to sit on, having a back and, usually, four legs. And so on. You can look up more if you like. Try "couch", "sofa", "table", "ottoman", and whatever. No matter what noun you look up, you'll find the same sort of pattern: relate this word to a larger class of things, then describe some features to distinguish this thing from similar sorts of things. The dictionary writers don't always help as much as we might like, however: rock: a large mass of stone stone: the hard, solid, nonmetallic mineral matter that rock is composed of Except for the extra bit of information that stone is mineral matter, all we know here is that rock is made of stone, and stone is what makes up rock. Sigh. In any case, we can use our high-level data abstraction, the directed graph, to make these relationships a bit more visual. For example, from the bird definitions, we can construct the following abstraction: vertebrate ^ | is-a | | has-part | /------------- wings | / reproduction | /--------------- egg-laying | / body-temp | /----------------- warm-blooded bird--<< no. of legs ^ ^ ^ \----------------- 2 / | \ \ covering is-a / | \ \--------------- feathers / | \ \ movement color / | \ \------------- flight yellow ------canary | \ size / | is-a \ is-a small -----/ | \ movement | ostrich---------- run movement | \ size swim ----------penguin \--------- big OK, so I fudged this a little. I had to infer that the fact that birds have wings means that they move around by flying; the dictionary writers didn't tell us that. And I had to infer that the fact that birds were egg-laying told us something about their reproductive processes, and so on. But you get the idea, no? IV. Networks in your head These sorts of knowledge hierarchies show up elsewhere. Independent of this dictionary organization, psychologists in the 1960s theorized that humans organize at least some of what they know in a similar hierarchical fashion. For example, they said, a person's knowledge of things in the world might be organized along these lines: all things / \ / \ / \ / \ physical objects abstract objects / \ / \ / \ / \ / \ time thought / \ inanimate animate objects objects / \ / \ / \ / \ / \ / \ inorganics plants mammals birds / \ / \ / \ / \ / \ / \ rock car dog human canary ostrich note: assume that all links point upward This hierarchy is by no means complete, nor is it exactly what the psychologists, Collins and Quillian, had proposed, but it's sufficient for our purposes. If we think of all the upward links as being relationships of the form, "the thing below is a subtype of the thing above," then we have something called a "type hierarchy". And in fact, we could put the label "subtype" or "subclass" on all those upward links, to indicate that the thing below is a "S"ubtype or "S"ubclass of the thing above. Folks in the AI world don't use the "subclass" or "subtype" terminology very much; instead, AI folks use the label "is-a" in hierarchies like this, as in "a canary is-a bird". So these hierarchies can also be called "is-a hierarchies". Note that we went ahead and used that "is-a" label in the first diagram above. In any case, Collins and Quillian backed up their theory with experiments based on this premise: If people really store knowledge in hierarchical form, then if they're asked the right questions, we should note significant differences in the time it takes those people to respond correctly. For example, the time to answer "yes" to "Is a canary a bird?" should be less than the time to answer "yes" to "Is a canary an animate object?" The experiments did in fact generate the right numbers, and for awhile everyone thought the question of how human memory is organized had been answered. But other experimenters had difficulty replicating these results, so there was some controversy about just how Collins and Quillian obtained their results. Nevertheless, hierarchical models of human memory are still very popular, although they are somewhat different in their organization than the one we've just looked at. V. Why do the arrows point up? Well now, that's an interesting question, no? The reason, at least from either a psychological or AI point of view, is that humans typically are better at answering questions like "Is a dog a mammal?" than questions like "Name all the mammals you know." In other words, people are better at recognition than recall or retrieval. The upward arrows in our diagrams suggest that it would be easier to start at the "dog" node and traverse the link up to the "mammal" node to answer "Is a dog a mammal?", than it would be to start at the "mammal" node and try to traverse all the downward links in an effort to enumerate all the different types of mammals. VI. Networks and relational databases Everything we've shown you so far has been purely tree-like in form, but as we've said, that's clearly not necessarily going to be true. In fact, it's much more likely that the organization in these structures will be much more convoluted. Consider some of the relationships which may exist in a small company that makes cough drops: Smith options Brothers ---------- pay plans |\ / \ | \ / \ | \ salaried hourly | \ / \ / \ dept.| ---- / $800/mo / $2.00/hr | \ / | pay / ---- /pay | plan/ \ /plan | / dept.\ / | / \/ manufacturing shipping / \ / \ / \ / \ / \ / \ Arnie Brian Chuck David Smith Smith Smith Smith \ \ pay \ $2.50/hr In an ordinary database (often called a "flat-file" database) where all the information about an employee is contained with that employee's record, changing the pay rate for all the salaried employees for example requires a change to every salaried employee's record. In this database, changing every salaried pay rate from $800 per month to $825 per month requires only one change. Anyway, welcome to the exciting world of relational databases. Relational database work is something that evolved from artificial intelligence ideas about how to organize knowledge (although you'll never get a relational database person to admit this), which in turn evolved from ideas in cognitive psychology. VII. The whole world is one big graph Geographically speaking, that's true. Take a look at http://www.mapquest.com sometime and find a route between two cities in the United States, say Atlanta and Los Angeles. Now think about how Mapquest might find that route. Here's a hint: look at a detailed highway map of the U.S....hmm, looks like a network of cities and towns connected by roads, doesn't it? And, you may have heard about the idea called "Six Degrees of Separation"---that is, the idea that each of us is somehow connected to everyone else on the planet by a distance of no more than six personal or professional relationships. That this notion might possibly be true suggests that, at least on a relationship level, we can model the world's population as a very very large directed graph, and that we could find a specific connection between any two people by performing some sort of search on that graph. That very principle is embodied in the automated version of the once popular game called "Six Degrees of Kevin Bacon" in which the premise is that everyone in the film industry has no more than six degrees of separation between them. You can try it out on the World Wide Web at http://www.cs.virginia.edu/oracle and while we're at it, the Web itself is just another relational network structure...from a given Web site you can link to a bunch of others, so you choose one, and from there you can link to a bunch of others or go back, and so on. (If you eliminate the commercial stuff, what's left on the Web seems to be an interconnected network of narcissistic memorials that people erect in honor of themselves...but I digress.)
Last revised: December 7, 2004