# 3. Reasoning: Goal Trees and Rule-Based Expert Systems

**Channel:** MIT OpenCourseWare
**Source:** https://www.youtube.com/watch?v=leXa7EKUPFk
**Transcript page:** https://www.withtranscript.ai/video/leXa7EKUPFk

## Chapters

- 0:09 — Chapter 1 (0:09)
- 3:07 — Chapter 2 (3:07)
- 3:39 — Chapter 3 (3:39)
- 4:15 — Chapter 4 (4:15)
- 5:41 — Chapter 5 (5:41)
- 7:50 — Chapter 6 (7:50)
- 8:54 — Chapter 7 (8:54)
- 10:25 — Chapter 8 (10:25)
- 11:03 — Chapter 9 (11:03)
- 11:32 — Chapter 10 (11:32)
- 12:26 — Chapter 11 (12:26)
- 15:15 — Chapter 12 (15:15)
- 17:39 — Chapter 13 (17:39)
- 20:34 — Chapter 14 (20:34)
- 21:04 — Chapter 15 (21:04)
- 22:03 — Chapter 16 (22:03)
- 23:05 — Chapter 17 (23:05)
- 24:26 — Chapter 18 (24:26)
- 25:34 — Chapter 19 (25:34)
- 30:09 — Chapter 20 (30:09)
- 38:57 — Chapter 21 (38:57)
- 41:36 — Chapter 22 (41:36)
- 43:57 — Chapter 23 (43:57)
- 45:23 — Chapter 24 (45:23)
- 48:19 — Chapter 25 (48:19)

## Transcript

**[0:09]:** Ladies and gentlemen, the engineers drinking song. Back in the day I've drunk quite a lot to that song and as drinking songs go it's not bad. I caution you however before playing this song if in the presence of small children audition it first. Some of the some of the verses are sufficiently gross as to make a sailor go beyond blushing. It's an interesting song because there are an infinite number of verses. Here's the mathematical proof. Suppose there were a finite number of verses. Then there would be a last verse. And if there were a last verse then some drunk alumni would compose a new one. Therefore there is no last verse, the size is not finite and there are an infinite number of verses. I play it for you today because I'm an engineer. I I like to build stuff. I build stuff out of wood, I build stuff out of metal, I build stuff out of rocks and I especially like to write programs.

**[1:16]:** I don't know, sometimes uh people come to me and say I'm majoring in computer science but I don't like to write programs. I've always been mystified by that. I mean if you want to show how tough you are you can go bungee jumping or drive a nail through your hand or something like that instead. But I've written quite a few programs for demonstrating stuff in um in this subject. Uh they're all written in Java principally because um I can therefore make them available to you and to the rest of the world by way of WebStart. A few weeks ago I was monkeying around with the system and broke the version on the server and within 15 minutes I got an email from somebody in the depths of Anatolia complaining about it and asking me to bring it back up.

**[2:07]:** This particular program is uh patterned after an early AI classic. And it was the uh business end of a program written by Terry Winograd who became and is a professor uh of um computer science at Stanford University. Uh which is on the West Coast for those uh on the on the on the strength of his his work on the natural language front end of this program. But uh the natural language part is not what uh makes it of interest to it interest for us today. It's more the um other kinds of stuff. Let's pile these things up. Now I'm going to ask to do something maybe put um put B2 on top of B7.

**[3:07]:** Not bad. How about B6 on B3?

**[3:18]:** This program's kind of clever.

**[3:24]:** Um let me do it one more. Let's put B7 on B2.

**[3:39]:** Okay, now let's see maybe um B5 on B2.

**[3:45]:** Well, B4 on B3 first maybe.

**[3:52]:** Oh, I must have clicked the wrong button. No, there it goes. Okay, let's put it up. Let's put B4 on B1. Ah. My mouse keeps getting out of control.

**[4:15]:** Now let's put B1 on B2. This is an example I'm actually going to work out on the board. So Oh, I see. My touchpad accidentally got activated. B1 on B2.

