artificial intelligence, lecture 6.3, page 1 · mw: mail waiting rhm: robot has mail c d. poole and...

27
Regression Planning Idea: search backwards from the goal description: nodes correspond to subgoals, and arcs to actions. ©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 1/8

Upload: others

Post on 25-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Regression Planning

Idea: search backwards from the goal description: nodescorrespond to subgoals, and arcs to actions.

A subgoal is an assignment of values to some features.

Search problem:

Nodes are subgoals

There is an arc 〈g , g ′〉 labeled with action A ifI A achieves one of the assignments in gI g ′ is a proposition that must be true immediately before

action A so that g is true immediately after.

The start node is the goal to be achieved.

goal(g) is true if g is a proposition that is true of theinitial state.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 1 / 8

Page 2: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Regression Planning

Idea: search backwards from the goal description: nodescorrespond to subgoals, and arcs to actions.A subgoal is an assignment of values to some features.

Search problem:

Nodes are subgoals

There is an arc 〈g , g ′〉 labeled with action A ifI A achieves one of the assignments in gI g ′ is a proposition that must be true immediately before

action A so that g is true immediately after.

The start node is the goal to be achieved.

goal(g) is true if g is a proposition that is true of theinitial state.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 1 / 8

Page 3: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Regression Planning

Idea: search backwards from the goal description: nodescorrespond to subgoals, and arcs to actions.A subgoal is an assignment of values to some features.

Search problem:

Nodes are subgoals

There is an arc 〈g , g ′〉 labeled with action A ifI A achieves one of the assignments in gI g ′ is a proposition that must be true immediately before

action A so that g is true immediately after.

The start node is the goal to be achieved.

goal(g) is true if g is a proposition that is true of theinitial state.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 1 / 8

Page 4: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Regression Planning

Idea: search backwards from the goal description: nodescorrespond to subgoals, and arcs to actions.A subgoal is an assignment of values to some features.

Search problem:

Nodes are subgoals

There is an arc 〈g , g ′〉 labeled with action A ifI A achieves one of the assignments in g

I g ′ is a proposition that must be true immediately beforeaction A so that g is true immediately after.

The start node is the goal to be achieved.

goal(g) is true if g is a proposition that is true of theinitial state.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 1 / 8

Page 5: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Regression Planning

Idea: search backwards from the goal description: nodescorrespond to subgoals, and arcs to actions.A subgoal is an assignment of values to some features.

Search problem:

Nodes are subgoals

There is an arc 〈g , g ′〉 labeled with action A ifI A achieves one of the assignments in gI g ′ is a proposition that must be true immediately before

action A so that g is true immediately after.

The start node is the goal to be achieved.

goal(g) is true if g is a proposition that is true of theinitial state.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 1 / 8

Page 6: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Regression Planning

Idea: search backwards from the goal description: nodescorrespond to subgoals, and arcs to actions.A subgoal is an assignment of values to some features.

Search problem:

Nodes are subgoals

There is an arc 〈g , g ′〉 labeled with action A ifI A achieves one of the assignments in gI g ′ is a proposition that must be true immediately before

action A so that g is true immediately after.

The start node is the goal to be achieved.

goal(g) is true if g is a proposition that is true of theinitial state.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 1 / 8

Page 7: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Regression Planning

Idea: search backwards from the goal description: nodescorrespond to subgoals, and arcs to actions.A subgoal is an assignment of values to some features.

Search problem:

Nodes are subgoals

There is an arc 〈g , g ′〉 labeled with action A ifI A achieves one of the assignments in gI g ′ is a proposition that must be true immediately before

action A so that g is true immediately after.

The start node is the goal to be achieved.

goal(g) is true if g is a proposition that is true of theinitial state.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 1 / 8

Page 8: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Defining nodes and arcs

A node g can be represented as a set of assignments ofvalues to variables:

[X1 = v1, . . . ,Xn = vn]

This is a set of assignments you want to hold.

The last action achieves one of the Xi = vi , and does notachieve Xj = v ′

