Module 4.1: Knowledge and Reasoning
Module 4.1: Knowledge and Reasoning
Module: 4.2
Knowledge and Reasoning
Motivation:
Motivation of this module is to provide the students with the knowledge of FOL and to find inference in FOL.
Syllabus:
Learning Objective:
Learner should know about the inference in FOL, Forward Chaining and Backward
Chaining, Knowledge Engineering in First-Order Logic, Unification and Resolution.
Theoretical Background:
Inference in First-Order Logic is used to deduce new facts or sentences from existing sentences.
Before understanding the FOL inference rule, let's understand some basic terminologies used in
FOL. Substitution is a fundamental operation performed on terms and formulas. It occurs in all
inference systems in first-order logic. The substitution is complex in the presence of quantifiers in
FOL. If we write F[a/x], so it refers to substitute a constant "a" in place of variable "x".
Key Definitions:
Equality:
First-Order logic does not only use predicate and terms for making atomic sentences but also uses
another way, which is equality in FOL. For this, we can use equality symbols which specify that the
two terms refer to the same object.
Course Content:
Lecture : 1
Inference in FOL
Forward chaining
Module 4.1: Knowledge and Reasoning
3
Backward chaining
Let’s check the take away from this lecture
Exercise
Q.1. Translate the following statement into FOL.
“For every a, if a is a philosopher, then a is a scholar”
a) ∀ a philosopher(a) scholar(a)
b) ∃ a philosopher(a) scholar(a)
c) (a) and (b)
d) neither (a) nor (b)
Learning from this lecture: Learners will be able to understand Inference in FOL, Forward chaining
and backward Chaining.
Lecture : 2
Unification
Q(x)
P(y) 🡪 FAIL
P(x)
P(y) 🡪 x/y
P(Marcus)
P(y) 🡪 Marcus/y
P(Marcus)
P(Julius) 🡪 FAIL
P(x,x)
P(y,y) 🡪 (y/x)
P(y,z) 🡪 (z/y , y/x)
Module 4.1: Knowledge and Reasoning
5
Algorithm Unify(L1,L2)
1. If L1 or L2 is a variable or constant, then:
a) If L1 and L2 are identical, then return NIL.
b) Else if L1 is a variable, then if L1 occurs in L2 then return FAIL, else return {(L2/L1)}.
c) Else if L2 is a variable, then if L2 occurs in L1 then return FAIL, else return {(L1/L2)}.
d) Else return FAIL.
2. If the initial predicate symbols in L1 and L2 are not identical, then return FAIL.
3. If L1 and L2 have a different number of arguments, then return FAIL
4. Set SUBST to NIL.
5. For i 🡨 1 to number of arguments in L1:
a) Call Unify with the ith argument of L1 and the ith argument of L2, putting result in S.
b) If S = FAIL then return FAIL.
c) If S is not equal to NIL then:
i. Apply S to the remainder of both L1 and L2.
ii. SUBST := APPEND(S, SUBST).
6. Return SUBST.
Resolution
Resolution Refutation
Module 4.1: Knowledge and Reasoning
7
Exercise
Q.2 The process of finding the substitutions needed to make two predicate calculus expressions
match is called ______________________
a. Universal
b. Existential
c. Predicate
d. Unification
Learning from this lecture: Learners will be able to understand Knowledge Engineering in
First-Order Logic, Unification and Resolution.
Conclusion
This chapter was introduction to how to find inference in FOL with the help of F/W, B/W chaining,
Unification and Resolution.
Q.2. From “Horse are animals”, it follows that “The head of the Horse is the head of an animal”.
Demonstrate that this inference is valid by carrying out the following steps:
(i) Translate the premise and the conclusion into the language of the first order logic. Use three
predicates HeadOf(h,x), Horse(x) and Animal(x)
(ii) Negate the conclusion and convert the premise and negated conclusion into conjunctive normal
form.
(iii) Use resolution to show that the conclusion follows from the premise.
References:
Books:
Title Authors Publisher Edition Year Chapter
No
1 Artificial Stuart J. Russell and Peter McGraw 3rd
Intelligence a Norvig Hill Edition
Modern 2009
Approach
2 A First Course in Deepak Khemani McGraw 1st
Artificial Hill Edition
Intelligence Education 2013
(India)
Online Resources:
● https://nptel.ac.in/courses/106/102/106102220/
● https://www.javatpoint.com/history-of-artificial-intelligence
● http://people.eecs.berkeley.edu/~russell/slides/