Logical Agents Reasoning [Ch 6] Propositional Logic [Ch 6] - - PDF document

logical agents
SMART_READER_LITE
LIVE PREVIEW

Logical Agents Reasoning [Ch 6] Propositional Logic [Ch 6] - - PDF document

Logical Agents Reasoning [Ch 6] Propositional Logic [Ch 6] Predicate Calculus Representation [Ch 7] Predicate Calculus Inference [Ch 9] Implemented Systems [Ch 10] Applications [Ch 8] Planning [Ch 11]


slide-1
SLIDE 1

Logical Agents

  • Reasoning

[Ch 6]

  • Propositional Logic

[Ch 6]

  • Predicate Calculus – Representation

[Ch 7]

  • Predicate Calculus – Inference

[Ch 9]

  • Implemented Systems

[Ch 10]

  • Applications

[Ch 8]

  • Planning

[Ch 11]

− Using “Situation Calculus” − Simple − GraphPlan [Notes]

Planning 1

slide-2
SLIDE 2

Planning 2

slide-3
SLIDE 3

Planning (Overview)

  • Planning vs Problem Solving ?
  • Strips framework
  • Situation Space vs Plan Space
  • Partial Order Planner
  • Protected Links
  • Example

Planning 3

slide-4
SLIDE 4

Planning in Situation Calculus

  • Planning

⊂ Problem Solving

Given: Initial: At(Home, S0) ∧ ¬Have(Milk, S0) Goal: ∃s At(Home,s) ∧ Have(Milk,s) Operators: ∀a, s Have(Milk, Result(a,s)) ⇔ [(a = Buy(Milk) ∧ At(Store, s)) ∨ (Have(Milk,s) ∧ a = Drop(Milk))] . . . Find: Sequence of operators [o1, . . . ok] where S = Result( ok, Result( ...Result( o1, S0 ) ...)) s.t. At(Home, S) ∧ Have(Milk, S)

  • but. . . Standard Problem Solving is inefficient

As goal is “black box” just generate-&-test!

Planning 4

slide-5
SLIDE 5

Na ¨ ıve Problem Solving

Goal: “Have Milk, Bananas, and Drill; at home”

∃s At(Home, s) ∧ Have(Milk, s) ∧ Have(Banana, s) ∧ Have(Drill, s)

Initial: “None of these; at home”

At(Home, S0) ∧ ¬Have(Milk, S0) ∧¬Have(Banana, S0) ∧ ¬Have(Drill, S0)

Operators: Goto(y), SitIn(z), Talk(w), Buy(q), ...

. . . Buy Tuna Fish Buy Arugula Buy Milk Go To Class Buy a Dog Talk to Parrot Sit Some More Read A Book ... Go To Supermarket Go To Sleep Read A Book Go To School Go To Pet Store

  • Etc. Etc. ...

Sit in Chair Start Finish

Planning 5

slide-6
SLIDE 6

General Issues

  • Done?
  • General problems:

− Problem solving is P-space complete − Logical inference is only semidecidable − . . . plan returned may go from initial to goal, but extremely inefficiently (NoOp, [A, A−1], . . . )

  • Solution

+ Restrict language + Special purpose reasoner ⇒ PLANNER

Planning 6

slide-7
SLIDE 7

Key Ideas

  • 1. Open up representation

. . . to connect States to Actions

If goal includes “Have(Milk)”, and “Buy(x) achieves Have(x)”, then consider action “Buy(Milk)”

  • 2. Add actions ANYWHERE in plan

Not just to front!

Order of adding actions = order of execution! Eg, can decide to include Buy(Milk) BEFORE de- ciding where? How to get there? . . . Note: Exploits decomposition: doesn’t matter which Milk-selling store, whether agent currently has Drill, . . . . . . avoid arbitrary early decisions . . .

  • 3. Subgoals tend to be nearly independent

⇒ divide-&-conquer

Eg, going to store does NOT interfer with bor- rowing from neighbor. . .

Planning 7

slide-8
SLIDE 8

Strips Representation

State: Conjunct’n of (function-free) ground literals

At(Home) ∧ ¬Have(Milk)

Goal: Conjunct’n of literals

. . . may contain existentially quantified variables At(Home) ∧ Have(Milk) At(x) ∧ Sells(x, Milk)

Action:

