You are on page 1of 12

Forward and Backward

Chaining
Dr. K. Lakshmi
Introduction
 Forward and Backward Chaining are the
modes used by the Inference Engine to
deduce new information from the knowledge
base.
 Inference Engine is one of the major

components of the intelligent system in


Artificial Intelligence that applies a set of
logical rules to the existing information
(Knowledge Base) to deduce new information
from the already known fact.
Forward Chaining
 Forward chaining is also known as a forward
deduction or forward reasoning method when
using an inference engine.
 Forward chaining is a form of reasoning

which start with atomic sentences in the


knowledge base and applies inference rules
(Modus Ponens) in the forward direction to
extract more data until a goal is reached.
Properties of Forward Chaining
 It follows a bottom-up approach i.e. from the
atomic statement to conclusion
 It is also called a Data-driven approach as it

relies on existing data to reach the goal state


 It is conclusion driven i.e. its objective is to

reach the conclusion from the initial state


 It is widely used in the Expert System like

CLIPS and Production rule system


Example 1
 Rule 1: IF A is human THEN A is mammal
 Rule 2: IF A is a mammal THEN A is a living

form
 Rule 3: IF A is a living form THEN A is mortal

 Fact: Shyam is human
 From these inference rules, we have to reach

the Goal
 Goal: Is Shyam a mortal?
Example 1
 Start with the Known fact. We know that Shyam
is human (From the Fact statement).
 Using R1 we can infer that Shyam is a mammal.
Since it is not a Goal Statement so continue.
 Then jump to Rule 2: if Shyam is a mammal
then it as a living form so we can say that
Shyam is a living form. Since it is not a Goal
Statement so continue
 Using R3, Since Shyam is a life form so it must
be Mortal. Since it is the goal statement so Exit
Example 2
 Knowledge Base (Initial State)
 Rules:

◦ R1 – if X is a power driven then X requires a power


source
◦ R2 – if X is a machine tool then X has a tool holder
◦ R3 – if X is a machine tool then X is power driven
 Fact:
◦ F1 – A lathe is a machine tool
F1 matches R2
F1 matches R3
Example 2
 Knowledge Base (Intermediate State)
 Fact:

◦ F1 – A lathe is a machine tool


◦ F2 – A lathe has a tool holder
◦ F3 – A lathe is power driven
 Rules:
◦ R1 – if X is a power driven then X requires a power
source
◦ R2 – if X is a machine tool then X has a tool holder
◦ R3 – if X is a machine tool then X is power driven

F3 matches R1
Example 2
 Knowledge Base (Final State)
 Fact:

◦ F1 – A lathe is a machine tool


◦ F2 – A lathe has a tool holder
◦ F3 – A lathe is power driven
◦ F4 – A lathe requires a power source
 Rules:
◦ R1 – if X is a power driven then X requires a power
source
◦ R2 – if X is a machine tool then X has a tool holder
◦ R3 – if X is a machine tool then X is power driven
Forward Chaining Vs Backward Chaining
Forward Chaining Backward Chaining
1. Forward chaining starts from Backward chaining starts
known facts and applies inference from the goal and works
rule to extract more data unit it backward through inference
reaches to the goal. rules to find the required
facts that support the goal.
2. It is a bottom-up approach It is a top-down approach
3. Forward chaining is known as Backward chaining is known
data-driven inference technique as as goal-driven technique as
we reach to the goal using the we start from the goal and
available data. divide into sub-goal to
extract the facts.
4. Forward chaining reasoning Backward chaining reasoning
applies a breadth-first search applies a depth-first search
strategy. strategy.
Forward Chaining Backward Chaining
5. Forward chaining tests for all Backward chaining only tests
the available rules for few required rules.
6. Forward chaining is suitable for Backward chaining is suitable
the planning, monitoring, for diagnostic, prescription, and
control, and interpretation debugging application.
application.
7. Forward chaining can generate Backward chaining generates a
an infinite number of possible finite number of possible
conclusions. conclusions.
8. It operates in the forward It operates in the backward
direction. direction.
9. Forward chaining is aimed for Backward chaining is only
any conclusion. aimed for the required data.
Reference
 https://www.youtube.com/watch?v=Jg9dukM
zlb4
 https://www.youtube.com/watch?v=RYIjxRfO
PWY

You might also like