Structure of Expert System

Knowledge Representation
and
Expert Systems
by
Sujan Pakala Stephen Brown
What are they?
Diagnose a problems in a given domain
Capable of justifying its actions and
conclusions
Applications:
Medical diagnosis applications
 Locating equipment failures
 Interpreting measurement data

Structure of Expert System
User
Shell
User
Interface
Inference
Engine
Knowledge
Base
Major Components:
• Knowledge Base
• Inference Engine
• User Interface
The Shell contains the inference
engine and the user interface.
Expert System Features
Goal driven reasoning or backward
chaining
Data driven reasoning or forward chaining
Coping with uncertainty
Data representation
User interface
Generating Explanations
If – then Rules
Most popular formalism for knowledge representation
Additional features
- modularity
- incrementability
- modifiability
- transparency
categorical vs. probabilistic knowledge
knowledge elicitation
Example – refer figure.
Knowledge base as an Inference Network
Kitchen_dry
Leak_in_bathroom
Hall_wet
Problem_in_kitchen
Bathroom_dry
Leak_in_kitchen
Window_closed
No_water_from_outside
No_rain
Backward chaining
Follow a chain of rules backwards
Stating rules into knowledgebase:
- as straightforward prolog rules –
hall_wet.
bathroom_dry.
leak_in_bathroom :hall_wet, kitchen_dry.
Contd..
Disadvantage
- not suited for normal user
- hence, not syntactically distinct
Better way:
- use ‘if’, ‘then’ etc. as operators:-op(800, fx, if)
- and write the rules asif hall_wet and kitchen_dry then leak_in_bathroom.
Major disadvantage:
- user has to state all relevant info.
Forward chaining
Generating Explanations
Has the ability to explain its results.
Two types of explanations:
how the system reached a given
conclusion
 why the system is asking a question

Coping with Uncertainty
Much of the time, the final answer is not
known with complete certainty.
We can model uncertainty by assigning some
qualification or measure of belief factor.
In our knowledge base, we can add a
certainty factor to our conclusions:
if
hall_wet and bathroom_dry
then
problem_in_kitchen : 0.9.
Example:

User specifies certainty estimates:
given(hall_wet, 1).
given(bathroom_dry, 1).
given(kitchen_dry, 0).
given(no_rain, 0.8).
sure
given(window_closed, 0).
% Hall is wet
% Bathroom is dry
% Kitchen is not dry
% Probably no rain, but not
% Window not closed
Continue Example:
An interpreter for rules with certainties:
certainty(P, Cert) :given(P, Cert).
certainty(Cond1 and Cond2, Cert) :certainty(Cond1, Cert1),
certainty(Cond2, Cert2),
minimum(Cert1, Cert2, Cert).
certainty(Cond1 or Cond2, Cert) :certainty(Cond1, Cert1),
certainty(Cond2, Cert2),
maximum(Cert1, Cert2, Cert).
certainty(P, Cert) :if Cond then P : C1,
certainty(Cond, C2),
Cert is C1 * C2.
?- certainty( leak_in_kitchen, C).
C = 0.8
Obtained:
hall is wet & bathroom is dry
problem in the kitchen : 0.9
Possibility of some rain
no water from outside : 0.8
Leak in kitchen is min(.8, .9) = 0.8
Demo
http://www.visual-prolog.com/vipexamples/geni/pdcindex.htm
Questions?
Summary
Expert System’s typical functions:
• Solving problem in a given domain
• Explaining the problem-solving process
• Handling uncertainty and incomplete information