Introduction to Artificial Intelligence. Planning

Similar documents
Outline. Planning. Search vs. Planning. Search vs. Planning Cont d. Search vs. planning. STRIPS operators Partial-order planning.

Partial-Order Planning Algorithms

Introduction to Planning

In which we see how an agent can take advantage of the structure of a problem to construct complex plans of action.

Plan-Space Search. Searching for a Solution Plan in a Graph of Partial Plans

Introduction to Artificial Intelligence. Intelligent Agents

Hybrid Planning in Cyber Security Applications

AN AI PLANNING APPROACH FOR GENERATING BIG DATA WORKFLOWS

Introduction. Real World Planning. Planning with Time. Time 15/11/2012. COMP219: Artificial Intelligence. COMP219: Artificial Intelligence

Threat-Removal Strategies for Partial-Order Planning

Management and optimization of multiple supply chains

Satisfiability Checking

Dynamic Temporal Planning for Multirobot Systems

Problems, Methods and Tools of Advanced Constrained Scheduling

Data exchange. L. Libkin 1 Data Integration and Exchange

Measuring the Performance of an Agent

2. The Language of First-order Logic

Verifying Semantic of System Composition for an Aspect-Oriented Approach

Demonstrating WSMX: Least Cost Supply Management

Figure 4-1 Price Quantity Quantity Per Pair Demanded Supplied $ $ $ $ $10 2 8

Logic in general. Inference rules and theorem proving

Agents: Rationality (2)

InvGen: An Efficient Invariant Generator

Linear Programming. March 14, 2014

Data Validation with OWL Integrity Constraints

Scheduling Shop Scheduling. Tim Nieberg

Questions? Assignment. Techniques for Gathering Requirements. Gathering and Analysing Requirements

Project Time Management

FUNDAMENTALS OF ARTIFICIAL INTELLIGENCE KNOWLEDGE REPRESENTATION AND NETWORKED SCHEMES

Error recovery in robots through failure reason analysis*

Interactive Timetabling

Algorithms and Data Structures

Planning Configuration Relocation on the BonFIRE Infrastructure

CS510 Software Engineering

UML TUTORIALS THE USE CASE MODEL

AN INTEGRATED LIFE CYCLE FOR WORKFLOW MANAGEMENT BASED ON LEARNING AND PLANNING

Data Masking and Data Migration

AUTOMATED TEST GENERATION FOR SOFTWARE COMPONENTS

Formal Verification Coverage: Computing the Coverage Gap between Temporal Specifications

Topic 2: Structure of Knowledge-Based Systems

Course Outline Department of Computing Science Faculty of Science. COMP Applied Artificial Intelligence (3,1,0) Fall 2015

MSc Project Planning

Mario Guarracino. Data warehousing

Software Modeling and Verification

Formal Verification of Software

Software Engineering

Optimizing Description Logic Subsumption

Network (Tree) Topology Inference Based on Prüfer Sequence

Practical Guide to the Simplex Method of Linear Programming

Unified XML/relational storage March The IBM approach to unified XML/relational databases

Trading the Daniel Code Numbers

SYSM 6304: Risk and Decision Analysis Lecture 5: Methods of Risk Analysis

Branch-and-Price Approach to the Vehicle Routing Problem with Time Windows

Course: Programming II - Abstract Data Types. The ADT Stack. A stack. The ADT Stack and Recursion Slide Number 1

KS3 Computing Group 1 Programme of Study hours per week

Chapter 20: Data Analysis

SEARCHING AND KNOWLEDGE REPRESENTATION. Angel Garrido

Environment Modeling for Automated Testing of Cloud Applications

Artificial Intelligence

Stacks. Linear data structures

Linear Programming. April 12, 2005

What is Linear Programming?

XML Data Integration

How To Handle Missing Information Without Using NULL

THE LOGIC OF ADAPTIVE BEHAVIOR

A static representation for ToonTalk programs

