Representation for Classical Planning
Need for Representation
Types of Representation
Classical Representation
Classical Representation
adjacent(l,l’) attached(p,l) belong(k,l)
occupied(l) at(r,l)
loaded(r,c) unloaded(r)
holding(k,c) empty(k)
in(c,p) on(c,c’)
top(c,p) top(pallet,p)
Classical Representation
Defining State
s1 = {attached(p1,loc1), in(c1,p1), in(c3,p1), top(c3,p1), on(c3,c1), on(c1,pallet), attached(p2,loc1), in(c2,p2), top(c2,p2), on(c2,palet), belong(crane1,loc1), empty(crane1), adjacent(loc1,loc2), adjacent(loc2,loc1), at(r1,loc2), occupied(loc2, unloaded(r1)}
Defining Operators
Operator: Example
Actions
Crane crane1 at location loc1 takes c3 off of c1 in pile p1
Notation
Notation: Example
Applicability of an Action
Executing an Applicable Action
Executing an Applicable Action
Executing an Applicable Action
Planning Domain
Planning Problem
Planning Problems
Plans and Solutions
Executing an Applicable Action
Example
〈move(r1,loc2,loc1), �take(crane1,loc1,c3,c1,p1), �move(r1,loc1,loc2), �move(r1,loc2,loc1), �load(crane1,loc1,c3,r1), �move(r1,loc1,loc2)〉
〈take(crane1,loc1,c3,c1,p1), �put(crane1,loc1,c3,c2,p2), �move(r1,loc2,loc1), �take(crane1,loc1,c3,c2,p2), �load(crane1,loc1,c3,r1), �move(r1,loc1,loc2)〉
Two redundant solutions
Irredundant and shortest solution
〈move(r1,loc2,loc1), take(crane1,loc1,c3,c1,p1), load(crane1,loc1,c3,r1), move(r1,loc1,loc2)〉
Set Theoretic Representation
{on(c1,pallet), on(c1,r1), on(c1,c2), …, at(r1,l1), at(r1,l2), …}
{on-c1-pallet, on-c1-r1, on-c1-c2, …, at-r1-l1, at-r1-l2, …}
Set Theoretic Representation
No operators, just actions:
Exponential Blowup
State Variable Representation
State Variable Representation
s1 = {top(p1)=c3,� cpos(c3)=c1,� cpos(c1)=pallet,� holding(crane1)=nil,� rloc(r1)=loc2,� loaded(r1)=nil, …}
Example: Blocks World
c
a
b
c
a
b
e
d
Initial state
Goal state
Classical Representation: Symbols
c
a
b
e
d
unstack(x,y)
Precond: on(x,y), clear(x), handempty
Effects: ¬on(x,y), ¬clear(x), ¬handempty,� holding(x), clear(y)
stack(x,y)
Precond: holding(x), clear(y)
Effects: ¬holding(x), ¬clear(y),� on(x,y), clear(x), handempty
pickup(x)
Precond: ontable(x), clear(x), handempty
Effects: ¬ontable(x), ¬clear(x),� ¬handempty, holding(x)
putdown(x)
Precond: holding(x)
Effects: ¬holding(x), ontable(x),� clear(x), handempty
c
a
b
c
a
b
c
a
b
c
a
b
unstack(c,a)
stack(c,a)
putdown(b)
pickup(b)
d
e
d
e
d
e
d
e
Classical Operators
Set Theoretic Representation: Symbols
ontable-a - block a is on the table
on-c-a - block c is on block a
clear-c - block c has nothing on it
holding-d - the robot hand is holding block d
handempty - the robot hand isn’t holding anything
c
a
b
d
e
unstack-c-a
Pre: on-c-a, clear-c, handempty
Del: on-c-a, clear-c, handempty
Add: holding-c, clear-a
stack-c-a
Pre: holding-c, clear-a
Del: holding-c, clear-a
Add: on-c-a, clear-c, handempty
pickup-b
Pre: ontable-b, clear-b, handempty
Del: ontable-b, clear-b, handempty
Add: holding-b
putdown-b
Pre: holding-b
Del: holding-b
Add: ontable-b, clear-b, handempty
60 actions, 50 if we exclude nonsensical ones, e.g., unstack-e-e
c
a
b
c
a
b
c
a
b
c
a
b
unstack-c-a
stack-c-a
putdown-b
pickup-b
d
e
d
e
d
e
d
e
Set-Theoretic Actions
State Variable Representation: Symbols
a, b, c, d, e of type block
0, 1, table, nil of type other
pos(x) = y if block x is on block y
pos(x) = table if block x is on the table
pos(x) = nil if block x is being held
clear(x) = 1 if block x has nothing on it
clear(x) = 0 if block x is being held or has another block on it
holding = x if the robot hand is holding block x
holding = nil if the robot hand is holding nothing
c
a
b
e
d
unstack(x : block, y : block)
Precond: pos(x)=y, clear(y)=0, clear(x)=1, holding=nil
Effects: pos(x)←nil, clear(x)←0, holding←x, clear(y)←1
stack(x : block, y : block)
Precond: holding=x, clear(x)=0, clear(y)=1
Effects: holding←nil, clear(y)←0, pos(x)←y, clear(x)←1
pickup(x : block)
Precond: pos(x)=table, clear(x)=1, holding=nil
Effects: pos(x)←nil, clear(x)←0, holding←x
putdown(x : block)
Precond: holding=x
Effects: holding←nil, pos(x)←table, clear(x)←1
c
a
b
c
a
b
c
a
b
c
a
b
unstack(c,a)
stack(c,a)
putdown(b)
pickup(b)
d
e
d
e
d
e
d
e
State-Variable Operators
Expressive Power
Classical
representation
State-variable
representation
Set-theoretic
representation
Trivial:
Each proposition is a 0-ary predicate
P(x1,…,xn)
becomes
fP(x1,…,xn)=1
Write all of
the ground�instances
f(x1,…,xn)=y
becomes
Pf(x1,…,xn,y)
Comparison