Partial Order Planning Slides with help from Dan

  • Slides: 48
Download presentation
Partial Order Planning Slides with help from: Dan Weld Stuart Russell & Peter Norvig

Partial Order Planning Slides with help from: Dan Weld Stuart Russell & Peter Norvig 10/31/2020 Brian C. Williams 16. 412 J/6. 834 J Sept 16 th, 2002 1

Self Repairing Explorers

Self Repairing Explorers

N IO PL UT AN NI EC Commanded at: • Mission level • Engineering

N IO PL UT AN NI EC Commanded at: • Mission level • Engineering level EX Self-commanding Self-diagnosing Self-repairing NG Autonomous Agents RECOVERY Monitors Command dispatch Fault protection Attitude control Mission Goal Scenario

Readings for Today’s Lecture • Partial Order Planning AIMA Chapter 11 • Execution and

Readings for Today’s Lecture • Partial Order Planning AIMA Chapter 11 • Execution and Conditional Planning AIMA Chapter 13 • * AIMA = “Artificial Intelligence: A Modern Approach, ” by Russell and Norvig. • Optional Reading: Weld “Introduction to Least Commitment Planning, ” AI Magazine. (To be posted on the class web site)

Planning with Atomic Time • Operator-based planning as search • Declarative encoding of states

Planning with Atomic Time • Operator-based planning as search • Declarative encoding of states and operators • Partial order planning – Planning problem – Partial order planning algorithm

Operator-based Planning Problem What assumptions are implied? • Input – Set of world states

Operator-based Planning Problem What assumptions are implied? • Input – Set of world states – Action operators • Fn: world-state – Initial state of world – Goal • partial state (set of world states) • Actions have deterministic effects. – Sequence of actions a W 0 a W 1 north 12 • Agent is omniscient (no sensing necessary). • Agent is sole cause of change. • Output north 11 • Atomic time. a W 2 • No indirect effects. ] STRIPS Assumptions

Operator-based Planning as Search 1) Forward-Chaining State-Space Search Initial State C A B What

Operator-based Planning as Search 1) Forward-Chaining State-Space Search Initial State C A B What problems arise? Goal State A B C

What Are Alternative Strategies? Are these strategies supported by our current representation? Initial State

What Are Alternative Strategies? Are these strategies supported by our current representation? Initial State C A B Goal State A B C Need more declarative description of operators and state

Planning as Search 2) Backward-Chaining (goal-directed search) • Search partial worlds (partial assignment) C

Planning as Search 2) Backward-Chaining (goal-directed search) • Search partial worlds (partial assignment) C D A B E Subgoals weakly interact: • Maintain goal/subgoal decomposition Initial State is • Order action sequences only where needed completely (partial orders) defined èHow do we represent the search state? A B C D E A D B C E *** A B C D E Many Goal States Where do we start?

Plan-Space Search Idea: Each state is a partial plan pick-from-table(C) put-on(C, B) pick-from-table(B) •

Plan-Space Search Idea: Each state is a partial plan pick-from-table(C) put-on(C, B) pick-from-table(B) • How do we represent plans? • How do we test if a plan is a solution? • How do we generate a plan?

Partial Order Planning • Plan from goals, back to initial state • Search through

Partial Order Planning • Plan from goals, back to initial state • Search through partial plans • Representation: – Operators given in declarative representation, rather than black box functions. – Plans represent only relevant commitments (e. g. , relevant ordering of operators, not total ordering)

Planning with Atomic Time • Operator-based planning as search • Declarative encoding of state

Planning with Atomic Time • Operator-based planning as search • Declarative encoding of state and operators • Partial order planning – Planning problem – Partial order planning algorithm

STRIPS Representation: Encode world states as conjunctions of literals • Propositions • True/False Statements

STRIPS Representation: Encode world states as conjunctions of literals • Propositions • True/False Statements (block a) • Literals • Proposition or its negation (not (block a) ) • Conjunction • And of literals • (And (block a) (block b) (block c) (on-table a) …) a W 0 north 11 a W 1 • A World state is a conjunction with every proposition appearing exactly once. • A Partial state is a conjunction with every proposition appearing at most once. What is missing from this logic?

STRIPS Operator Representation • Initial state: • ((block a) (block b) (block c) (on-table

STRIPS Operator Representation • Initial state: • ((block a) (block b) (block c) (on-table a) (on-table b) (clear a) (clear b) (clear c) (arm-empty)) • goal (partial state): • ((on a b) (on b c))) • Available actions • Strips operators a W 0 north 11 a W 1 precond: (and (agent-at 1 1) (agent-facing north)) North 11 effect: (and (agent-at 1 2) (not (agent-at 1 1))) • Effects specify how to change the set of propositions.

(Parameterized) Operator Schemata • Instead of defining: pickup-A and pickup-B and … • Define

(Parameterized) Operator Schemata • Instead of defining: pickup-A and pickup-B and … • Define a schema: ? var denotes a free variable (: operator pick-up : parameters ((block ? ob 1)) : precondition (and (clear ? ob 1) (on-table ? ob 1) (arm-empty)) : effect (and (not (clear ? ob 1)) (not (on-table ? ob 1)) (not (arm-empty)) (holding ? ob 1))) } No all te: yo ow stri u m de ps us rive doe t b d sn e c eff ’t om ect pl s; ete !

