Chapter 4 - Knowledge and Reasoning(II)
Chapter 4 - Knowledge and Reasoning(II)
1
Outline
Limitations of Proposition Logic
Power of predicate logic
FOL function and predicate symbol
Syntax and semantics of FOPC
FOL sentence
Quantifier in FOL
Proprty of Quantifier
Free and bounded variable
Well formed formula
Normal forms
Conversion into CNF
Substitution
Inference Rules Involving Quantifiers
Unification
Skolen functions
Generalized modus ponens
Generalized resoulution
Conversion into CNF
Backward and forward chaining
2
Propositional Logic Limitations
Some of the limitations of prepositional logic includes
Context dependency: unlike natural language, where meaning depends on
context, meaning in propositional logic is context-independent
Example of statements which are not a propositional statement
Then she saw it (context depends the preceding and succeeding
sentences)
All of them submit the requirement
very limited expressive power: unlike natural language, propositional
logic has very limited expressive power
Example cannot say “pits cause breezes in adjacent squares” except
by writing one sentence for each square
It only represent declarative sentences: Propositional logic is declarative
(sentence always have truth value)
Deals with only finite sentences: propositional logic deals satisfactorily
with finite sentences composed using not, and, or, if . . . Then, iff
3
Limitations….
e.g., if there are 3 students A, B and C
taking p = “A has red hat”,
q = “B has red hat” and
r = “C has red hat”,
the formula “there exists a student with a red hat” may be modeled as p q r.
on infinite models this may require infinite formulas;
example, “each natural number is even or odd” has to be translated as
(p0 q0)(p1 q1) (p2 q2) …
where p0 ,p1,p2,… are even and q0,q1,q2,… are odd. .
The pprepositional logic assumes the world consists of facts.
Cannot express the following:
6
Example1
Let: s(x) is the successor function and
L(x,y) represents the relation “x < y”,
The statement “a number is smaller than its successor ” can be represented as
x L(x,s(x))
where domain is implicitly known
x N(x) L(x,s(x))
where domain is explicitly mentioned
Example2
Represent the statement “Not all birds can fly”
Let B(x) denotes “x is a bird.”
Let F(x): denotes “x can fly”;
~(x (B(x) F(x)))
Does this equivalent to
x (B(x) F(x))
7 some birds couldn’t fly
Example3
Represent the statement “All men are mortal. Socrates is man.
Therefore, Socrates is Mortal”
Let:
H(x) denotes “x is man”;
M(x) denotes “x is mortal ”, and
s denotes Socrates;
The statement (2) may be described as:
x(H(x) M(x)), H(s) |- M(s)
Example4
Represent the statement“ Ann likes Mary’s brother”
x (B(x,m) L(a,x))
Every natural language sentence which is not semantically ambiguous can be
represented using logic
8
• First-order logic is used to model the world in terms of
– objects which are things with individual identities
e.g., individual students, lecturers, companies, cars ...
– properties of objects that distinguish them from other objects
e.g., mortal, blue, oval, even, large, ...
– classes of objects (often defined by properties)
e.g., human, mammal, machine, red-things...
– relations that hold among objects
e.g., brother of, bigger than, outside, part of, has color, occurs
after, owns, a member of, ...
– functions which are a subset of the relations in which there is only
one ``value'' for any given ``input''.
e.g., father of, best friend, second half, one more than ...
9
Syntax & Semantics of FOPC
Sentence : Atomic Sentence Sentence Connective Sentence Quantifier
Variable,… Sentence ~ Sentence (Sentence)
AtomicSentence : Predicate(Term1, Term2,…,Termn)Term = Term
Term: Function(Term,…) Constant Variable
Connective :
Quantifier :
Constant : A X1 KingJohn ...
Variable : a x s …
Predicate : Before HasColor Raining …
Function : Mother LeftLegOf ...
10
Term
A term is a logical expression that refers to an object .
It is a name for a thing.
Arguments of predicates must be terms
There are three kinds of terms which allows us to name things in the
world.:
1. Constant symbol,
Example: John, Japan, Bacterium
2. Variable symbol, a variable is instantiated when it is assigned a
constant as its value
Example: x,y a, t,…
3. Function symbols,
Example: f(f(x)); mother_of(John); LeftLegOf(John)
Note: A term with no variables is called a ground term. For example
John, father(solomon)
A ground atom has value true or false (like a proposition in PL)
Predicates, though special functions, are not terms in FOL
11
• Predicates: P(x[1], ..., x[n])
– P: predicate name; (x[1], ..., x[n]): argument list
– A special function with range = {T, F};
– Examples: human(x), /* x is a human */
father(x, y) /* x is the father of y */
– When all arguments of a predicate is assigned values (said to be
instantiated), the predicate becomes either true or false, i.e., it becomes
a proposition.
• Ex. Father(Fred, Joe)
– A predicate, like a membership function, defines a set (or a class) of
objects
12
Equality (=)
Two terms term1 and term2 are equal under a given interpretation if and
only if term1 and term2 refer to the same object
Example1:
If the object referred by Father(John) and the object referred to by Henry
are the same, then
Father(John) = Henry
Example2:
Definition of Sibling in terms of Parent
13
Predicate symbols
Predicate symbols: are symbols that stands to show a relationship
among terms or to indicate property of a term
For example:
On(A,B) to mean A is on B (relation between A & B)
Sister(Senait, Biruk) to mean Senait is sister of Biruk
Female(Azeb) to mean Azeb is female (proprty of azeb being female)
Here ‘On’, ‘Sister’ and Female are predicate symbols, ‘A’, ‘B’,
‘Senait’, ‘Biruk’ and Azeb are terms.
14
Atomic sentences
Atomic sentences states the facts of world and is formed from a predicate
symbol followed by a parenthesis list of terms.
Example:
Brother(Richard, John)
15
Complex Sentence
~Brother(Robin,John)
represents Robin is not Brother of John
Hana = daughter(brother(mother(Selam))) ;
represents Hana is Selam’s cousin
16
Sentences are built from terms and
atoms
• A term (denoting a individual in the world) is a constant
symbol, a variable symbol, or a function of terms.
• An atom (atomic sentence) is a predicate P(x[1], ..., x[n])
– Ground atom: all terms in its arguments are ground terms (does
not involve variables)
– A ground atom has value true or false (like a proposition in PL)
• A literal is either an atom or a negation of an atom
• A sentence is an atom, or,
– ~P, P v Q, P ^ Q, P => Q, P <=> Q, (P) where P and Q are
sentences
– If P is a sentence and x is a variable, then (x)P and (x)P
are sentences
17
Quantifiers
A quantifier is a symbol that permits one to declare, or identify the
range or scope of the variables in a logical expression.
A quantifier express properties of entire collection of objects.
There are two types of quantifier
Universal quantifier
Existential quantifier
18
Universal Quantification ()
Universal quantifier defines the domain of a variable in a logical
expression to be the any element in the universe
(x)P(x) means that P holds for all values of x in the domain associated
with that variable.
If x is a variable, then, x is read as
for all x OR for each x OR for every x
The scope of universal quantifier is the whole element in the domain
Universal quantifiers often used with "implication (=>)" to form "rules"
about properties of a class
Syntax: <variables> <sentence>
" x P is true in a model m iff P is true with x being each possible
object in the model
One or more variables can be quantified by a single quantifier by separating
with comma
Example1: “Every student is smart:”
x (Student(x) Smart(x))
Example2:
19 “All cats are mammals”
Universal Quantification ()
Roughly speaking, is equivalent to the conjunction of an instantiations
of P
20
Universal Quantification ()
Note1: Typically, is the main connective with
Note2: Avoid the mistake of using as the main connective with :
Example:
x (Student(x) Smart(x)) means “Everyone is a student and everyone is
smart”
x(cats(x) Mammals(x)) means “Everything is a cat and every thing is
mammal”
This doesn’t agree in concept with the original sentence which is every
student is smart, every cat are mammal respectively
Often associated with English words “all”, “everyone”, “always”, etc.
You rarely use universal quantification to make blanket statements about
every individual in the world (because such statement is hardly true)
(x)student(x)^smart(x)
means everyone in the world is a student and is smart.
21
Existential quantification ()
Existential quantifier defines the domain of a variable in a logical expression to be
a non empty set which is the subset of the universal set
(x)P(x) means that P holds for some value(s) of x in the domain associated with
that variable.
if y is a variable, then y is read as
23
Existential quantification ()
Note1: Typically, is the main connective with .
Note2: Avoid the mistake of using as the main connective with :
Existential quantifiers usually used with “^ (and)" to specify a list of properties about an individual.
(x) student(x) ^ smart(x) (there is a student who is smart.)
Often associated with English words “someone”, “sometimes”, etc.
Example:
Some students are smart is to mean that
there are entities that satisfy the property of both being a student and smart. In the figure, the yellow
part indicates the set of such groups
x(Man(x) ~Woman(x))
Every man is not a woman (there is no man who is a woman)
x(Man(x) Handsome(x))
Some man are handsome
25
Nested quantifiers
Universal and existential quantifiers can be nested one into
another.
It is possible to have one or more quantifier nested in another
quantifier
Example1
“For all x and all y, if x is the parent of y then y is the child of x”
can be represented as
x,y (Parent(x,y)Child(y,x))
Note: Here x,y means x y
Example2
“There is someone who is loved by everyone
yx Loves(x,y)
26
Nested quantifiers
Difficulty may arise when two quantifiers are used with the same
variable name.
For example
x (Cat(x) x Brother(Richard,x)))
in the sentence above, x in Brother(Richard,x) is existentially
qualified and the universal quantifier has no effect on it.
27
Examples of Translating English to FOL
1. Every gardener likes the sun.
(x) (gardener(x)likes (x,sun))
2. All purple mushrooms are poisonous
(x) [(mushrooms(x) purple(x)) poisonous(x)]
3. No purple mushroom is poisonous
~(x) (purple(x) mushroom(x) poisonous(x))
4. There are exactly two purple mushrooms
(x)(y) {mushroom (x) purple(x) mushroom(y) purple(y)
~(x=y) (z)[(mushroom(z) purple(z)) ((x=z)(y=z))]}
28
Examples of Translating English to FOL
5. You can fool some of the people all of the time
(x)(person(x) ( t) (time(t) can-fool(x,t)))
6. You can fool all of the people some of the time
( x)(person(x) ( t) (time(t) can-fool(x,t)))
29
Examples of Translating English to FOL
10. Everybody has a father
x y Father(y,x)
11. Everybody has a father and mother
x y,z (Father(y,x) Mother(z,x))
12. Whoever has a father has a mother
x y (Father(y,x) z Mother(z,x))
13. Every son of my father is my brother
xy ((MyFather(x) Son(y,x)) MYBrother(y))
30
Properties of quantifiers (commutativity)
i. xy is the same as y x
ii. xy is the same as y x
iii. xy is not the same as y x,
Example
x y Loves(x,y) means “There is a person who loves everyone
in the world”
y x Loves(x,y) means “Everyone in the world is loved by at
least one person”
31
Properties of quantifiers (duality)
Quantifier duality refers to the possibility of expressing one
quantifier with the other equivalently
Example
x Likes(x,IceCream) x Likes(x,IceCream)
x Likes(x,IceCream) Everyone likes ice cream
x Likes(x,IceCream) there is no one who does not like ice cream.
32
Properties of quantifiers (duality)
Quantifiers are intimately connected with each other, through
negation.
Example
If one says that everyone dislikes bitter guard
one is also saying that there does not exists someone who likes them
or vice versa.
is really conjunction over the universe of objects and is a
disjunction over the universe, they obey De Morgan’s rules.
33
Properties of quantifiers (duality)
The De Morgan rules for quantified and un-quantified sentences are as follows:
x ~P ~ x P
~x P x ~P
x P ~ x ~P
x P ~x ~P
Example: no one likes everyone
~ (x)(y)likes(x,y)
(x)(y)~likes(x,y)
In fact, one quantifier can do both works, if used with negation in appropriate
place.
Consider a world consists of only three object A
Hence x P(x) (P(A) P(B) P(C))
(P(A) P(B) P(C))
( P(A) P(B) P(C))
(x P(x) )
34
Syntax & Semantics of FOPC
35
Scope of Quantifiers
Each quantified variable has its scope
(x)[human(x) => (y) [human(y) ^ father(y, x)] ]
All occurrences of x within the scope of the quantified x refer to the
same thing.
Better to use different variables for different things, even if they are in
scopes of different quantifiers
Switching the order of universal quantifiers does not change the
meaning:
(x)(y)P(x,y) <=> (y)(x)P(x,y), can write as (x,y)P(x,y)
Similarly, you can switch the order of existential quantifiers.
(x)(y)P(x,y) <=> (y)(x)P(x,y)
Switching the order of universals and existential does change
meaning:
Everyone likes someone: (x)(y)likes(x,y)
Someone is liked by everyone: (y)(x) likes(x,y)
36
Free and Bound variables
A variable in a formula is free iff its occurrence is outside the scope of
the quantifier having the variable.
A variable in a formula is bound iff its occurrence is within the scope of
the quantifier.
The scope of a quantifier is the first complete sentence directly following
the quantifier.
Example1
38
Free and Bound variables
Example-2:
Consider the formula: x (A(x)B(x)) ----(2)
In this formula, the quantifier applies over the entire formula
(A(x)B(x)).
Hence the scope of the quantifier is entire (A(x)B(x)).
A variable is bound in situation where at least one occurrence of it is
bound.
Similarly a variable is free in a formula, if all of its occurrence is free.
Example-3:
In the formula x y (A(x,y,z)) z (B(y,z)), ----(3)
the variable z is free in the first portion of the formula and bound in the
second portion of the formula.
Hence the two occurrence of z are different variables
39
Well formed formula
Well formed formula is a formula written in logical expression that can be
interpreted perfectly into equivalent natural language sentence.
we can use inductive definition to define wff as follows:
Every atomic sentence is wff
If W is wff then ~W is also wff
If W and V are wff so are
W V WV
WV WV
5. Others
41
Normal Forms:
42
Steps to convert form predicate logic formula to CNF.
43
Conjunctive Normal Forms
Formula to be used in CNF conversion
1) (Qx) A[x]B (Qx) (A[x] B)
2) (Qx) A[x]B (Qx) (A[x] B)
3) ~(x) (A[x]) x (~A[x])
4) ~( x) (A[x]) x (~A[x])
5) x A[x] x B[x] (x) (A[x] B[x])
6) x A[x] x B[x] (x) (A[x] B[x])
7) (Q1 x) A[x] (Q2x) B[x] (Q1 x) (Q2y) (A[x] B[y])
8) (Q1 x) A[x] (Q2x) B[x] (Q1 x) (Q2y) (A[x] B[y])
Note 1. Q represents either or
Note 2. A[x] means the variable x is free in A
Note 3. B represents a formula that does not contain variable x.
Note 4. Q1 and Q2 are either or . And y does not appear in A[x].
44
Conversion exercise into CNF
1. x (A(x) y B(x,y)) ---(1)
x (~A(x) y B(x,y)) implication elimination
x y(~A(x) B(x,y)) pushing to the front
- (solution)
2. x (A(x) x B(x))
x (A(x) y B(y)) variable renaming
x (~A(x) y B(y)) eliminating
xy (~A(x) B(y)) pushing to the front
3. x A(x) x B(x)
(x A(x)) y B(y) scoping
~(xA(x)) y B(y) elimination
x ~A(x) yB(y) pushing ~ inward
xy (~A(x) B(y)) pushing to the front
x,y (~A(x) B(y)) using single quantifier
45
Conversion exercise into CNF
4. x y [z (A(x,y,z) B(y)) x C(x,z)]
=x y [z (A(x,y,z) B(y)) t C(t,s))]
renaming the variable x to t, z to s to avoid confusion
=x y [~ z (A(x,y,z) B(y)) t C(t,s))]
elimination
=x y [ z ~(A(x,y,z) B(y)) t C(t,s))]
pushing ~ inward
=x y [ z (~A(x,y,z) ~B(y)) t C(t,s))]
pushing to the front
=x y z (~A(x,y,z) ~B(y)) t C(t,s))
renaming the free variable z to s
=x y z t (~A(x,y,z) ~B(y)) C(t,s))
pushing to the front
=x y z t (~A(x,y,z) C(t,z)) (~B(y) C(t,s))
46 distributive propert of over
Substitution
Idea:
if we replace a valid sentence with any constant uniformly, the new
sentence is also valid. i.e.
given a sentence with free variables, we can have multiple
instance of the sentence by uniformly substituting one or more of
its variables.
This process is very important during inferencing by the agent which
we will see soon.
47
Substitution
Given a sentence S, free variable x, and a ground term t then we can
represent a substitution of every occurrence of x by t in S as:
SUBST({x/t}, S).
e.g., SUBST({x/f(x,y)}, S(x,y) x (P(x) Q(x)) { S(f(x,y),y) x
(P(x) Q(x))}
A sentence with free variable is called open sentence and a sentence
with only bounded variable is called closed sentence.
Substitution can be applied only on open sentence.
Hence, it is important to know the principles how to make a variable in
an expression free
48
Inference Rules Involving Quantifiers
Those rules we have seen for prepositional logic are also valid for
FOPL
A variable which is bound under the universal quantifier can be free if
the world is clearly stated.
For example: all normal human beings has two legs
x( Normal-human(x) has-legs(x, 2)). Here x is bounded
variable
This can be written in known world as Normal-human(x) has-legs(x,
2). Here x is free variable
49
Inference Rules Involving Quantifiers
Example
Axioms: x (Bird(x) Flies(x))
Bird(Tweety)
Goal: Flies(Tweety)
By removing the universal quantifier and converting to clausal form,
we will get
~Bird(x) Flies(x)
Bird(Tweety)
Without further operation, no resolution is possible
Apply SUBST({x/Tweety}, ~Bird(x) Flies(x)) gives
~Bird(Tweety) Flies(Tweety)
Bird(Tweety)
Using resolution, it results Flies(Tweety)
50
Inference Rules Involving Quantifiers
To help the agent for better inferencing, we have three more inference
rules mentioned bellow:
1. Universal Elimination: for any sentence variable x and ground term
g:
x,
SUBST({x/g}, )
example:
x Likes(x, IceCream} we can use substitution {x/Helen}
and infer
Likes(Helen, IceCream}
51
Inference Rules Involving Quantifiers
To help the agent for better inferencing, we have three more inference
rules mentioned bellow:
x,
SUBST({x/k}, )
example:
from x Kill(x, victim) we can infer
Kill(Murderer, victim) as long as Murderer doesn’t appear in the KB.
52
Inference Rules Involving Quantifiers
3. Existential Introduction: for any sentence variable x that doesn’t
occur in and ground term g that occur in :
x, SUBST({g/x}, )
example:
from Likes(Jerry, IceCream) we can infer
x Like(x, IceCream).
53
Unification
Unification: is a process of finding a substitution that makes two
expressions match exactly each other.
A substitution that makes two clauses resolvable is called a unifier.
In other words, unification is a “pattern matching” procedure that takes
two atomic sentences (literals), as input and returns:
“failure” if they do not match
a substitute list , if they do match.
Knows(John,x) Hates(John,x)
Knows(John, Jane)
Knows(y,Leonid)
Knows(y,Mothers(y))
Knows(x, Elizabeth)
Knows(solomon, mother(Jane))
Ask the question ?Hates(John, z).
Now, consult KB to know the ‘sentences’ that unify with Knows(John,
z) and then apply the unifier to Hates(John,z).
55
Unification
UNIFY(Knows(John,z), Knows(John,Jane)) = {z/Jane}
57
Generalized Modus-ponens
Generalized Modus Ponens is complete for KBs containing only Horn
clauses.
A Horn clause is a sentence of the form:
(vList) P1 (vList),P vList (x), …, PN (vList) Q(vList) where zero or more Pi’s
and Q which are positive literals (atomic sentences).
Only Horn clause sentences are acceptable in prolog
Horn clause represents a subset of the set of sentences representable in
FOL.
For example R(x) P(y) Q(z) is a sentence in FOL, but not in Horn
clause.
58
x King(x) Greedy(x) Evil(x)
King(John)
y Greedy(y)
Brother(Richard,John)
We would like to infer Evil(John)
Basic Idea: Use Modus Ponens, Resolution when
literals unify.
59
p1', p2', … , pn', ( p1 p2 … pn q)
Subst(θ,q)
where we can unify pi‘ and pi for all i
Example:
p1 p2 …. Pj …. pm, q1 q2 …. qk …. qn
SUBST(, (p1 p2 …. Pj-1 Pj+1 …. pm q1 q2 …. qk-1 qk+1 ….
qn))
61
Resolution for FOPC
Proving theorem:
Method1: Start with the given axiom, use the rules of inference and
prove the theorem
Method2: Prove that the negation of the result can not be TRUE.
Method2 is commonly known as prove by refutation.
62
Resolution for FOPC
The Resolution Refutation Procedure involves five steps:
64
First Order Resolution Examples
In equation (4), substitute x = Biruk.
~Physician(Biruk) Knows_surgery (Biruk) ---- (5)
This contradiction was due to the assumption that was made at the
beginning i.e., ~ knows_surgery(Biruk) is valid.
65
First Order Resolution
In FOL, to perform resolution, two main tasks are to be completed first:
1. writing expressions in Clausal form, and then
2. Instantiate the variables in the universal statements by substitution and
unification.
Example:
x (P(x)Q(x)) ; All men are mortal
P(A) ; Socrates is a man
Q(A) ; Socrates is mortal
Use equivalence rules to remove implication.
x (~P(x) Q(x))
P(A)
Q(A)
Substitute A for x, the proposition remains still true.
~P(A) Q(A)
P(A)
Q(A) ; Propositional resolution
66
Skolem Function
A Skolem function eliminates existential qualifier() and introduces
a brand new constant symbol known as Skolem constant that is not
used in any other sentence
So to Skolemize means, to substitute a brand new name for each
existentially quantified variable.
procedure for systematic elimination of the existential quantifiers in
a first-order formula, by introducing new constant and functional
symbols, called Skolem constants and Skolem functions, in the
formula
Simple case: the result of Skolemization of the formula xyzA
is the formula yzA[c=x], where c is a new (Skolem) constant.
For instance, the result of Skolemization of the formula
x y z(P(x, y) Q(x, z)) is y z(P(c, y) Q(c, z))
x1… xk y1 · · · ynA is y1 · · · ynA[c1/x1,…,ck/xk],
where c1,…,ck are new (Skolem) constants.
67
Note that the resulting formula is not equivalent to the original one, but is
equally satisfiable with it
The result of Skolemization of yzP(y,z) is yP(y, f(y)), where f is a
new unary function, called Skolem function
69
Skolem Function
If is in the scope of in the formula, then, is removed by replacing
the variables as functions of variables preceding it.
e.g., x y Loves(x,y) can be represented as x Loves(x, Beloved(x))
But x Loves(x, L) says every one loves the same person. But the orignal
sentence says every one has some one to love.
x (Person(x) y Heart(y) Has(x,y)) Every one has a heart
x (Person(x) Heart(H) Has(x,H)). Every one has the same heart
(shared)
x (Person(x) Heart(f(x)) Has(x,f(x))). Where f(x) is heart of x
70
Skolen Function
Example1:
Convert the formula into its Skolem Form
P = q r s t (A(q,r)B(s,t)) ---(1)
Solution:
In this formula, q is not preceded by any quantifier. Whereas s and
t are in the scope of . Hence replace q by a constant ‘’, and, s and t
by functions of r.
The Skolem form P* of P is
P* = r (A(,r) B(f1(r), f2(r) )
71
Conversion of FOL to CNF by removing quantifier
The following are guiding line for the conversion
1. Eliminating implications and bi-implication
2. Drive negative symbols inward
3. Apply De Morgan laws on quantifiers
4. Rename variables that may create ambiguity
5. Skolemize existential quantifier
6. Drop universal quantifiers
7. Distribute over which return clauses
8. Rename the variables in each clause so that each clause will be distinct
72
FOL to CNF conversion Example
“Everyone who loves all animals is loved by someone”
Representation
Let P(x) is x loves all animal
Loves(y,x) is y loves x
74
FOL to CNF conversion Example
3. Standardize variables: each quantifier should use a different one
x (( y (Animal(y) ~Loves(x,y))) zLoves(z,x))
4. Skolemization: a more general form of existential instantiation. Each
existential variable is replaced by a Skolem function of the enclosing
universally quantified variables:
x (((Animal(F(x)) ~Loves(x, F(x)))) Loves(G(x),x))
6. Distribute over :
(Animal(F(x)) Loves(G(x),x) ) (~Loves(x, F(x)) Loves(G(x),x) )
75
First Order Resolution Example:
Given the following premises, use resolution refutation procedure to
prove that “curiosity killed Tuna”
a) John owns a dog
b) Any one who owns a dog is a lover-of-animals
c) Lovers-of-animals do not kill animals
d) Either Jack is killed Tuna or curiosity killed Tuna
e) Tuna is a cat
f) All cats are animals
Knowledge representation in CNF
77
First Order Resolution Example:
c) Lovers-of-animals do not kill animals
x (L(x) (y (A(y) ~K(x,y))))
x (~L(x) (y (A(y) ~K(x,y))))
x (~L(x) (y (~A(y) ~K(x,y))))
xy (~L(x) ~A(y) ~K(x,y))
Drop universal quantifiers
~L(x) ~A(y) ~K(x,y)
d) Either Jack killed Tuna or curiosity killed Tuna
K(J,T) K(C,T)
e) “Tuna is a cat
C(T)
f) All cats are animals
~C(x) A(x)
78
First Order Resolution Example:
The next step is to prove the theorem “curiosity killed Tuna” by
refutation
That is, we should assume curiosity didn’t killed Tuna (~K(C,T)) as a
valid sentence then the set of facts and rules that we have are:
a. D(Fido) O(J,Fido)
b. ~D(y) ~O(x,y) L(x)
c. ~L(x) ~A(y) ~K(x,y)
d. K(J,T) K(C,T)
e. C(T)
f. ~C(x) A(x)
g. ~K(C,T)
79
First Order Resolution Example:
Step No. Clause Derivation
1 D(Fido) a
2 O(J,Fido) a
3 ~D(y) ~O(x,y) L(x) b
4 ~L(x) ~A(y) ~K(x,y) c
5 K(J,T) K(C,T) d
6 C(T) e
7 ~C(x) A(x) f
8 ~K(C,T) g Refutation
9 K(J,T) Resolution of 5,8
10 A(T) Resolution of 6,7 with unifier {x/T}
11 ~L(J) ~A(T) Resolution of 4,9 with unifier {x/J, y/T}
12 ~L(J) Resolution of 10,11
13 ~D(y) ~O(J,y) Resolution of 3, 12 with unifier {x/J}
14 ~D(Fido) Resolution of 13, 2 with unifier {y/Fido}
15 * Resolution of 14,1
80 Step-15 is a contradiction. Which proves that indeed curiosity killed the cat “Tuna”