**[4:44]:** Now let's ask a question.

**[4:57]:** Okay. Cool. Okay, stop.

**[5:06]:** Yeah. I've had enough of that. Let's see uh why did you put why did you want to get rid of B4? Okay, one of the two of them.

**[5:29]:** Thank you. Thank you.

**[5:33]:** It's what happens when you use software you write yourself.

**[5:41]:** Why did you want to clear the top of B2? Did I do that? Uh why did you clear the top of B1? Okay.

**[6:06]:** Well, it's haunting me. Yeah, it's it's it the the drinking song is easily offended I guess.

**[6:29]:** But I won't I won't develop that scenario again. What I wanted to show you is that this program looks like it's kind of smart and it somehow can answer questions about its own behavior. You ever written a program that's answered questions about its own behavior? Probably not. Would you would you like to learn how to do that? Okay. So by the end of the hour you'll be able to write this program and many more like it that know how to answer questions about their own behavior. There've been tens of thousands of such programs written but only by people who know the stuff I'm going to tell you about right now. Okay? So what I want to do is I want to start by taking this program apart on the board and talking to you about the modules, the subroutines that it contains. So here it is.

**[7:17]:** The first thing we need to think about here are some blocks. What hap- what has to happen if I'm going to put the bottom block on the larger block? Well, first of all I have to find space for it. Then I have to grasp the lower block, then I have to move it, then I have to ungrasp it. So those are four things I need to do in order to achieve what I want to do. So therefore I know that the put on method

**[7:50]:** has four pieces. It has to find space on the target block. It has to grasp the block that has been commanded to move. Then it has to move. And then it has to ungrasp.

**[8:15]:** But taking hints from some of the questions that it did answer before I got haunted by the music taking our cue from that, we know that in order to grasp something in this particular world you can't have anything on top of it. So grasp therefore may call clear top

**[8:36]:** in order to get stuff off uh from the target object. And that um may happen in an iterative loop because there may be several things on top. And how do you get rid of stuff? Well, by calling get rid of.

**[8:54]:** And that may go around the loop several times. And then the way you get rid of stuff is by calling put on. So that gives us recursion and it's from the recursion that we get a lot of the apparent complexity of the program's behavior when it solves a problem. Now in order to find space you also have to call get rid of. So that's where I meant to put this other iterative loop not down here. Clear top has got the iterative loop inside of it. So that's the structure of the program. It's extremely simple. And you might say to me, well, how can you get such apparently complex looking behavior out of such a simple program? A legitimate question. But before we tackle that one head on I'd like to do a simulation of this program on a very simple blocks problem.

**[9:48]:** And it's the one I almost showed you but it goes like this. Here's B1. We'll call this BX because I forgot its name. Here's BY. And here's B2. And the task is to put

**[10:08]:** B1 on B2. And according to our system diagram, that results in four calls to subroutines. We have to find space.

**[10:25]:** We have to grasp B1.

**[10:34]:** We have to move. And then we ungrasp.

**[10:44]:** Now, the way we grasp something is the first thing we have to do is clear off its top.

**[11:03]:** So, grasp calls clear top.

**[11:08]:** And clear top in turn calls get rid of.

**[11:18]:** And let me see, let me keep track of these. This is clearing the top of B2 uh B1. And this is getting rid of BX. And the way we get rid of BX is by putting

**[11:32]:** BX on the table.

**[11:38]:** And then that in turn call causes calls to another find space, another grasp, another move, and another ungrasp. So, that's a little trace of the program as it works on this simple problem. So, how does it go about about answering the questions that I demonstrated to you a moment ago? It must do that by using this trace. So, how for example does it answer the question why did you get rid of BX?

**[12:17]:** Manasa, what do you think? How can it answer that question?

