Title: Basic Architecture of an Expert System
1Basic Architecture of an Expert System
2- Knowledge base - contains the domain specific
problem-solving knowledge. - Facts - represent what we know at any time
about the problem we are working at. - Rules - represent relationships between the
facts. - Inference engine - is a general program that
activates the knowledge in the knowledge base. - Interface enables the user to communicate with
the expert system.
3- Rule-Based Expert Systems
- Based on the production system concept.
- Rules
- IF the engine is getting gas
- AND the engine will turn over
- THEN the problem is spark plugs
- Facts
- The engine is getting gas
- Conclusion
- action
- employ a particular model
- execute a procedure
- display a report
4Inference Engine (1) Selection of rule
candidates pattern matching (2) Choice of one
rule conflict resolution (3) Execution
deduction
5- Backward chaining (goal driven) the inference
engine works backward from a conclusion to be
proven to determine if there are data in the
workspace to prove the truth of the conclusion.
Example. Rule base Workspace R1 IF A AND B
THEN D A,B R2 IF B THEN C R3 IF C AND D THEN E
6Example. Expert system for diagnosing car
problems. Rule 1 IF the engine is getting
gas AND the engine will turn over THEN the
problem is spark plugs Rule 2 IF the engine
does not turn over AND the lights do not come
on THEN the problem is battery or cables. Rule
3 IF the engine does not turn over AND the
lights do come on THEN the problem is the
starter motor. Rule 4 IF there is gas in the
fuel tank AND there is gas in the
carburettor THEN the engine is getting gas
7Working space
Rule 1 Rule 2 Rule 3 Rule 4
The problem is X
Working space
Rule 1 Rule 2 Rule 3 Rule 4
the engine isgetting gas the engine willturn
over the problem isspark plugs
8Working space
Rule 1 Rule 2 Rule 3 Rule 4
gas in fuel tank gas in carburettor the engine
isgetting gas the engine willturn over the
problem isspark plugs
9Explanation in Backward Chaining Why? gas in
fuel tank? yes gas in carburettor? yes engine
will turn over? why It has been established
that 1. the engine is getting gas, therefore
if 2. the engine will turn over, then the problem
is spark plugs
10How? how the engine is getting gas This follows
from rule 4 IF there is gas in the fuel tank AND
there is gas in the carburettor THEN the engine
is getting gas gas in fuel tank was given by the
user gas in carburettor was given by the user
11Exercise. Rule 1 IF blood pressure is likely to
be high THEN risk of heart failure is high Rule
2 IF blood pressure is likely to be low THEN
risk of heart failure is low Rule 3 IF alcohol
consumption is high AND patient salt intake is
high THEN blood pressure is likely to be
high Rule 4 IF alcohol consumption is low AND
patient salt intake is low THEN blood pressure
is likely to be low Rule 5 IF units of alcohol
per week are gt 30 THEN alcohol consumption is
high Rule 6 IF units of alcohol per week are lt
20 THEN alcohol consumption is low Rule 7 IF
units of alcohol per week are gt 20 AND lt
30 THEN alcohol consumption is average Goal
determine a patient's risk of heart
failure Questions units of alcohol gt30, salt
intake high
12- Forward chaining (data driven) the inference
engine works from the initial content of the
workspace towards the final conclusion.
Example. Rule base Workspace R1 IF A AND B
THEN D A,B R2 IF B THEN C R3 IF C AND D THEN E
13Example. Expert system for diagnosing car
problems.
Working space
Rule 1 Rule 2 Rule 3 Rule 4
Working space
Rule 1 Rule 2 Rule 3 Rule 4
the engineturns over
14Working space
Rule 1 Rule 2 Rule 3 Rule 4
The engine isgetting gas There is gasin the
fuel tank There is gasin the carburettor The
engineturns over
15- Explanation in Forward Chaining
- Why?
- The current rule under consideration is
presented. - How?
- More difficult than in backward chaining.
16Example R1 IF management competence is
good AND External credit rating is fair AND
Bank's credit rating is marginal THEN Loan is
rejected R2 IF Loan type is seasonal AND
Profitability rating is high AND Solvency
rating is low THEN Bank's credit rating is
marginal R3 IF Cash/current liabilities gt
0.1 AND Tentative solvency rating is low THEN
Solvency rating is low Bank's credit
rating UNKNOWN Cash/current liabilities 0.18
External credit rating FAIR Loan SEASONAL Lo
an type UNKNOWN Management competence UNKNOWN
Profitability rating HIGH Solvency
rating UNKNOWN Tentative solvency rating LOW
17 - Choosing between backward and forward chaining.
18Hybrid Expert System Architecture
19Example 1. IF WEIGHT of MY-FORD gt 3,000
pounds THEN set DETOUR AROUND RICKETY
BRIDGE Example 2. IF ?VEHICLE is instance-of
AUTOMOBILESAND ?VEHICLE has-a ?ENGINE AND
?ENGINE is instance-of DIESEL THEN set REFUEL of
?VEHICLE to TRUCKSTOP
20SUMMARY
- The major components of an expert system are
the knowledge base, inference engine, and user
interface. - Rule-based expert systems are introduced.
- There are two approaches for controlling
inference in rule-based expert systems forward
chaining and backward chaining.