Software Verification and Testing. Lecture Notes: Temporal Logics

npsolver A SAT Based Solver for Optimization Problems

Introducing Formal Methods. Software Engineering and Formal Methods

Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification

Scheduling. Getting Started. Scheduling 79

Introduction to Database Management Systems

High-Level Robot Control Through Logic

Classnotes 5: 1. Design and Information Flow A data flow diagram (DFD) is a graphical technique that is used to depict information flow, i.e.

CHAPTER 1. Basic Concepts on Planning and Scheduling

Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification

Planning with Subdomains and forests

Event Calculus Planning Revisited

Sudoku Puzzles Generating: from Easy to Evil

Coverability for Parallel Programs

A Path to Critical Thinking

Applied Logic in Engineering

Testing LTL Formula Translation into Büchi Automata

Version Spaces.

A Numerical Study on the Wiretap Network with a Simple Network Topology

Project Scheduling in Software Development

Data Integration: A Theoretical Perspective

Operating Systems. Virtual Memory

Software Engineering Techniques

Agreement on. Dual Degree Master Program in Computer Science KAIST. Technische Universität Berlin

Temporal Logics. Computation Tree Logic

On the Modeling and Verification of Security-Aware and Process-Aware Information Systems

A Review And Evaluations Of Shortest Path Algorithms

Constraint-Directed Scheduling for Multi-Storey Building Projects

PREPARATION GUIDE FOR WRITTEN TESTS

Formal Engineering for Industrial Software Development

A MODEL TO SOLVE EN ROUTE AIR TRAFFIC FLOW MANAGEMENT PROBLEM:

The First Law of Robotics (a call to arms)

Time Management. Part 5 Schedule Development. Richard Boser

Disjunction of Non-Binary and Numeric Constraint Satisfaction Problems

Transcription:

Introduction to Artificial Intelligence Planning Bernhard Beckert UNIVERSITÄT KOBLENZ-LANDAU Summer Term 2003 B. Beckert: Einführung in die KI / KI für IM p.1

Outline Search vs. planning STRIPS operators Partial-order planning The real world Conditional planning Monitoring and replanning B. Beckert: Einführung in die KI / KI für IM p.2

Search vs. Planning Consider the following task Get milk, bananas, and a cordless drill Standard search algorithms seem to fail miserably Talk to Parrot Go To Pet Store Buy a Dog Go To School Go To Class Start Go To Supermarket Buy Tuna Fish Go To Sleep Buy Arugula Read A Book Buy Milk... Finish Sit in Chair Sit Some More Etc. Etc....... Read A Book B. Beckert: Einführung in die KI / KI für IM p.3

Search vs. Planning Actions have requirements & consequences that should constrain applicability in a given state stronger interaction between actions and states needed Most parts of the world are independent of most other parts solve subgoals independently Human beings plan goal-directed; they construct important intermediate solutions first flexible sequence for construction of solution B. Beckert: Einführung in die KI / KI für IM p.4

Search vs. Planning Planning systems do the following Unify action and goal representation to allow selection (use logical language for both) Divide-and-conquer by subgoaling Relax requirement for sequential construction of solutions B. Beckert: Einführung in die KI / KI für IM p.5

STRIPS STRIPS STandford Research Institute Problem Solver Tidily arranged actions descriptions Restricted language (function-free literals) Efficient algorithms B. Beckert: Einführung in die KI / KI für IM p.6

STRIPS: States States represented by: Conjunction of ground (function-free) atoms Example At Home Have Bread Closed world assumption Atoms that are not present are assumed to be false Example State: At Home Have Bread Implicitly: Have Milk Have Bananas Have Drill B. Beckert: Einführung in die KI / KI für IM p.7

STRIPS: Operators Operator description consists of: Action name Positive literal Buy Milk Precondition Conjunction of positive literals At Shop Sells Shop Milk Effect Conjunction of literals Have Milk Operator schema Operator containing variables At(p) Sells(p,x) Buy(x) Have(x) B. Beckert: Einführung in die KI / KI für IM p.8