Action descript’n: Name of action Precondition: Conjunct’n of positive literals Effect: Conjunct’n of literals Eg: Op(Action: Go(here, there), Precondition: At(here) ∧ Path(here, there), Effects: At(there) ∧ ¬At(here) ) Initial: At(Home), Path(Home, Store), ... take “Go(Home, Store)” New state: ¬At(Home), At(Store), Path(Home, Store), ... NOTE: no explicit “situation variables” Precondition just wrt previous situation, . . .

Planning 8

slide-9
SLIDE 9

Situation Space

Situation Space Planner: search through space

  • f SITUATIONS

Progression planner: Forward search through situations, from initial towards goal Problem: High branching factor Regression planner: Backward search from goal to starting situation Possible: if operator contain enuff info to regress

from (partial description) of result state to (partial description) of previous state

Desirable: if goal has few conjuncts; &

each conjunct has only a few applicable operators

⇒ Regression planner can be much more ef- ficient but . . . Conjunctive goals make this difficult: − Inefficient − Interdependent goals

Planning 9

slide-10
SLIDE 10

Searching in Space of “Situations”

(a) (b)

2

At(P , A)

1

At(P , A)

1

At(P , A)

2

At(P , B)

1

At(P , B)

2

At(P , A)

1

At(P , B)

2

At(P , A)

1

At(P , A)

2

At(P , B)

1

At(P , B)

2

At(P , B)

1

Fly(P ,A,B)

2

Fly(P ,A,B)

1

Fly(P ,A,B)

2

Fly(P ,A,B)

Planning 10

slide-11
SLIDE 11

Search the Space of Plans

  • Start with partial plan

Expand plan until producing complete plan

  • Refinement operators

add constraints to partial plan

Eg: Adding an action Imposing order on actions Instantiating unbound variable . . . (View “partial plan” as set of “completed” plans. Each refinement REMOVES some plans.)

+ Modification Operators

  • ther changes – “debugging” bad plans

Planning 11

slide-12
SLIDE 12

Searching in Space of “Partial Plans”

Start Start On(R−Shoe) On(L−Shoe) On(R−Shoe) On(L−Shoe) Start On(R−Shoe) On(L−Shoe) Start On(R−Shoe) On(L−Shoe) Buy Arugala

At(GS) Sells(GS, Arugala)

Talk(Parrot)

At(Parrot, x) At(x) PutOn(L−Shoe) On(L−Sock)

Finish

Finish Finish Finish

Planning 12

slide-13
SLIDE 13

Partial Plan

  • A “(partial) plan” is

          

set of actions {Si} set of ordering constraints: “Si ≺ Sj” set of causal links: “Si

PreC

− → Sj” set of open preconditions:

          

  • Action

∈ S

≡ instantiated operator

PutOn(L-Sock), PutOn(R-Shoe)

  • Ordering constraints

⊂ S × S

“Si ≺ Sj” means Si has to happen (sometime) before Sj

PutOn(L-Sock) ≺ PutOn(L-Shoe)

  • Causal links

⊂ S × Prop × S

“Si

PreC

− → Sj” means Si causes PreC, which Sj needs

PreC ∈ Effects of Si; PreC ∈ PreConditions of Sj PutOn(L-Sock)

On(L−Sock)

− → PutOn(L-Shoe)

  • Open-PreC

⊂ Prop

Set of preconditions, over all actions that are not achieved

Planning 13

slide-14
SLIDE 14

Initial Partial Plan (Shoes)

Consider: Goal: RShoeOn ∧ LShoeOn Initial: {} Operators: Op(RShoe,

PreC: RSockOn, Eff:

RShoeOn) Op(LShoe,

PreC: LSockOn, Eff:

LShoeOn) Op(RSock,

PreC: {}, Eff:

RSockOn) Op(LSock,

PreC: {}, Eff:

LSockOn)

  • Initially. . . just dummy actions:

Ss (Start): no PreC; Effects are FACTs Sf (Finish): PreC = Goal; no Effects Plan(Actions:

  • Ss:

Act( Start;

PreC: {}; Eff:

{} )

Sf: Act( Finish; PreC: RShoeOn ∧ LShoeOn )

  • Orderings:
  • Ss ≺ Sf
  • CausalLinks: {}

Open-PreC:

  • RShoeOn

LShoeOn

  • )

Planning 14

slide-15
SLIDE 15

Shoe Plan #2

Plan

    

Actions:

Ss:

Act( Start; PreC: {}; Eff:

{} )

