Transcript ppt

Resolution Proof Example
Prateek Tandon, John Dickerson
“Robot Doom” Domain
1.
2.
3.
4.
Jack owns a roomba
Every roomba owner is a robot enthusiast.
No robot enthusiast breaks a robot.
Either Jack or SENSOR MALFUNCTION broke
my roomba.
Question: Did SENSOR MALFUNCTION break my
roomba?
Write in First Order Logic
1. Jack owns a roomba
xRoomba(x)Owns(Jack,x)
2. Every roomba owner is a robot enthusiast.

x[yRoomba(y)Owns(x, y)]  Robot _enthusiast(x)
1. No robot enthusiast breaks a robot.
xRobot _ enthusiast(x)  [yRobot (y)  Breaks(x, y)]
2. Either Jack or SENSOR MALFUNCTION broke my roomba.
Breaks(Jack,myRoomba) Breaks(S.M.,myRoomba)
Roomba(myRoomba)
Some Additional Facts:
xRoomba(x) Robot (x)
Algorithm for Converting FOL to CNF
1.
2.
3.
4.
5.
6.
Eliminate Implications
Move negation inward
Standardize variables
Skolemization
Drop universal quantifiers
Apply distributivity
Convert to CNF
Step 1: Eliminate Implications
Replace pq with not p or q
xRoomba(x)  Owns(Jack, x)
x(yRoomba(y)  Owns(x, y))  Robot _ enthusiast(x)
xRobot _ enthusiast(x)  yRobot(y)  Breaks(x, y)
Breaks(Jack,myRoomba)  Breaks(S.M.,myRoomba)
Roomba(myRoomba)
xRoomba(x)  Robot(x)
Convert to CNF
Step 2: Move Negation Inward
Apply Demorgan’s Laws, change quantifiers, etc.
(A  B)  A  B
(A  B)  A  B
xA(x)  xA(x)
xA(x)  xA(x)
xRoomba(x)  Owns(Jack, x)
x(yRoomba(y)
  Owns(x, y))  Robot _ enthusiast(x)
xRobot _ enthusiast(x)  yRobot(y)  Breaks(x, y)
Breaks(Jack,myRoomba)  Breaks(S.M.,myRoomba)
Roomba(myRoomba)
xRoomba(x)  Robot(x)
Convert to CNF
Step 3: Standardize Variables
If two variables have the same name, then
change the name of one of the variables (no
modification in this example)
xRoomba(x)  Owns(Jack, x)
x(yRoomba(y)  Owns(x, y))  Robot _ enthusiast(x)
xRobot _ enthusiast(x)  yRobot(y)  Breaks(x, y)
Breaks(Jack,myRoomba)  Breaks(S.M.,myRoomba)
Roomba(myRoomba)
xRoomba(x)  Robot(x)
Convert to CNF
Step 4: Skolemization
“Skolemization” – the process of removing
existential quantifiers by elimination.
General Rule: Arguments of the skolem function are all the universally
quantified variables in whose scope the existential quantifier appears.
Roomba(R)  Owns(Jack,R)
x(yRoomba(y)  Owns(x, y))  Robot _ enthusiast(x)
xRobot _ enthusiast(x)  yRobot(y)  Breaks(x, y)
Breaks(Jack,myRoomba)  Breaks(S.M.,myRoomba)
Roomba(myRoomba)
xRoomba(x)  Robot(x)
Convert to CNF
Step 5: Drop Universal Quantifiers
Pretty Easy…
Roomba(R)  Owns(Jack,R)
(Roomba(y)  Owns(x, y))  Robot _ enthusiast(x)
Robot _ enthusiast(x)  Robot(y)  Breaks(x, y)
Breaks(Jack,myRoomba)  Breaks(S.M.,myRoomba)
Roomba(myRoomba)
Roomba(x)  Robot(x)
Convert to CNF
Step 6: Apply Distributivity
Nothing much to do in this example…but you
know how to do this well after problem 1.
Roomba(R)
Owns(Jack,R)
Roomba(y)  Owns(x, y)  Robot _ enthusiast(x)
Robot _ enthusiast(x)  Robot(y)  Breaks(x, y)
Breaks(Jack,myRoomba)  Breaks(S.M.,myRoomba)
Roomba(myRoomba)
Roomba(x)  Robot(x)
Assert Negation of Conclusion
What we want to
conclude:
Breaks(S.M.,myRoomba)
Negation of
conclusion:


Breaks(S.M.,myRoomba)
Resolution Rule
(simplified)
a  b,a  c
bc
Apply Resolution
Breaks(S.M,myRoomba)
Breaks(Jack,myRoomba) Breaks(S.M.,myRoomba)

Breaks(Jack,myRoomba)

Robot _enthusiast(x)Robot(y)Breaks(x, y)

Robot _enthusiast(Jack)Robot(myRoomba)
Roomba(y)Owns(x,y) Robot _enthusiast(x)

Robot(myRoomba)  Roomba(y)
Owns(Jack, y)

Roomba(R)
Owns(Jack,R)
Roomba(y)  Owns(x, y)  Robot _ enthusiast(x)
Robot _ enthusiast(x)  Robot(y)  Breaks(x, y)
Breaks(Jack,myRoomba)  Breaks(S.M.,myRoomba)
Roomba(myRoomba)
Roomba(x)  Robot(x)

Apply Resolution (continued)
Robot(myRoomba)Roomba(y)Owns(Jack, y)
Robot(myRoomba)Owns(Jack,R)
Robot(myRoomba)

Roomba(myRoomba)
FALSE
Roomba(R)

Owns(Jack,R)
 Roomba(x)  Robot(x)
Roomba(myRoomba)

…So negated conclusion is wrong.
…So original statement must be right.
Roomba(R)
Owns(Jack,R)
Roomba(y)  Owns(x, y)  Robot _ enthusiast(x)
Robot _ enthusiast(x)  Robot(y)  Breaks(x, y)
Breaks(Jack,myRoomba)  Breaks(S.M.,myRoomba)
Roomba(myRoomba)
Roomba(x)  Robot(x)
Practical Aspects of Logic
• Jess Rule-Based System for Java
(http://herzberg.ca.sandia.gov)
• Wolfram-Alpha Logic Engine
• MATLAB toolbox