j where v ′j is different to vj .

The neighbor of g along arc A must contain:I The prerequisites of action AI All of the elements of g that were not achieved by A

it must be consistent = have at most one value for eachfeature.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 2 / 8

Page 9: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Defining nodes and arcs

A node g can be represented as a set of assignments ofvalues to variables:

[X1 = v1, . . . ,Xn = vn]

This is a set of assignments you want to hold.

The last action achieves one of the Xi = vi ,

and does notachieve Xj = v ′

j where v ′j is different to vj .

The neighbor of g along arc A must contain:I The prerequisites of action AI All of the elements of g that were not achieved by A

it must be consistent = have at most one value for eachfeature.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 2 / 8

Page 10: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Defining nodes and arcs

A node g can be represented as a set of assignments ofvalues to variables:

[X1 = v1, . . . ,Xn = vn]

This is a set of assignments you want to hold.

The last action achieves one of the Xi = vi , and does notachieve Xj = v ′

j where v ′j is different to vj .

The neighbor of g along arc A must contain:I The prerequisites of action AI All of the elements of g that were not achieved by A

it must be consistent = have at most one value for eachfeature.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 2 / 8

Page 11: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Defining nodes and arcs

A node g can be represented as a set of assignments ofvalues to variables:

[X1 = v1, . . . ,Xn = vn]

This is a set of assignments you want to hold.

The last action achieves one of the Xi = vi , and does notachieve Xj = v ′

j where v ′j is different to vj .

The neighbor of g along arc A must contain:

I The prerequisites of action AI All of the elements of g that were not achieved by A

it must be consistent = have at most one value for eachfeature.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 2 / 8

Page 12: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Defining nodes and arcs

A node g can be represented as a set of assignments ofvalues to variables:

[X1 = v1, . . . ,Xn = vn]

This is a set of assignments you want to hold.

The last action achieves one of the Xi = vi , and does notachieve Xj = v ′

j where v ′j is different to vj .

The neighbor of g along arc A must contain:I The prerequisites of action A

I All of the elements of g that were not achieved by A

it must be consistent = have at most one value for eachfeature.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 2 / 8

Page 13: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Defining nodes and arcs

A node g can be represented as a set of assignments ofvalues to variables:

[X1 = v1, . . . ,Xn = vn]

This is a set of assignments you want to hold.

The last action achieves one of the Xi = vi , and does notachieve Xj = v ′

j where v ′j is different to vj .

The neighbor of g along arc A must contain:I The prerequisites of action AI All of the elements of g that were not achieved by A

it must be consistent = have at most one value for eachfeature.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 2 / 8

Page 14: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Defining nodes and arcs

A node g can be represented as a set of assignments ofvalues to variables:

[X1 = v1, . . . ,Xn = vn]

This is a set of assignments you want to hold.

The last action achieves one of the Xi = vi , and does notachieve Xj = v ′

j where v ′j is different to vj .

The neighbor of g along arc A must contain:I The prerequisites of action AI All of the elements of g that were not achieved by A

it must be consistent = have at most one value for eachfeature.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 2 / 8

Page 15: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Formalizing arcs using STRIPS notation

〈g , g ′〉 is an arc labeled with action A where g is[X1 = v1, . . . ,Xn = vn] and A is an action, if

∃i Xi = vi is on the effects list of action A

∀j Xj = v ′j is not on the effects list for A, where v ′

j 6= vj

g ′ = preconditions(A) ∪ {Xk = vk ∈ g : Xk = vk /∈effects(A)} if it is consistent

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 3 / 8

Page 16: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Formalizing arcs using STRIPS notation

〈g , g ′〉 is an arc labeled with action A where g is[X1 = v1, . . . ,Xn = vn] and A is an action, if

∃i Xi = vi is on the effects list of action A

∀j Xj = v ′j is not on the effects list for A, where v ′

j 6= vj

g ′ = preconditions(A) ∪ {Xk = vk ∈ g : Xk = vk /∈effects(A)} if it is consistent

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 3 / 8

