Presentation is loading. Please wait.

Presentation is loading. Please wait.

COM362 Knowledge Engineering Inferencing 1 Inferencing: Forward and Backward Chaining John MacIntyre 0191 515 3778

Similar presentations


Presentation on theme: "COM362 Knowledge Engineering Inferencing 1 Inferencing: Forward and Backward Chaining John MacIntyre 0191 515 3778"— Presentation transcript:

1 COM362 Knowledge Engineering Inferencing 1 Inferencing: Forward and Backward Chaining John MacIntyre 0191 515 3778 john.macintyre@sunderland.ac.uk

2 COM362 Knowledge Engineering Inferencing 2 The Inference Process Inference-based data processing relies on some form of moving through the rules in the KBS The two main forms of inferencing are: FORWARD CHAINING BACKWARD CHAINING However, there are other inferencing techniques

3 COM362 Knowledge Engineering Inferencing 3 A Review of Rules Follow an IF...THEN... format In English language: IF the Pump’s temperature is hot THEN follow maintenance instructions In AionDS this would be expressed as: IFMATCH Pump with temperature is ‘hot’ THEN send (Print Maintenance to Pump) END

4 COM362 Knowledge Engineering Inferencing 4 How Inferencing Works The inference engine’s job is to decide which RULE ANTECEDENTS (the IF bit) are satisfied by the FACTS (the data) FACTS can be stored in the knowledge base, inferred by the inference engine, or supplied by the user Different types of problem can be better solved by different inference approaches

5 COM362 Knowledge Engineering Inferencing 5 Data vs Goal Driven A choice must be made Do we drive the inference based on the DATA, or Do we drive the inference based on the GOALS of the process?

6 COM362 Knowledge Engineering Inferencing 6 Data vs Goal Driven Data driven starts with the data, and fires rule to infer new information Usually achieved by forward chaining Goal driven starts with the goal of a required solution and tries to match the facts to the solution Usually achieved by backward chaining

7 COM362 Knowledge Engineering Inferencing 7 Forward Chaining A simplified view of forward chaining is as follows: 1. Enter new data 2. Fire forward-chaining rules 3. Rule actions infer new data values 4. Go to Step 2 5. Repeat until no new data can be inferred 6. If no solution, rule base is insufficient

8 COM362 Knowledge Engineering Inferencing 8...continued

9 COM362 Knowledge Engineering Inferencing 9 Cascading Rules Only applicable in forward chaining Rule executes causing inference of new data New data is added to knowledge base New data causes other rules to fire The process may repeat - hence a ‘cascade’ effect through the knowledge base

10 COM362 Knowledge Engineering Inferencing 10 Cascading Example RULE 1: IF a driver is assigned AND a forklift operator is assigned AND a foreman is assigned THEN all workers have been assigned to the shift RULE2: IF all workers have been assigned to the shift AND day is Saturday AND overtime is authorised THEN work can begin

11 COM362 Knowledge Engineering Inferencing 11 Driving with Data In forward chaining, data is entered ‘up front’, usually in the user’s interaction with the knowledge base This is usually best done form-by-form, rather than question-by-question Necessary to devise input displays with relevant groups of questions Forward-chaining rules can only fire when all information in the antecedent is available

12 COM362 Knowledge Engineering Inferencing 12...continued Inference engine will not try automatically to source unknown information If it is likely that the system will require information from the user at run-time, then backward chaining may be more appropriate Therefore need to analyse the implementation to decide on inference mechanism most appropriate

13 COM362 Knowledge Engineering Inferencing 13...continued Small amounts of data can trigger a large number of new assertions Remember, forward chaining rules cannot fire until all the conditions in the premise are satisfied Rule priorities can be used to change the order in which rules are fired

14 COM362 Knowledge Engineering Inferencing 14 Why Forward Chain?

15 COM362 Knowledge Engineering Inferencing 15 Backward Chaining A simplified view of backward chaining is as follows: 1. State a goal 2. Find rules which resolve the goal 3. At run-time, answer questions to satisfy the antecedents of the rules as required 4. Obtain a result: goal is resolved or not

16 COM362 Knowledge Engineering Inferencing 16...continued

17 COM362 Knowledge Engineering Inferencing 17 Driving with Goals In backward chaining, the process is trying to satisfy a goal or sub-goal The results of executing backward chaining rules is the determination of a value for the initiating goal Backward chaining rules search for supporting data on an ‘as needed’ basis Rules unrelated to the chain of reasoning are not used

18 COM362 Knowledge Engineering Inferencing 18 Input to BC Rules Input for backward chaining may come from: Pre-existing values in the KB Questions asked of the user Accessing values from an external database Execution of external calculations

19 COM362 Knowledge Engineering Inferencing 19 Output from BC Rules Can usually be phrased as a question: “What is the value?” BC rules often used to achieve multiple goals during a single execution of the inference process If the value for the goal is not found, then BC concludes that these particular rules cannot find the value, not that the value does not exist

20 COM362 Knowledge Engineering Inferencing 20 Why Backward Chain?

21 COM362 Knowledge Engineering Inferencing 21 Choosing FC or BC The criteria which you must consider when choosing FC or BC are: The logical reasoning process Design features of the system What are the inputs, and where do they come from? What are the outputs, and where do they go? How do these map to FC or BC?

22 COM362 Knowledge Engineering Inferencing 22...continued Most problems can be solved using either FC or BC However, almost always one or the other is preferable (more efficient, more robust) Therefore worthwhile considering which is the most appropriate, and using it

23 COM362 Knowledge Engineering Inferencing 23 A Rough(!) Guide


Download ppt "COM362 Knowledge Engineering Inferencing 1 Inferencing: Forward and Backward Chaining John MacIntyre 0191 515 3778"

Similar presentations


Ads by Google