STRIPS: Operator Application Operator applicability Operator o applicable in state s if: there is substitution Subst of the free variables such that Subst precond o s Example Buy x is applicable in state At Shop Sells Shop Milk Have Bread with substitution Subst p Shop x Milk At(p) Sells(p,x) Buy(x) Have(x) B. Beckert: Einführung in die KI / KI für IM p.9

STRIPS: Operator Application Resulting state Computed from old state and literals in Subst effect Positive literals are added to the state Negative literals are removed from the state All other literals remain unchanged (avoids the frame problem) Formally s s P P a positive atom P Subst effect o P P a positive atom P Subst effect o B. Beckert: Einführung in die KI / KI für IM p.10

STRIPS: Operator Application Example Application of to state Drive a b precond: At a Road a b effect: At b At a At Koblenz Road Koblenz Landau results in At Landau Road Koblenz Landau B. Beckert: Einführung in die KI / KI für IM p.11

State Space vs. Plan Space Planning problem Find a sequence of actions that make instance of the goal true Nodes in search space Standard search: Planning search: node = concrete world state node = partial plan (Partial) Plan consists of Set of operator applications S i Partial (temporal) order constraints S i S j Causal links S i c S j Meaning: S i achieves c precond S j (record purpose of steps) B. Beckert: Einführung in die KI / KI für IM p.12

State Space vs. Plan Space Operators on partial plans add an action and a causal link to achieve an open condition add a causal link from an existing action to an open condition add an order constraint to order one step w.r.t. another Open condition A precondition of an action not yet causally linked Note We move from incomplete/vague plans to complete, correct plans B. Beckert: Einführung in die KI / KI für IM p.13

Partially Ordered Plans Start Start Left Sock Right Sock LeftShoeOn, RightShoeOn Finish LeftSockOn Left Shoe RightSockOn Right Shoe LeftShoeOn, RightShoeOn Special steps with empty action Finish Start Finish no precond, initial assumptions as effect) goal as precond, no effect Note Different paths in partial plan are not alternative plans, but alternative sequences of actions B. Beckert: Einführung in die KI / KI für IM p.14

Partially Ordered Plans Complete plan A plan is complete iff every precondition is achieved A precondition c of a step S j is achieved (by S i ) if S i c S j effect S i there is no S k with S i S k S j and c effect S k (otherwise S k is called a clobberer or threat) Clobberer / threat A potentially intervening step that destroys the condition achieved by a causal link B. Beckert: Einführung in die KI / KI für IM p.15

Clobbering and Promotion/Demotion Example Go Home clobbers At HWS Go(HWS) DEMOTION Demotion Put before Go HWS At(HWS) Buy(Drill) Go(Home) At(Home) Promotion Put after Buy Drill PROMOTION At(Home) Finish B. Beckert: Einführung in die KI / KI für IM p.16

Example: Blocks world "Sussman anomaly" problem A B C A B C Start State Goal State Clear(x) On(x,z) Clear(y) PutOn(x,y) ~On(x,z) ~Clear(y) Clear(z) On(x,y) Clear(x) On(x,z) PutOnTable(x) ~On(x,z) Clear(z) On(x,Table) + several inequality constraints B. Beckert: Einführung in die KI / KI für IM p.17

Example: Blocks World START On(C,A) On(A,Table) Cl(B) On(B,Table) Cl(C) B C A On(A,B) On(B,C) FINISH A B C B. Beckert: Einführung in die KI / KI für IM p.18

Example: Blocks World START On(C,A) On(A,Table) Cl(B) On(B,Table) Cl(C) B C A Cl(B) On(B,z) Cl(C) PutOn(B,C) On(A,B) On(B,C) FINISH A B C B. Beckert: Einführung in die KI / KI für IM p.18

