Forward chaining (or forward reasoning) is one of the two main methods of
reasoning
Reason is the capacity of consciously applying logic by drawing conclusions from new or existing information, with the aim of seeking the truth. It is closely associated with such characteristically human activities as philosophy, science, lang ...
when using an
inference engine
In the field of artificial intelligence, an inference engine is a component of the system that applies logical rules to the knowledge base to deduce new information. The first inference engines were components of expert systems. The typical expert ...
and can be described
logically as repeated application of ''
modus ponens''. Forward chaining is a popular implementation strategy for
expert system
In artificial intelligence, an expert system is a computer system emulating the decision-making ability of a human expert.
Expert systems are designed to solve complex problems by reasoning through bodies of knowledge, represented mainly as if†...
s,
business and
production rule systems. The opposite of forward chaining is
backward chaining
Backward chaining (or backward reasoning) is an inference method described colloquially as working backward from the goal. It is used in automated theorem provers, inference engines, proof assistants, and other artificial intelligence applicatio ...
.
Forward chaining starts with the available
data
In the pursuit of knowledge, data (; ) is a collection of discrete values that convey information, describing quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpret ...
and uses
inference rule
In the philosophy of logic, a rule of inference, inference rule or transformation rule is a logical form consisting of a function which takes premises, analyzes their syntax, and returns a conclusion (or conclusions). For example, the rule of ...
s to extract more data (from an end user, for example) until a
goal
A goal is an idea of the future or desired result that a person or a group of people envision, plan and commit to achieve. People endeavour to reach goals within a finite time by setting deadlines.
A goal is roughly similar to a purpose or ...
is reached. An
inference engine
In the field of artificial intelligence, an inference engine is a component of the system that applies logical rules to the knowledge base to deduce new information. The first inference engines were components of expert systems. The typical expert ...
using forward chaining searches the inference rules until it finds one where the
antecedent
An antecedent is a preceding event, condition, cause, phrase, or word.
The etymology is from the Latin noun ''antecedentem'' meaning "something preceding", which comes from the preposition ''ante'' ("before") and the verb ''cedere'' ("to go").
...
(If clause) is known to be true. When such a rule is found, the engine can conclude, or infer, the
consequent
A consequent is the second half of a hypothetical proposition. In the standard form of such a proposition, it is the part that follows "then". In an implication, if ''P'' implies ''Q'', then ''P'' is called the antecedent and ''Q'' is called t ...
(Then clause), resulting in the addition of new
information
Information is an abstract concept that refers to that which has the power to inform. At the most fundamental level information pertains to the interpretation of that which may be sensed. Any natural process that is not completely random, ...
to its data.
Inference engines will
iterate through this process until a goal is reached.
Example
Suppose that the goal is to conclude the color of a pet named Fritz, given that he croaks and eats flies, and that the
rule base
In computer science, a rule-based system is used to store and manipulate knowledge to interpret information in a useful way. It is often used in artificial intelligence applications and research.
Normally, the term ''rule-based system'' is app ...
contains the following four rules:
# If X croaks and X eats flies - Then X is a frog
# If X chirps and X sings - Then X is a canary
# If X is a frog - Then X is green
# If X is a canary - Then X is blue
Let us illustrate forward chaining by following the pattern of a computer as it evaluates the rules.
Assume the following facts:
* Fritz croaks
* Fritz eats flies
With forward reasoning, the inference engine can derive that Fritz is green in a series of steps:
1. Since the base facts indicate that "Fritz croaks" and "Fritz eats flies", the antecedent of rule #1 is satisfied by substituting Fritz for X, and the inference engine concludes:
Fritz is a frog
2. The antecedent of rule #3 is then satisfied by substituting Fritz for X, and the inference engine concludes:
Fritz is green
The name "forward chaining" comes from the fact that the inference engine starts with the data and reasons its way to the answer,
as opposed to
backward chaining
Backward chaining (or backward reasoning) is an inference method described colloquially as working backward from the goal. It is used in automated theorem provers, inference engines, proof assistants, and other artificial intelligence applicatio ...
, which works the other way around.
In the derivation, the rules are used in the opposite order as compared to
backward chaining
Backward chaining (or backward reasoning) is an inference method described colloquially as working backward from the goal. It is used in automated theorem provers, inference engines, proof assistants, and other artificial intelligence applicatio ...
.
In this example, rules #2 and #4 were not used in determining that Fritz is green.
Because the data determines which rules are selected and used, this method is called
data-driven, in contrast to
goal-driven backward chaining
Backward chaining (or backward reasoning) is an inference method described colloquially as working backward from the goal. It is used in automated theorem provers, inference engines, proof assistants, and other artificial intelligence applicatio ...
inference. The forward chaining approach is often employed by
expert system
In artificial intelligence, an expert system is a computer system emulating the decision-making ability of a human expert.
Expert systems are designed to solve complex problems by reasoning through bodies of knowledge, represented mainly as if†...
s, such as
CLIPS.
One of the advantages of forward-chaining over backward-chaining is that the reception of new data can trigger new inferences, which makes the engine better suited to dynamic situations in which conditions are likely to change.
See also
*
Backward chaining
Backward chaining (or backward reasoning) is an inference method described colloquially as working backward from the goal. It is used in automated theorem provers, inference engines, proof assistants, and other artificial intelligence applicatio ...
*
Constraint Handling Rules
*
Opportunistic reasoning
Opportunistic reasoning is a method of selecting a suitable logical inference strategy within artificial intelligence applications.
Specific reasoning methods may be used to draw conclusions from a set of given facts in a knowledge base, e.g. f ...
*
Rete algorithm
References
{{reflist
External links
Forward vs. Backward Chaining Explained at SemanticWeb.com
Logic
Expert systems
Logic in computer science