**[12:26]:** So, it it goes up one level and reports what it sees. So, it says and said in the demonstration I got rid of BX because I was trying to clear the top of B1. So, if I were to say why did you clear the top of B1 it would say because I was trying to grasp it. If I were to say why did you grasp B1 it would say because I was putting B1 on B2. If I say why did you put B1 on B2 it would say slavishly because you told me to. Okay, so that's how it deals with with why questions. How about how questions? Timothy, what do you think about that one? How would it go about answering a question about how you did something? Do you have a thought? Um yeah, I would think about what I was trying to accomplish.

**[13:21]:** Yeah, but how would it do that? How would the program do that? We know that answering why question makes it go up one level. How does it answer how question? Sebastian? It go down one level. So, you start start off all the way up here with the put on it will say oh, well, I did these four things. You say why did you grasp B1? It will say because I was trying to clear its top. Why did you clear its top? Because I was trying to get rid of it. Why were you trying to get rid of it? Because I was trying to put it on the table. So, that's how it answers how questions. By going down in this tree in this trace of program action so as to see how things are put together. What are these things that are being put together?

**[14:07]:** What's the word I've been avoiding so as to bring it this to a crescendo? What are What are these objectives? These things it wants to do, they're goals. So, this thing is leaving a trace which is a goal tree. How does that sound familiar? Uh 3 days ago we talked about goal trees in connection with uh integration. So, this thing is building a goal tree, also known as an AND/OR tree. So, this must be an AND tree. And if this is an AND tree, are there any AND nodes? Sure, there's one right there.

**[14:48]:** So, do you think then that you can answer questions about your own behavior as long as you build an AND/OR tree? Sure. Does this mean that the integration program can answer questions about its own behavior? Sure. Because they both build goal trees, and whenever you got a goal tree you can answer certain kinds of questions about your own behavior.

**[15:15]:** So, let me see uh if in fact that's if it really does build itself a um a goal tree as it solves problems. So, this time we'll put B6 on B3. This time

**[15:35]:** we'll watch it develop its goal tree.

**[15:42]:** So, in contrast to the simple example I was working on the board this gets to be a pretty complicated goal tree. But I can still answer questions about behavior. For example, I could say why did you put B6 on B3? Cuz you told me to. All right? So, the complexity of the behavior is largely a consequence not of the complexity of the program in this particular case, but the building of this giant goal tree is a consequence of the complexity of the problem. And this brings us to one of our uh brings us rather early on to one of the goal star ideas of today. And this goal star idea goes back to a lecture given in the late '60s by Herb Simon, who was the first Nobel laureate in the pseudo Nobel Prize for economics. Is that right, Bob? Was he the first? No, he was the first winner of the Nobel Prize pseudo Nobel Prize in economics.

**[16:42]:** And in this uh lecture, which was titled Sciences of the Artificial he said imagine that you're looking on a beach at the path of an ant. And he said, well, you know, the path of the ant looks extremely complicated and you're tempted to think the ant is some kind of uh of genius or or uh master brain ant, but in fact when you take a closer look what you discover is that there are a bunch of pebbles on the beach and all the ant is doing is avoiding those pebbles on its way home. So, the complexity of the behavior said Simon is a consequence of the complexity of the environment, not the complexity of the program. So, that's the metaphor of Simon's ant. And what it what it says is that the complexity of the behavior

**[17:39]:** is the max of the complexity of the program

**[17:48]:** and the complexity of the environment.

**[17:58]:** So, that's something we'll see uh over many times during the rest of the semester. Complex behavior, simple program. You think it's going to be complicated, turns out to be simple because the problem is the has the complexity not the not the program. So, that brings us to uh checkbox three in today's talk and there's a little bit of a seam here because now I want to stop talking about goal-centered programming and start talking about rule-based expert systems. The rule-based expert systems were developed in a burst of um enthusiasm about the prospects for commercial applications of artificial intelligence uh in the mid-1980s.

