0% found this document useful (0 votes)
66 views4 pages

Forward Chaining and Backward Chaining

Nothing

Uploaded by

AHMAD BHATTI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views4 pages

Forward Chaining and Backward Chaining

Nothing

Uploaded by

AHMAD BHATTI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Expert System

An expert system is a computer application that uses rules, approaches,


and facts to provide solutions to complex problems. Examples of expert
systems include MYCIN.

There are three components in an expert system: user interface,


inference engine, and knowledge base. The user interface enables users
of the system to interact with the expert system. High-quality and
domain-specific knowledge is stored in the knowledge base.

Backward and forward chaining stem from the inference engine


component.

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

A. 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:

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


o 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.
o Forward-chaining approach is also called as data-driven as we reach to the goal using
available data.
o Forward -chaining approach is commonly used in the expert system, such as CLIPS,
business, and production rule systems.

Consider the following famous example which we will use in both approaches:

Example:
"As per the law, it is a crime for an American to sell weapons to hostile nations.
Country A, an enemy of America, has some missiles, and all the missiles were sold
to it by Robert, who is an American citizen."

Prove that "Robert is criminal."

To solve the above problem, first, we will convert all the above facts into first-order
definite clauses, and then we will use a forward-chaining algorithm to reach the goal.

Facts Conversion into FOL:

o It is a crime for an American to sell weapons to hostile nations. (Let's say p, q, and r are
variables)
American (p) ∧ weapon(q) ∧ sells (p, q, r) ∧ hostile(r) → Criminal(p) ...(1)
o Country A has some missiles.
o ?p Owns(A, p) ∧ Missile(p). .......(2)
o All of the missiles were sold to country A by Robert.
All p Missiles(p) ∧ Owns (A, p) → Sells (Robert, p, A) ......(3)
o Missies are weapons.
Missile(p) → Weapons (q) .......(4)
o Enemy of America is known as hostile.
Enemy(r, America) →Hostile(r) ........(5)
o Country A is an enemy of America.
Enemy (A, America) .........(7)
o Robert is American
American(Robert). ..........(8)

American Missiles(P) Owns(A,P) Enemy


(Robert) (r,america)

Weapons(q) Sells(Robert,P,A) Hostile (r)

Criminal (Robert)

B. 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:

o It is known as a top-down approach.


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

Example:
In backward-chaining, we will use the same above example, and will rewrite all the rules.

o It is a crime for an American to sell weapons to hostile nations. (Let's say p, q, and r are
variables)
American (p) ∧ weapon(q) ∧ sells (p, q, r) ∧ hostile(r) → Criminal(p) ...(1)
o Country A has some missiles.
o ?p Owns(A, p) ∧ Missile(p). .......(2)
o All of the missiles were sold to country A by Robert.
All p Missiles(p) ∧ Owns (A, p) → Sells (Robert, p, A) ......(3)
o Missies are weapons.
Missile(p) → Weapons (q).......(4)
o Enemy of America is known as hostile.
Enemy(r, America) →Hostile(r) ........(5)
o Country A is an enemy of America.
Enemy (A, America) .........(7)
o Robert is American
American(Robert). ..........(8)

American(Robert)

Weapon(q) Missiles(p)
Criminal(
Robert)
Sells(Robert,q,r) Missile(q)

Owns(A,P)
Hostile(r)

Enemy(r,America
)

You might also like