Planning with Atomic Time • Operator-based planning as search • Declarative encoding of state

Planning with Atomic Time • Operator-based planning as search • Declarative encoding of state and operators • Partial order planning – Planning problem – Partial order planning algorithm

Given Initial and Goal State Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. )

Given Initial and Goal State Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) Initial and Goal states are encoded as operators, Why? Don’t need to introduce (partial) states as separate objects. Keeps theory minimal. Have(Milk) At(Home) Have(Ban. ) Have(Drill) Finish

Given Plan Operators At(HWS) At(SM), Sells(SM, Ban. ) Go(SM) Buy(Ban. ) At(SM) Have(Ban) At(Home)

Given Plan Operators At(HWS) At(SM), Sells(SM, Ban. ) Go(SM) Buy(Ban. ) At(SM) Have(Ban) At(Home) At(HWS) Sells(HWS, Drill) Go(HWS) Buy(Drill) At(HWS) Have(Drill) At(SM), Sells(SM, Milk) Go(Home) At(Home) What is a solution? Buy(Milk) Have(Milk)

Partial Order Plan <Actions, Orderings, Links> Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban.

Partial Order Plan <Actions, Orderings, Links> Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) Have(Milk) At(Home) Have(Ban. ) Have(Drill) Finish

Partial Order Plan <Actions, Orderings, Links> Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban.

Partial Order Plan <Actions, Orderings, Links> Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) Have(Milk) At(Home) Have(Ban. ) Have(Drill) Finish

Partial Order Plan <Actions, Orderings, Links> Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban.

Partial Order Plan <Actions, Orderings, Links> Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(HWS) Sells(HWS, Drill) Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban. ) Have(Drill) Finish

Partial Order Plan <Actions, Orderings, Links> Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban.

Partial Order Plan <Actions, Orderings, Links> Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) 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. ) Buy(Milk) Buy(Ban. ) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban. ) Have(Drill) Finish

Partial Order Plan <Actions, Orderings, Links> Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban.

Partial Order Plan <Actions, Orderings, Links> Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) 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. ) Buy(Milk) Buy(Ban. ) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban. ) Have(Drill) Finish

Why is an ordering needed? At(HWS) Go(SM) At(SM) Buy(Milk) At(SM) Go(Home) At(Home)

Why is an ordering needed? At(HWS) Go(SM) At(SM) Buy(Milk) At(SM) Go(Home) At(Home)

Why is an ordering needed? Suppose the other order is allowed, what happens? At(HWS)

Why is an ordering needed? Suppose the other order is allowed, what happens? At(HWS) Go(SM) “Threatened Precondition” At(SM) Go(Home) At(SM) Buy(Milk)

Why is an ordering needed? Suppose the other order is allowed, what happens? At(HWS)

Why is an ordering needed? Suppose the other order is allowed, what happens? At(HWS) Go(SM) Link indicates protected time interval. At(SM) Go(Home) At(SM) Buy(Milk)

Ordering Resolves Threat At(HWS) Go(SM) At(SM) Buy(Milk) At(SM) Go(Home) At(Home)

Ordering Resolves Threat At(HWS) Go(SM) At(SM) Buy(Milk) At(SM) Go(Home) At(Home)

A Solution: Complete and Consistent Plan • Complete Plan IFF every precondition of every

A Solution: Complete and Consistent Plan • Complete Plan IFF every precondition of every step is achieved Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(Home) Go(HWS) At(HWS) Sells(HWS, Drill) A step’s precondition is achieved iff • its the effect of a preceding step, • no possibly intervening step At(SM), Sells(SM, Milk) undoes it. Buy(Drill) At(HWS) Go(SM) At(SM), Sells(SM, Ban. ) Buy(Milk) • Consistent Plan IFF there is no contradiction in the ordering constraints (I. e. , never si < sj and sj < si. ) Buy(Ban. ) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban. ) Have(Drill) Finish

Planning with Atomic Time • Operator-based planning as search • Declarative encoding of state

Planning with Atomic Time • Operator-based planning as search • Declarative encoding of state and operators • Partial order planning – Planning problem – Partial order planning algorithm

POP(<A, O, L>, agenda, actions) • <A, O, L>, A partial plan to expand

POP(<A, O, L>, agenda, actions) • <A, O, L>, A partial plan to expand • Agenda: A queue of open conditions still to be satisfied: <p, aneed > • Actions: A set of actions that may be introduced to meet needs. • aadd: an action that produces the needed condition p for aneed • Athreat : an action that might threaten a causal link from aproducer to aconsumer

