chef planer

Upload: hidingstar

Post on 29-May-2018

231 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Chef Planer

    1/5

    CHEF: A Model o f Case-based Planning.*

    Kristian J. Hammon d

    Department of Computer ScienceYale University

    ABSTRACT

    Case-based planning is based on the idea that a machine plannershould make use of its own past experience in developing new plans,relying on its memories instead of a base of rules. Memories of pastsuccesses are accessed and modified to create new plans. Memories ofpast failures are used to warn the planner of impending problems andmemories of past repairs are called upon to tell the planner how todeal with them.

    Successful plans are stored in memory, indexed by the goals theysatisfy and the problems they avoid. Failures are also stored, indexedby the features in the world that predict them. By storing failures aswell as successes, the planner is able to anticipate and avoid futureplan failures.

    These ideas of memory, learning and planning are implemented inthe case-based planner CHEF, which creates new plans in the domainof Szechwan cooking.

    I WHAT IS CASE-BASED PLANNING?

    Case-based planning is planning from experience. A case-basedplanner differs sharply from planners that make use of libraries ofgoals and plans in that it relies on an episodic memory of past plan-ning experiences. As a result, memory organization, indexing, planmodification, and learning are central issues in case-based planning.Because this sort of planner has to be able to reuse the plans that itbuilds, it must be able to understand and explain why the plans thatit has built succeed or fail in order to properly store them for lateruse. This means that a cased-based planner not only needs to havea powerful memory organization, it must also have a strong model ofthe causality of the domain in which it operates.

    The case-based approach to planning is to treat planning tasks asmemory problems. Instead of building up new plans from scratch, Acase-based planner recalls and modifies past plans. Instead of seeingplan failures as planning problems alone, it treats them as expecta-tion failures that indicate a need to modify its understanding of theworld. And instead of treating plans as disposable items that are usedonce and then forgotten, a case-based planner treats them as valuablecommodities that can be stored and recalled for later use. In general,a case-based planner treats at the problem of building and maintain-ing plans as an interaction between its knowledge base and the world.Any problem that arises out of a disparity between what the plannerknows and what is requires that it alter not only its plan but also theexpectations that led to the creation of that plan.

    II WHY CASE BASED?

    The argument for case-based planning is straightforward: we wanta planner that can learn complex plans rather than replan every time

    it has to achieve an already planned for set of goals. In the case of asingle plan from the CHEF domain, a plan for stir fried chicken andpeanuts for example, the plan itself has seventeen steps performed ona dozen ingredients. While such a plan can be built up from a setof rules or plan abstractions, it is more efficient to save the entireplan and recall it for reuse when the same situation reoccurs. Further,the case-based approach seems to much more closely reflect humanplanning behavior than do those approaches that suggest replanningfor every new case.

    Even going back to the earliest rule-based planners such as STRIPS[l], there has always been the desire to save completed plans in a waythat makes them accessible to the planner in later situations. Thiswas especially the case in those situations where a past plan includedinformation about how to avoid problems that the planners base ofrules tended to lead into. But the planning algorithm used by mostplanners does not allow for anything but the most obvious reuse ofexisting plans. Most planners build plans for multiple goal situationsout of the individual plans for each of the goals that the planner ishanded and then deal with any interactions as they arise. Unfortu-nately, this algorithm has resulted in set of planners that recreate andthen debug past mistakes rather than using the plans that they havedeveloped before that avoid those mistakes altogether [2,4,5].

    The approach taken in CHEF is to anticipate and avoid problemsdue to plan interaction. To do this, CHEF keeps track of what featuresin its domain are predictive of particular problems so it can predictwhen it has to plan for them. It also saves plans in memory, indexedby the goals that they satisfy and the problems that they avoid. So theprediction of a problem allows CHEF to find the plans in memory thatavoid it. CHEFs basic algorithm is to find a past plan that satisfiesas many of the most important goals as possible and then modify thatplan to satisfy the other goals as well.

    III CHEFS OVERALL STRUCTURE

    CHEF is a case-based planner that builds new plans out of itsmemory of old ones. CHEFs domain is Szechwan cooking and itstask is to build new recipes on the basis of a users requests. CHEFsinput is a set of goals for different tastes, textures, ingredients andtypes of dishes and its output is a single recipe that satisfies all of itsgoals. Its output is a single plan, in the form of a recipe, that satisfiesall of the users goals.

    Before searching for a plan to modify, CHEF examines the goals inits input and tries to anticipate any problems that might arise whileplanning for them. If a failure is predicted, CHEF adds a goal to avoidthe failure to its list of goals to satisfy and this new goal is also usedto search for a plan. Because plans are indexed in memory by theproblems they avoid, this prediction can be used to find a plan thatsolves the predicted problem. Much of CHEFs planning power liesin this ability to predict and thus avoid failures it has encounteredbefore.

    *This report describes work done in the Department of Computer ScienceYale University. It was supported in part by ONR Grant #N00014-85-K-0108.

    at

    C O G N I T IV E M O D E L LI N G A N D E D U CA T I O N / 2 67

    From: AAAI-86 Proceedings. Copyright 1986, AAAI (www.aaai.org). All rights reserved.

  • 8/9/2019 Chef Planer

    2/5

    CHEF consists of six processes:

    l P r o b l e m a n t i c ip a t i o n : The planner anticipates planningproblems by noticing features in the current input that havepreviously participated in past planning problems.

    l P l a n r e t r i e v a l: The planner searches for a plan that satisfies asmany of its current goals as possible while avoiding the problemsthat it has predicted.

    l P l a n m o d i fi c a t i o n : The planner alters the plans it has foundto satisfy any goals from the input that are not already achieved.

    In the sections that follow, each of these modules will be discussedin turn. These sections will discuss two examples: one in which CHEFcreates and then repairs a faulty plan for a stir fry dish including beefand broccoli and one in which CHEF uses the knowledge gained fromthe first example to create a plan for a stir fry dish including chickenand snow peas. Most of this paper will attend to the second example inwhich the knowledge learned by CHEF in dealing with the first exam-ple is actually used, so as to show the power of the processes of problemanticipation, plan retrieval and plan modification. In discussing the

    l P l a n r e p a i r : When a plan fails, the planner fixes the faultyplan by building up a causal explanation of why the failure hasoccurred and using it to find the different strategies for repairingit.

    processes of failure repair, plan storage and credit assignment, how-ever, the first example is discussed. This is because CHEF learns fromthe problems encountered in dealing with this example and these threemodules make-up CHEFs repair and learning abilities.

    IV PROBLEM ANTICIPATION

    l C r e d i t a s s ig n m e n t : Along with repairing a failed plan, the CHEFs initial input is a set of goals to include different tastesplanner wants to repair the characterization of the world that and ingredients in a type of dish, The first step that CHEF takes inallowed it to create the failed plan in the first place. It does this dealing with them is to try to anticipate any problems that might ariseby using the causal explanation of why the failure occurred to in planning for them. CHEF wants to predict problems before theyidentify the features in the input that led to the problem and occur so it can find a plan in memory that already avoids them.then mark them as predictive of it.

    l P l a n s t o r a g e : The planner places successful plans in memory,indexed by the goals that they satisfy and the problems thatthey avoid.

    The flow of control through these processes is simple. Goals arehanded to the problem anticipator, which tries to predict any problemsthat might occur as a result of planning for them. If a problem ispredicted, a goal to avoid it is added to the set of goals to be plannedfor. Once this is done, the goals are handed to the plan retriever,which searches for a plan that satisfies as many of the planners goalsas possible, including any goals to avoid any predicted problems. In

    The planner anticipates problems on the basis of a memory of pastfailures that is linked to the features that participated in causing them.These links are used to pass markers from the features in an input tothe memory of failures that those features predict. When the featuresthat are related to a past problem are all present, the memory of thefailure is activated and the planner is informed of the possibility of thefailure reoccurring.

    For example, one of the failures the planner has in memory relatesto an attempt to make a stir-fry dish with beef and broccoli. In makingthe dish, the liquid produced when stir frying the beef ruined thetexture of the broccoli while it was cooking. The failure is indexed inmemory by the features of the goals that interacted to cause it: the

    order to do this, the plan retriever makes use of a memory of plansindexed by the goals they satisfy and the problems they solve. Once abase line plan is found, the plan modifier alters the plan to satisfy anygoals that it does not already deal with. The alteration of the plan isdone using a set of modification rules that are indexed by the goal tobe added and the type of plan being altered.

    After the plan is built it is handed to a simulator, which runs theplan using a set of rules concerning the effects of each action in CHEFsdomain under different circumstances. If the plan runs without fail,it is placed in memory, indexed by the goals that it satisfies. If thereare failures, the plan is handed to the plan repair mechanism. Thisprocess builds a causal description of why a plan has failed and thenuses that description to find the repair strategies that will alter thecausal situation to fix the fault. After the plan has been repaired, it isplaced in memory, indexed by the goals it satisfies and the problemsit now avoids. Because a problem has to be anticipated before it canbe planned for, however, the planner has to do more than just storeplans by the fact they they solve particular problems. It also has tobuild up a knowledge base that can be used to infer problems on thebasis of the features in the world that predict them. The planner mustdecide which features in the input are responsible for the problem andmark them as such. This credit assignment is done whenever a failureoccurs and the features that are blamed for the failure are linked tothe memory of the failure itself. These links are later used to predictfailures so that plans can be found that avoid them.

    These six processes make up the basic requirements for a case-basedplanner. Plan retrieval, modification and storage are essential to thebasic planning loop that allows old plans to be modified in service ofnew goals. A plan repair process is need for those situations in whichplans fail. A process that assigns blame to the features responsiblefor failures is required for the planner to be able to later anticipateproblems. And problem anticipation is needed in order for the plannerto avoid making mistakes that it has already encountered.

    goal to include meat, the goal to include a crisp vegetable and thegoal to make a stir fry dish. When these features are present in aninput the planner can predict that the failure will occur again. Once aproblem is predicted, the planner can add a goal to avoid the problemto the set of goals that will be used to find a plan.

    In planning for the goals to include SNOW PEAS and CHICKENin a STIR FRY dish, the planner is is reminded of the past failure itencountered in building the beef and broccoli plan. This failure wasdue to the fact that CHEF tried to stir fry some beef and broccolitogether in a past plan, allowing the liquid from the beef to makethe broccoli soggy. The surface features of the goal to include meatand the goal to include a crisp vegetable are the same, so the plannerpredicts that it will make this mistake again if it does not attend tothis problem.S e a r c h i n g f or p l a n t h a t satisfies input goals -

    In c lu d e c h i c k e n i n t h e d i sh .I n c l u d e B R O W e a i n t h e d i s h .M a k e a s t i r - fr y d i e h .

    C o l l ec t i n g a n d a c t i v a t i n g t e s t e .I e t h e d i e h STY LE-STIR -FR Y .I s t h e i t e m a M E A T .I s t h e item a V E G E T A B L E .I e t h e T E X T U R E f i t e m C R I S PC h i c k e n + S n o w P e a + S t i r f r y in g = F a i l u r e M e a t a w e a t a w h e n i t i s s t i r - f r i e d ."S t i r - f ry in g i n t o o m u c h l i q u id makesCriBp Vegetablea Soggy."

    R e m in d e d o f a f a i l u re i n t h eB E E F - AN D - B R O C C O L I l a n .Fa i l u r e = 'Th e v e g e t a b l e i a n o w B o g g y '

    Once a failure has been anticipated, CHEF builds a goal to avoid

    268 I SCIENCE

  • 8/9/2019 Chef Planer

    3/5

    it and adds this goal to the set of goals which will be used to searchfor a plan. This set of goals is then handed to the plan retriever.

    V PLAN RETRIEVAL

    The function of the plan retriever is to find the best plan to usein satisfying a set of goals. It seeks what we call the Ybest match inmemory, the plan for a past situation that most closely resembles thecurrent situation. In CHEF, this notion of best match is definedas finding a plan that satisfies or partially satisfies as many of theplanners most important goals as possible. Finding a raspberry soufflCrecipe that can be turned into a strawberry soufflC or finding a beef stirfry dish that can be turned into one for pork. The plan retriever usesthree kinds of knowledge in finding the best match for a set of goals: aplan memory that is indexed by the goals that the plans satisfy and theproblems that they avoid, a similarity metric that allows it to noticepartial matches between goals and a value hierarchy that allows it tojudge the relative importance of the goals it is planning for.

    The planners goals, including the goal to avoid the problem of thesoggy vegetable are all used to drive down in a discrimination networkthat organizes past plans.

    D riv in g d o w n o n : Ma k e a s t i r - f ry d i sh .Succeeded -

    Driving down on:A v o id f a i l u re exemplified by the state

    The broccol i ie now Soggy' i n r e c ip e B E E F - AN D - B R O C C O L I .Succeeded -D riv in g d o w n o n : In c lu d e c h i c k e n i n t h e d i sh .Failed - Trying more g e n e ra l g o a l .

    D r i v i n g down o n : I n c l u d e m e a t in t h e d is h .

    When CHEFs retriever is searching for a past case on which to baseits planning, it is searching for a plan that was built for a situationsimilar to the one it is currently in. The idea behind this search isthat the solution to a past, problem similar to the current one willbe useful in solving the problem at hand. But this means that thevocabulary used to describe the similarity between the two situationshas to capture the relevant aspects of the planning problems that theplanner deal with. This vocabulary consists of two classes of objects:the goals in a situation, (which in the case of stored plans are satisfiedby those plans) and the problems that have been anticipated (whichin the case of the stored plans are avoided by them). CHEF gets itsgoals directly from the user in the form of a set of constraints thathave to be satisfied. It gets information about the problems that itthinks it has to avoid while planning for those goals from its problemanticipator, which examines the goals and is reminded of problemsthat have resulted from interactions between similar goals in the past.

    CHEFS domain is Szechwan cooking, so the goals that it plansfor are all related to the taste, texture and style of the dish it iscreating. The basic vocabulary that CHEF uses to describe the effectsof its plans, and the effects that it wants a plan to accomplish includedescriptions of the foods that it can include, (e.g., Beef, chicken, snowpeas and bean sprouts), the tastes that the user wants (e.g., Hot,spicy, savory and fresh), the textures that the dish should include,(e.g., Crunchy, chewy and firm) and the type of dish that the user islooking for, (e.g., STIR-FRY, SOUFFLE, and PASTA). In searchingfor a past situation which might be useful, the plan retriever uses thegoals that i t is handed to index to possible plans. The plan it finds,then, will satisfy at least some of the goals it is looking for.

    Succeeded -D riv in g d o w n o n : In c lu d e BROW p e a i n t h e d i s h .

    F a i l e d - T r y i n g m o r e g e n e r a l goal.D r i v i n g down o n : In c lu d e v e g e t a b l e i n t h e d i sh .

    Su c c e e d e d -F o u n d r e c i p e - > R E C Q B E E F - A N D - B R O C C O L I

    Here CHEF finds a past plan that avoids the problem due to goalinteractions that has been predicted while still partially satisfying theother more surface level goals.

    VI PLAN MODIFICATION

    C H E F s m e m o r y o f p l a n s i s a u g m e n t e d by the ability to modifyplans fo r s i t u a t i o n s that only partially match the planners presentproblems. C H E F s p l a n m o d i fi e r , t h e m o d u l e t h a t handles thesechanges, makes use of a modification library that is indexed by thechanges that have to be made and the plan that they have to be madein. The modification rules it has are not designed to be complete planson their own, but are instead descriptions of the steps that have tobe added and deleted from existing plans in order to make them sat-isfy new goals. Along with the modification rules are a set of objectC&U that look at a plan and, on the basis of the items or ingredi-ents involved, correct difficulties that have been associated with thoseingredients in the past.

    The process used by CHEFs modifier i s s im p le . For each goalthat is not yet satisfied by the current plan, the modifier looks for themodification rule associated with the goal and the general plan type.If no modification rule exists for the particular goal, the modifier stepsup in an abstraction hierarchy and finds the modification rule for themore general version of the goal. Once a rule is found, the stepsit describes are added to the plan, merged with existing steps whenpossible.

    The problems that CHEF tries to avoid, by finding plans that workaround past instances of them, also relate to the planners goals. Insearching for a plan, CHEF uses the predictions of any problems thatit has anticipated to find plans that avoid those problems. Becauseplans are indexed by the problems that they solve, the planner is ableto use these predictions to find the plans that will avoid the problemsthey describe. In searching for a base-line plan for the chicken andsnow peas situation, CHEF searches for a plan that, among otherthings, avoids the predicted problem of soggy vegetables. Because thebeef and broccoli plan is indexed by the fact that it solves the problemof soggy vegetables due to stir frying with meats, the plan retrieveris able to find it on the basis of the prediction of this problem, eventhough the surface features of the two situations are dissimilar.

    If the goal in question is already partially satisfied by the plan,(this happens when the plan satisfies a goal that is similar to thecurrent one), the planner does not have to go to its modification rules.It replaces the new item for the old item, removing any steps thatwere added by the old items ingredient critics and adding any stepsrequired by the new items ingredient critics.

    In altering the BEEF-AND-BROCCOLI plan to include chickenand snow peas, the planner has the information that both new ingre-dients are partial matches for existing ones and can be directly substi-tuted for them. A critic under the concept CHICKEN then adds thestep of boning the chicken before chopping.

    In searching for a plan that includes chicken and snow peas, theplanner is also trying to find a plan that avoids the problem it haspredicted of the vegetables getting soggy as a result of being cookedwith the meat. The fact that it has predicted this problem allows itt o find a p l a n i n m e m o r y that avoids it, even though the plan dealswith surface features that are not in the current input. The planner isable to find this plan even though a less appropriate plan with moresurface features in common with the current situation, a recipe forchicken and green beans, is also in memory.

    Mo d i fy in g n e w p l a n t o a a t i e fy :Include chicken in the d i s h .

    S u b s t i t u t i n g chicken for b e e f i n n e w p l a n .Mo d i fy in g n e w p l a n t o a a t i s fy :

    I n c l u d e s n o w p e a i n t h e d i s h .Su b e t i t u t i n g e n o w p e a fo r b ro c c ol i i n n e w p l a n .C o n s id e r in g c r i t i c :

    C O G N I T I V E M O D E L L I N G A N D E D U C A T I O N / 269

  • 8/9/2019 Chef Planer

    4/5

    Bef or e doing s tep : C hop the ch ickendo: Bone the ch icken . - Cr i t i c app l ied .

    s i t u a t i o n .This past failure occurred when CHEF was planning for the goals

    of including beef and broccoli in a stir fry dish. CHEF originallybuilt a simple plan in which the two main ingredients were stir friedtogether. Unfortunately, this plan resultsstir frying the beef making the vegetables

    in the liquid produced bysoggy as they are cooking.

    This explanation of the failure in this example indexes to the TOiSIDE-EFFECT:DISABLED-CONDITION:CONCURRENT, a mem-ory structure related to the interaction between concurrent plans inwhich a side effect of one violates a precondition of the other. This isbecause the side effect of liquid coming from the stir-frying of the beef

    VII PLAN REPAIR

    Because CHEF cannot avoid making e r r o r s , it has to be able tor e p a i r faulty plans in response to failures. As it is, CHEFs planr epa i r e r i s one of the m os t com plex pa r t s of both the CHEF programand the case-based theory that it implements. It is complex becauseit makes the most use of the planners specific knowledge about thephys ic s of the CHEF domain and has to combine this knowledge witha more abstract understanding of how to react to planning problemsin general.

    Once it completes a plan, CHEF runs a simulation of it using aset of causal rules. This simulation is CHEFs equivalent of the realworld. At the end of the simulation, it checks the final states that havebeen simulated against the goals of the plan it has run. If any goalis unsatisfied or if any state has resulted that CHEF wants to avoidin general, an announcement of the failure is handed to the the planr e p a i r e r .

    CHEF deals with plan failure by building a causal explanation ofwhy the failure has occurred. This explanation connects the surfacefeatures of the initial plan to the failure that has resulted. The plan-ners goals, the particular steps that it took and the changes that weremade are all included in this explanation. This explanation is builtby back chaining from the failure to the initial steps or states thatcaused it, using a set of causal rules the describe the results of actionsin different circumstances.

    The explanation of the failure is used to find a structure in memorythat organizes a set of strategies for solving the problem describedby the explana t ion . These structures, called Thematic OrganizationPackets or TOPS [3], are similar in function to the critics found inHACKER [4] and NOAH [2]. Each TOP is indexed by the descriptionof a particular type of planning problem and each organizes a set ofs t r a t e g i e s for deal with that type of problem. These strategies take theform of general repair rules such as REORDER steps and RECOVERfrom side-effects. Each general strategy is filled in with the specificsof the particular problem to build a description of a change in theplan that would solve the current problem. This description is used asan index into a library of plan modifiers in the cooking domain. Themodifications found are then tested against one another using rulesconce r n ing the e ff i cacy of the d i f fe r en t chan ges a nd the one tha t i smost likely to succeed is chosen.

    The idea behind these structures is simple. There is a great deal ofplanning information that is related to the interactions between plansand goals. This information cannot be tied to any individual goal orplan but is instead tied to problems that rise out of their combina-tion. In planning, one important aspect of this information concernshow to deal with problems due to the interactions between plan steps.Planning TOPS provide a means to store this information. Each TOPcorresponds to a planning problem due to the causal interaction be-tween the steps and the states of a plan. When a problem arises, acausal analysis of it provides the information needed to identify theTOP that actually describes the problem in abstract terms. Undereach TOP is a set of strategies designed to deal with the problem theTOP describes. By finding the TOP that relates to a problem, then, aplanner actually finds the strategies that will help to fix that problems.

    CHEF does not run into any failures while planning for the stir frydish with chicken and snow peas. This is because it is able to avoidthe problem of the liquid from the meat making the vegetables soggyby anticipating the failure and finding a plan the avoids it. It can onlydo this, however, because it has handled this problem already in thatit built a similar plan that failed and was then repaired. This earlierplan is the same one that CHEF selected as the base-line plan for thissituation, because it knows that this is a plan that it repaired in thepast to avoid the same problem of liquid from the meat .making thevegetables soggy that is now predicted as a problem in the current

    is disabling a precondition attached to the broccoli stir-fry plan thatthe pan being used is dry.

    The causal description of the failure is used to access this TOP outof the twenty that the program knows about. All of these TOPS areassociated with causal configurations that lead to failures and storestrategies for fixing the situations that they describe. For example,one TOP is DESIRE@EFFECT:DISABLED-CONDITION:SERIAL,a TOP that describes a situation in which the desired effect of a stepinterferes with the satisfaction conditions of a later step. The programwas able to recognize t,hat the current situation was a case of SIDE-EFFECT:DISABLED-CONDITION:CONCURRENT because it hasdetermined that no goal is satisfied by the interfering condition (theliquid in the pan), that the condition disables a satisfaction require-ment of a step (that the pan be dry) and that the two steps are oneand the same (the stir fry step). Had the liquid in the pan satisfied agoal, the situation would have been recognized as a case of DESIRED-EFFECT:DISABLED-CONDITION:CONCURRENT because the vi-olating condition would actually be a goal satisfying state.

    F o u n d T O P T O P 1 -> S I D E - E F F E C T : D I S A B L E D -C f J N D I T I O N : C O N C U R R E N TT O P - > S I D E - E F F E C T : D I S A B L E D -C O N D I T I O N : C O N C U R R E N Ta s 3

    etrategies aseoc ia ted with it:S P L I T - A N D - R E F O R MA L T E R - P L A N : S I D E - E F F E C TA D J U N C T - P L A N

    These three strategies reflect the different changes that can bemade to repair the plan. They suggest:

    l ALTER-PLAN:SIDE-EFFECT: Replace the step that causes theviolating condition with one that does not have the same side-effect but achieves the same goal.

    l SPLIT-AND-REFORM: Split the step into two separate stensand run them independently. 1

    l ADJUNCT-PLAN:REMOVE: Add a new step to be run alongwith a step that causes a side-effect that removes t.he side-effectas it is created.

    In this case, only SPLIT-AND-REFORM can be implemented forthis particular problem so the change it suggests is made. As a resultthe single stir fry step in the original plan in which the beef and broc-coli were stir fried together is changed into a series of steps in whichthey are stir fried apart and joined back together in the final st,ep ofthe plan.

    Once a plan is repaired it can be described as a plan that now avoidsthe problem that has just be fixed. When it is stored in memory, then,it is stored as a plan that avoids this problem so it can be found if asimilar problem is predicted.

    VIII PLAN STORAGE

    Plan storage is done using the same vocabulary of goals satisfiedand problems avoided that plan retrieval uses. Once a plan has beenbuilt and run, it is stored it in memory, indexed by the goals it satisfies

    270 / SCIENCE

  • 8/9/2019 Chef Planer

    5/5

    and the problems it avoids. The plans are indexed by the goals thatthey satisfy so the planner can find them later on when it, is asked tofind a plan for a set, of goals. They are also stored by the problemsthat they avoid so that CHEF, if it knows that a problem is going toresult from some planning situation, can find a plan that avoids thatproblem.

    The repaired BEEF-AND-BROCCOLI is indexed in memory underthe goals that it satisfies as well as under the problems that it avoids.So it is indexed under the fact that is a plan for stir frying, for includingbeef and so on. It is also indexed by the fact, that it avoids the problemof soggy vegetables that r ises out the interaction between meat andcrisp vegetables when stir fried. The fact that, the plan is associatedwith the problem that it solves allows the plan retriever to later findthe plan to use when confronted with the later task of finding a planthat avoids the problem of soggy vegetables that results when meatsand crisp vegetables are stir fried together.

    I n d e x i n g B E E F - A N D - B R O C C O L I n d e r goals a n d problems:I f t h i s p l a n i s su c c e ss fu l , t h e fol l ow in g sh o u ld b e t ru e :Th e b e e f i s n o w t e n d e r .

    Th e b ro c c ol i i s n o w c r i sp .In c lu d e b e e f i n t h e d i sh .In c lu d e b r o c co l i i n t h e d i sh .Ma k e a s t i r - f ry d i sh .

    The plan avoids f a i l u re e x e m p l i f i e d b y t h es t a t e 'Th e broccoli is now soggy inr e c i p e B E E F - A N D - B R O C C O L I .

    IX CREDIT ASSIGNMENT

    CHEFs approach to failures is two fold. It repairs the plan tomake it run and it repairs itself to make sure that it will not make thesame mistake again. Part of assuring that the same mistake will notbe repeated is storing the repaired plan so that it can be used again.But the fact that the original plan failed and had to be repaired in thefirst place indicates that CHEFs initial understanding of the planningsituation was faulty in that it built a failure when it thought it wasbuilding a correct plan. When it encounters a failure, then, CHEF hasto also find out why the failure occurred so that it can anticipate thatfailure when it encounters a similar situation in the future.

    CHEFs makes use of the same causal explanation used to findits TOPS and repair strategies to figure out which features shouldbe blamed for a failure. The purpose of this blame assignment is totrack down the features in the current, input that could be used topredict this failure in later inputs. This ability to predict, planningfailures before they occur allows the problem anticipator to warn theplanner of a possible failure and allow it to search for a plan avoidingthe predicted problem. The power of the problem anticipator, then,rests on the power of the process that figures out which features areto blame for a failure.

    CHEFs steps through the explanation built by the plan repairerto the identify goals that interacted to cause the failure. After beingpushed to the most general level of description that the current expla-nation can account for, these goals are turned into tests on the input.This allows the planner to later predict failures on the basis of surfacefeatures that are similar to the ones that participated in causing thecurrent problem.

    As a result of the beef and broccoli failure, a test on the textureof vegetables, is built and associated with the concept VEGETABLEbecause a goal for a crisp vegetable predicts this failure while goals forother vegetables do not. It is associated with VEGETABLE ratherthan BROCCOLI because the rule explaining the failure is valid forall crisp vegetables not just broccoli. Because any meat will put offthe liquid l ike that which participated in the failure no test is neededand a link is built directly from the presence of the goal to the memory

    of the failure.B u i l d in g d e m o n : D E M O N 0 o a n t i c ip a t e i n t e r a c t i on b e t w e e n r u l e s :"Me a t sw e a t s w h e n i t i s s t i r - fr i e d . ""S t i r - f ry in g i n t o o m u c h l i q u id m a k e s c r i sp v e g e t a b l e s so g g y ."I n d e x i n g m a r k e r p a s s in g d e m o n u n d e r item: M E A Tb y t e s t : I s t h e Item a M E A T .

    I n d e x i n g m a r k e r p a s s i n g d e m o n u n d e r i t e m : V E G E T A B L Eb y t e s t :I s t h e i t e m a V E G E T A B L E .

    a n d I s t h e T E X T U R E o f i t e m C R I S P .G o a l t o b e a c t i v a t e d = A v o id fa i l u re e x e m p l i f i e db y t h e s t a t e 'Th e b ro c c ol i i s no w soggy ' inr e c i p e B E E F - A N D - B R O C C O L I .

    These links between surface features and memories of failures areused later to predict the same problem when it is handed the goals tomakes a stir fry dish with chicken and snow peas. This prediction isthen used to find the plan that avoids the problem.

    X CHEF

    The idea behind CHEF is to build a planner that learns from itsown experiences. The a p p r o a c h t a k e n in CHEF is to use a representa-t ion of those e x p e r i e n c e s i n t h e p l a n n in g p ro c e ss . To m a k e t h i s p o s s i -ble, CHEF requires what any case-based planner requires, a memoryof past events and a means to retrieve and store new them, a methodfor modifying old plans to satisfy new goals, a way to repair plans thatfail, and a way to turn those failures into knowledge of how to betterplan.

    By choosing plans on the basis of the problems that they solve aswell as the goals they satisfy, CHEF is able to avoid any problem that itis able to predict. By also treating planning failures as understandingfailures and repairing its knowledge base as well as its plans, CHEFis able to predict problems that it has encountered before. And byusing an extensive causal analysis as a means of d ia g n o s in g p ro b l e m s ,CHEF is able to apply a wide variety of repairs to a single failure.

    PI

    PI

    PI

    bl

    PI

    REFERENCES

    Fikes, R., and Nilsson, N., STR IPS: A neul approach to the appli-cation of theorem proving to problem solving, a r t i f i c i a l In t e l l i g e n c e ,2 (1971).Sacerdoti, E., A struct ure for plans and behavior, Technical Report109, SRI Artificial Intelligence Center, 1975.Schank, R., Dynami c memory: A theory of learning in computersand people, Cambridge University Press, 1982.Sussman, G., Artificial Intelligence Series, Volume 1: A computermodel oj skill acquisit ion, American Elsevier, New York, 1975.Wilensky, R., META-PLANNING, Technical Report M80 33, UCBCollege of Engineering, August 1980.

    C O G N I T IV E M O D E L LI N G A N D E D U C AT I O N / 2 7 1