Chapter 7
Inference engine performs 2 major tasks:1) examines existing facts and rules and adds new facts when possible
We shall look at Inference and Control
E.g:
Rule :
IF Ahmet's CAR IS DIRTY
THEN Ahmet HAS BEEN DRIVING OUTSIDE ANKARA
Given fact : Ahmet has not been outside Ankara.
New rule : Ahmet car is not dirty.
This conclusion seems quite obvious but cannot be reached
by most expert systems.
Because they use modus ponens for deriving new facts from
rules.
Forward Chaining (Example 2)
In such a situation backward chaining
might be more cost-effective.With this inference method the system starts
with what it wants to prove, e.g.,that situation Z exists, and only executes
rules that are relavent to establishing it.Figure following shows
how bacward chaining would work using the rules from the forward chaining
example.
In step 1 the system is told to establish
(if it can) that situation Z exists,It first checks the data base for Z,and
when that fails, searches for rules that conclude Z,i.e., have Z on the
right side of the arrow.It finds the rule F?B->Z, and decides that it must
establish F and B in order to conclude Z.
In step 2 the system tries to establish F, first checking the data base and then finding a rule that concludes F. From this rule, C?D->F, the system decides it must establish C and D to conclude F.
In steps 3 through 5 the system finds C in the data base but decides it must establish A before it can conclude D. It then finds A in the data base.
In steps 6 through 8 the system executes
the third rule to establish D, then executes the second rule to establish
the original goal, Z.The infenece chain created here is identical to the
one created by forward chaining. The difference in two approaches hinges
on the method in which data and rules are searched.
R4. IF A and G then B
} R4-R8
R5. IF B and D then H
} are forward chaining
R6. IF G and D then E
}
R7. IF A and B then D
}
R8. IF A and C then G
}
1) Mixed Chaining with priority to backward chaining
only resort to forward chaining when
unable to backward chaining
Assume working memory has
{A,C} ?goal to determine K.
B B
B
R1,R3,R8,R4,R7,R5,R6,R2
2) Mixed Chaining with priority to forward chaining
some rule -set and goal and facts
R8,R4,R7,R5,R6,R2(B)
Result: 9 steps v.s +steps
CONTROL
There are two problems addressed by the inference engine:
1 ) It must have a way to decide where to start.Rules
and facts reside in a static knowledge base. There must be a way for the
reasining process to begin.
2 ) The inference engine must resolve conflicts
that occur when alternative links of reasining emerge,The system may reach
a point where there are more than a few rules ready to fire. The inference
engine must choose which rule to examine next.
CONFLICT RESOLUTION STRATEGIES (A PARTIAL LIST )
x occurs twice at time t1 has taken value a and at time t2 obtained the value b.
A rulebase can easily be enlarged by adding new, more specific rules to it without worrying too much about older ones, because more specific Production Rules will prevail over more general ones.
For example, a person encountering a friend in the
street will not be inclined to think this person is a mammal , but instead
think of the person by name , just applying the most specific knowledge.
Give priority to rules with more specific antecedents.
A general rule : If B And D Then P And Q And L.
A specific rule : If A and B And C And D Then J And K And L.
Other possible conflict resolution strategies :
This page is maintained by: | Mehmet R.TOLUN tolun@ceng.metu.edu.tr |
Last updated at: |