Planning Philipp Koehn 26 March 2020 Philipp Koehn Artificial - - PowerPoint PPT Presentation

planning
SMART_READER_LITE
LIVE PREVIEW

Planning Philipp Koehn 26 March 2020 Philipp Koehn Artificial - - PowerPoint PPT Presentation

Planning Philipp Koehn 26 March 2020 Philipp Koehn Artificial Intelligence: Planning 26 March 2020 Outline 1 Search vs. planning STRIPS operators Partial-order planning The real world Conditional planning Monitoring


slide-1
SLIDE 1

Planning

Philipp Koehn 26 March 2020

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-2
SLIDE 2

1

Outline

  • Search vs. planning
  • STRIPS operators
  • Partial-order planning
  • The real world
  • Conditional planning
  • Monitoring and replanning

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-3
SLIDE 3

2

search vs. planning

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-4
SLIDE 4

3

Search vs. Planning

  • Consider the task get milk, bananas, and a cordless drill
  • Standard search algorithms seem to fail miserably:
  • After-the-fact heuristic/goal test inadequate

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-5
SLIDE 5

4

Search vs. Planning

  • Planning systems do the following
  • 1. improve action and goal representation to allow selection
  • 2. divide-and-conquer by subgoaling
  • 3. relax requirement for sequential construction of solutions
  • Differences

Search Planning States Data structures Logical sentences Actions Program code Preconditions/outcomes Goal Program code Logical sentence (conjunction) Plan Sequence from S0 Constraints on actions

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-6
SLIDE 6

5

strips operators

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-7
SLIDE 7

6

STRIPS Operators

  • Tidily arranged actions descriptions, restricted language
  • ACTION: Buy(x)

PRECONDITION: At(p),Sells(p,x) EFFECT: Have(x)

  • Note: this abstracts away many important details!
  • Restricted language

⇒ efficient algorithm Precondition: conjunction of positive literals Effect: conjunction of literals

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-8
SLIDE 8

7

partial-order planning

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-9
SLIDE 9

8

Partially Ordered Plans

  • Partially ordered collection of steps with

– Start step has the initial state description as its effect – Finish step has the goal description as its precondition – causal links from outcome of one step to precondition of another – temporal ordering between pairs of steps

  • Open condition = precondition of a step not yet causally linked
  • A plan is complete iff every precondition is achieved
  • A precondition is achieved iff it is the effect of an earlier step

and no possibly intervening step undoes it

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-10
SLIDE 10

9

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-11
SLIDE 11

10

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-12
SLIDE 12

11

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-13
SLIDE 13

12

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-14
SLIDE 14

13

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-15
SLIDE 15

14

Planning Process

  • Operators on partial plans

– add a link from an existing action to an open condition – add a step to fulfill an open condition – order one step wrt another to remove possible conflicts

  • Gradually move from incomplete/vague plans to complete, correct plans
  • Backtrack if an open condition is unachievable or

if a conflict is unresolvable

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-16
SLIDE 16

15

Partially Ordered Plans Algorithm

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

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-17
SLIDE 17

16

Partially Ordered Plans Algorithm

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 Demotion: Add Sthreat ≺ Si to ORDERINGS( plan) Promotion: Add Sj ≺ Sthreat to ORDERINGS( plan) if not CONSISTENT( plan) then fail end

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-18
SLIDE 18

17

Clobbering and Promotion/Demotion

  • A clobberer is a potentially intervening step that destroys the condition achieved

by a causal link. E.g., Go(Home) clobbers At(Supermarket): Demotion: put before Go(Supermarket) Promotion: put after Buy(Milk)

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-19
SLIDE 19

18

Properties of Partially Ordered Plans

  • Nondeterministic algorithm: backtracks at choice points on failure

– choice of Sadd to achieve Sneed – choice of demotion or promotion for clobberer – selection of Sneed is irrevocable

  • Partially Ordered Plans is sound, complete, and systematic (no repetition)
  • Extensions for disjunction, universals, negation, conditionals
  • Can be made efficient with good heuristics derived from problem description
  • Particularly good for problems with many loosely related subgoals

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-20
SLIDE 20