Page 17: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Formalizing arcs using STRIPS notation

〈g , g ′〉 is an arc labeled with action A where g is[X1 = v1, . . . ,Xn = vn] and A is an action, if

∃i Xi = vi is on the effects list of action A

∀j Xj = v ′j is not on the effects list for A, where v ′

j 6= vj

g ′ = preconditions(A) ∪ {Xk = vk ∈ g : Xk = vk /∈effects(A)} if it is consistent

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 3 / 8

Page 18: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Formalizing arcs using STRIPS notation

〈g , g ′〉 is an arc labeled with action A where g is[X1 = v1, . . . ,Xn = vn] and A is an action, if

∃i Xi = vi is on the effects list of action A

∀j Xj = v ′j is not on the effects list for A, where v ′

j 6= vj

g ′ = preconditions(A) ∪ {Xk = vk ∈ g : Xk = vk /∈effects(A)}

if it is consistent

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 3 / 8

Page 19: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Formalizing arcs using STRIPS notation

〈g , g ′〉 is an arc labeled with action A where g is[X1 = v1, . . . ,Xn = vn] and A is an action, if

∃i Xi = vi is on the effects list of action A

∀j Xj = v ′j is not on the effects list for A, where v ′

j 6= vj

g ′ = preconditions(A) ∪ {Xk = vk ∈ g : Xk = vk /∈effects(A)} if it is consistent

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 3 / 8

Page 20: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Regression example

[¬ swc]

mcc

dc

mc

mccmc mccmcpuc

[off,rhc]

[cs,rhc] [lab,rhc]

[mr,rhc] [off,rhc]

[off,rhc]

[mr,rhc]

[cs]

Actionsmc: move clockwisemcc: move counterclockwisepuc: pick up coffeedc: deliver coffeepum: pick up maildm: deliver mail

Locations:cs: coffee shopoff: officelab: laboratorymr: mail room

Feature valuesrhc: robot has coffeeswc: Sam wants coffeemw: mail waitingrhm: robot has mail

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 4 / 8

Page 21: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Loop detection and multiple-path pruning

Goal G1 is simpler than goal G2 if G1 is a subset of G2.I It is easier to solve [cs] than [cs, rhc].

If you have a path to node N have already found a pathto a simpler goal, you can prune the path N .

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 5 / 8

Page 22: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Improving Efficiency

You can define a heuristic function that estimates howdifficult it is to solve a goal from a state.

You can use domain-specific knowledge to removeimpossible goals, e.g.I It is often not obvious from an action description to

conclude whether an agent can hold multiple items atany time.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 6 / 8

Page 23: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Improving Efficiency

You can define a heuristic function that estimates howdifficult it is to solve a goal from a state.

You can use domain-specific knowledge to removeimpossible goals, e.g.I It is often not obvious from an action description to

conclude whether an agent can hold multiple items atany time.

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 6 / 8

Page 24: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Comparing forward and regression planners

Which is more efficient depends on:I The branching factor

I How good the heuristics are

Forward planning is unconstrained by the goal (except asa source of heuristics).

Regression planning is unconstrained by the initial state(except as a source of heuristics)

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 7 / 8

Page 25: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Comparing forward and regression planners

Which is more efficient depends on:I The branching factorI How good the heuristics are

Forward planning is unconstrained by the goal (except asa source of heuristics).

Regression planning is unconstrained by the initial state(except as a source of heuristics)

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 7 / 8

Page 26: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

Comparing forward and regression planners

Which is more efficient depends on:I The branching factorI How good the heuristics are

Forward planning is unconstrained by the goal (except asa source of heuristics).

Regression planning is unconstrained by the initial state(except as a source of heuristics)

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 7 / 8

Page 27: Artificial Intelligence, Lecture 6.3, Page 1 · mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2016 Arti cial Intelligence, Lecture 6.3, Page 4. Find the errors

©D.L. Poole and A.K. Mackworth 2010-2020 Artificial Intelligence, Lecture 6.3 8 / 8