Professional Documents
Culture Documents
Rulebase Forward and Backwardcahning Digram
Rulebase Forward and Backwardcahning Digram
1
• 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.
2
Rule-Based Expert Systems
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
3
Inference Engine
4
• 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
5
Example. Expert system for diagnosing car problems.
Working space
8
Explanation 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
9
How?
10
Exercise.
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 > 30
THEN alcohol consumption is high
Rule 6 IF units of alcohol per week are < 20
THEN alcohol consumption is low
Rule 7 IF units of alcohol per week are >= 20 AND <+ 30
THEN alcohol consumption is average
12
Example. Expert system for diagnosing car problems.
Working space
Rule 1
Rule 2
Rule 3
Rule 4
Working space
Rule 1
The engine is
Rule 2
getting gas
Rule 3
There is gas Rule 4
in the fuel tank
There is gas
in the carburettor
The engine
turns over
14
Explanation in Forward Chaining
Why?
• The current rule under consideration is presented.
How?
• More difficult than in backward chaining.
15
Example
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 > 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
Loan type UNKNOWN
Management competence UNKNOWN
Profitability rating HIGH
Solvency rating UNKNOWN 16
Tentative solvency rating LOW
– Choosing between backward and forward chaining.
17
Hybrid Expert System Architecture
18
Example 1.
IF WEIGHT of MY-FORD > 3,000 pounds
THEN set DETOUR AROUND RICKETY BRIDGE
Example 2.
IF ?VEHICLE is instance-of AUTOMOBILES
AND ?VEHICLE has-a ?ENGINE
AND ?ENGINE is instance-of DIESEL
THEN set REFUEL of ?VEHICLE to TRUCKSTOP
19
SUMMARY
20