Sf: Act( Finish; PreC: RShoeOn ∧ LShoeOn )

  • Orderings:

{ Ss ≺ Sf } CausalLinks:

{}

Open-PreC:

RShoeOn

LShoeOn

   

  • “Open-PreC” = {}

⇒ NOT DONE!

  • Next partial plan:

Try to achieve “RShoeOn” ∈Open-PreC . . . using “RShoe” Plan

             

Actions:

    

Ss: Act( Start; PreC: {}; Eff:

{} )

Sf: Act( Finish; PreC: RShoeOn ∧ LShoeOn )

Srs: Act( RShoe; PreC: RSockOn;

Eff: RShoeOn )

    

Orderings:

  • Ss ≺ Sf

Ss ≺ Srs ≺ Sf

  • CausalLinks:

{ RSock On(RSockOn) − → RShoe }

Open-PreC:

RSockOn

LShoeOn

            

Planning 15

slide-16
SLIDE 16

Comments on Partial Plans

  • Every action is between Ss and Sf

Ss for start, before everything Se for finish,

  • nly when all goals achieved
  • ≺ means BEFORE

not necessarily IMMEDIATELY before “Si

PreC

− → Sj” means before with no “intervening clobber-er”

  • In “Planning Space”:

Move from Plani to Planj by ⋆ Adding new Action S

⋆ Adding new Ordering ≺; CausalLink Si

PreC

− → Sj, Value for Variable, . . . . . . Q: When to add S? A: If S :Effect matches Open-PreC Q: How to add S? A: Add S to Actions Add S ≺ T to Ordering Add S

PreC

− → T to CausalLinks Add S:PreC to Open-PreC as necessary + more. . .

Planning 16

slide-17
SLIDE 17

Shoe Plan #3

Plan(Actions:

            

Ss: Act(Start;

PreC: {}; Eff:

{})

Se: Act(Finish; PreC: RShoeOn ∧ LShoeOn) Srs: Act(RShoe; PreC: RSockOn; Eff: RShoeOn) Srx: Act(RSock; PreC: {}; Eff: RSockOn) Slx: Act(LSock; PreC: {}; Eff: LSockOn) Sls: Act(LShoe; PreC: LSockOn; Eff: LShoeOn)

            

Orderings:

  

Ss ≺ Se, Ss ≺ Slx, Ss ≺ Srx, . . . Slx ≺ Sls, Srx ≺ Srs Sls ≺ Se, Srs ≺ Se, . . .

  

CausalLinks:

  

Slx

LSockOn

− → Sls Srx

RSockOn

− → Srs

  

Open-PreC: {} ) Notes: As “Open-PreC = {}, can stop (Still another check) . . .

Planning 17

slide-18
SLIDE 18

Partial Plans

Plan(Actions:

        

Ss: Act(Start; PreC: {}; Eff:

{})

Se: Act(Finish; PreC: RShoeOn ∧ LShoeOn) Srs: Act(RShoe; PreC: RSockOn; Eff: RShoeOn) Srx: Act(RSock; PreC: {}; Eff: RSockOn) Slx: Act(LSock; PreC: {}; Eff: LSockOn) Sls: Act(LShoe; PreC: LSockOn; Eff: LShoeOn)

        

Orderings:

Ss ≺ Se, Ss ≺ Slx, Ss ≺ Srx, . . .

Slx ≺ Sls, Srx ≺ Srs Sls ≺ Se, Srs ≺ Se, . . .

  • CausalLinks:
  • Srx

RSockOn

− → Srs Slx

LSockOn

− → Sls

  • Open-PreC: {} )
  • ≈ RSock, RShoe and LSock, LShoe

Q: Should they be combined, to produce LINEAR plan?? A: Why?

If left PARTIALLY specified, more options later . . . when we have more constraints!

  • Principle of least commitment:

Don’t make decisions until necessary.

– Only order actions that HAVE to be ordered – Only instantiate variables when needed (Don’t decide on store until have all constraints)

Planning 18

slide-19
SLIDE 19

Partial- vs Total- Order Plan

Start Start Start

Total Order Plans: Partial Order Plan:

Start Left Sock Left Shoe Sock Right Shoe Right Finish Start Finish Sock Right Shoe Right Sock Left Shoe Left Start Left Sock Shoe Right Finish Right Sock Left Shoe Finish Sock Left Right Sock Shoe Left Right Shoe Shoe Right Finish Sock Right Left Sock Left Shoe Finish Sock Right Shoe Left Left Sock Right Shoe LeftSockOn RightSockOn LeftShoeOn, RightShoeOn Start Sock Right Shoe Right Sock Left Shoe Left Finish

  • LeftSock before LeftShoe

RightSock before RightShoe But nothing else specified!

Planning 19

slide-20
SLIDE 20

Constraints on PO-Plans

  • “Partial order plan”

⋆ Some constraints on order of actions ⋆ Must be consistent NOT: Sa ≺ Sb and Sb ≺ Sa

  • A linearization of (partial) plan

completely orders all actions . . . producing a“totally ordered plan”

  • “Causal Link” A

ρ

− → B . . . A achieves ρ for B ⋆ connects action A to action B where A:Effect = ρ = B :PreCond If C :Effect = ¬ρ, must not add C between A and B

Planning 20

slide-21
SLIDE 21

Solution

A solution ≡ a (partial) plan that agent can execute and guarantees achievement of goal(s). ≡ a complete, consistent plan: Complete: Open-PreC= {}

Each precond ρ of each action A s achieved by some other action B s.t. B ≺ A and ∃C s.t. C undoes ρ and B ≺ C ≺ A ∀A ∈ Actions(Plan), ∀ρ ∈ PreC(A), ∃B B ≺ A & ρ ∈ Eff(A) & ∃C B ≺ C ≺ A & ¬ρ ∈ Eff(C)

Consistent: No contradictions in

  • rdering constraints.

Note: Need not be a TOTAL plan. . . . but every linearization is correct!

Planning 21

slide-22
SLIDE 22

POPlaning Example: Changing a Tire

Planning 22

slide-23
SLIDE 23

Flat-Tire Domain

Fl= Flat; Sp= Spare; Ax= Axel; Tr= Trunk; Gr= Ground

  • Initial: At(Fl, Ax) ∧ At(Sp, Tr)

Op

 

Start

PreC:

{}

Eff:

At(Fl, Ax) ∧ At(Sp, Tr)

 

  • Goal: At(Sp, Ax)

Op

 

Finish

PreC:

At(Sp, Ax)

Eff:

{}  

  • Actions:

Op

 

TakeOutSpare

PreC:

At(Sp, Tr)

Eff:

¬At(Sp, Tr) ∧ At(Sp, Gr)

 

Op

 

RemoveFlat

PreC:

At(Fl, Ax)

Eff:

¬At(Fl, Ax) ∧ At(Fl, Gr)

 

Op

 

PutOnSpare

PreC:

At(Sp, Gr) ∧ ¬At(Fl, Ax)

Eff:

¬At(Sp, Gr) ∧ At(Sp, Ax)

 

Op

  

LeaveOverNight

PreC:

{}

Eff:

¬At(Sp, Gr) ∧ ¬At(Sp, Ax) ∧ ¬At(Sp, Tr) ∧ ¬At(Fl, Gr) ∧ ¬At(Fl, Ax)

  

Planning 23

slide-24
SLIDE 24

Tire – Planning #1

  • Initial configuration:

Plan

   

Acts:

