Knowledge Engineering Process of acquiring knowledge from experts and
building knowledge base Narrow perspective
Knowledge acquisition, representation, validation, inference, maintenance
Broad perspective Process of developing and maintaining intelligent
system
KE Process Knowledge representation
Organized knowledge
Acquisition of knowledge General knowledge or metaknowledge
From experts, books, documents, sensors, files
Inferences Software designed to pass statistical sample data to generalizations
Knowledge validation and verification
Explanation and justification capabilities
•In rule-based expert system, the domain knowledge is represented by a set of IF-THEN production rules and data is represented by a set of facts about the current situation.
•The inference engine compares each rule stored in the knowledge base with facts contained in the database.
Inference Process (1 of 4)Inference Process (1 of 4)
Inference Process (2 of 4)
Done in three stages:
match select execute Match : contents of the working memory are compared to the
facts and rules contained in the knowledge base
Select: When consistent match found the corresponding rules are
placed in the conflict set.
Execute: When all matched rules are placed in the conflict set one
of the rules is selected for execution
Fact: A is XFact: A is X Fact: B is yFact: B is y
Rule: IF A is x THEN B is yRule: IF A is x THEN B is y
Knowledge baseKnowledge base
DatabaseDatabase
MatchMatch FireFire
Figure : The inference engine cycles via a match-fire procedure Figure : The inference engine cycles via a match-fire procedure
Inference Process (3 of 4)Inference Process (3 of 4)
The matching of the IF parts to the facts produces
inference chains.
The inference engine must decide when the rules
have to be fired. There are two principal ways in which
rules are executed:
Forward Chaining
Backward Chaining
Inference Process (4 of 4)Inference Process (4 of 4)
It’s the data-driven reasoning.
The 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.
Inference Process: Forward Inference Process: Forward ChainingChaining
Knowledge-Base
Database
Y & D Z
X & B & E Y
A X
C L
L & M N
Match Fire
A B C D E
X
Knowledge-Base
Database
Y & D Z
X & B & E Y
A X
C L
L & M N
Match Fire
A B C D E
LX
Cycle #1
Inference Process: Forward Inference Process: Forward ChainingChaining
Knowledge-Base
Database
Y & D Z
X & B & E Y
A X
C L
L & M N
Match Fire
A B C D E
YL
Cycle #2
X
Knowledge-Base
Y & D Z
X & B & E Y
A X
C L
L & M N
Match Fire
Database
A B C D E
ZYLX
Cycle #3
Inference Process: Forward Inference Process: Forward ChainingChaining
It’s the goal-driven reasoning.
Here an expert system has the goal and the inference
engine attempts to find the evidence to prove it.
First the knowledge base is searched to find rules that
might have the desired solution.
Such rules must have the goal in their THEN parts. If
such rule is found and its IF part matches data in the
database, then the rule is fired and the goal is proved.
Inference Process: Backward Inference Process: Backward ChainingChaining
Knowledge-Base
Database
Y & D Z
X & B & E Y
A X
C L
L & M N
A B C D E
Pass 1: Goal: Z Pass 2: Sub-goal: y
Z
Knowledge-Base
Y & D Z
X & B & E Y
A X
C L
L & M N
Y
Database
A B C D E
?
Inference Process: Backward Inference Process: Backward ChainingChaining
Pass 3: Sub goal:X
Knowledge-Base
Database
Y & D Z
X & B & E Y
A X
C L
L & M N
A B C D E
X
?
Knowledge-Base
Database
Y & D Z
X & B & E Y
A X
C L
L & M N
A B C D E
Pass 4: Sub goal:X
Match Fire
X
Inference Process: Backward Inference Process: Backward ChainingChaining
Pass 5: Sub-goal: Y
Knowledge-Base
Database
Y & D Z
X & B & E Y
A X
C L
L & M N
A B C D E
Pass 6:Goal: Z
Match Fire
YX
Knowledge-Base
Database
Y & D Z
X & B & E Y
A X
C L
L & M N
A B C D E
Match Fire
ZYX
Inference Process: Backward Inference Process: Backward ChainingChaining
Knowledge-Base
Database
Y & D Z
X & B & E Y
A X
C L
L & M N
Match Fire
A B C D E
LX
Inference Process: Backward Inference Process: Backward ChainingChaining
Y Z
Pass 7:Goal: L
Forward vs. Backward Chaining
Forward Chaining Backward Chainingplanning, control diagnosisdata-driven goal-driven (hypothesis)bottom-up reasoning top-down reasoning
find possible conclusions supported by given facts
find facts that support a given hypothesis
similar to breadth-first search similar to depth-first search
antecedents (LHS) control evaluation
consequents (RHS) control evaluation