**[18:45]:** And at that time it was supposed lengthy articles were written that you could account for useful aspects of human intelligence by writing all the knowledge in the form of simple rules. So, if this is true then that's true. If you want to achieve this, then do that. But all the knowledge had to be encapsulated in the form of simple rules. So, what might you want to do with this? All sorts of things. Thousands of these systems were written as I indicated before. Uh but here's an example I'm going to work out an example having to do with identification. And this uh this example is patterned off of a classic program strangely also written at Stanford called MYCIN. It was developed to diagnose bacterial infections of the blood. So, you come in, you got some horrible disease and the doctor gets curious about what antibiotic would be perfect for your disease and starts asking you a lot of questions.

**[19:49]:** So, I'm not go deal with that because that world has all kinds of unpronounceable terms like Bacteroides and uh anaerobic and stuff like that. So, it's completely analogous to talk about identifying animals in a little zoo. Sort of a small town type of zoo. So, I'm going to suggest that we write down on a piece of paper all the things we can observe about an animal and then we'll try to figure out what what the animal is. So, I don't know what what can we start with? Um has hair.

**[20:34]:** And there are some characteristics uh of the following form. Has claws.

**[20:45]:** Sharp teeth.

**[20:53]:** And uh forward-pointing eyes.

**[21:04]:** And these are all characteristics of carnivores. Uh we happen to have forward-pointing eyes, too, but that's more because we used to swing around in trees a lot and we needed the stereo vision. And we don't have the the claws and the sharp teeth to go with it. But anyhow, those are typically characteristics of uh carnivores as is eating meat.

**[21:28]:** And this particular little animal we're looking at uh is also got spots. And it's very fast.

**[21:40]:** What is it? Oh, well, everybody says it's a cheetah. Let's see how our program would figure that out. Well, our program might say, uh let's see, if it has hair then rule one says that that means it must be a mammal.

**[22:03]:** We can imagine another rule that says, if you have sharp claws uh sharp teeth and forward-pointing eyes, then you're a carnivore. And I'm using sort of hardware notation here. That's an AND gate, right? So, that means that we have to have all of these characteristics before we will conclude that the animal is a carnivore.

**[22:32]:** Now, this animal has been also observed to eat meat. So, that means we've got extra evidence that the animal is carnivorous. And now because the animal is a mammal

**[22:49]:** and a carnivore and it has spots and it's very fast then the animal is a cheetah.

**[23:05]:** And I hope all of our African students agree that that must be a cheetah. If it's a small zoo, I mean, if it's a big zoo, who knows what it is. It's probably got some unpronounceable name or other there's possibilities. But for our small zoo, that will do. So, we have now written down in the form of these AND gates several rules, R1 R2 and there needs to be an AND gate here. That's R3 and an R4. All of which are indicated all of which indicate that this animal is a cheetah. So, we built ourselves a little rule-based expert system that can recognize exactly one animal, but you can imagine filling out filling out this system with other rules so as you could recognize giraffes and penguins and all the other sorts of things you'd find in a small zoo.

**[23:55]:** So, when you have a system like this that works as I've indicated then what we're going to call that we're going to give that a special name and we're going to call that a forward

**[24:11]:** chaining

**[24:15]:** rule-based because it uses rules.

**[24:26]:** Expert

**[24:30]:** system.

**[24:34]:** And we're going to put expert in parentheses because when these things were developed for marketing reasons, they called them expert systems instead of novice systems. But are they really experts in the human sense? Not really because they have these knee-jerk rules. They're not equipped with anything you might want to call common sense. They don't have an ability to deal with previous cases like we do when we go to medical school. So, they really ought to be called rule-based novice systems because they reason like novices on the basis of rules. But the tradition is to call them rule-based expert systems. And this one works forward from the facts we give it to the conclusion off on the right. That's why it's a forward chaining system. Okay? Can this system answer questions about its own behavior?

**[25:34]:** Why is there what do you think? Why?