Example: Blocks World START On(C,A) On(A,Table) Cl(B) On(B,Table) Cl(C) B C A PutOn(A,B) clobbers Cl(B) => order after PutOn(B,C) Cl(A) On(A,z) Cl(B) PutOn(A,B) Cl(B) On(B,z) Cl(C) PutOn(B,C) On(A,B) On(B,C) FINISH A B C B. Beckert: Einführung in die KI / KI für IM p.18

Example: Blocks World START On(C,A) On(A,Table) Cl(B) On(B,Table) Cl(C) B C A On(C,z) Cl(C) PutOnTable(C) Cl(A) On(A,z) Cl(B) PutOn(A,B) Cl(B) On(B,z) Cl(C) PutOn(B,C) PutOn(A,B) clobbers Cl(B) => order after PutOn(B,C) PutOn(B,C) clobbers Cl(C) => order after PutOnTable(C) On(A,B) On(B,C) FINISH A B C B. Beckert: Einführung in die KI / KI für IM p.18

POP Algorithm (Cont d) procedure CHOOSE-OPERATOR(plan, operators, S need, c) choose a step S add from operators or STEPS( plan) that has c as an effect if there is no such step then fail add the causal link S add c S need to LINKS( plan) add the ordering constraint S add S need to ORDERINGS( plan) if S add is a newly added step from operators then add S add to STEPS( plan) add Start S add Finish to ORDERINGS( plan) B. Beckert: Einführung in die KI / KI für IM p.20

POP Algorithm (Cont d) procedure RESOLVE-THREATS(plan) for each S threat that threatens a link S i c S j in LINKS( plan) do choose either Demotion: Add S threat Promotion: Add S j if not CONSISTENT( plan) then fail end S i to ORDERINGS( plan) S threat to ORDERINGS( plan) B. Beckert: Einführung in die KI / KI für IM p.21

Properties of POP Non-deterministic search for plan, backtracks over choicepoints on failure: choice of S add to achieve S need choice of promotion or demotion for clobberer Sound and complete There are extensions for: disjunction, universal quantification, negation, conditionals Efficient with good heuristics from problem description But: very sensitive to subgoal ordering Good for problems with loosely related subgoals B. Beckert: Einführung in die KI / KI für IM p.22

The Real World On(x) ~Flat(x) START FINISH ~Flat(Spare) Intact(Spare) Off(Spare) On(Tire1) Flat(Tire1) On(x) Remove(x) Off(x) ClearHub Off(x) ClearHub Puton(x) On(x) ~ClearHub Intact(x) Flat(x) Inflate(x) ~Flat(x) B. Beckert: Einführung in die KI / KI für IM p.23

Things Go Wrong Incomplete information Unknown preconditions Example: Intact Spare? Disjunctive effects Example: Incorrect information Inflate x causes Inflated x SlowHiss x Burst x BrokenPump Current state incorrect Example: spare NOT intact Missing/incorrect postconditions in operators Qualification problem Can never finish listing all the required preconditions and possible conditional outcomes of actions B. Beckert: Einführung in die KI / KI für IM p.24

Solutions Conditional planning Plan to obtain information (observation actions) Subplan for each contingency Example: Check Tire1 If Intact Tire1 Inflate Tire1 CallHelp Disadvantage: Expensive because it plans for many unlikely cases Monitoring/Replanning Assume normal states / outcomes Check progress during execution, replan if necessary Disadvantage: Unanticipated outcomes may lead to failure B. Beckert: Einführung in die KI / KI für IM p.25

Conditional Planning Execution of conditional plan If p thenplan elseplan Check p against current knowledge base, execute thenplan or elseplan Conditional planning Just like POP except: If an open condition can be established by observation action add the action to the plan complete plan for each possible observation outcome insert conditional step with these subplans CheckTire(x) KnowsIf(Intact(x)) B. Beckert: Einführung in die KI / KI für IM p.26

