Sei sulla pagina 1di 3

International Journal of Emerging Technology and Advanced Engineering

Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 10, October 2012)

STUDY OF DIFFERENCE BETWEEN FORWARD AND


BACKWARD REASONING
Tilotma Sharma1, Navneet Tiwari2 and Deepali Kelkar3
1
M.Tech (IT), Mahakal Institute of Technology, Ujjain
M.Tech (IT)
2
MCA Department, Mahakal Institute of Technology and Science, Ujjain
3
HOD CS/IT, Mahakal Institute of Technology and Management. Ujjain
Abstract - In artificial intelligence, an expert system is a When found it can conclude, or infer, the THEN clause,
computer system that emulates the decision making ability of resulting in the addition of new information to its dataset.
a human expert. Expert systems are designed to solve complex In other words, it starts with some facts and applies rules to
problems by reasoning about knowledge, like an expert, and find all possible conclusions. Therefore, it is also known as
not by following the procedure of the developer as is the case Data Driven Approach [1].
in conventional programming. An expert system has a unique
structure. It is divided into two parts, one fixed, independent Flowchart of Forward Chaining:
of the expert system: the inference engine, and one variable:
the knowledge base. To run an expert system, the engine
reasons about the knowledge base like a human.

Keywords - Artificial Intelligence, Expert system, inference


engine, knowledge base, reasoning method

I. INTRODUCTION
The inference engine is a computer program designed to
produce reasoning on rules. In order to produce reasoning,
it should be based on logic. With logic, the engine is able to
generate new information from the knowledge contained in
the rule base and data to be processed.
The engine has two ways to run: batch or conversational.
In batch, the expert system has all the necessary data to
process from the beginning. For the user, the program
works as a classical program: he provides data and receives
results immediately. Reasoning is invisible. The
conversational method becomes necessary when the
developer knows he cannot ask the user for all the Fig 1: Flowchart of Forward Chaining
necessary data at the start, the problem being too complex.
The software must "invent" the way to solve the problem, The standard definition of a forward-chaining system is
request the missing data from the user, gradually that the system operates by repeating the following
approaching the goal as quickly as possible. The result sequence of operations [2] (shown in Fig1):
gives the impression of a dialogue led by an expert. To 1. Examine the rules to find one whos If part is satisfied
guide a dialogue, the engine may have several levels of by the current contents of Working Memory.
sophistication: "forward chaining" and "backward 2. Fire the rule by adding to Working Memory the facts
chaining". that are specified in the rules Then part. (The Then
part may perform other actions as well, but that can be
II. FORWARD CHAINING ignored for now.)
This control cycle continues until no rules have satisfied
An inference engine using forward chaining searches the If parts.
inference rules until it finds one where the IF clause is
known to be true.

271
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 10, October 2012)
III. B ACKWARD CHAINING ii. If the condition is known to be unsatisfied,
An inference engine using backward chaining would continue with the loop at Step 2.
search the inference rules until it finds one which has a iii. If it was not possible to determine whether the
THEN clause that matches a desired goal. If the IF clause condition was satisfied, continue with the loop at
of that inference rule is not known to be true, then it is Step 2.
added to the list of goals (in order for goal to be confirmed b. If all the conditions in the selected rule are
it must also provide data that confirms this new rule) [4]. In satisfied, add to Working Memory the facts
other words, this approach starts with the desired specified in the Then part of the rule, pop the goal
conclusion and works backward to find supporting facts. off the stack, and return from this invocation of the
Therefore, it is also known as Goal-Driven Approach. system.
The system terminates with success when the goal stack
Flowchart of Backward Chaining: is empty. It terminates with failure if the system runs out of
rules to try in Step 2.

IV. COMPARISON B ETWEEN FORWARD AND B ACKWARD


