1. The document discusses refinement methods for deliberation and acting in automated planning and acting. Refinement methods decompose tasks into subtasks using refinement stacks.
2. An example domain involving robots, containers, locations, and doors is used to illustrate refinement methods. Methods are provided for tasks like opening doors, fetching objects, and responding to emergencies.
3. The Refinement Acting Engine (RAE) uses refinement stacks to perform tasks and handle events in parallel by recursively refining tasks into subtasks using applicable refinement methods until commands can be issued to the execution platform.
3. 3"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Nota.on(and(Terminology(
● Recall from Chapter 2 that the actor’s state ξ may differ from the state s that the
actor gives to the planner
! ξ is the actor’s current state; execution platform keeps it up-to-date
! Ξ = {all possible states}
● Fact: an atom that’s true in the current state
● Task: an activity that the actor needs to carry out
● State variable: like a CSV state variable, but its range more general
! If x is a state variable, Range(x) can be finite, infinite, continuous,
discontinuous, vectors, matrices, other data structures
● Assignment: more general than a CSV assignment
! x ← expr where expr returns a ground value in Range(x) and expr has no
side-effects on the current state
● Tests (e.g., preconditions)
! Simple test: x = v, x ≠ v, x > v, x < v
! Compound test: conjunction, disjunction, or negation of simple tests
4. 4"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Example(
● Objects
! Robots = {rbt}, Containers = {c1, c2, …}, Locations = {loc1, loc2, …}.
● State variables
! loc(r) ∈ Locations
! load(r) ∈ Containers ⋃ {nil}
! pos(c) ∈ Locations ⋃ Robots ⋃ {unknown}
! view(l) ∈ {T, F}
• whether the robot has looked at location l or not
• If view(l)=T then for every container c in l, pos(c) = l
● Commands to the execution platform:
! take(r,o): r takes object o
! put(r,o): r puts o
! perceive(r,l): robot r perceives what objects are at a location l
5. 5"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Refinement(Methods(
● Refinement method: a triple (task or event, precondition, body)
! a task or event that the method can be used for
! precondition that needs to be true for the method to be applicable
! body: a program
● Write in the following format:
method-name(arg1, …, argk) method-name(arg1, …, argk)
task: task event: event
pre: precondition pre: precondition
body: body body: body
● body: sequence of steps
! assignments, commands, tasks
! control constructs: if-then-else, while, loop, etc.
6. 6"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Con.nue(Previous(Example(
● Task: fetch container c
● Method: if you know c’s location, then go get it; else search
mHfetch(r,c)
task: fetch(r,c)
pre:
body: if pos(c) = unknown then search(r,c)
else if loc(r) = pos(c) then take(r,c)
else do
goto(r,pos(c))
take(r,c)
mHsearch(r,c)
task: search(r,c)
pre: pos(c) = unknown
body: if ∃l (view(l)=F) then
goto(r,l)
perceive(l)
if pos(c)=l then take(r,c)
else search(r,c)
else fail
start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
7. 7"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Con.nue(Previous(Example(
● Task: go to location m
● Method: if there’s a door to a hallway,
then go through the door then proceed to m
mHgoHtoHhallway(r,l,m)
task: goto(r,m)
pre: loc(r)=l, door(d,l,h),
type(h,hallway), status(d)=closed"
body: openHdoor(r,d)
goto(r,h)
close(r,d)
goto(r,m)
start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
8. 8"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Con.nue(Previous(Example(
● Event: emergency call
! Stop current activity, go where the emergency is
● Another state variable
! emergencyHhandling(r) ∈ {T, F}
• whether r is handling an emergency
● Method:
mHemergency(r,l,i)
event: emergency(l,i)
pre: emergencyHhandling=F
body: emergencyHhandling ← T
if loaded(r) ≠ nil"then
" "put(r,load(r))
goto(l)
addressHemergency(l,i)
start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
9. 9"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Con.nue(Previous(Example(
● Commands used for opening a door
! moveHclose(r,o): r moves to a position
where reachable(r,o)=T"
! moveHby(r,λ): r moves with magnitude and
direction given by vector λ
! grasp(r,o): r grasps object o
! ungrasp(r,o): r release grasp on o
! turn(r,o,α): r turns a grasped object
o by angle α ∈ [−π,+π]
! pull(r,λ): r pulls its arm by vector λ
! push(r,λ): r pushes its arm by λ
! monitorHstatus(r,d):
r focuses its perception to
keep doorHstatus"updated
(starts a process)
! endHmonitorHstatus(r,d):
r stops monitoring d
(terminates a process) start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
10. 10"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Con.nue(Previous(Example(
● Task: open the door
mHopendoor(r,d,l,h)""
task: opendoor(r,d)""
pre: loc(r)"="l"∧"adjacent(l,d)"∧"handle(d,h)""
"body: while ¬reachable(r,h)"do
" " "moveHclose(r,h)""
" "monitorHstatus(r,d)""
" "if doorHstatus(d)=closed"then
unlatch(r,d) "
" "throwHwide(r,d)
" "endHmonitorHstatus(r,d)
"
start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
11. 11"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Con.nue(Previous(Example(
m1Hunlatch(r,d,l,o)
task: unlatch(r,d)
pre: loc(r,l) ∧ towardHside(l,d) ∧ side(d,leX)
∧ type(d,rotate) ∧ handle(d,h)
body: grasp(r,h)
turn(r,h,alpha1)
pull(r,val1)
if doorHstatus(d)≠cracked"then fail"
"
m1-throw-wide(r,d,l,h)
task: throwHwide(r,d)
pre: loc(r,l) ∧ towardHside(l,d)
∧ side(d,leX) ∧ type(d,rotate)
∧ handle(d,h) ∧ grasping(r)=d
∧ doorHstatus(d)=cracked"
body: pull(r,val1)
moveHby(r,val2)
ungrasp(r,h)
"
start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
14. 14"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Refinement(Stacks(in(RAE(
● Refinement stack:
! (opendoor(r1,d3), mHpullHopen(r1,d3,loc2,d3h), i1, {m3})
! (goto(r1,loc1), mHgoHtoHhallway(r1,d3,loc1), i2, {m1,m2})
! (fetch(r1,o7), mHfetch(…), nil, ∅)
● Corresponds to a path from the
current node back to the root
● Each element is a 4-tuple (τ,m,i,tried)
! τ: task or event
! m: current method for τ
! i: execution pointer for body(m)
• τ[i] = instruction that’s
currently executing
• i is initially nil
! tried: methods RAE has
already tried for m start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,loc1)
…
methods
for other
kinds of
routes
m2
i1
i2
m1
m3
16. 16"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
If(a(Method(Fails(
● Similar to backtracking
! If a method fails, try the next one
! If none left, then fail
● But not identical to backtracking
! ξ may have changed
• Because of something the actor did
• Because the world changes dynamically
start
monitor
opendoor(r1,d3)
m-fetch(…)
take(r1,o7)
move
close to
handle
m-pull-open(r1,loc3,d3,d3h)
goto(r1,loc4) closedoor(r1,d3)
unlatch throw wide end
monitor
goto(r1,loc1)
fetch(r1,o7)
… methods for other
kinds of doors
m-go-to-hallway(r1,d3,loc1)
goto(r1,lo
…
metho
for oth
kinds
routes
m2
i1
i2
m1
m3
17. 17"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Goals(in(RAE(
● Special kind of task: achieve(condition)
● Like other tasks, but includes monitoring
! Can easily modify Progress to do this
● Stop execution early if condition becomes true
● fail"if condition isn’t true after execution
(triggers a Retry)
! mHfetch(r,c)
task: fetch(r,c)
pre:
body: achieve(pos(c) ≠ unknown)
goto(pos(c))
take(r,c)
! mHfindHwhere(r,c)
goal: achieve(pos(c) ≠ unknown)
pre:
body: while ∃l (view(l)=F) do
goto(l)
perceive(l)
● What we had before:
mHfetch(r,c)
task: fetch(r,c)
pre:
body: if pos(c) = unknown then
search(r,c)
else if loc(r) = pos(c) then
take(r,c)
else do
goto(r,pos(c))
take(r,c)
mHsearch(r,c)
task: search(r,c)
pre: pos(c) = unknown
body: if l (view(l)=F) then
goto(r,l)
perceive(l)
if pos(c)=l then take(r,c)
else search(r,c)
else fail
18. 18"Dana"Nau"and"Vikas"Shivashankar:"Lecture"slides"for!Automated!Planning!and!Ac0ng" Updated"3/24/15"
Extensions(to(RAE(
● Section 3.3.4 discusses some additional features that extend RAE’s capabilities:
! Controlling the progress of tasks, e.g., suspend a task for a while
! Refining into concurrent subtasks
• mHfoo(x,y,z)
task: foo(x,y,z)
pre:
body: .".".
{concurrent: ⟨ν1,1,...,ν1,n⟩⟨ν2,1,...,ν2,m⟩...⟨νk,1,...,νk,l⟩}
• Each ⟨νi,1,...,νi,j⟩ is a sequence of steps, like the body of a method
• Split the current stack into k sub-stacks, one for each ⟨νi,1,...,νi,j⟩
! Choosing methods, and stack ordering
• If there are multiple stacks, which ones get higher priority?
▸ Application-specific heuristics
• For a task t, which method to try first?
▸ Refinement planning (Section 3.4)