**[25:41]:** Because it looks like a goal tree. All right. This is in fact building a goal tree. Because each of these rules that require several things to be true is creating an AND node. And each of these situations here where you have multiple reasons for believing a thing is a carnivore, that's creating an OR node. And we already know that you can answer questions about your own behavior if you leave behind a trace of a goal tree. So, look at this. If I say to it

**[26:19]:** "Why were you interested in the animal's claws?" "Because I was trying to see if it was a carnivore." "How did you know that the animal is a mammal?" "Because it has hair." "Why did you think it was a cheetah?" "Because it's a mammal, a carnivore, has spots, and very fast." So, by working forward and backward in this this goal tree, this too can answer questions about its own behavior. So, now you know how going forward you can write programs that answer questions about their behavior. Either you write the subroutine so that each one is wrapped around a goal so you've got goal-centered programming or you build a so-called expert system using rules in which case it's easy to make it leave behind a trace of a goal tree which makes it possible to answer questions about its own behavior just as this Blocks World program did.

**[27:12]:** But now a little more vocabulary. Uh I'm going to save time by erasing all of these things that I previously drew by way of connections.

**[27:26]:** And I'm going to approach this zoo in a little different way. I'm going to not ask any questions about the animal. Instead, I'm going to say "Mommy, is this thing I'm looking at a cheetah?" And how would Mommy go about figuring it out? In her head she would say, "Well, I don't know. If it's going to be a cheetah then it must be the case that it's a carnivore and it must be the case that it has spots and it must be the case that it's very fast." So, so far what we've established is that if it's going to be a cheetah, it has to have the four characteristics that Mommy finds behind this rule R4. So, instead of working forward from facts what I'm going to do is work backward from a hypothesis. So, here the hypothesis is, this thing is a cheetah. Uh how do I go about showing whether that's true or not?

**[28:40]:** Well, I haven't done anything so far because all I know is it is a cheetah if all of these things are true, but are they true? Well, to find out if it's a mammal, I can use rule one. And if I know or can determine that the animal has hair then that part of it is taken care of. And I can similarly work my my way back through carnivore by saying, "Well, it's a carnivore if it has claws sharp teeth, and forward-pointing eyes." And in as much as the animal in question does then I'm through. I know it's a carnivore. I don't have to go through and show that it's a carnivore another way. So, I'll never actually ask questions about whether it eats meat. Finally the final two conditions are met by just an inspection of the animal. That is to say, it's in the database.

**[29:31]:** I don't have to use any rules to determine that the animal has spots and it's very fast. So, now I've got everything in place to say that it's a cheetah because it's a carnivore because it has claws, sharp teeth, and forward-pointing eyes. And all the rest of the stuff is similarly determined by going backwards. Backwards from the hypothesis toward the facts instead of from the facts forward to the conclusions. So going building a system that works like that, I have a backward

**[30:09]:** a backward chaining rule-based expert system. But there's a very important characteristic of this system in both backward and forward mode. And that is that this thing is a deduction system.

**[30:29]:** That's because it's working with facts to produce new facts. And when you have a deduction system, you can never take anything away. But these rule-based systems are also used in another mode where it's possible to take something away. See, in in fact world, the deduction world, you're talking about proving things. And once you prove something is true, you can't it can't be false. If it is, you've got a contradiction in your system. But if you think of this as a programming language, if you think of using rules as a pro programming language, then you can think of arranging it so that these rules add or subtract from a database. Let me show you an example of um a sis couple of systems. First of all, since I've talked about the MYCIN system, let me show you um

**[31:39]:** an example of uh a MYCIN dialogue. That's a MYCIN dialogue. And you can see the the appearance of words you have to go to medical school to learn. And here's a typical MYCIN rule, just like the rules for doing zoo analysis, only a more complicated domain. But here's another example of a system that was written not in the '80s, but just a couple of years ago by a student in the um architecture uh department uh PhD thesis. He was interested in the architecture of a Portuguese architect named Siza. And Siza's done a lot of mass housing stuff. And Siza has the idea that you ought to be able to design your own house. And so Jose Duarte, a Portuguese student in this PhD student in architecture, wrote a rule-based system that was capable of designing Siza-like houses in response to the requirements and rec and recommendations and desires of the people who are

