Topic 6 Inference Engine Design Part 2
Topic 6 Inference Engine Design Part 2
ENGINE
DESIGN
PART 2
ITS661: KNOWLEDGE-BASED SYSTEMS
Control Strategies
How the system’s knowledge can best be controlled - asking the expert
to work through a typical problem.
Backward chaining
◦ Goal driven
◦ If expert first considers some conclusion or goal, then attempts to prove it by
searching for support information.
◦ Concern with proving some hypothesis or recommendation.
◦ If the number of goals < than the amount of data.
Selecting Control Strategies
INFERENCE
PROBLEM TYPE
BACKWARD FORWARD
Control Low High
Design Low High
Diagnosis High Low
Instruction High Low
Interpretation Avg. High
Monitoring Low High
Planning Low High
Prediction Avg. High
Prescription Avg. Avg.
Selection High Low
Simulation Low High
CONTROL STRATEGIES
Two common strategies:
1. Forward Chaining
2. Backward Chaining
Start with known Execute
Rule 1 : Y & D → B A B C D E A B C D E A B C D E A B C D E
Rule 3 : A X
Match Fire Match Fire Match Fire Match Fire
Rule 4 : C L Knowledge Base Knowledge Base Knowledge Base Knowledge Base
Y&D Z Y&D Z Y&D Z Y&D Z
Rule 5 : L & M N X&B&E Y X&B&E Y X&B&E Y X&B&E Y
A X A X A X A X
C L C L C L C L
Known facts: L&M N L&M N L&M N L&M N
A, B, C, D, E
Cycle 1 Cycle 2 Cycle 3
Forward Chaining
(Step-by-step)
Finally, Z is fired. Database Database Database Database
Disadvantage of FC: A B C D E A B C D E A B C D E A B C D E
A B C D E A B C D E A B C D E A B C D E
X X L X L Y X L Y Z
If found, IF part no
matches, stack the rule,
set up new subgoal with
the IF part
Repeat the
process
Backward Chaining
(Step-by-step)
Pass 1 Pass 2 Pass 3
Database Database Database
A B C D E A B C D E A B C D E
? ?
Z Y X
Knowledge Base Knowledge Base Knowledge Base
Y & D Z Y & D Z Y & D Z
X & B & E Y X & B & E Y X & B & E Y
A X A X A X
C L C L C L
L & M N L & M N L & M N
Goal: Z Sub-Goal: Y Sub-Goal: X
A B C D E A B C D E A B C D E
X X Y X Y Z
A B C D E A B C D E A B C D E
? ?
Z Y X
Knowledge Base Knowledge Base Knowledge Base
Y & D Z Y & D Z Y & D Z
X & B & E Y X & B & E Y X & B & E Y
A X A X A X
C L C L C L
L & M N L & M N L & M N
Goal: Z Sub-Goal: Y Sub-Goal: X
A B C D E A B C D E A B C D E
X X Y X Y Z
A B C D E A B C D E A B C D E
? ?
Z Y X
Knowledge Base Knowledge Base Knowledge Base
Y&D Z Y&D Z Y&D Z
X&B&E Y X&B&E Y X&B&E Y
A X A X A X
C L C L C L
L&M N L&M N L&M N
Goal: Z Sub-Goal: Y Sub-Goal: X
A B C D E A B C D E A B C D E
X X Y X Y Z
Rule: 6 Rule: 8
Rule: 10 Rule: 12
Backward chaining
◦ Fact: low inflation rate (R1) will lead to R2 and then to R3
◦ Conclusion: buy.
EXERCISE
Have everyone in the group consider the fairly easy task of doing
laundry. Individually, write down all the motions you use in sorting
clothes, loading the washer and dryer, and folding the clothes. Compare
notes.
Are any members of the group better at the task than others? For
simplicity, leave out details such as “go to the Laundromat.” Code the
doing-laundry facts in a rule base. How many exceptions to the rules did
you find?