Professional Documents
Culture Documents
Derwin Suhartono
Inference in FOL
of First-Order Logic
of First-Order Logic
Atomic Sentence
• Atomic sentence = predicate (term1,...,termn)
Example:
“Richard the Lionheart is the brother of King John”.
Brother(Richard, John)
of First-Order Logic
Complex Sentence
• Complex sentences are made from atomic sentences
using connectives.
Example:
“All king are person” written as:
x : King(x) Person(x)
“King John has a crown on his head” written as:
y : Crown(y) OnHead(y, John)
of First-Order Logic
Complex Sentence
• More complex sentences using multiple quantifier :
p q : brother (p, q) sibling(p, q)
• Symmetric relationship:
p q : sibling(p, q) sibling(q, p)
Sibling(King John, Richard) Sibling(Richard, King John)
Logic
Given the following statements:
1. Chandra is a student
2. Chandra is a student in SoCS
3. Each SoCS student is a member of SoCS
4. Algorithm is difficult
5. Each student in SoCS likes or hates the Algorithm
6. Each student likes one lesson
7. The student who does not come to difficult lesson dislikes the
lesson
8. Chandra does not come to Algorithm
Logic
Backward Chaining
(7)
(1)
(4)
come(Chandra, Algorithm)
(8)
null
Resolution
Resolution
(P ^ Q) R P v Q v R
(S v T) Q S v Q
T v Q
T T
Resolution
Resolution
6. like(x3,f(x3))
Resolution
hate(Chandra,Algorithm) 5
Chandra/x2
Prove whether
3 student(Chandra, SoCS) v like(Chandra,Algorithm)
Chandra hates
Chandra/x1
algorithm or not?
SoCS(Chandra) v like(Chandra,Algorithm) 2
7 like(Chandra,Algorithm)
Chandra/x4 ; Algoritma/y1
difficult(Algorithm) v come(Chandra,Algorithm) 4
Resolution
Backward Chaining
Given the following statements:
1. Marcus was a man.
2. Marcus was a Pompeian.
3. All Pompeian were Romans.
4. Caesar was a ruler.
5. All Romans were either loyal to Caesar or hated him.
6. Everyone is loyal to someone.
7. People only try to assassinate rulers they aren’t loyal to.
8. Marcus tried to assassinate Caesar.
9. All men are people.
Prove by using Backward Chaining that Marcus is not loyal to Caesar
Backward Chaining
First-Order Logic from the statements are:
1. man(Marcus)
2. Pompeian(Marcus)
3. x : Pompeian (x) Roman(x)
4. ruler(Caesar)
5. x : Roman(x) loyalto(x,Caesar)
hate(x,Caesar)
6. x : y : loyalto (x,y)
7. x : y : person(x) ruler(y)
tryassassinate(x,y) loyalto(x,y)
8. tryassassinate (Marcus, Caesar)
9. x : man(x) person(x)
Backward Chaining
Closing
Any Questions?
Exercise
From the last period of “Pemilu” in Jakarta, we have some facts. They are given as
follows:
(1) At that time, Foke was the Vice Governor of Jakarta. (2) Then, Foke went
to propose himself to be the Governor candidate. (3) And the Vice Governor
candidate was Priyanto. (4) Someone who was success would be famous. (5)
Every people who was famous and loved would be elected. (6) Because of his
position, Foke was success and he was loved. (7) Adang was the strongest
rival on that “Pemilu”. (8) All people that were elected will be the Governor.
a. Convert all of the statements to First-Order Logic!
b. Convert the FOL to CNF form!
c. Prove that Foke became the Governor using Resolution!