**[32:39]:** going to occupy the houses. So the most compelling part of this thing of this exercise was that Duarte took some of the designs of the program, mixed them up with some of the designs of Siza, and put them in front of Siza and said, "Which ones did you do?" And Siza couldn't tell. So somehow the rule-based system that was built using this kind of technology was sufficient to confuse even the expert that they were patterned after. But this program is a little complicated. It too has its own specialized lingo. So uh I'm not going to talk about it in detail, but rather talk instead about an analogous problem. And that is a problem that uh everyone is faced at one point or another. And that is the problem of putting groceries in a bag at a grocery store. It's the same thing, right? Instead of putting rooms in a house, you're putting groceries in a bag.

**[33:41]:** And there must be some rules about how to do that. In fact, maybe some of you have been professional grocery store baggers? Ariel, is a grocery store professional bagger? You're a Which one? I work at Market Basket. Yeah, what is your name? Lisa. Lisa. Okay, we've got two two uh professional grocery store baggers. And I'm going to be uh now uh simulating a now highly paid knowledge engineer desirous of building a program that knows how to bag groceries. So I'm going to visit your site, Market Basket, and I'm going to ask uh Lisa, now fearful of losing her job, if she would tell me about how she bags groceries. So could you suggest uh a rule? Sure. Large items on the bottom. Large items on the bottom. You see, that's why I'm a highly paid knowledge engineer, because I translate what she said into into an if-then rule.

**[34:44]:** So if large, then bottom. So now I So how about you, Ariel? You've got a suggestion?

**[34:54]:** About how to bag groceries? I mean, you have the small things on top. If small, then on top. Lisa, have you got anything else you can tell me? Don't put too many heavy things in the same bag. Don't put too many heavy things in the same bag. So if heavy greater than three, then new bag or something like that. Okay. Is that all we're going to be able to do? Does anybody else want to volunteer? Sila, have you bagged bagged groceries in Turkey? So they don't have uh grocery baggers, so we have to Yeah, everybody's a professional bagger in Turkey. It's outsourced to the customer. So no squishies on the bottom. No squishies on the bottom. That's good. Tomatoes. Now there's very different thing about squishies and tomatoes, because tomato is specific and squishy isn't. Uh one tendency of MIT students, of course, is that we all tend to generalize.

**[35:52]:** I once knew a professor in a Sloan School who seemed real smart. And uh then I figured out what he did. If I were to say, "I'm uh thinking about a red apple," he'd sit back up and say, "Oh, I see you're contemplating colored fruit today." You know, just uh taking it up one level of abstraction. Man of genius. He also was able to talk for an hour after he drew a triangle on the board. Amazing people. Anyhow, uh where were we? Oh yes, bagging groceries. So uh we're uh making some progress, uh but not as much as I would like. And so in order to really make progress on tasks like this, you have to exercise you have to know about uh some principles of knowledge engineering. So principle number one, which I've uh listed over here as uh part of a gold star idea, is deal with specific cases.

**[36:52]:** So while you're at the site, if all you do is talk to the experts like Lisa and Ariel, all you're going to get is vague generalities, because they won't think of everything. So what you do is you say, "Well, uh let me watch you on the line." And then you'll see that they have to have some way of dealing with the milk. And then you'll see that they have to have some way of dealing with the potato chips. Nobody mentioned potato chips, except insofar as they might be squishy. Squishy. I don't have a definition for squishy. No one talked about the macaroni. Uh and no one talked about the motor oil if this is a convenience store. I don't want that in the same bag with the meat. And then uh no one talked about that canned stuff. Here's a can of olives. So by looking at specific cases, you will elicit from people uh knowledge that they otherwise would not have thought to give you.

