Cs344 Lect11 Resolution Robotic Knowledge Representation 29jan08
Cs344 Lect11 Resolution Robotic Knowledge Representation 29jan08
Intelligence
Pushpak Bhattacharyya
CSE Dept.,
IIT Bombay
~P P
Terminology
• Pair of clauses being resolved is called the
Resolvents. The resulting clause is called the
Resolute.
• Choosing the correct pair of resolvents is a
matter of search.
Club example revisited
1. member(A)
2. member(B)
3. member(C)
4. x[member ( x) (mc( x) sk ( x))]
– Can be written as [member ( x) (mc( x) sk ( x))]
– ~ member ( x) mc( x) sk ( x)
5. x[ sk ( x) lk ( x, snow)]
– ~ sk ( x) lk ( x, snow)
6. x[mc( x) ~ lk ( x, rain)]
– ~ mc( x) ~ lk ( x, rain)
7. x[like( A, x) ~ lk ( B, x)]
– ~ like( A, x) ~ lk ( B, x)
8. x[~ lk ( A, x) lk ( B, x)]
– lk ( A, x) lk ( B, x)
9. lk ( A, rain)
10. lk ( A, snow)
11. x[member( x) mc( x) ~ sk ( x)]
– Negate– x[~ member ( x) ~ mc( x) sk ( x)]
• Now standardize the variables apart which
results in the following
1. member(A)
2. member(B)
3. member(C)
4. ~ member ( x ) mc( x ) sk ( x )
1 1 1
5. ~ sk ( x 2) lk ( x 2, snow)
6. ~ mc( x ) ~ lk ( x , rain)
3 3
7. ~ like( A, x ) ~ lk ( B, x )
4 4
8. lk ( A, x ) lk ( B, x )
5 5
9. lk ( A, rain)
10. lk ( A, snow)
11. x[~ member ( x ) ~ mc( x ) sk ( x )]
6 6 6
~ like( A, x 4) ~ lk ( B, x 4) lk ( A, snow) 10
7
12 ~ lk ( B, snow) ~ sk ( x 2) lk ( x 2, snow) 5
11
x[~ member ( x 6) ~ mc( x 6) sk ( x 6)] mc(B ) 15
16 ~ member ( B ) sk ( B ) ~ sk ( B ) 13
17 ~ member ( B ) member (B ) 2
Robotic Knowledge
Representation and inferencing
A planning agent
• An agent interacts with the world via perception and actions
• Perception involves sensing the world and assessing the situation
– creating some internal representation of the world
• Actions are what the agent does in the domain. Planning involves
reasoning about actions that the agent intends to carry out
• Planning is the reasoning side of acting
• This reasoning involves the representation of the world that the
agent has, as also the representation of its actions.
• Hard constraints where the objectives have to be achieved
completely for success
• The objectives could also be soft constraints, or preferences, to be
achieved as much as possible
Interaction with static domain
• The agent has complete information of the domain
(perception is perfect), actions are instantaneous and
their effects are deterministic.
• The agent knows the world completely, and it can take
all facts into account while planning.
• The fact that actions are instantaneous implies that there
is no notion of time, but only of sequencing of actions.
• The effects of actions are deterministic, and therefore
the agent knows what the world will be like after each
action.
Two kinds of planning
• Projection into the future
– The planner searches through the possible
combination of actions to find the plan that will
work
• Memory based planning
– looking into the past
– The agent can retrieve a plan from its memory
Planning
•Definition : Planning is arranging a sequence of
actions to achieve a goal.
•Sentence generation
•Word order determination (Syntax planning)
E.g. I see movie ( English)
I movie see (Intermediate Language)
STRIPS
•Stanford Research Institute Problem Solver (1970s)
•Planning system for a robotics project : SHAKEY (by
Nilsson et.al.)
•Knowledge Representation : First Order Logic.
•Forward Chaining:
man(Shakespeare) matches LHS of Rule.
X = Shakespeare
mortal( Shakespeare) added
-Forward Chaining used by design expert systems
•R2 : putdown(x)
Precondition & Deletion List : holding(x)
Add List : hand empty, on(x,table), clear(x)
Rules
•R3 : stack(x,y)
Precondition & Deletion List :holding(x), clear(y)
Add List : on(x,y), clear(x)
•R4 : unstack(x,y)
Precondition & Deletion List : on(x,y), clear(x)
Add List : holding(x), clear(y)
Plan for the block world problem
• For the given problem, Start Goal can be achieved
by the following sequence :
1. Unstack(C,A)
2. Putdown(C)
3. Pickup(B)
4. Stack(B,C)
5. Pickup(A)
6. Stack(A,B)
• Execution of a plan: achieved through a data structure
called Triangular Table.
Triangular Table
on(C,A)
1 clear(C)
hand empty unstack(C,A)
holding(C) putdown(C)
2
0 1 2 3 4 5 6
Triangular Table
• For n operations in the plan, there are :
• (n+1) rows : 1 n+1
• (n+1) columns : 0 n
• At the end of the ith row, place the ith component of the plan.
• The row entries for the ith step contain the pre-conditions for the
ith operation.
• The column entries for the jth column contain the add list for the
rule on the top.
• The <i,j> th cell (where 1 ≤ i ≤ n+1 and 0≤ j ≤ n) contain the pre-
conditions for the ith operation that are added by the jth operation.
• The first column indicates the starting state and the last row
indicates the goal state.
Search in case of planning
Start
• Ex: Blocks world Pickup(B) Unstack(C,A)
S1 S2
• Triangular table leads
• to some amount of fault-tolerance in the robot
NOT ALLOWED
C A
A B A B C C B
START
WRONG
MOVE
Resilience in Planning
• After a wrong operation, can the robot come back to
the right path ?
• i.e. after performing a wrong operation, if the system
again goes towards the goal, then it has resilience
w.r.t. that operation
• Advanced planning strategies
– Hierarchical planning
– Probabilistic planning
– Constraint satisfaction
Predicate Calculus
• Well Known Example:
∀x[man(x) → mortal(x)]
– shakespeare is a man
man(shakespeare)
• man(x) → mortal(x)
• Goal mortal(shakespeare)
– x = shakespeare
– Travel back over and hit the fact asserted
– man(shakespeare)
Resolution - Refutation
• man(x) → mortal(x)
– Convert to clausal form
– ~man(shakespeare) mortal(x)
• Clauses in the knowledge base
– ~man(shakespeare) mortal(x)
– man(shakespeare)
– mortal(shakespeare)
Resolution – Refutation contd
Re solvent1 Re solvent 2
Re solute
Search in resolution
• Heuristics for Resolution Search
– Goal Supported Strategy
• Always start with the negated goal
– Set of support strategy
• Always one of the resolvents is the most recently
produced resolute
Assignment
• Prove the inferencing in the himalayan club
example with different starting points,
producing different resolution trees.
• Think of a Prolog implementation of the
problem
• Prolog Reference (Prolog by Chocksin &
Melish)