Conditional Planning Example Start On(Tire1) Flat(Tire1) Inflated(Spare) On( x ) Inflated( x ) Finish (True) B. Beckert: Einführung in die KI / KI für IM p.27

Conditional Planning Example Start On(Tire1) Flat(Tire1) Inflated(Spare) Flat(Tire1) Intact(Tire1) Inflate(Tire1) (Intact(Tire1)) Tire1 On( x ) Tire1 Inflated( x ) Finish (True) B. Beckert: Einführung in die KI / KI für IM p.27

Conditional Planning Example Start On(Tire1) Flat(Tire1) Inflated(Spare) Check(Tire1) Intact(Tire1) Flat(Tire1) Intact(Tire1) Inflate(Tire1) (Intact(Tire1)) Tire1 On( x ) Tire1 Inflated( x ) Finish (True) (Intact(Tire1)) B. Beckert: Einführung in die KI / KI für IM p.27

L Conditional Planning Example Start On(Tire1) Flat(Tire1) Inflated(Spare) Check(Tire1) Intact(Tire1) Flat(Tire1) Intact(Tire1) Inflate(Tire1) (Intact(Tire1)) Tire1 On( x ) Tire1 Inflated( x ) Finish (True) (Intact(Tire1)) On( x ) Finish Inflated( x ) ( Intact(Tire1)) B. Beckert: Einführung in die KI / KI für IM p.27

L Conditional Planning Example Start On(Tire1) Flat(Tire1) Inflated(Spare) Check(Tire1) Intact(Tire1) Flat(Tire1) Intact(Tire1) Inflate(Tire1) (Intact(Tire1)) Tire1 On( x ) Tire1 Inflated( x ) Finish (True) (Intact(Tire1)) Spare On( x ) Spare Finish Inflated( x ) ( Intact(Tire1)) B. Beckert: Einführung in die KI / KI für IM p.27

L L L Conditional Planning Example Start On(Tire1) Flat(Tire1) Inflated(Spare) Check(Tire1) Intact(Tire1) Flat(Tire1) Intact(Tire1) Inflate(Tire1) (Intact(Tire1)) Tire1 On( x ) Tire1 Inflated( x ) Finish (True) (Intact(Tire1)) LIntact(Tire1) Remove(Tire1) ( Intact(Tire1)) Puton(Spare) ( Intact(Tire1)) Spare On( x ) Spare Finish Inflated( x ) ( Intact(Tire1)) B. Beckert: Einführung in die KI / KI für IM p.27

Monitoring Execution monitoring Failure: Preconditions of remaining plan not met Action monitoring Failure: Preconditions of next action not met (or action itself fails, e.g., robot bump sensor) Consequence of failure Need to replan B. Beckert: Einführung in die KI / KI für IM p.28

Preconditions for Remaining Plan Start At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM) Sells(SM,Milk) At(SM) Sells(SM,Ban.) At(HWS) Have(Drill) Sells(SM,Ban.) Sells(SM,Milk) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish B. Beckert: Einführung in die KI / KI für IM p.29

Replanning Simplest On failure, replan from scratch Better Plan to get back on track by reconnecting to best continuation Failure B. Beckert: Einführung in die KI / KI für IM p.30

Replanning: Example PRECONDITIONS FAILURE RESPONSE START Color(Chair,Blue) ~Have(Red) Get(Red) Have(Red) Paint(Red) Color(Chair,Red) FINISH none Have(Red) Color(Chair,Red) N/A Fetch more red Repaint B. Beckert: Einführung in die KI / KI für IM p.31

Summary Planning Differs from general problem search; subgoals solved independently STRIPS: restricted format for actions, logic-based Nodes in search space are partial plans POP algorithm Standard planning cannot cope with incomplete/incorrect information Conditional planning with sensing actions to complete information; expensive at planning stage Replanning based on monitoring of plan execution; expensive at execution stage B. Beckert: Einführung in die KI / KI für IM p.32