**[37:49]:** Okay? That's rule that's a knowledge engineering rule number one. And within a very few minutes, you'll have all three knowledge engineering rules and be prepared to be a highly paid knowledge engineer. Rule heuristic Let's call these heuristics. Heuristic number one, specific cases. Heuristic number two is ask questions about things that appear to be the same, but are actually handled differently. So there's some Birds Eye frozen peas. And here some um fresh cut sweet peas. And to me, uh a person who's never touched a grocery bag in my life, maybe I'm from Mars, I can't tell the difference. They're both peas. But I observe that the experts are handling these objects differently. So I say, "Why did you handle those peas differently from those peas?" And what do they say? One's canned and one's frozen. So what happens? Bingo, I've got some new words in my vocabulary.

**[38:57]:** And those new vocabulary words are going to give me power over the domain, because I can now use those words in my rules. And I can write rules like if frozen, then put them all together in a little plastic bag. Actually, that's too complicated, but but that's what we end up doing, right? Why do we put them all together in a little plastic bag? What's that? Well, there are two explanations. The Uh there's the MIT explanation. Uh we know that uh that temperature flow is equal to the fourth power of the temperature difference and the surface area and all that kind of stuff. We want to get them all together in a ball, sphere. Uh the normal explanation is that they're going to melt anyway, so they might as well not get everything else wet. All right.

**[39:50]:** So, that's heuristic number two. And actually, there's heuristic number three um that uh I just want to relate to you for the first time because I have been dealing with it a lot over this past summer. Heuristic number three is you build a system and you see when it cracks. And when it cracks is when you don't have one of the rules you need in order to execute uh in in order in order to get the program to execute as you want it to execute. So, if I were to write a grocery store bagging program and have it bag some groceries, again eventually it would either make a mistake or come to a grinding halt and bingo, I know that there's a missing rule.

**[40:28]:** Uh isn't that what happens when you do a problem set and you hit an impasse? You're performing an experiment on yourself and you're discovering that you don't have the whole program. In fact, I've listed this as a gold star idea having to do with engineering yourself because all of these things that you can do for knowledge engineering are things you can do when you learn a new subject yourself because essentially, you're making yourself into an expert system when you're learning circuit theory or electromagnetism or something of that sort. You're saying to yourself, well, let's look at some specific cases. Well, what are the vocabulary items here that tell me why this problem is different from that problem? Oh, this is a cylinder instead of a sphere. Or you're working the problem set and discovering you can't work the problem and you need to get another another chunk of knowledge that makes it possible for you to do it.

**[41:19]:** So, this sort of thing, which you think of in primarily as a mechanism heuristics for doing knowledge engineering, are also uh mechanisms uh for for making yourself uh making yourself smarter.

**[41:36]:** So, that uh concludes what I want to talk with you uh about today. Uh but the bottom line is that if you build a rule-based expert system, it can answer questions about its own behavior. If you build a program that's centered on goals, it can answer questions about its own behavior. If you build an integration program, it can answer questions about its own behavior. And if you want to build one of these systems and you need to extract knowledge from an expert, you need to approach it with these kinds of heuristics because the expert won't think what to tell you unless you elicit that information by specific cases, by asking questions about differences, and by ultimately doing some experiments to see where your program has cracked. So, that really concludes what I had to say except um I want to ask the question,

**[42:23]:** is this all we need to know about human intelligence? Can these things be Are these things really smart? And the traditional answer is no, they're not really smart because their intelligence is a sort of thin veneer. And once we you try to get underneath it, they tend to they tend to as written, they tend to crack. For example, we talked about a a rule or we could talk about a rule that knows that you should put the potato chips on the top of the bag. But a program that knows that would have no idea why you would want to put the potato chips on top of the bag. It wouldn't know that if you put them on the bottom of the bag, they'll get crushed. And it wouldn't know that if they get crushed, the customer will get angry because people don't like to eat crushed potato chips.

