Knowledge Engineering For Automated Planning


Published on

Knowledge Engineering For Automated Planning

Published in: Education, Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Knowledge Engineering For Automated Planning

  1. 1. Knowledge Engineering for Automated Planning Lee McCluskey With acknowledgement to Ron Simpson
  2. 2. Abstract <ul><li>Algorithms for automated planning have become significantly more powerful in recent years, but the industrial take up of the technology has been slow. One reason for this has been the difficulty of modelling problem areas with sufficient rigour to allow for their automated solution. </li></ul><ul><li>The tutorial will provide attendees with </li></ul><ul><li>an insight into the range of potential applications of the technology </li></ul><ul><li>an idea of the level of difficulty in deploying the technology </li></ul><ul><li>Information on where to find out more and how to obtain free software </li></ul>
  3. 3. Abstract <ul><li>The tutorial will cover </li></ul><ul><li>a brief introduction to automated planning from an AI perspective (‘AI Planning’) </li></ul><ul><li>a review of the scope and power of the currently available automated planning systems. </li></ul><ul><li>the languages used for domain problem specification and the associated knowledge engineering issues. </li></ul><ul><li>the development of example domain models using dedicated knowledge engineering tools in GIPO . </li></ul><ul><li>practical demonstrations! </li></ul>
  4. 4. Introduction
  5. 5. Introduction: Resources <ul><li>Mainly because of PLANET (EC F5 NoE in Planning) there are heaps of resources to back up this tutorial: </li></ul><ul><li>Applications of AI Planning website: </li></ul><ul><li> </li></ul><ul><li>Free Planners, Schedulers and Domain Models: </li></ul><ul><li>http// </li></ul><ul><li>General PLANET website containing Summer School Notes on many aspects of AI Planning, and Planning Curriculum </li></ul><ul><li>http// </li></ul>
  6. 6. Introduction: Resources <ul><li>Free downloadable software – GIPO - to engineer planning domain models </li></ul><ul><li> </li></ul><ul><li>KE for Planning ROADMAP </li></ul><ul><li>http:// scom . hud .ac. uk /planet/home/ </li></ul><ul><li>The notes will be on my website </li></ul><ul><li> </li></ul>
  7. 7. Introduction: What is AI Planning? <ul><li>The scope of ‘AI Planning’ is the synthesis ( generation ) and execution of PLANS. That is, AI Planners reason with actions and generate plans. </li></ul><ul><li>Scheduling is the allocation of resources to plans of action taking into account various constraints – generally considered an ‘easier’ subpart of the Planning process </li></ul><ul><li>Planning is considered more of a knowledge-based pursuit than scheduling </li></ul>
  8. 8. Introduction: MAIN ASSUMPTION <ul><li>The MAIN ASSUMPTION of virtually all work in AI Planning is that there should be a logical separation between </li></ul><ul><ul><li>The Planning Engine </li></ul></ul><ul><ul><li>The Domain Model </li></ul></ul>APPLICATION DOMAIN Domain Model Planning Engine Planning System
  9. 9. Introduction <ul><li>Implications of assumption: </li></ul><ul><li>It tends to made AI Planning a different subject to eg ‘planning and scheduling’ in manufacturing </li></ul><ul><li>planning engines AND domain models can be developed, tested, debugged, validated independently - the ‘model’ of the particular application of planning is developed in relative isolation to the planning engine </li></ul><ul><li>domain models may be useful for more purposes that simply automated planning functions </li></ul>
  10. 10. Introduction <ul><li>Negative consequences of assumption .. </li></ul><ul><li>Domain model representation is influenced by ‘what planners an handle’ </li></ul><ul><li>Consequent inefficiency in planning systems - akin to ‘compilation’ rather than ‘hand coding’ in software </li></ul><ul><li>Much research work has been carried out in developing planning engines, pushed along by the International Planning Competition (AIPS’98, AIPS’00, AIPS’02, ICAPS’04) BUT methods and tools to help develop the domain models have had relatively little attention </li></ul>
  11. 11. Introduction– Applications of AI Planning <ul><li>See web site </li></ul><ul><li>Aerospace e.g. </li></ul><ul><li>Autonomous control of spacecraft - the NASA Remote Agent experiment </li></ul><ul><li>‘ Vicar ’ p lanner applied to automated image processing </li></ul><ul><li>Satellite mission planning and scheduling (European Meteostat) </li></ul><ul><li>Planning and Scheduling of Spacecraft Assembly </li></ul>
  12. 12. Introduction– Applications of AI Planning <ul><li>Military e.g. </li></ul><ul><li>Planning for military air campaigns </li></ul><ul><li>DARPA/Rome Planning Initiative - A military scheduling project </li></ul>
  13. 13. Introduction– Applications of AI Planning <ul><li>See web site </li></ul><ul><li> </li></ul><ul><li>Industrial / Government / Control e.g. </li></ul><ul><li>Planning in a forest fire simulation system - </li></ul><ul><li>.. + disaster recovery in general </li></ul><ul><li>B r ewery production-line scheduling </li></ul><ul><li>Generation of control programmes for industrial plant </li></ul><ul><li>Oil Spill Response Planning </li></ul><ul><li>Ship Building using shipyard scheduling optimi s ation system s </li></ul><ul><li>Aircraft crew s c heduling </li></ul><ul><li>Chemical Plant control </li></ul>
  14. 14. Introduction– Applications of AI Planning <ul><li>Other Current and Future Application areas </li></ul><ul><li>Other areas in ‘Control’: </li></ul><ul><ul><li>Workflow/Workforce </li></ul></ul><ul><ul><li>Air Traffic </li></ul></ul><ul><ul><li>Project planning </li></ul></ul><ul><ul><li>Transport Logistics </li></ul></ul><ul><li>Web Agents, </li></ul><ul><li>Games Software </li></ul><ul><li>Physical Robots, Autonomous Vehicles </li></ul>
  15. 15. Basic Concepts in AI Planning
  16. 16. Basic Concepts in AI Planning <ul><li>Basic concepts in AI Planning are: </li></ul><ul><li>Operators, Objects, States, Goals, Planning Problem, Plans </li></ul><ul><li>To illustrate them we will use a famous benchmark domain – the ‘change tyre’ world </li></ul>
  17. 17. Basic Concepts in AI Planning <ul><li>A state represents a world or snapshot within the domain. Objects have States – the conjunction of all objects’ states make up a world state </li></ul><ul><li>[ wrench_in(wrench 1 ,boot)] </li></ul><ul><li>[wheel_in(wheel1,boot) ,pumped_up(wheel1) ] </li></ul><ul><li>[wheel _on (wheel2 ,hub1 ) ,flat(wheel2) ] </li></ul><ul><li>[pump_in(pump 1 ,boot)] </li></ul><ul><li>[tight(nuts1,hub0)] </li></ul><ul><li>[have_jack(jack 1 )] </li></ul><ul><li>[on_ground(hub 1 ),fastened(hub 1 ) ] </li></ul><ul><li>[closed(boot)] </li></ul>
  18. 18. Basic Concepts in AI Planning <ul><li>An operator represents an action within the application. Operators change state. </li></ul><ul><li>operator(putaway_wheel(C,W), </li></ul><ul><li>% prevail </li></ul><ul><li>[ se(container,C,[open(C)])], </li></ul><ul><li>% necessary </li></ul><ul><li>[ sc(wheel,W,[have_wheel(W)]=>[wheel_in(W,C)])], </li></ul><ul><li>% conditional </li></ul><ul><li>[]) </li></ul><ul><li>A Domain model consists of a set of operators … </li></ul>
  19. 19. Basic Concepts in AI Planning <ul><li>Goals are conditions on states </li></ul><ul><li>wheel_on(wheel 1 ,hub 1 ) </li></ul>
  20. 20. Basic Concepts in AI Planning <ul><li>A Planning Problem is a triplet </li></ul><ul><li>(Initial World State, Goal, Domain Model) </li></ul><ul><li>Plans are collections of (instantiated, ordered) operators that solve planning problems </li></ul>
  21. 21. Basic Concepts in AI Planning <ul><li>Other concepts in AI Planning are: </li></ul><ul><li>Tasks, Events, Resources, Time </li></ul><ul><li>- Tasks are compound actions to be executed (eg ‘make a cup of tea’) </li></ul><ul><li>Events change the states of objects but happen exactly when their pre-conditions are true </li></ul><ul><li>Resources are quantities used up by actions - usually represented by numeric variables </li></ul>
  22. 22. Basic Concepts in AI Planning <ul><li>How do AI planners generate plans? </li></ul><ul><li>… well there are MANY techniques .. </li></ul><ul><li>Genarally they SEARCH through some representation of the planning problem! </li></ul>
  23. 23. Current State of AI Planning
  24. 24. Current State of AI Planning <ul><li>Research in AI planning has produced very good results in the last 10 – 15 years – largely due to… </li></ul><ul><li>The International Planning Competition </li></ul><ul><li>Acceptance of a ‘standard’ communication language called PDDL for domain models and domain problems </li></ul><ul><li>More ‘industrial’ involvement – NASA + US military </li></ul>
  25. 25. OLD State of AI Planning <ul><li>In the 80’s / early 90’s.. Most planners could solve simple problems with domain models consisting of </li></ul><ul><li>Actions modelled as instantaneous, deterministic operators with infinite resources. </li></ul><ul><li>Action’s pre-conditions and effects were propositions </li></ul><ul><li>States = set of propositions under the CWA </li></ul><ul><li>Goal = set of propositions. </li></ul><ul><li>Metrics for planners </li></ul><ul><ul><li>time to solve problem – ie generate plan </li></ul></ul><ul><ul><li>size (no of operators) in sequential plan </li></ul></ul>
  26. 26. Current State of AI Planning <ul><li>Now: Planners can solve more complex problems with domain models consisting of .. </li></ul><ul><li>Durative operators – time is explicit </li></ul><ul><li>Resources </li></ul><ul><li>Non-deterministic operators </li></ul><ul><li>Operators with complex/conditional effects </li></ul><ul><li>Partially observed states </li></ul><ul><li>More metrics considered e.g. makespan and multi-objective achievement </li></ul><ul><li>MOST IMPORTANT: they are downloadable! </li></ul>
  27. 27. Current State of AI Planning <ul><li>PDDL is the common communication language. Main variants of PDDL.. </li></ul>PDDL 1 1998 – first IPC PDDL 2.1 PDDL+ PDDL 2.2 2002 - Added Duration and Numerical Quatities 2002 - Added Processes, Events, cts time 2003 - Added timed initial facts, derived predicates
  28. 28. Current State of AI Planning <ul><li>Now many very effective techniques in use in plan generation.. </li></ul><ul><li>(see http// ) </li></ul><ul><li>Generate and search through a plan graph (Graphplan, STAN) </li></ul><ul><li>Do best-first, forward, state space search with very good weak heuristics (FF, HSP) </li></ul><ul><li>Compile planning problem into a large set of clauses and solve with a satisfiability engine (Blackbox) </li></ul><ul><li>Compile planning problem into a compact storage form such as Binary Decision Diagrams (MIPS) </li></ul>
  29. 29. Current State of AI Planning <ul><li>Summary - Good News: </li></ul><ul><li>Plan generation algorithms are much more efficient than 10 years ago, and can work efficiently in more expressive problems domains </li></ul><ul><li>But there is Bad News: </li></ul><ul><li>Technology transfer: there is much to do in making the technology generally available and usable </li></ul><ul><li>Model development: domain model authors use planners themselves to try to develop and debug a domain model. Planners have not generally been designed for this purpose.. </li></ul>
  30. 30. Knowledge Engineering and Domain Model Capture
  31. 31. Knowledge Engineering <ul><li>Knowledge Acquisition / Engineering is a huge area in AI related to Knowledge-based Systems (KBS) </li></ul><ul><li>O ld idea of 'knowledge transfer' , where constructing a KBS amounted to extracting the knowledge from experts and encoding it within an expert system 'shell‘ (20 years ago!) </li></ul>Application expertise transfer Procedural expert knowledge
  32. 32. Knowledge Engineering <ul><li>Now KBS emphasis es the bui l ding of a deep causal model prior to an operational system. </li></ul><ul><ul><li>Th is ‘ domain ’ model has to embody not just the procedural expert knowledge but the environment in which this knowledge was utilised. </li></ul></ul><ul><li>Several modelling frameworks have been developed (e.g. CommonKads which is based on the use of a series of models during domain capture, each dealing with different aspects of the domain. ) </li></ul><ul><ul><li>These support the process of model acquisition and validation, and are underpinned by an overall method of development. </li></ul></ul>
  33. 33. Knowledge Engineering for AI Planning: Definition <ul><li>Knowledge Engineering (KE) in AI Planning is the process that deals with </li></ul><ul><li>acquisition,validation and maintenance of planning domain models, and </li></ul><ul><li>the selection and optimization of appropriate planning machinery to work on them. </li></ul><ul><li>Hence, knowledge engineering processes support the planning process – they comprise all of the off-line, knowledge-based aspects of planning that are to do with the application being built. </li></ul><ul><li>(definition of Roadmap – http:// ) </li></ul>
  34. 34. Knowledge Engineering for AI Planning
  35. 35. Knowledge Engineering for AI Planning <ul><li>KE for KBS Is generally not the same as KE for planning.. </li></ul><ul><li>The knowledge elicited in planning is largely knowledge about actions and how objects are effected by actions. Thi s knowledge has to be adequate to allow efficient automated reasoning and plan construction. </li></ul><ul><li>The ultimate use of the planning domain model is to be part of a system involved in the ``synthetic'' task of plan construction (not for solving diagnostic or classification problems as in typical KBS) </li></ul>
  36. 36. Knowledge Engineering for AI Planning: Terminology <ul><li>Domain is the application area </li></ul><ul><li>Domain model is a formal model (theory) of the application area </li></ul><ul><li>Acquisition is the process of producing a domain model of the application area </li></ul><ul><li>Modelling is the area of using the model to predict behaviour in the application area </li></ul>
  37. 37. Knowledge Engineering for AI Planning: Terminology DOMAIN = APPLICATION AREA Symbolic World Domain Model Modelling Predict Acquisition Domain Model Language
  38. 38. Knowledge Engineering for AI Planning: Validation <ul><li>Validation of a model is the process that promotes its quality in terms of internal and external criteria by the identification and removal of errors in the model. </li></ul><ul><ul><li>Internal criteria includes properties such as syntactic correctness and logical consistency; in general these properties can be proved formally and are not too problematic. </li></ul></ul><ul><ul><li>External criteria includes properties such as accuracy, correctness and completeness. Given that the sources of the model will not often be a mathematical object, these properties can never be proved correct (in the same sense that a requirements specification can never be proved correct). </li></ul></ul><ul><li>Note the distinction between validation of a domain model and validation of a planning system. The former supports the latter, and occurs at a much earlier stage in system development. </li></ul>
  39. 39. Domain Model Languages for AI Planning <ul><li>A DML should: </li></ul><ul><li>Be associated with a method . </li></ul><ul><li>Be tool supported </li></ul><ul><li>Be expressive and customizable </li></ul><ul><li>Support the operational aspects of the model </li></ul><ul><li>Have a clear syntax and semantics </li></ul><ul><li>Be structured </li></ul>
  40. 40. PDDL <ul><li>PDDL is the ‘standard’ communication language for domain models but… </li></ul><ul><li>has no associated method for building models </li></ul><ul><li>has little ‘structure’ for helping in model building </li></ul><ul><li>has little in the way of static tools to help in de-bugging </li></ul>
  41. 41. OCLh <ul><li>OCLh is a language developed precisely for helping with the BUILDING of domain models </li></ul><ul><li>It is similar in some respects to PDDL but- </li></ul><ul><li>It has structure using object classes and state abstractions </li></ul><ul><li>It has a tools environment called GIPO which supports a model building method </li></ul>
  42. 42. Planning Domain Engineering with GIPO
  43. 43. GIPO - rationale <ul><li>Planning Domain Models are hard to design, write, debug, maintain - even for experts. The process of encoding is laborious. Bugs are of various types can lurk in models for a long time. </li></ul><ul><li>As planners and planning applications become larger, the problems of engineering planning domain models become more acute. There is a need to research into engineering environments and explore their synergy with general purpose planners. </li></ul>Acquisition is Very hard!! Application Domain Model
  44. 44. GIPO - rationale <ul><li>The two main planning systems used in anger are: </li></ul><ul><li>O-Plan (Edinburgh University) </li></ul><ul><li>SIPE (Stanford Research Institute) </li></ul><ul><li>Both have very expressive domain models languages. </li></ul><ul><li>To make an application efficient, the user must encode appropriate heuristics. </li></ul><ul><li>To be able to use them one has to be a planning expert, modelling expert and an application expert. </li></ul><ul><li>Even then, developing models is a painstaking process. </li></ul>
  45. 45. GIPO – what is it? <ul><li>GIPO ( Graphical Interface for Planning with Objects ) is an experimental GUI and tools environment for building planning domain models. </li></ul><ul><ul><li>It is written mainly in Java, with some embedded tools in Prolog, and is under continuous development. </li></ul></ul><ul><ul><li>It is a product of PLANFORM, a UK EPSRC-funded research project, written at The University of Huddersfield UK. Website: http:// scom . hud .ac. uk / planform </li></ul></ul><ul><li>Our long term aim is make the technology more usable and available! </li></ul>
  46. 46. GIPO – versions GIPO 1.1 Generally available For ‘Flat’ models (ECP’01) GIPO 2 Generally available For hierarchical models (ICAPS’03) GIPO+ Not on release For models with cts time, events and processes (PlanSig’03) GIPO 1.2 Not on release Incorporating automated induction of Operators (AIPS’02)
  47. 47. GIPO -functions <ul><li>GIPO allows a user to create new domain models or import and change old ones via a GUI. It features </li></ul><ul><li>on-line tutorial and OCL manual </li></ul><ul><li>Tools for initial model acquisition </li></ul><ul><li>Tools for model validation </li></ul><ul><li>Planning engines </li></ul><ul><li>3 rd party Planning engines can be easily ‘bolted on’ to GIPO 1 as it outputs PDDL 1.2, and can accept generated plans from them. </li></ul>
  48. 48. GIPO – main tools <ul><li>syntax and semantic checks for individual components, and between components, of a model </li></ul><ul><ul><li>From: Trivial checks on names and sorts </li></ul></ul><ul><ul><li>To: complex check’s on the structure of hierarchically defined operators </li></ul></ul><ul><li>a plan stepper </li></ul><ul><li>a plan animator </li></ul><ul><li>a random task generator (GIPO 1 only) </li></ul><ul><li>an operator induction method (GIPO 1.2 only) </li></ul>
  49. 49. GIPO – simple method <ul><li>Identify objects and object classes (sorts) </li></ul><ul><li>Define predicates </li></ul><ul><li>Define typical object states </li></ul><ul><li>Define operators </li></ul><ul><li>Debug and validate using plan stepper, planner and animator </li></ul><ul><li>Method in more detail was given in: </li></ul><ul><li>T.L. McCluskey and J.M. Porteous Engineering and Compiling Planning Domain Models to Promote Validity and Efficiency . Artificial Intelligence Vol. 95(1), pages 1 - 65, 1997. </li></ul>
  50. 50. Future releases – GIPO+ <ul><li>GIPO+ supports models that contain </li></ul><ul><li>Actions </li></ul><ul><li>Events </li></ul><ul><li>Processes </li></ul><ul><li>Continuously varying values (Time) </li></ul>
  51. 51. GIPO+: Air Traffic Control Example plane flying through a block represented by a process All Symbols are ‘clickable’ and give object information
  52. 52. Air Traffic Control Example Safety Violation Event
  53. 53. Conclusion <ul><li>AI Planning is a maturing technology </li></ul><ul><li>AI Planning technology needs to made more usable and available </li></ul><ul><li>The main assumption in AI Planning is that there should be a logical separation between the planning engine and the domain model. Particularly important is the engineering of the domain model – if this has bugs then the application is doomed </li></ul><ul><li>GIPO is an experimental GUI for building and validating planning domain models. It is a first step in making planning technology more usable. </li></ul>