CHAINING
1) The exploration of knowledge has different
mechanisms in forward and backward chaining.
Backward chaining is more focused and tries to
avoid exploring unnecessary paths of reasoning.
Forward chaining, on the other hand is like an
exhaustive search [3].
2) Backward chaining systems are good for
diagnostic and classification tasks, but they are not
good for planning, design, process monitoring,
and quite a few other tasks. Forward chaining
systems can handle all these tasks.
3) Forward chaining system, includes writing rules to
manage sub goals. Whereas, backward chaining
systems automatically manage sub goals [7].
4) Lots of output Hypothesis + Lots of data up front
=> Use Forward Chaining
Fewer output Hypothesis + Must query for data=>
Fig 2: Flowchart of Backward Chaining Use Backward Chaining
5) Backward chaining engines query for new facts,
Backward-chaining systems try to satisfy the goals in the whereas forward chaining relies on the
goal stack. They do this by finding rules that can conclude application asserting facts to the rule engine.
the information needed by the goal, and trying to make the 6) In backward chaining, the search is goal directed,
If parts of those rules satisfied [6]. In more detail, the so rules can be applied that are necessary to
standard backward-chaining control cycle is (shown in achieve the goal. But in forward chaining the
Fig2): whole process is not directed towards goal, so
1. Check the conclusions of the rules to find all rules when to stop the rules in not known [5].
that can satisfy the top goal on the stack. 7) If the facts that has to be established lead to a
2. Process these rules one at a time: large number of conclusion, but the number of
a. Evaluate the conditions in the rules If part one at a ways to reach that particular conclusion is small,
time: then there is more information out rather than
i. If the condition is currently unknown (that is, if information in, then backward chaining should be
there is not enough information currently known used. On the other hand, if the number of ways to
to determine whether the condition is satisfied) reach a particular conclusion is large, but the
push a goal to make that condition known, and number of conclusions likely to be reach using the
recursively invoke the system. facts is small, then forward chaining is preferred.
272
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 10, October 2012)
V. CONCLUSION REFERENCES
Unfortunately, the only way to know how a rule will [1 ] RC Chakraborty, Expert Systems, Artificial Intelligence, June 01,
2010.
behave is to profile it and understand the business case.
[2 ] George Luger, William Stubblefield, Artificial Intelligence,
Many people make the mistake of thinking a rule engine Structures and Strategies for Complex Problem Solving, Third
will magically solve their problems. Writing high Edition Addison-Wesley, 1998
performance rules is not easy or intuitive. The best way to [3 ] Knut Hinkelmann, Forward Chaining Vs Backward Chaining,
build efficient applications using rule engines is to take the University of Applied Sciences Northwestern Switzerland, School of
time to learn how each approach works and use both Business, 2004
techniques. Although it increases the learning curve, the [4 ] Donna Kay, A Comparison of Forward and Backward Chaining
Algorithms For use in a Technical Support Expert System Used for
choice between forward and backward chaining isn't Diagnosing Computer Virus Issues, April 9th, 2009 Computer
something that can be summed up in 2-3 sentences. It's Science Department California State University, Chico.
crucial to consider the intent of the rule, size of the dataset [5 ] John A. Bullinaria, IAI: Production Systems, 2005.
and performance requirements. [6 ] Alan Holland, Rule Based Systems, University College Cork, Mar
Table1 2010.
Comparative Study [7 ] Alison Cawsey, Forward and Backward Chaining, Department of
Computing and Electrical engineering, Heriot-Watt University,
Attribute Backward Forward Edinburgh, UK.
Chaining Chaining
Also known Goal-driven Data-driven
as
Starts from Possible New data
conclusion
Processing Efficient Somewhat
wasteful
Aims for Necessary data Any
Conclusion(s)
Approach Conservative/Cauti Opportunistic
ous
Practical if Number of Combinatorial
possible final explosion
answers is creates an
reasonable or a set infinite number
of known of possible
alternatives is right answers.
available.
Appropriate Diagnostic, Planning,
for prescription and monitoring,
debugging control and
application interpretation
application
Reasoning Top-down Bottom-up
reasoning reasoning
Type of Depth-first search Breadth-first
Search search
Who Consequents Antecedents
determine determine search determine
search search
Flow Consequent to Antecedent to
antecedent consequent

273

Potrebbero piacerti anche