Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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.
273