Rule Based Expert Systems
Rule Based Expert Systems
IF <antecedent>
THEN <consequent>
• A rule can have multiple antecedents joined by he keywords
AND(conjunction), OR(disjunction) or a combination of both.
• The Database includes a set of facts used to match against the IF (condition) parts
of the rules stored in the knowledge base.
• „The Inference Engine caries out the reasoning whereby the expert system reaches
a solution. It links the rules given in the knowledge base with the facts provided in
the database.
• The explanation facilities enable the user to ask the expert system how a
particular condition is reached and why a specific fact is needed. An expert system
must be able to explain its reasoning and justify its advice, analysis or conclusion. „
• The user interface is the means of communication between a user seeking a
solution and an expert system
Characteristics Of An Expert System
Inference chain:
• In a rule-based expert system, the domain of knowledge is represented by a set
of IF THEN production rules and data is represented by facts about current
situation. The inference engine compares each rule in knowledge base with facts
in the database.
• The matching of the rule IF parts to the facts produces inference chains. The
inference chain indicates how an expert system applies rules to reach conclusion.
Forward Chaining
• Data-driven reasoning starts from the known data and proceeds forward with
that data.
• „Each time only the topmost rule is executed.
• „When fired, the rule adds a new fact in the database.
• „Any rule can be executed only once.
• „The match-fire cycle stops when no further rules can be fired.
When to use it:
• Forward chaining is a technique for gathering information and then inferring
from it whatever can be inferred.
• „Many rules may be executed that have nothing to do with established goal.
• If our goal is to infer only one particular fact, the forward chaining inference
technique would not be efficient.
Backward chaining
• It is the goal-driven reasoning
• The expert system has a goal (a hypothetical solution) - the inference engine
attempts to find the evidence to prove it.
• …The knowledge base is searched to find rules that might have the desired
solution
• …Such rules must have the goal in their THEN (action) parts.
• I…f such a rule is found and its IF (condition) part matches data in the database,
then the rule is fired and the goal is proved. However, this is rarely the case.
Process:
• The engine puts aside the rule it is working with (“stack”) and set up a new
goal, a subgoal, to prove the IF part of this rule.
• „Then the knowledge base is searched again for rules that can prove the
subgoal.
• „The engine repeats the process of stacking the rule until no rules are found in
the knowledge base to prove the current subgoal.
How to choose between forward
and backward chaining?
• „If an expert first needs to gather some information and then tries to infer
from it whatever can be inferred, the forward chaining inference engine can
be chose.
• If the expert begins with a hypothetical solution and then attempts to find
facts to prove it, the backward chaining inference engine can be chose.
Conflict resolution:
• If there exist two or more rules with the same IF part both of them can be set
to fire when the condition part is satisfied. They represent a conflicting set.
• Conflicting resolution – a method for choosing a rule to fire when more than
one rule can be fired in a given cycle.
• Methods are
1. Fire the rule with the highest priority
2. Fire the most specific rule (longest matching strategy)
3. Fire the rule that uses the data most recently entered in the database.
Metaknowledge and rules
Metarules
• Metarule 1:
Rules supplied by experts have higher priorities than rules supplied by
novices
• „Metarule 2:
Rules governing the rescue of human lives have higher priorities than rules
concerned with clearing overloads on power system equipment.
Advantages of rule-based expert system
• Natural knowledge representation : an expert usually explains the problem-
solving procedure with “In such-and-such situation, I do so-and-so”. represented
quite naturally as IF-THEN production rules.
• „Uniform structure: production rules have uniform IF-THEN structure. Each rule
is an independent piece of knowledge (self-documented)
• Separation of knowledge from its process: The structure of a rule-based expert
system provides an effective separation of the knowledge base from the
inference engine. This makes it possible to develop different applications using
the same expert system shell.
• „Dealing with incomplete and uncertain knowledge: Most rule-based expert
systems are capable of representing and reasoning with incomplete and
uncertain knowledge
Disadvantages of rule-based expert system
• Opaque relations between rules: Rule-based systems make it difficult to
observe how individual rules serve the overall strategy.
• „Ineffective search strategy: The inference engine applies an exhaustive search
through all the production rules during each cycle (inefficient for large rules).
• Inability to learn : In general, rule-based expert systems do not have an ability
to learn from experience. Unlike a human expert, who knows when to “break
the rules”, an expert system cannot automatically modify its knowledge base, or
adjust existing rules or add new ones. The knowledge engineer is still
responsible for revising and maintaining the system