POP(<A, O, L>, agenda, actions) 1. 2. 3. 4. 5. 6. Termination: If agenda

POP(<A, O, L>, agenda, actions) 1. 2. 3. 4. 5. 6. Termination: If agenda is empty, return plan <A, O, L>. Goal Selection: select and remove open condition <p, aneed > from agenda. Action Selection: Choose new or existing action aadd that can precede aneed and whose effects include p. Link and order actions. Update Agenda: If aadd is new, add its preconditions to agenda. Threat Detection: For every action athreat that might threaten some causal link from aproduce to aconsume, choose a consistent ordering: a) Demotion: Add athreat < aproduce b) Promotion: Add aconsume < athreat Recurse: on modified plan and agenda Choose is nondeterministic Select is deterministic

To remove threats… promote threat… At(HWS) Go(SM) At(SM) Go(Home) At(SM) Buy(Milk)

To remove threats… promote threat… At(HWS) Go(SM) At(SM) Go(Home) At(SM) Buy(Milk)

To remove threats… promote threat… demote threat… At(HWS) Go(SM) At(SM) Buy(Milk) At(SM) Go(Home) At(Home)

To remove threats… promote threat… demote threat… At(HWS) Go(SM) At(SM) Buy(Milk) At(SM) Go(Home) At(Home)

To remove threats… promote threat… demote threat… • But only allow demotion/promotion if schedulable

To remove threats… promote threat… demote threat… • But only allow demotion/promotion if schedulable • consistent = loop free • no action precedes initial state At(HWS) Go(SM) At(SM) Buy(Milk) At(SM) Go(Home) At(Home)

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) Have(Drill) Have(Milk) Have(Ban. ) at(Home)

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) Have(Drill) Have(Milk) Have(Ban. ) at(Home) Finish

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM),

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) Have(Drill) Have(Milk) Have(Ban. ) at(Home) Finish

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM),

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) Have(Drill) Have(Milk) Have(Ban. ) at(Home) Finish

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(x) Go(SM) At(x) Go(HWS) At(HWS)

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(x) Go(SM) At(x) Go(HWS) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) Have(Drill) Have(Milk) Have(Ban. ) at(Home) Finish

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(Home) Go(SM) Go(HWS) At(HWS) Sells(HWS,

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(Home) Go(SM) Go(HWS) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) Have(Drill) Have(Milk) Have(Ban. ) at(Home) Finish

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(Home) Go(SM) Go(HWS) At(HWS) Sells(HWS,

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(Home) Go(SM) Go(HWS) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) Have(Drill) Have(Milk) Have(Ban. ) at(Home) Finish

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(Home) Go(SM) Go(HWS) At(HWS) Sells(HWS,

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(Home) Go(SM) Go(HWS) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) Have(Drill) Have(Milk) Have(Ban. ) at(Home) Finish

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(x) At(Home) Go(SM) Go(HWS) At(HWS)

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(x) At(Home) Go(SM) Go(HWS) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) At(SM) Go(Home) Have(Drill) Have(Milk) Have(Ban. ) at(Home) Finish

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(x) Go(SM) At(x) Go(HWS) At(HWS)

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(x) Go(SM) At(x) Go(HWS) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) Have(Drill) Have(Milk) Have(Ban. ) at(Home) Finish

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(Home) Go(SM) Go(HWS) At(HWS) Sells(HWS,

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(Home) Go(SM) Go(HWS) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) Have(Drill) Have(Milk) Have(Ban. ) at(Home) Finish

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(Home) Go(SM) Go(HWS) At(HWS) Sells(HWS,

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(Home) Go(SM) Go(HWS) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) Have(Drill) Have(Milk) Have(Ban. ) at(Home) Finish

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(x) At(Home) Go(SM) Go(HWS) At(HWS)

Start At(Home) Sells(HWS, Drill) Sells(SM, Milk) Sells(SM, Ban. ) At(x) At(Home) Go(SM) Go(HWS) At(HWS) Sells(HWS, Drill) Buy(Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Ban. ) Buy(Milk) Buy(Ban. ) At(SM) Go(Home) Have(Drill) Have(Milk) Have(Ban. ) at(Home) Finish

N IO PL UT AN NI EC EX Self-commanding Self-diagnosing Self-repairing NG Autonomous Agents:

N IO PL UT AN NI EC EX Self-commanding Self-diagnosing Self-repairing NG Autonomous Agents: What is missing? RECOVERY Monitors Command dispatch Fault protection Attitude control Mission Goal Scenario

Expressive Many Action Representations: (Many Studied In This Course) POMDPs Tractable MDPs Hierarchical Hybrid

Expressive Many Action Representations: (Many Studied In This Course) POMDPs Tractable MDPs Hierarchical Hybrid Constraint Automata Situation Calculus SADL Probabilistic Concurrent Constraint Automata STRIPS ADL, UWL TPNs DS 1 DDL