**[43:19]:** So, that's what I mean when I say the knowledge of these things tends to be a veneer. So, the MYCIN program during debugging once prescribed a barrel of penicillin to to be administered to a patient for his disease. They don't know they don't have any common sense. So, the question then becomes, well, I don't know um does rule-based Do do rules have anything to do uh with um with common sense? And I'm becoming a little bit agnostic on that subject.

**[43:57]:** Because there are certain indications, there are certain situations in which rules could be said uh to to play a a role in our ordinary understanding of things. Would you like to see a demonstration? What I'm going to show you when Eclipse boots up, well, before I make any promises, let me see if I'm actually connected to the web.

**[44:34]:** MIT, good. MIT guest. Yeah, that's me.

**[44:52]:** Yeah, sounds good.

**[45:23]:** Okay, I just tested the system and I've seen that it is actually connected to the web. Now, I'm going to adjust um some systems options here. We'll get rid of the text box. And we'll get rid of uh this or change its scale a little bit. And then what I'm going to do is I'm going to read a little synopsis of the Macbeth plot. Now, you're MIT students, I'm sure you're all classically educated and very familiar with Shakespearean plots. So, I'm going to read one. I'm going to read a version of the Macbeth plot. And it's going to go along like this. It's basically reading a rule base so far. And pretty soon, it's going to get beyond the rule base and start reading the Macbeth story. And there it is. It's read the Macbeth story. Let me show you what the Macbeth story looks like as it's actually retained by the system.

**[46:18]:** That's it. You can read that.

**[46:25]:** Okay, you ran out of time because the machine's already finished. Takes about 5 seconds to read the story. Now, as you look at this little synopsis of Macbeth, there are a couple of things to note. For one thing, it says that Duncan is murdered. Duncan, I hope this doesn't bother you. Duncan is murdered by Macbeth, but at no time does it say that Duncan is dead. But you know Duncan's dead because he was murdered. If murdered, then dead. So, if you look a little further down, what you see is that um Macduff kills Macbeth, fourth line up from the bottom. Why did Macbeth Why did Macduff kill Macbeth? Doesn't say why in the story, but you have no trouble figuring out that it's because he got angry. And when you get angry, you don't necessarily kill somebody, but it's possible.

**[47:24]:** So, now that you see what's in the story, uh let me take you back to this display. It's what we call an elaboration graph. And when I blow it up, you can see that there are some familiar-looking things in there. For example, up here in the left-hand corner, Macbeth murders Duncan, right over there. And over here, Macbeth kills Macduff kills Macbeth. And if you look at what is a consequence of that, it looks like there must be a rule that says if you murder somebody, you harm them. And if you murder somebody, then they're dead. And one reason why you might kill somebody is because they angered you. And if you go the other way, one cons- consequence of killing somebody is that you harm them and that they get and they die, too. And if you harm somebody, they get angry and their state goes negative.

**[48:19]:** So, that suggests that there are some things that we have in our heads that are very compiled and very uh strangely enough, very rule-like in um in their character. Now, to close, I'm just going to read Hamlet. The Hamlet demonstration is much like the Macbeth one. In fact, Hamlet and Macbeth are very alike in their plot. But there's one thing that's well illustrated by our particular capturing of of Hamlet here, and that is that you'll note that the ratio of gray stuff to white stuff is considerable. The gray stuff is stuff that has been deduced by rules. And the reason there's so much gray stuff in this Hamlet story is because everybody's related to everybody else, so when you kill anybody, you you irritate everybody else.

**[49:12]:** So, look at that. A few white things, those are the things that are explicit in the story, and lots of gray stuff. So, what this is suggesting is that when we tell a story, it's mostly a matter of controlled hallucination. I know what rules are in your head, so I can take advantage of that in telling the story and not have to tell you anything you I'm sure you're going to know. And so, that's why we discovered that storytelling is largely a matter of just controlling how you're going along, a kind of controlled hallucination.
