2. Objective
This lecture will enable you to
• Represent simple facts in the language of
propositional logic
• Interpret a propositional logic statement
• Compute the meaning of a compound
proposition
3. Knowledge Representation
• Knowledge is a theoretical or practical
understanding of a subject or a domain.
Knowledge is also the sum of what is currently
known.
• Knowledge is “the sum of what is known: the
body of truth, information, and principles
acquired by mankind.” Or, "Knowledge is what I
know, Information is what we know."
• There are many other definitions such as:
4. Definition of Knowledge
• Knowledge is "information combined with experience,
context, interpretation, and reflection. It is a high-value
form of information that is ready to apply to decisions
and actions." (T. Davenport et al., 1998)
• Knowledge is “human expertise stored in a person’s
mind, gained through experience, and interaction with
the person’s environment." (Sunasee and Sewery,
2002)
• Knowledge is “information evaluated and organized by
the human mind so that it can be used purposefully,
e.g., conclusions or explanations." (Rousa, 2002)
5. Knowledge Representation
• Knowledge consists of information that has
been:
– interpreted,
– categorised,
– applied, experienced and revised.
• In general, knowledge is more than just data,
it consist of: facts, ideas, beliefs, heuristics,
associations, rules, abstractions, relationships,
customs.
6. Research literature classifies
knowledge as
Classification-based
Knowledge
Ability to classify information
Decision-oriented
Knowledge
Choosing the best option
Descriptive
knowledge
State of some world (heuristic)
Procedural knowledge How to do something
Reasoning knowledge
What conclusion is valid in what
situation?
Assimilative
What its impact is?
7. Knowledge Representation
• Knowledge representation (KR) is the study of how
knowledge about the world can be represented and
what kinds of reasoning can be done with that
knowledge. Knowledge Representation is the method
used to encode knowledge in Intelligent Systems.
• Since knowledge is used to achieve intelligent behavior,
the fundamental goal of knowledge representation is
to represent knowledge in a manner as to facilitate
inferencing (i.e. drawing conclusions) from knowledge.
A successful representation of some knowledge must,
then, be in a form that is understandable by humans,
and must cause the system using the knowledge to
behave as if it knows it.
8. • Some issues that arise in knowledge
representation from an AI perspective are:
– How do people represent knowledge?
– What is the nature of knowledge and how do we
represent it?
– Should a representation scheme deal with a particular
domain or should it be general purpose?
– How expressive is a representation scheme or formal
language?
– Should the scheme be declarative or procedural ?
10. Properties for Knowledge
Representation Systems
• Representational Adequacy
– the ability to represent the required knowledge;
• Inferential Adequacy
– the ability to manipulate the knowledge represented to produce
new knowledge corresponding to that inferred from the
original;
• Inferential Efficiency
– the ability to direct the inferential mechanisms into the most
productive directions by storing appropriate guides;
•
• Acquisitional Efficiency
– the ability to acquire new knowledge using automatic methods
wherever possible rather than reliance on human intervention.
12. How can we represent knowledge in a
machine ?
• We need a language to represent domain
knowledge
• There must be a method to use this
knowledge
• Inference Mechanism
• Syntax and Semantics of a language
– Laughs (Suman) == ??
– Likes ( Sunita, Shanta) == ??
13. Logic is a Formal language
• Propositional Logic
– Serena is Intelligent Propositional
– Serena is hardworking
– If Serena is Intelligent and Serena is hardworking
Then Serena scores high marks
14. Elements of Propositional Logic
• Anil is Intelligent
• Anil is hardworking
• Objects and Relations or Functions
Anil Intelligent
hardworking
15. Intelligent (Anil) == Anil is intelligent
Hardworking (Anil) == Anil is hardworking
Propositions
Also Intelligent-Anil can be a proposition
A Propositions (statement) can be True or False
16. Towards the Syntax
• Let P stand for intelligent (Anil)
• Let Q stand for Hardworking (Anil)
• What does P Λ Q ( P and Q) mean ?
• What does P V Q ( P or Q) mean ?
• P Λ Q, P V Q are compound propositions
17. Syntactic Elements of Propositional
Logic
• Vocabulary
– A set of propositional symbols (P , Q, R etc.) each
of which can be True or False
– Set of logical operators
Λ (AND), V(OR), ¬ (NOT), (IMPLIES)
Often parenthesis () is used for grouping
– There are two special symbols
TRUE (T) and FALSE(F) – these are logical
constants
18. How to form propositional sentences ?
• Each symbol ( a proposition or a constant) is a
sentence
• If P is a sentence and Q is a sentence
• Then
– (P) is a sentence
– P Λ Q is a sentence
– P V Q is a sentence
– ¬P is a sentence
– P Q is a sentence
– Nothing else is a sentence
Sentences are also
called well formed
formulae (wff)
19. Example wffs
• P
• True
• P Λ Q
• (P V Q) R
• (P Λ Q) V R S
• ¬ (P V Q)
• ¬ (P V Q) R Λ S
20. Implies
• P Q
• If P is true then Q is true
• If it rains then the roads are wet
• What about –
• If the roads are wet then it rains ????
21. Equivalence
• P Q
• Example ?
• If two sides of a triangle are equal then two
base angles of the triangle are equal.
• Can be represented as two sentences
• P Q and Q P
22. What does a wff mean -- Semantics
• Interpretation in a world
• When we interpret a sentence in a world we
assign meaning to it and it evaluates to either
True or False
23. P The child can write Nursery
Class II
F
T
The child can speak
T
T
24. P Suman is intelligent
Q Serena is Diligent
Class II
Class III
T
T
F
F
25. So how do we get the meaning ?
• Remember: Sentences can be compound
propositions
• Interpret each atomic proposition in the same
world
• Assign Truth values to each interpretation
• Compute the truth value of the compound
proposition
26. Example
• P: likes (Suman, Shanta)
• Q: knows (Subash, Shraddha)
• World: Suman and Shanta are friends and Subash
and Shraddha are known to each other
• P = T, Q = T
• P Λ Q = T
• P Λ (¬ Q) = F
27. Validity of a sentence
• If a propositional sentence is true under all
possible interpretation, it is VALID
• Tautology
– P V ¬ P is always true
28. Quiz
Express the following English Statements in the
language of propositional logic:
1. It rains in July
2. The book is not costly
3. If it rains today and one does not carry
umbrella he will be drenched
29. Quiz
• If P is true and Q is true, then are the
following true or false ?
1. P Q
2. (¬ P V Q) Q
3. (¬ P V Q) P
4. P V ¬ P T
31. Quiz Answer
It rains in July
Rains (July)
¬ Rains (November) etc.
If it rains today and one does not carry umbrella
he will be drenched
• Rains (Today) Λ ¬ Carry (Umbrella) Get_Drenched
• Rains (Today) Λ ¬ Carry (Umbrella, Tom) Get_Drenched (Tom)
32. Objective
• In this lecture you will learn to:
• Infer the truth value of a proposition
• Reason towards new facts, given a set of
propositions
• Prove a proposition given a set of
propositional facts
33. Procedure to derive Truth Value
Truth Table
P Q P Λ Q
F F F
F T F
T F F
T T T
P Q P V Q
F F F
F T T
T F T
T T T
P Q P Q
F F T
F T T
T F F
T T T
34. ¬PVQ P Λ Q
P Q ¬P ¬PVQ P Λ Q
F F T T F F
F T T T F F
T F F F F T
T T F T T T
35. De Morgan’s Theorem
¬(P Λ Q) =¬P V ¬Q
¬(P V Q) =¬P Λ ¬Q
P Q P V Q ¬(P V Q) ¬P ¬Q ¬P Λ ¬Q
F F F T T T T
F T T F T F F
T F T F F T F
T T T F F F F
36. Retry the Earlier Quiz
• If P is true and Q is true, then are the
following true or false ?
1. P Q P Q P Q
F F T
F T T
T F F
T T T
37. Retry the Earlier Quiz
3. (¬ P V Q) P: S is the entire statement
P ¬ P Q S
T F T T
38. Reasoning
P: It is the month of July
Q: It rains
R: P Q
If it is the month of July then it rains
It is the month of July
Conclude: It rains
40. Is Modus Ponens Correct Inference
Rule ??
P Q can be written as ¬ P V Q conjoined
with P we can write
P Λ ¬ P V Q = (P Λ ¬ P) V Q
= F V Q
= Q
41. Modus Ponens
• Thus irrespective of meaning Modus Ponens
allows us to infer the truth of Q
• Modus Ponens is an inference rule that allows
us to deduce the truth of a consequent
depending on the truth of the antecedents
42. Inference rule can be mechanically applied
Other rules
If P and Q then P
If P then P or Q
If Not(Not(P)) then P
Chain Rule:
If P then Q If Q then R
Leads to If P then R
43. Satisfiability
• Remember: An interpretation is a mapping to a
world
• A sentence is SATISFIABLE by an interpretation
If
Under that interpretation the sentence evaluates to
TRUE
If No interpretation makes all the sentences in the
set to be TRUE
Then the set of sentences is UNSATISFIABLE or
INCONSISTENT
44. Entailment
Interpretation that satisfies the larger world set of sentences S and same interpretation makes the
candidate sentence TRUE then we can say the S logically entails the candidate sentence.
45. • If a sentence s1 has a value True for all
interpretations that make all sentences a set
of sentence S then
S |- s1
S1 logically follows from S
S1 is a logical consequence of S
S logically entails s1
46.
47. Clause: A Special Form
• Literal – A single proposition or its negation
P, ¬ P
• A clause is a disjunction of literals
P V Q V ¬ R
48. Converting a compound proposition to
the clausal form
• Consider the sentence (wff)
¬ (A B) V ( C A)
1. Eliminate implication sign
¬ (¬ A V B) V (¬ C V A)
2. Eliminate double negation and replace scope
of “not” signs (De - Morgans Law)
(A Λ ¬ B) V (¬ C V A)
49. Converting a compound proposition to
the clausal form
3. Convert to conjunctive normal form by using
distributive and associative laws
(A Λ ¬ B) V (¬ C V A)
(A V ¬ C V A) Λ (¬ B V ¬ C V A)
(A V ¬ C) Λ (¬ B V ¬ C V A)
4. Get the set of clauses
Set of clauses
(A V ¬ C)
(¬ B V ¬ C V A)
50. Resolution – A technique of Inference
• A sound inference mechanism
Principle:
Suppose x is a literal and s1 and s2 are two sets of
propositional sentences represented in clausal form
If we have (x V s1) Λ (¬x V s2)
Then we get S1 V S2
Here S1 V S2 is the resolvent,
x is resolved upon
51. An Example
• If a triangle is equilateral then it is isosceles
• If a triangle is isosceles then two sides AB and
AC are equal
• If AB and AC are equal then angle B and angle
C are equal
• ABS is an equilateral triangle
• Angle B is equal to angle C – Prove
52. Proving by Resolution
• If a triangle is equilateral then it is isosceles
Equilateral (ABC) Isosceles (ABC)
• If a triangle is isosceles then two sides AB and AC
are equal
Isosceles (ABC) Equal (AB, AC)
• If AB and AC are equal then angle B and angle C
are equal
Equal (AB, AC) Equal (B, C)
• ABC is an equilateral triangle
Equilateral (ABC)
53. Proving by Resolution
• Clausal Form
1. Equilateral (ABC) Isosceles (ABC)
¬ Equilateral (ABC) V Isosceles (ABC)
2. Isosceles (ABC) Equal (AB, AC)
¬Isosceles (ABC) V Equal (AB, AC)
3. Equal (AB, AC) Equal (B, C)
¬Equal (AB, AC) V Equal (B, C)
4. Equilateral (ABC)
54. Proof by refutation
• To prove
Angle B is equal to Angle C
Equal (B,C)
Let us disprove
Not Equal (B,C)
¬ Equal (B,C)
Let us try to disprove this
55. ¬ Equilateral
(ABC) V
Isosceles (ABC)
¬Isosceles (ABC)
V Equal (AB,
AC)
¬Equal (AB, AC)
V Equal (B, C)
Equilateral
(ABC)
¬ Equal (B,C)
¬Equal (AB, AC) V Equal (B, C)
¬Equal (AB, AC)
¬Isosceles (ABC)
V Equal (AB, AC)
¬Isosceles (ABC)
¬ Equilateral (ABC)
V Isosceles (ABC)
¬ Equilateral (ABC)
Equilateral (ABC) Null Clause
56. Procedure for Resolution
• Convert given propositions into clausal form
• Convert the negation of the sentence to be
proved into clausal form
• Combine the clauses into a set
• Iteratively apply resolution to the set and add the
resolvent to the set
• Continue until no further resolvents can be
obtained or a null clause is obtained
57. Quiz
• Consider the following sentences
1. Mammals drink milk
2. Man is mortal
3. Man is a mammal
4. Tom is a man
5. Prove Tom drink(s) milk
6. Prove Tom is mortal
58. Quiz
1. Represent all the sentences in clausal form
2. Prove (5) and (6) using modus ponens
3. Prove (5) and (6) using resolution
60. Quiz Answers
1. Mammals drink milk
2. Man is mortal
3. Man is a mammal
4. Tom is a man
1. Prove Tom drink(s) milk
2. Prove Tom is mortal
61.
62. • Applying modus ponens on R and S we get
mammal(Tom) ……… 5
• Applying modus ponens on 5 and 1 we get
drink(Tom, Milk)
63. • Applying modus ponens on R and S we get
mammal(Tom) ……… 5
• Applying modus ponens on 5 and 1 we get
drink(Tom, Milk)
64. Proof by Resolution
P: mammal (Tom) drink (Tom, Milk)
¬ mammal (Tom) V drink (Tom, Milk)
Q: man (Tom) mortal (Tom)
¬ man (Tom) V mortal (Tom)
R: man(Tom) mammal (Tom)
¬man(Tom) V mammal (Tom)
S: man(Tom)
Goal: drink(Tom, Milk)
To disprove: ¬ drink(Tom, Milk)
65. P: ¬ mammal (Tom)
V drink (Tom, Milk)
Q:¬ man (Tom) V
mortal (Tom)
R: ¬man(Tom) V
mammal (Tom)
S: man(Tom)
¬ drink(Tom, Milk)
¬ mammal (Tom)
V drink (Tom, Milk)
¬ mammal (Tom)
¬man(Tom) V
mammal (Tom)
¬man(Tom)
man(Tom)
Null Clause
66. Objective
This lecture will enable you to
• Formulate more types of sentences in logic
• Write correct predicate logic formulae
67. Limitation of Propositional Logic
• Consider the following argument
– All dogs are faithful
– Tommy is a dog
– Therefore, Tommy is faithful
• How to represent and infer this in
propositional logic?
68. Limitation of Propositional Logic
p : all dogs are faithful
q: Tommy is a dog
But P Λ q === >Tommy is faithful ??
No! we cannot infer this in Propositional Logic
69. More Scenarios
• Tom is a hardworking student
Hardworking(Tom)
• Tom is an intelligent student
Intelligent(Tom)
• If Tom is hardworking and Tom is intelligent
Then Tom scores high marks
• Hardworking(Tom) Λ Intelligent (Tom)
Scores_High_Marks(Tom)
70. What about John and Jill ?
If we could write instead
All students who are hardworking and intelligent
scores high marks !!!
For all x such that x is a student and x is intelligent
and x is hardworking then x scores high marks
71. The Problem of Infinite Model
• In general, propositional logic can deal with
only a finite, number of propositions.
• If there are only three dogs Tommy, Jimmy,
and Laika, Then
T: Tommy is faithful
J: Jimmy is faithful
L: Laika is faithful
All dogs are faithful T Λ J Λ L
• What if there are infinite number of dogs ?
72. First-Order Logic / Predicate Logic
• First – order logic or predicate logic is a
generalization of propositional logic that
allows us to express and infer arguments in
infinite modes like
– All men are mortal
– Some birds cannot fly
– At least one planet has life on it
73. Syntax of FOL
• The syntax of first-order logic can be defined
in terms of
–Terms
–Predicate
–Quantifiers
74. Term
• A term denotes some object other than True
or False
Tommy is a dog
Tommy = Term
All men are mortal
Men = Term
75. Terms: Constant & Variable
• A constant of type W is a name that denotes a
particular object in a set W
– Example: 5, Tommy etc.
• A variable of type W is a name that can
denote any element in the set W
– Example: x ∈ N denotes a natural number
d denotes the name of a dog
76. Terms: Functions
• A functional term of arity n takes n objects of
type W 1 to W n as inputs and returns an
object of type W.
f(W 1, W2, …, W n )
plus(3,4) = 7
Functional term Constant term
77. Functions: Example
• Let plus be a function that takes two
arguments of type Natural Number and
returns a Natural number
• Valid functional terms:
plus (2, 3) plus(5, plus(7,3))
plus(plus(100,plus(1,6)),plus(3,3))
• Invalid functional terms:
plus(0, -1) plus(1.2, 3.1)
79. Predicates
• Predicates are like functions except that their
return type is true or false.
• Example:
– gt ( x , y ) is true iff x > y
– Here gt is a predicate symbol that takes two
arguments of type natural number
– gt (3, 4 ) is a valid predicate but gt (3, -4) is not
80. Types of Predicates
• A predicate with no variable is a proposition
– Tommy is a dog
• A predicate with one variable is called a
property
– dog(x) is true iff x is a dog.
– mortal(y) is true iff y is mortal.
81. Formulation of Predicates
• Let P( x , y , …) and Q( x , y , …) are two
predicates.
• Then so are
P V Q
P Λ Q
¬ P
P Q
82. Predicate Examples
• If x is a man then x is mortal
man (x) mortal (x)
¬ man (x) V mortal (x)
• If n is a natural number, then n is either even
or odd.
natural (n) even (n) V odd (n)
83. Quantifiers
• There are two basic quantifiers in FOL
– ∀ “For all” – Universal quantifier
– ∃ “There exists” – Existential quantifier
84. Universal quantifier
• ∀x P(x) : P(x) is true for any element that I
choose from the set
• This predicate will be true if it satisfy all value
of x satisfy P(x)
86. Existential quantifier
• ∃x holiday (x)
• This predicate will be true if it satisfy at least
one x
• Days of week {Saturday, Sunday, Monday,
Tuesday, Wednesday, Thursday, Friday}
87. Universal Quantifiers
• All dogs are faithful
– faithful(x) : x is faithful
– dog(x): x is a dog
– ∀x (dog (x) faithful (x))
• All birds cannot fly
– fly(x): x can fly
– bird(x): x is a bird
– ¬ (∀x(bird (x) fly (x)))
89. Existential Quantifiers
• At least one planet has life on it
– Planet(x): x is a planet
– haslife(x): x has life on it
– ∃x (planet (x) Λ haslife(x))
90. Existential Quantifiers
• All birds cannot fly There exists a bird that
cannot fly
• Fly (x): x can fly
• Bird (x): x is a bird
• ∃x (Bird (x) Λ ¬ fly (x))
91. Duality of Quantifiers
All men are mortal
No man is immortal
There exist birds that can fly.
It is not the case that all birds cannot fly.
92. Sentences
• A predicate is a sentence
• If sen, ¬ sen are sentences and x a variable,
then
• (sen), ¬sen, ∃x sen, ∀x sen, sen Λ ¬ sen , sen V
¬ sen, sen ¬ sen are sentences
• Nothing else is a sentence
93. Quiz / Exercises
• Some dogs bark
• All dogs have four legs
• All barking dogs are irritating
• No dugs purr
• Father are male parents with children
• Students are people who are enrolled in
courses
94. Examples of Sentences
Birthday ( x , y ) – x celebrates birthday on date y
∀ y ∃ x Birthday ( x , y ) –
For all dates, there exists a person who
celebrates his/her Birthday on that date.
That is - “everyday someone celebrates
his/her birthday”
95. Examples
Brother ( x , y ) – x is y’s brother
Loves ( x , y ) – x loves y
∀ x ∀ y Brother ( x , y) Loves ( x , y)
Everyone loves (all of) his/her brothers.
Let m(x) represent mother of x then
“everyone loves his/her mother” is
∀ x Loves (x, m(x))
96. Examples
• Any number is the successor of its
predecessor
• succ (x), pred (x)
• Equal ( x , y )
∀ x equal ( x , succ (pred (x))
97. Alternative Representation
• The previous example can be represented
succinctly as
• ∀ x (succ (pred (x) = x))
• Not Allowed in predicates
98. FOL with Equality
• In FOL with equality, we are allowed to use
the equality sign (=) between two functions.
• This is just for representational ease.
• We modify the definition of sentence to
include equality as
term = term is also a sentence
99. Quiz Revisited
• Some dogs bark
• ∃ x (dog(x) Λ bark(x))
• All dogs have four legs
• ∀ x (dog(x) have_four_legs(x))
• ∀ x (dog(x) legs(x,4))
• No dugs purr
• ¬ ∃ x (dog(x) Λ purr(x))
100. • Father are male parents with children
• ∀ x (father(x) male(x) Λ has_childern(x))
101. Inference Rule
• Universal Elimination
∀ x Likes(x, flower)
Substituting x by Shirin gives
Likes(Shirin , flower)
The substitution should be done by a constant
term
102. Inference Rule
• Existential Elimination (Skolemization)
∃ x Likes(x, flower)
Likes(Person, flower)
As long as person is not in the knowledge base
• Existential introduction
Likes (shahid, flower)
Can be written as
∃ x Likes(x, flower)
103. Reasoning in FOL
• Consider the following problem:
If a perfect square is divisible by a prime p,
then it is also divisible by square of p. Every
perfect square is divisible by some prime.
36 is a perfect square.
Does there exist a prime q such that square of
q divided 36?
104. Representation in FOL
• If a perfect square is divisible by a prime p,
then it is also divisible by square of p.
∀ x ,y ( perfect_sq(x) Λ prime(y) Λ divides(x, y)
divides (x, square(y))
• Every perfect square is divisible by some
prime.
∀ x ∃ y (perfect_sq(x) Λ prime(y) Λ divides(x,
y)
105. Representation in FOL
• 36 is a perfect square.
perfect_sq(36)
• Does there exist a prime q such that the
square of q divides 35 ?
∃ y (prime(y) Λ divides(36, square(y))
106. The knowledge base
1. ∀ x ,y ( perfect_sq(x) Λ prime(y) Λ divides(x,
y) divides (x, square(y))
2. ∀ x ∃ y (perfect_sq(x) Λ prime(y) Λ divides(x,
y)
3. perfect_sq(36)
107. Inference
• From 2 and Universal Elimination
(4) ∃ y (perfect_sq(36) Λ prime (y) Λ
divides(36, y))
• From 4 and Existential Elimination
(5) perfect_sq(36) Λ prime (P) Λ divides(36, P)
• From (1) and (5)
(6) divides (36, square(P))
108. Inference
• From (5) and (6)
(7) prime (P) Λ divides(36, square(P))
• From (7) and Existential Introduction
∃ y prime (y) Λ divides(36, square(y))
109. Horn Sentences
• Atomic sentence
perfect_sq(36)
• Implication with a conjunction of atomic
sentences on the left and a single atom on the
right
∀ x ,y ( perfect_sq(x) Λ prime(y) Λ divides(x, y)
divides (x, square(y))
• No existential Quantifier
110. Conversion to Horn Sentences
• Existential Quantifiers can be removed using
Existential Elimination (Skolemization)
– If the existential quantifier is outside any universal
quantifier, a Skolem constant is introduced. E.g. ∃
y prime (y) can be written as prime(P), where P is
a Skolem constant
– Otherwise a Skolem function is introduced. E.g.
– ∀ x ∃ y ( prime(y) Λ divides(x, y) ∀ x
prime(PD(x)) Λ divides(x, PD(x)), where PD(x) is a
Skolem function
111. Conversion to Horn Sentences
• And- Elimination
• Prime(P) Λ divides( x , P) can be written as two
clauses
Prime(P)
divides ( x , P )
112. Substitution
• It replaces variables with constants.
• SUBST({x/49, y/7}, Divides( x, y)) = Divides (49;
7)
113. Unification
• It is the process of finding a substitution that
makes two atomic sentences identical.
• UNIFY(Prime(7), Prime(x)) = {x/7}
116. An Example
• If a triangle is equilateral then it is isosceles
• If a triangle is isosceles then two sides AB and
AC are equal
• If AB and AC are equal then angle B and angle
C are equal
• ABS is an equilateral triangle
• Angle B is equal to angle C – Prove
117. Proving by Resolution
• If a triangle is equilateral then it is isosceles
Equilateral (ABC) Isosceles (ABC)
• If a triangle is isosceles then two sides AB and AC
are equal
Isosceles (ABC) Equal (AB, AC)
• If AB and AC are equal then angle B and angle C
are equal
Equal (AB, AC) Equal (B, C)
• ABC is an equilateral triangle
Equilateral (ABC)
118. Proving by Resolution
• Clausal Form
1. Equilateral (ABC) Isosceles (ABC)
¬ Equilateral (ABC) V Isosceles (ABC)
2. Isosceles (ABC) Equal (AB, AC)
¬Isosceles (ABC) V Equal (AB, AC)
3. Equal (AB, AC) Equal (B, C)
¬Equal (AB, AC) V Equal (B, C)
4. Equilateral (ABC)
119. Proof by refutation
• To prove
Angle B is equal to Angle C
Equal (B,C)
Let us disprove
Not Equal (B,C)
¬ Equal (B,C)
Let us try to disprove this
120. ¬ Equal (B,C)
¬Equal (AB, AC) V Equal (B, C)
¬Equal (AB, AC)
¬Isosceles (ABC)
V Equal (AB, AC)
¬Isosceles (ABC)
¬ Equilateral (ABC)
V Isosceles (ABC)
¬ Equilateral (ABC)
Equilateral (ABC) Null Clause
¬ Equilateral
(ABC) V Isosceles
(ABC)
¬Isosceles (ABC)
V Equal (AB, AC)
¬Equal (AB, AC) V
Equal (B, C)
Equilateral (ABC)
121. Procedure for Resolution
• Convert given propositions into clausal form
• Convert the negation of the sentence to be proved into
clausal form
• Combine the clauses into a set
• Iteratively apply resolution to the set and add the resolvent
to the set
• Continue until no further resolvents can be obtained or a
null clause is obtained
122. A Few Statements
• All people who are graduating are happy.
• All happy people smile.
• Someone is graduating.
• Is someone smiling?
(Conclusion)
123. Solving the problem
• We intend to code the problem in predicate
calculus.
• Use resolution refutation to solve problem
• Solving = whether the conclusion can be
answered from the given set of sentences.
124. Selecting the Predicates
• Graduating(x): x is graduating
• Happy(x): x is happy
• Smiling(x): x is smiling
125. Encoding sentences in Predicate Logic
• All people who are graduating are happy
– ∀ x [graduating(x) happy(x)]
• All happy people smile
– ∀ x[happy(x) smiling(x)]
• Someone is graduating
– ∃ x graduating(x)
• Is someone smiling
– ∃ x smiling(x)
126. Predicates
1.∀ x [graduating(x) happy(x)]
2. ∀ x[happy(x) smiling(x)]
3. ∃ x graduating(x)
4. ¬ ∃ x smiling(x)
(Negating the conclusion)
127. Converting to Clausal Form
• Step 1: Eliminate
1. ∀ x ¬graduating(x) V happy(x)
2. ∀ x ¬ happy(x) V smiling(x)
3. ∃ x graduating(x)
4. ¬ ∃ x smiling(x)
128. Converting to Canonical / Normal
Form
• Step 2: Reduce the scope of negation
1. ∀ x ¬graduating(x) V happy(x)
2. ∀ x ¬ happy(x) V smiling(x)
3. ∃ x graduating(x)
4. ∀ x ¬ smiling(x)
129. Converting to Canonical / Normal
Form
• Step 3: Standardize variables apart
1. ∀ x ¬graduating(x) V happy(x)
2. ∀ y ¬ happy(y) V smiling(y)
3. ∃ z graduating(z)
4. ∀w ¬ smiling(w)
130. Converting to Canonical / Normal
Form
• Step 4: Move all quantifiers to the left
1. ∀ x ¬graduating(x) V happy(x)
2. ∀ y ¬ happy(y) V smiling(y)
3. ∃ z graduating(z)
4. ∀w ¬ smiling(w)
131. Converting to Canonical / Normal
Form
• Step 5: Eliminate ∃ (Skolemization)
1. ∀ x ¬graduating(x) V happy(x)
2. ∀ y ¬ happy(y) V smiling(y)
3. graduating(name1)
(name1 is the Skolemization constant)
4. ∀w ¬ smiling(w)
132. Converting to Canonical / Normal
Form
• Step 6:Drop all ∀
1. ¬graduating(x) V happy(x)
2. ¬ happy(y) V smiling(y)
3. graduating(name1)
(name1 is the Skolemization constant)
4. ¬ smiling(w)
134. Converting to Canonical Form
• Step 7: Convert to conjunct of disjunction
form
• Step 8: Make each conjunct a separate clause.
• Step 9: Standardize variables apart again.
• These steps do not change the set of clauses
any further (in the present problem)
136. Quiz
• Solve the problem with resolution
If a perfect square is divisible by a prime p,
then it is also divisible by square of p. Every
perfect square is divisible by some prime.
36 is a perfect square.
Does there exist a prime q such that square of
q divided 36?
138. Find the Package Example (Nilsson)
• We know that
• All packages in room 27 are smaller than those
in room 28
• Package A is either in room 27 or in room 28
• Package B is in room 27
• Package B is not smaller than Package A
• Where is Package A ?