Ss: Act( Start;

PreC: {}; Eff: At(Sp,Tr) ∧ At(Fl,Ax) Sf: Act( Finish; PreC: At(Sp,Ax); Eff:

{} )

  • Orderings:

{ Ss ≺ Sf } CausalLinks:

{}

Open-PreC: { At(Sp,Ax) }

   

Start At(Sp,Tr) At(Fl,Ax) Finish At(Sp,Ax)

  • Only “Open-PreC”: At(Sp,Ax)

Given

Op

 

PutOnSpare

PreC:

At(Sp,Gr) ∧ ¬At(Fl,Ax)

Eff:

¬At(Sp,Gr) ∧ At(Sp,Ax)

 

  • New (partial) plan . . .

Plan

            

Acts:

    

Ss: Act( Start; PreC: {}; Eff: At(Sp,Tr) ∧ At(Fl,Ax) Sf: Act( Finish; PreC: At(Sp,Ax); Eff:

{} )

S1: Act( PutOnSpare; PreC: At(Sp,Gr) ∧ ¬At(Fl,Ax) Eff: ¬At(Sp,Gr) ∧ At(Sp,Ax) )

    

Orderings:

  • Ss ≺ S1 ≺ Sf
  • CausalLinks:

{ S1

At(Sp,Ax)

− → Sf }

Open-PreC:

At(Sp,Gr)

¬At(Fl,Ax)

           

Planning 24

slide-25
SLIDE 25

Tire — Planning #2

Plan

        

Acts:

  

Ss: Act( Start; PreC: {}; Eff: At(Sp,Tr) ∧ At(Fl,Ax) Sf: Act( Finish; PreC: At(Sp,Ax); Eff:

{} )

S1: Act( PutOnSpare; PreC: At(Sp,Gr) ∧ ¬At(Fl,Ax) Eff: ¬At(Sp,Gr) ∧ At(Sp,Ax) )

  

Orderings: { Ss ≺ S1 ≺ Sf } CausalLinks: S1

At(Sp,Ax)

− → Sf Open-PreC:

At(Sp,Gr)

¬At(Fl,Ax)

       

  • Now work on Open-PreC:

At(Sp,Gr)

(PutOnSpare’s pre-cond)

Only action achieving this condition: TakeOutSpare

TakeOutSpare

At(Spare,Trunk)

PutOnSpare

At(Spare,Ground) At(Flat,Axle)

Finish

At(Spare,Axle)

Start

At(Flat,Axle) At(Spare,Trunk)

  • Now: Open-PreC =
  • At(Sp,Tr)

¬At(Fl,Ax)

  • To process ¬At(Fl,Ax) . . .

Planning 25

slide-26
SLIDE 26

“Clobbering”

TakeOutSpare

At(Spare,Trunk)

PutOnSpare

At(Spare,Ground) At(Flat,Axle)

Finish

At(Spare,Axle)

Start

At(Flat,Axle) At(Spare,Trunk)

  • For ¬At(Fl,Ax):

Spse LeaveOvernight

Op

  

LeaveOverNight

PreC:

{}

Eff:

¬At(Sp, Gr) ∧ ¬At(Sp, Ax) ∧ ¬At(Sp, Tr) ∧ ¬At(Fl, Gr) ∧ ¬At(Fl, Ax) ∧

  

  • BUT. . .

LeaveOvernight:Effects includes ¬At(Sp,Gr), which clobbers TakeOutSpare At(Sp,Gr) − → PutOn(Sp,Ax)

  • Ie, sequence

TakeOutSpare, LeaveOvernight , PutOn(Sp,Ax)

will NOT work: when about to perform PutOn(Sp,Ax) its precondition At(Sp,Gr) is NOT true!

Planning 26

slide-27
SLIDE 27

Protected Links

Problem: A step S3 threatens causal link S1

ρ

− → S2 if effect of S3 is deleting (clobbering) ρ

Eg: LeaveOvernight threatens TakeOutSpare

At(Sp,Gr)

− → PutOnSpare

Solution: Add ordering constraints to keep S3 from intervening between S1 and S2 Option1: Demotion (before S1): (b) Option2: Promotion (after S2): (c)

c

L

c

L

c

L

c c c

(a) (b) (c)

S 2 S 3 S 2 S 3 S 2 S 3 S1 S1

1

S

Planning 27

slide-28
SLIDE 28

Planning 28

slide-29
SLIDE 29

Where to add LeaveOvernight?

⇒ need to move LeaveOvernight to 1. before TakeOutSpare 2. after PutOnSpare

  • 2. does NOT work:

as LeaveOvernight:Effects includes ¬At(Sp,Ax), which clobbers PutOn(Sp,Ax)

At(Sp,Ax)

− → Finish ⇒ AFTER Finish . . . but NOTHING can be AFTER Finish. . .

⇒ need to use 1. see dotted-line (for ≺)

TakeOutSpare

At(Spare,Trunk)

PutOnSpare

At(Spare,Ground) At(Flat,Axle)

Finish

At(Spare,Axle)

LeaveOvernight

At(Flat,Axle) At(Flat,Ground) At(Spare,Axle) At(Spare,Ground) At(Spare,Trunk)

Start

At(Flat,Axle) At(Spare,Trunk)

Planning 29

slide-30
SLIDE 30

Problem... backtrack ...

TakeOutSpare

At(Spare,Trunk)

PutOnSpare

At(Spare,Ground) At(Flat,Axle)

Finish

At(Spare,Axle)

LeaveOvernight

At(Flat,Axle) At(Flat,Ground) At(Spare,Axle) At(Spare,Ground) At(Spare,Trunk)

Start

At(Flat,Axle) At(Spare,Trunk)

  • Here,Open-PreC= { At(Sp,Tr) }

Start is only action w/Effect = At(Sp,Tr) ⇒ need Start At(Sp,Tr) − → TakeOutSpare,

  • But. . . LeaveOvernight

threatens Start At(Sp,Tr) − → TakeOutSpare, Promote or Demote?

  • 1. Move LeaveOvernight BEFORE Start ?

Not allowed!

  • 2. Move LeaveOvernight AFTER TakeOutSpare?

No – as LeaveOvernight ≺ TakeOutSpare

Neither is possible!

  • Planner has proven

LeaveOvernight is NOT (this) part of changing tire! ⇒ Need to backtrack!

Planning 30

slide-31
SLIDE 31

Tire — Planning #3

  • Return to

TakeOutSpare

At(Spare,Trunk)

PutOnSpare

At(Spare,Ground) At(Flat,Axle)

Finish

At(Spare,Axle)

Start

At(Flat,Axle) At(Spare,Trunk)

How else to achieve ¬At(Fl,Ax) ?

  • Try

Op

 

RemoveFlat

PreC:

At(Fl, Ax)

Eff:

¬At(Fl, Ax) ∧ At(Fl, Gr)

 

Start TakeOutSpare

At(Spare,Trunk)

RemoveFlat

At(Flat,Axle)

PutOnSpare

At(Spare,Ground) At(Flat,Axle)

Finish

At(Spare,Axle) At(Flat,Axle) At(Spare,Trunk)

  • Open-PreC

= { At(Fl,Ax), At(Sp,Tr) } Use Start At(Fl,Ax) − → RemoveFlat Start At(Sp,Tr) − → TakeOutSpare

  • Open-PreC = {} ... DONE!

Planning 31

slide-32
SLIDE 32

Comments

Start TakeOutSpare

At(Spare,Trunk)

RemoveFlat

At(Flat,Axle)

PutOnSpare

At(Spare,Ground) At(Flat,Axle)

Finish

At(Spare,Axle) At(Flat,Axle) At(Spare,Trunk)

  • Partial Order: 2 linearizations

(in general, can be MANY extensions)

Added FLEXIBITY if events later impose other constraints

  • Further improvements

Might unlink Start

At(Fl,Ax)

− → RemoveFlat, then re-link it Should use Dependency-Directed backtracking!

  • Other complications if FirstOrder

and have unbound variables

  • Some good heuristics

⋆ most-constrained variables (CSP)

Planning 32

slide-33
SLIDE 33

POP: Partial Order Planner

function POP(initial,goal,operators) returns plan plan

  • MAKE-MINIMAL-PLAN(initial, goal)

loop do if SOLUTION?(plan) then return plan Sneed, c

  • SELECT-SUBGOAL( plan)

CHOOSE-OPERATOR(plan,operators,Sneed, c) RESOLVE-THREATS( plan) end function SELECT-SUBGOAL(plan) returns Sneed, c pick a plan step Sneed from STEPS( plan) with a precondition c that has not been achieved return Sneed, c procedure CHOOSE-OPERATOR(plan,operators,Sneed,c) choose a step Sadd from operators or STEPS(plan) that has c as an effect if there is no such step then fail add the causal link Sadd

c

✁✄✂

Sneed to LINKS( plan) add the ordering constraint Sadd

Sneed to ORDERINGS( plan) if Sadd is a newly added step from operators then add Sadd to STEPS(plan) add Start

Sadd

Finish to ORDERINGS( plan) procedure RESOLVE-THREATS(plan) for each Sthreat that threatens a link Si

c

✁✆✂

Sj in LINKS( plan) do choose either Promotion: Add Sthreat

Si to ORDERINGS( plan) Demotion: Add Sj

Sthreat to ORDERINGS( plan) if not CONSISTENT( plan) then fail end

Planning 33

slide-34
SLIDE 34

Comments on POP

  • Starts from

Finish Start Have(Drill) Have(Milk) Have(Banana) At(Home) At(Home) Sells(SM,Banana) Sells(SM,Milk) Sells(HWS,Drill)

  • Sneed is step (in current partial plan)

with an unsatisfied precondition, c Try to achieve c from − an existing step,

  • r

− some operator

  • Link Sneed to that step.
  • Resolve any new threats
  • POP is REGRESSION planner
  • Sound and Complete!

Planning 34

slide-35
SLIDE 35

Dealing with Variables

  • So far, everything PROPOSITIONAL

In general: Variables!

  • Op

 

Move(b,x,y)

PreC:

On(b,x) ∧ Clear(b) ∧ Clear(y)

Eff:

On(b,y) ∧ Clear(x) ∧ ¬On(b,x) ∧ ¬Clear(y)

 

SubGoal: On(A,B)

  • Use

Op

 

Move(A,x,B)

PreC:

On(A,x) ∧ Clear(A) ∧ Clear(B)

Eff:

On(A,B) ∧ Clear(x) ∧ ¬On(A,x) ∧ ¬Clear(B)

 

. . . move A from somewhere to B “least committment principle”

  • If initially On(A,D): could be

“Move(A, D ,B)” Or if reach On(A,Q), then “Move(A, Q ,B)” . . . Q: Is Move(A,x,B)

On(A,B)

− → Finish threatened by M2 where M2:Effect = On(Q,z) ? A: Only if z = A or z = B So need to record z = A, z = B

Planning 35

slide-36
SLIDE 36

RealWorld Planning

  • Optimum-AIV

− used by European Space Agency − assembly, integration, verification of space-craft

  • Generate plans, monitor their execution

+ replan as required

  • DS1: NASA probe
  • CelCorp . . .
  • Job-Shop scheduling
  • Scheduling for space mission

Hubble telescope . . .

Planning 36

slide-37
SLIDE 37

Comparison

  • Operation Research tools

(eg, PERT chart, Critical Path method) Input: Hand-constructed complete partial-order plan Output: Find optimal schedule action = object that takes time, have ordering constraints . . . effects ignored

Note: Ordering constraints hard-coded no additional knowledge engineering

  • Don’t have info needed to replan
  • r to handle many different planning task
  • Here, need general information . . .

+ sophisticated planner . . .

  • Most time spent finding what the con-

straints really are

Planning 37

slide-38
SLIDE 38

Limits of Strips-Based Planners

  • Hierarchical plans

“Prepare booster, prepare capsule, load cargo, launch” then achieve each sub-part, recursively . . .

  • Complex conditions

Strips: Simple Proposition literals Better: “Launch causes ALL iterms to go into space” “If . . . THEN . . . ”

  • Time

Strips: discrete, sequential,. . . Better: deadlines, actions have durations, time windows,. . .

  • Resources

Global constraints on TOTAL resources allowed . . . of allowed at instant,. . .

Planning 38

slide-39
SLIDE 39

Comparison of Strips vs ADL

Strips language ADL language Positive literals in states Positive and negative literals in states: Poor ∧ Unknown ¬Rich ∧ ¬Famous Closed World Assumption: Open World Assumption: Unmentioned literals are false Unmentioned literals are unknown Effect P ∨ ¬Q means Effect P ∨ ¬Q means add P and delete Q add “P and ¬Q” and delete “¬P and Q” Only ground literals in goals: Quantified variables in goals: Rich ∧ Famous ∃x At(P1, x)∧At(P2, x) is goal of having P1 and P2 in same place Goals are conjunctions Goal can include conjunctions and disjunctions Rich ∧ Famous ¬Poor ∧ (Famous ∨ Smart) Effects are conjunctions Conditional effects allowed: ”whenP : E” means E is an effect only if P is satisfied No support for equality Equality predicate (x = y) is built in No support for types Variables can have types, as in (p: Plane)

Planning 39

slide-40
SLIDE 40

Simple Rocket Domain

(define (operator move) :parameters ((rocket ?r) (place ?from) (place ?to)) :precondition (:and (:neq ?from ?to) (at ?r ?from) (has fuel ?r)) :effect (:and (at ?r ?to) (:not (at ?r ?from)) (:not (has fuel ?r)))) (define (operator unload) :parameters ((rocket ?r) (place ?p) (cargo ?c)) :precondition (:and (at ?r ?p) (in ?c ?r)) :effect (:and (:not (in ?c ?r)) (at ?c ?p))) (define (operator load) :parameters ((rocket ?r) (place ?p) (cargo ?c)) :precondition (:and (at ?r ?p) (at ?c ?p)) :effect (:and (:not (at ?c ?p)) (in ?c ?r)))

Typical problem: Initially: k ≥ 1 rockets and cargo at loc ℓ1 Goal: move cargo to specified destinations

Planning 40