Forward & Backward Chainning

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Inference engine:

The inference engine is the component of the intelligent system in artificial intelligence,
which applies logical rules to the knowledge base to infer new information from known facts.
The first inference engine was part of the expert system. Inference engine commonly
proceeds in two modes, which are:

A. Forward chaining
B. Backward chaining

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.

The Forward-chaining algorithm starts from known facts, triggers all rules whose
premises are satisfied, and add their conclusion to the known facts. This process
repeats until the problem is solved.

Properties of Forward-Chaining:

 It is a down-up approach, as it moves from bottom to top.


 It is a process of making a conclusion based on known facts or data, by
starting from the initial state and reaches the goal state.
 Forward-chaining approach is also called as data-driven as we reach to the
goal using available data.
Example:
"As per the law, it is a crime for an American to sell weapons to enemy of
America, Country Nono , an enemy of America, has some missiles, and all the
missiles were sold to it by Colonel, who is an American citizen."

Prove that "Colonel is a criminal."

First of all we divide the above statements into separate sentences to convert easily
into FOL (first order logic). You can directly convert these statements into FOL

 It is crime for an American to sell weapons to the enemy of America


 Country Nono is an enemy of America
 Nono has some Missiles
 All the missiles were sold to Nono by colonel
 Missiles are weapon
 Colonel is an American

Now we convert these facts into FOL

It is crime for an American to sell weapons to the enemy of America (Let's say x,
y, and z are variables)

FOL of above sentence

American (x) ∧ weapon(y) ∧ sells (x, y, z) ∧ Enemy(z, America) →


Criminal(p)

Country Nono is an enemy of America

Enemy(Nono, America)

Nono has some Missiles

Owns(Nono, x)
All the missiles were sold to Nono by colonel

∀x Missiles(x) ∧ Owns (Nono, x) → Sells (Colonel, x, Nono)

Missiles are weapons.


Missile(x) → Weapons (x)

Colonel is an American

American (Colonel)

Forward chaining proof:


Step 1

In the first step we will start with the known facts and will choose the sentences
which do not have implications, such as: American(Colonel), Enemy(Nono,
America), Owns(Nono, x), and Missile(x).

Hence it is proved that Colonel is Criminal using forward chaining approach.


Backward Chaining:
Backward-chaining is also known as a backward deduction or backward reasoning
method when using an inference engine. A backward chaining algorithm is a form
of reasoning, which starts with the goal and works backward, chaining through
rules to find known facts that support the goal.

Properties of backward chaining:

 It is known as a top-down approach.


 Backward-chaining is based on modus ponens inference rule.
 In backward chaining, the goal is broken into sub-goal or sub-goals to
prove the facts true.
 It is called a goal-driven approach, as a list of goals decides which rules
are selected and used.
 Backward -chaining algorithm is used in game theory, automated
theorem proving tools, inference engines, proof assistants, and various AI
applications.
 The backward-chaining method mostly used a depth-first
search strategy for proof.

Example

We will take the same example as above and will convert the facts in FOL

It is crime for an American to sell weapons to the enemy of America (Let's say x,
y, and z are variables)

FOL of above sentence

American (x) ∧ weapon(y) ∧ sells (x, y, z) ∧ Enemy(z, America) →


Criminal(p)

Country Nono is an enemy of America

Enemy(Nono, America)

Nono has some Missiles

Owns(Nono, x)
All the missiles were sold to Nono by colonel

∀x Missiles(x) ∧ Owns (Nono, x) → Sells (Colonel, x, Nono)

Missiles are weapons.


Missile(x) → Weapons (x)

Colonel is an American

American (Colonel)

Backward-Chaining proof
At the first step, we will take the goal fact. And from the goal fact, we will infer
other facts, and at last, we will prove those facts true. So our goal fact is "Colonel
is Criminal”
Difference between Forward Chaining and Backward chaining

No. Forward Chaining Backward Chaining

1. Forward chaining starts from Backward chaining starts from the goal and
known facts and applies works backward through inference rules to
inference rule to extract more find the required facts that support the goal.
data unit it reaches to 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 as goal-driven


data-driven inference technique as we start from the goal and
technique as we reach to the divide into sub-goal to extract the facts.
goal using the available data.

4. Forward chaining reasoning Backward chaining reasoning applies a


applies a breadth-first search depth-first search strategy.
strategy.

5. Forward chaining tests for all Backward chaining only tests for few
the available rules required rules.

6. Forward chaining is suitable Backward chaining is suitable for diagnostic,


for the planning, monitoring, prescription, and debugging application.
control, and interpretation
application.

7. Forward chaining can generate Backward chaining generates a finite


an infinite number of possible 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 aimed for the
any conclusion. required data.

You might also like