19

Example: Blocks World

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-21
SLIDE 21

20

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-22
SLIDE 22

21

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-23
SLIDE 23

22

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-24
SLIDE 24

23

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-25
SLIDE 25

24

the real world

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-26
SLIDE 26

25

The Real World

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-27
SLIDE 27

26

Things Go Wrong

  • Incomplete information

– Unknown preconditions, e.g., Intact(Spare)? – Disjunctive effects, e.g., Inflate(x) causes Inflated(x) ∨ SlowHiss(x) ∨ Burst(x) ∨ BrokenPump ∨ ...

  • Incorrect information

– Current state incorrect, e.g., spare NOT intact – Missing/incorrect postconditions in operators

  • Qualification problem can never finish listing all

– required preconditions of actions – possible conditional outcomes of actions

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-28
SLIDE 28

27

Solutions

  • Conformant or sensorless planning

Devise a plan that works regardless of state or outcome Such plans may not exist

  • Conditional planning

Plan to obtain information (observation actions) Subplan for each contingency, e.g., [Check(Tire1),if Intact(Tire1) then Inflate(Tire1) else CallAAA] Expensive because it plans for many unlikely cases

  • Monitoring/Replanning

Assume normal states, outcomes Check progress during execution, replan if necessary Unanticipated outcomes may lead to failure (e.g., no AAA card) ⇒ Really need a combination; plan for likely/serious eventualities, deal with others when they arise, as they must eventually.

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-29
SLIDE 29

28

Conformant Planning

  • Search in space of belief states (sets of possible actual states)

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-30
SLIDE 30

29

conditional planning

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-31
SLIDE 31

30

Conditional Planning

  • If the world is nondeterministic or partially observable

then percepts usually provide information, i.e., split up the belief state

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-32
SLIDE 32

31

Conditional Planning

  • Conditional plans check (any consequence of KB +) percept
  • [...,if C then PlanA else PlanB,...]
  • Execution: check C against current KB, execute “then” or “else”
  • Need some plan for every possible percept

– game playing: some response for every opponent move – backward chaining: some rule such that every premise satisfied

  • AND–OR tree search (very similar to backward chaining algorithm)

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-33
SLIDE 33

32

Example

  • Double Murphy: sucking or arriving may dirty a clean square

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-34
SLIDE 34

33

monitoring and replanning

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-35
SLIDE 35

34

Execution Monitoring

  • Plan with Partially Ordered Plans algorithms
  • Process plan, one step at a time
  • Validate planned conditions against perceived reality
  • “Failure” = preconditions of remaining plan not met
  • Preconditions of remaining plan

= all preconditions of remaining steps not achieved by remaining steps = all causal links crossing current time point

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-36
SLIDE 36

35

Responding to Failure

  • Run Partially Ordered Plans algorithms again
  • Resume Partially Ordered Plans to achieve open conditions from current state
  • IPEM (Integrated Planning, Execution, and Monitoring)

– keep updating Start to match current state – links from actions replaced by links from Start when done

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-37
SLIDE 37

36

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-38
SLIDE 38

37

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-39
SLIDE 39

38

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-40
SLIDE 40

39

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-41
SLIDE 41

40

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-42
SLIDE 42

41

Example

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-43
SLIDE 43

42

Emergent Behavior

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-44
SLIDE 44

43

Emergent Behavior

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-45
SLIDE 45

44

Emergent Behavior

  • “Loop until success” behavior emerges from interaction between monitor/replan

agent design and uncooperative environment

Philipp Koehn Artificial Intelligence: Planning 26 March 2020

slide-46
SLIDE 46

45

Summary

  • Planning

– break down problem into subgoals – search for plans for subgoals – merge sub-plans

  • Defined actions in terms of preconditions and effects
  • Partially Ordered Plans algorithm
  • Clobbering: need to deal with steps that destroy clausal link in plan
  • Real world: incomplete and incorrect information

⇒ conformant or conditional planning, monitoring and replanning

Philipp Koehn Artificial Intelligence: Planning 26 March 2020