SLIDE 1 Chapter 5 1
Knowledge Representation Using Predicate Logic
- Representing Simple Facts in Logic
- Representing Instance and Isa
Relationships
Predicates
- Resolution
- Natural Deduction
SLIDE 2 Chapter 5 2
Representing Simple Facts in Logic
man(Marcus)
Pompiean(Marcus)
νx: Pompiean(x) -> Roman(x)
ruler(Caesar )
- 5. All Romans were either loyal to
Caesar or hated him ν x: Roman(x) -> loyalto(x,Caesar) v hate(x,Caesar)
SLIDE 3 Chapter 5 3
- 6. Everyone is loyal to someone
ν x:∋ y : loyal(x,y)
- 7. People only try to assassinate
rulers they are not loyal to
ν x: ν y : person(x) Λ ruler(y) Λ tryassassinate(x,y) -> not
loyalto(x,y)
- 8. Marcus tried to assassinate Caesar
tryassassinate(Marcus,Caesar)
ν x: man(x) -> person(x)
SLIDE 4
Chapter 5 4
not loyalto(Marcus,Caesar) (7, substitution) person(Marcus) ruler(Caesar) tryassassinate(Marcus,Caesar) (4) person(Marcus) tryassassinate(Marcus,Caesar) (8) person(Marcus) An Attempt to Prove not loyalto(Marcus,Caesar)
SLIDE 5 Chapter 5 5
Representing Instance and Isa Relationships
- 1. man(Marcus)
- 2. Pompiean(Marcus)
- 3. ν x: Pompiean(x) -> Roman(x)
- 4. ruler(Caesar )
- 5. ν x: Roman(x) -> loyalto(x,Caesar) ν hate(x,Caesar)
- 1. instance(Marcus,man)
- 2. instance(Marcus, Pompiean)
- 3. ν x: instance(x, Pompiean)->instance(x,Roman)
- 4. instance(Caesar,ruler)
- 5. ν x: instance(x, Roman)->loyalto(x,Caesar) ν hate(x,Caesar)
- 1. instance(Marcus,man)
- 2. instance(Marcus, Pompiean)
- 3. isa(Pompiean,Roman)
- 4. instance(Caesar,ruler)
- 5. ν x: instance(x, Roman)->loyalto(x,Caesar) hate(x,Caesar)
- 6. ν x: ν y: ν z: instance(x,y)Λ isa(y,z)-> instance(x,z)
Three Ways of Representing Class Membership
SLIDE 6
Chapter 5 6
Conversion to Clause Form
ν x: [R(x)Λ k(x,M)] -> [h(x,C) ν ( ν y: ∋ z: h(y,z) -> t(x,y))] 1.Eliminate -> using the fact a->b is eq. to not a ν b ν x: not [R(x) Λ k(x,M)]
ν [h(x,C) ν ( ν y:not(∋ z: h(y,z))ν t(x,y))]
2.Reduce the scope of each not to a single term using not (not p) = p, deMorgan's law, and the
standard correspondence between quantifiers [not ν x:P(x)= ∋ x: not P(x) and not ∋ x:P(x)= ν x:-P(x)]
ν x: [not R(x) ν not k(x,M)]
ν [h(x,C) ν ( ν y:ν z: not h(y,z)ν t(x,y))] 3.Standardize variables
For example ν x: P(x) ν ν x:Q(x) would be converted to νx: P(x) ν ν y:Q(y)
SLIDE 7
Chapter 5 7
4.Move all quantifiers to the left of the formula ν x:ν y: ν z: [ not R(x) ν not k(x,M)] ν [h(x,C) ν (not h(y,z)ν t(x,y))] (prenex normal
form)
5.Eliminate existential quantifier
∋ y: President(y) can be transformed into the formula President(S1) where S1 is a function with no argument that somehow produces a value that satisfies President ν x: ∋ y: father-of(y,x) can be transformed into ν x: father-of(S2(x),x))
6.Drop the prefix not R(x) ν not k(x,M) ν h(x,C) ν not h(y,z)ν t(x,y) 7.Convert the matrix into a conjunction of disjuncts You can use the distribution law in this step but we don have in this example 8.Create a separate clause for each conjunct We have only one clause
SLIDE 8 Chapter 5 8
- 9. Standardize apart the variables in the set of clauses
generated in step 8
SLIDE 9 Chapter 5 9
Resolution in Propositional Logic
Given Axioms Converted to Clause Form P P (P Λ Q) -> R not P ν not Q ν R (S ν T) -> Q not S ν Q not T ν Q T T
A Few Facts in Propositional Logic
P
T
Resolution in Propositional Logic
SLIDE 10 Chapter 5 10
Resolution in Predicate Logic
Axioms in clause form:
1.man(Marcus) 2.Pompiean(Marcus) 3.- Pompiean(x1) ν Roman(x1) 4.ruler(Caesar ) 5.- Roman(x2) ν loyalto(x2,Caesar) ν hate(x2,Caesar)
7.- man(x4) ν - ruler(y1) ν - tryassassinate(x4,y1) ν loyalto(x4,y1) 8.tryassassinate(Marcus,Caesar) Prove: hate(Marcus,Caesar)
5 3
- Roman(Marcus) ν loyalto(Marcus,Caesar)
Pompiean(Marcus) ν loyalto(Marcus,Caesar) 2 7 loyalto(Marcus,Caesar) 1 - man(Marcus) ν- ruler(Caesar)νtryassassi..(Marcus,Caesar)
- ruler(Caesar) ν - tryassassinate(Marcus,Caesar)
4
- tryassassinate(Marcus,Caesar) 8
A Resolution Proof
SLIDE 11 Chapter 5 11
Prove: loyalto(Marcus,Caesar)
5 3
- Roman(Marcus) ν hate(Marcus,Caesar)
- Pompiean(Marcus) ν hate(Marcus,Caesar)
2 10 hate(Marcus,Caesar) 9 persecute(Caesar,Marcus) hate(Marcus,Caesar)
An Unsuccessful Attempt at Resolution
SLIDE 12 Chapter 5 12
Given 1. father (x,y) ν - women(x) 2. mother(x,y) ν women(x) 3. mother(Chris, Mary) 4. father(Chris, Bill) 1 2
- father(x,y) ν - mother(x,y)
3
The need to Standardize Variables 1 2
- father(a,y) ν - mother(a,b)
3
4
SLIDE 13 Chapter 5 13
Prove: ∋x: hate(Marcus,x)Λ ruler(x)
(negate):- ∋ x: hate(Marcus,x) Λ ruler(x) (clausify): - hate(Marcus,x) ν - ruler(x)
- hate(Marcus,x) ν - ruler(x)
hate(Marcus, Paulus)
(a)
- hate(Marcus,x) ν - ruler(x)
hate(Marcus, Julian)
(b)
- hate(Marcus,x) ν - ruler(x)
hate(Marcus, Caesar)
ruler(Caesar)
Trying Several Substitution
SLIDE 14 Chapter 5 14
- ∋ t: died(Marcus,t) = - died(Marcus,t)
- Pompeian(x1) ν died(x1,79)
- died(Marcus,t)
79/t,Marcus/x1
Pompeian(Marcus) (a)
- Pompeian(x1) νdied(x1,79) - died(Marcus,t)νdied(Marcus,t)
79/t,Marcus/x1
- Pompeian(Marcus) ν died(Marcus,t)
Pompeian(Marcus) died(Marcus,79)
Answer Extraction Using Resolution