Forward chaining
Forward chaining is a method of reasoning in artificial intelligence in which
inference rules are applied to existing data to extract additional data until an
endpoint (goal) is achieved.
In this type of chaining, the inference engine starts by evaluating existing
facts, derivations, and conditions before deducing new information. An
endpoint (goal) is achieved through the manipulation of knowledge that
exists in the knowledge base.
Forward chaining can be used in planning, monitoring, controling, and
interpreting applications.
Properties of forward chaining
The process uses a down-up approach (bottom to top).
It starts from an initial state and uses facts to make a conclusion.
This approach is data-driven.
It’s employed in expert systems and production rule system.
Examples of forward chaining
A simple example of forward chaining can be explained in the following
sequence.
A->B
A is the starting point. A->B represents a fact. This fact is used to achieve a
decision B.
A practical example will go as follows;
Tom is running (A)
If a person is running, he will sweat (A->B)
Therefore, Tom is sweating. (B)
A DENDRAL expert system is a good example of how forward chaining is
used in artificial intelligence. DENDRAL is used in the prediction of the
molecular structure of substances.
Deducing the chemical structure starts by finding the number of atoms in
every molecule. The mass spectrum of the sample is then used to establish
the arrangement of the atoms. We can summarize these steps as follows.
The chemical formula is determined (the number of atoms in every
molecule).
The spectrum machine is used to form mass spectrums of the sample.
The isomer and structure of the chemical are identified.
In this example, the identification of the chemical structure is the endpoint. In
the DENDRAL expert system, a generate and test technique is employed.
There are two elements in the generator: a synthesiser and structural
enumerator. The synthesiser plays the role of producing the mass spectrum.
The structural enumerator identifies the structure of substances and prevents
redundancy in the generator.
Advantages
It can be used to draw multiple conclusions.
It provides a good basis for arriving at conclusions.
It’s more flexible than backward chaining because it does not have a
limitation on the data derived from it.
Disadvantages
The process of forward chaining may be time-consuming. It may take a
lot of time to eliminate and synchronize available data.
Unlike backward chaining, the explanation of facts or observations for
this type of chaining is not very clear. The former uses a goal-driven
method that arrives at conclusions efficiently.
Backward chaining
Backward chaining is a concept in artificial intelligence that involves
backtracking from the endpoint or goal to steps that led to the endpoint. This
type of chaining starts from the goal and moves backward to comprehend the
steps that were taken to attain this goal.
The backtracking process can also enable a person establish logical steps that
can be used to find other important solutions.
Backward chaining can be used in debugging, diagnostics, and prescription
applications.
Properties of backward chaining
The process uses an up-down approach (top to bottom).
It’s a goal-driven method of reasoning.
The endpoint (goal) is subdivided into sub-goals to prove the truth of
facts.
A backward chaining algorithm is employed in inference engines, game
theories, and complex database systems.
The modus ponens inference rule is used as the basis for the backward
chaining process. This rule states that if both the conditional statement
(p->q) and the antecedent (p) are true, then we can infer the subsequent
(q).
Example of backward chaining
The information provided in the previous example (forward chaining) can be
used to provide a simple explanation of backward chaining. Backward
chaining can be explained in the following sequence.
A->B
B is the goal or endpoint, that is used as the starting point for backward
tracking. A is the initial state. A->B is a fact that must be asserted to arrive at
the endpoint B.
A practical example of backward chaining will go as follows:
Tom is sweating (B).
If a person is running, he will sweat (A->B).
Tom is running (A).
The MYCIN expert system is a real life example of how backward chaining
works. This is a system that’s used in the diagnosis of bacterial infections. It
also recommends suitable treatments for this type of infections.
The knowledge base of a MYCIN comprises many antecedent-consequent
rules, that enable the system to recognize various causes of (bacterial)
infections. This system is suitable for patients who have a bacterial infection,
but don’t know the specific infection. The system will gather information
relating to symptoms and history of the patient. It will then analyze this
information to establish the bacterial infection.
A suitable sequence can be as follows:
The patient has a bacterial infection.
The patient is vomiting.
He/she is also experiencing diarrhea and severe stomach upset.
Therefore, the patient has typhoid (salmonella bacterial infection).
The MYCIN expert system uses the information collected from the patient to
recommend suitable treatment.
The recommended treatment corresponds to the identified bacterial infection.
In the case above, the system may recommend the use of ciprofloxacin.
Advantages
The result is already known, which makes it easy to deduce inferences.
It’s a quicker method of reasoning than forward chaining because the
endpoint is available.
In this type of chaining, correct solutions can be derived effectively if
pre-determined rules are met by the inference engine.
Disadvantages
The process of reasoning can only start if the endpoint is known.
It doesn’t deduce multiple solutions or answers.
It only derives data that is needed, which makes it less flexible than
forward chaining.
Forward Chaining vs Backward Chaining
Basis of Forward Chaining Backward Chaining
comparison
Question Type Expert System uses this strategy to Expert System uses this strategy to
answer, “What can happen next ?” answer, “Why this happen ?”
Approach Follows Bottom-Up approach Follows Top-Down Approach
Type of It applies the Breadth-First Strategy It applies the Depth-First Strategy
Strategy
Technique Forward chaining is a data-driven It is a goal-driven technique.
technique
Goal Its goal is to get a conclusion. Its goal is to get the possible facts
Operational Forward direction, i.e. it goes from fact to Backward direction, i.e. it goes from result
Direction result to facts.
Number of It can generate an infinite number of It generates a finite number of possible
Conclusions possible conclusions conclusions
Application It used in monitoring, planning, It is used in prescription, debugging and
interpretation and control applications. diagnostics applications.
Speed Slow as it has to use all the rules Fast as it has to use only a few rules.