Professional Documents
Culture Documents
AI
AI
AI
When found it can conclude, or infer, the THEN clause, resulting in the addition of new information to its dataset. In other words, it starts with some facts and applies rules to find all possible conclusions. Therefore, it is also known as Data Driven Approach [1]. Flowchart of Forward Chaining:
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 necessary data at the start, the problem being too complex. The software must "invent" the way to solve the problem, request the missing data from the user, gradually approaching the goal as quickly as possible. The result gives the impression of a dialogue led by an expert. To guide a dialogue, the engine may have several levels of sophistication: "forward chaining" and "backward chaining". II. FORWARD CHAINING
An inference engine using forward chaining searches the inference rules until it finds one where the IF clause is known to be true.
The standard definition of a forward-chaining system is that the system operates by repeating the following sequence of operations [2] (shown in Fig1): 1. Examine the rules to find one whos If part is satisfied by the current contents of Working Memory. 2. Fire the rule by adding to Working Memory the facts that are specified in the rules Then part. (The Then part may perform other actions as well, but that can be ignored for now.) This control cycle continues until no rules have satisfied If parts.
271
2)
3)
4)
Backward-chaining systems try to satisfy the goals in the goal stack. They do this by finding rules that can conclude the information needed by the goal, and trying to make the If parts of those rules satisfied [6]. In more detail, the standard backward-chaining control cycle is (shown in Fig2): 1. Check the conclusions of the rules to find all rules that can satisfy the top goal on the stack. 2. Process these rules one at a time: a. Evaluate the conditions in the rules If part one at a time: i. If the condition is currently unknown (that is, if there is not enough information currently known to determine whether the condition is satisfied) push a goal to make that condition known, and recursively invoke the system.
5)
6)
7)
272
Unfortunately, the only way to know how a rule will behave is to profile it and understand the business case. Many people make the mistake of thinking a rule engine will magically solve their problems. Writing high performance rules is not easy or intuitive. The best way to build efficient applications using rule engines is to take the time to learn how each approach works and use both techniques. Although it increases the learning curve, the choice between forward and backward chaining isn't something that can be summed up in 2-3 sentences. It's crucial to consider the intent of the rule, size of the dataset and performance requirements.
Table1 Comparative Study
Attribute Also known as Starts from Processing Aims for Approach Practical if
Backward Chaining Goal-driven Possible conclusion Efficient Necessary data Conservative/Cauti ous Number of possible final answers is reasonable or a set of known alternatives is available. Diagnostic, prescription and debugging application Top-down reasoning Depth-first search Consequents determine search Consequent antecedent to
Forward Chaining Data-driven New data Somewhat wasteful Any Conclusion(s) Opportunistic Combinatorial explosion creates an infinite number of possible right answers. Planning, monitoring, control and interpretation application Bottom-up reasoning Breadth-first search Antecedents determine search Antecedent to consequent
Appropriate for
273