Upload
jenny-padillo
View
220
Download
1
Embed Size (px)
Citation preview
Backward-Chaining Rule-Based System
Introduction:
● The principle objective of backward chaining is to prove some goal or hypothesis
● The process begins by collecting GOAL RULES
● The premise of the goal rules may be supported by other rules, so they are set as Sub-Goals
Introduction:
● The inference engine searches through the system’s rules in a recursive fashion.
● Backward Chaining inference engine will reach some premise that is not supported by any of the system’s rules (a Primitive) --> Ask User
Introduction:
● The answer is placed in the current memory
● The process continue until all goals and sub-goals are searched memory contains all information provided by user and inferred by rules.
Medical Consultation Systems
MYCIN was an early expert system that used artificial intelligence to identify bacteria causing severe infections, such as bacteremia and meningitis, and to recommend antibiotics, with the dosage adjusted for
patient's body weight
Medical Consultation Systems
● Like MYCIN , performs diagnosis for infectious blood diseases
● Unlike MYCIN , doesn’t identify organ but rather the nature of the infection
● 3 different expert systems: Diagnosis, Prescription, Prescription Changes
Megningitis Diagnosis Expert System
● The system has only one goal :Prove or disprove “Infection is
meningitis”
● One Goal rule : RULE 1This can be proven if the user already knows that the patient has meningitis or the system can infer it.
Megningitis Diagnosis Expert System
● The system has only one goal :Prove or disprove “Infection is
meningitis”
● One Goal rule : RULE 1This can be proven if the user already knows that the patient has meningitis or the system can infer it.
● RULE 2,3,4 : search the test results
Megningitis Diagnosis Expert System
● The system has only one goal :Prove or disprove “Infection is
meningitis”
● One Goal rule : RULE 1This can be proven if the user already knows that the patient has meningitis or the system can infer it.
● RULE 2,3,4 : search the test results
● RULE 5 : searches the area of patient symptoms
Meningitis diagnosis rules
● STEP 1: Find rules with hypothesis in “THEN” part
EMPTY
Working Memory
● STEP 2: see if first premise in RULE 1 is listed in working memory
NO
Meningitis diagnosis rules
EMPTY
Working Memory● STEP 3: see if this premise exists in
“THEN” part of any rule
- NO
● STEP 4: This premise is a primitive
Question : “Do you know if patient has Meningitis ?”
Answer : NO
Patient known to have Meningitis - FALSE
Meningitis diagnosis rules
EMPTY
Working Memory● STEP 5: look at second premise in
RULE 1 and see if it’s in working memory
- NO
● STEP 6: see if this premise exists in “THEN” part of any rule
Patient known to have Meningitis - FALSE
Meningitis diagnosis rules
EMPTY
Working Memory● STEP 7: see if first premise in RULE
2 is listed in working memory
- NO
● STEP 8: see if this premise exists in “THEN” part of any rule
Patient known to have Meningitis - FALSE
Meningitis diagnosis rules
EMPTY
Working Memory
● STEP 9: Q: Were test run?A:
YES
Patient known to have Meningitis - FALSE
Tests run- TRUE
● STEP 10: Q: Were culture seen?
A: YES
Culture seen- TRUE
Meningitis diagnosis rules
EMPTY
Working Memory
Patient known to have Meningitis - FALSE
Tests run- TRUE
Culture seen- TRUE
Meningitis diagnosis rules
EMPTY
Working Memory
Patient known to have Meningitis - FALSE
Tests run- TRUE
Culture seen- TRUE
● STEP 11: Q: The appearance of the culture is coccus?
A: Why
System: This will aid in determining if cultures look like Meningitis
Meningitis diagnosis rules
EMPTY
Working Memory
Patient known to have Meningitis - FALSE
Tests run- TRUE
Culture seen- TRUE
● STEP 11: Q: The appearance of the culture is coccus?
A: Why
System: This will aid in determining if cultures look like Meningitis
Meningitis diagnosis rules
EMPTY
Working Memory
Patient known to have Meningitis - FALSE
Tests run- TRUE
Culture seen- TRUE
● STEP 12:
User: Why?
System: This will determining if “we suspect meningitis from test results”
Meningitis diagnosis rules
EMPTY
Working Memory
Patient known to have Meningitis - FALSE
Tests run- TRUE
Culture seen- TRUE
● STEP 13:
Q: The appearance of the culture is coccus?
A: No Appearance of cultures is coccus-FALSE
Meningitis diagnosis rules
EMPTY
Working Memory
Patient known to have Meningitis - FALSE
Tests run- TRUE
Culture seen- TRUE
● STEP 14: look at second premise in RULE 2 and see if it’s in working memory
- NoAppearance of cultures is coccus-FALSE
Meningitis diagnosis rules
EMPTY
Working Memory
Patient known to have Meningitis - FALSE
Tests run- TRUE
Culture seen- TRUE
● STEP 15: see if this premise exists in “THEN” part of any rule
Appearance of cultures is coccus-FALSE
Meningitis diagnosis rules
EMPTY
Working Memory
Patient known to have Meningitis - FALSETests run- TRUE
Culture seen- TRUE
● STEP 16: All premises of RULE 5 are unknown and primitives Questions Appearance of cultures is
coccus-FALSESuffering persistent headaches- TRUE
Q: Has the patient been suffering persistent headaches ?
A: YES
Meningitis diagnosis rules
EMPTY
Working Memory
Patient known to have Meningitis - FALSETests run- TRUE
Culture seen- TRUE
● STEP 16: All premises of RULE 5 are unknown and primitives Questions Appearance of cultures is
coccus-FALSESuffering persistent headaches- TRUE
Q: Has the patient been suffering dizziness?
A: YESSuffering dizziness- TRUE
Meningitis diagnosis rules
EMPTY
Working Memory
Patient known to have Meningitis - FALSETests run- TRUE
Culture seen- TRUE
● STEP 16: All premises of RULE 5 are unknown and primitives Questions Appearance of cultures is
coccus-FALSESuffering persistent headaches- TRUE
Q: Has the patient been lethargic?A: YES Patient been lethargic -
TRUE
MCS: Example 2SYSTEM: My first recommendation is the following:
AMPICILLINDose: 3.8g (30ml)
GENTAMICINDose: 131mg (3.2ml)
MCS Example 3The goal of the alternative prescription system is to allow the user to choose some alternative drug, which the system will then check for effectiveness and safety.
Alternative Prescription rules
Working Memory
● STEP 1:
Drug recommendation AMPICILLIN-TRUE
Drug recommendation GENTAMICIN-TRUE
System : The following drugs are recommended:
Drug1 = AMPICILLINDrug2 = GENTAMICIN
Alternative Prescription rules
Working Memory
● STEP 2:
System : Do you want to consider another prescription?
User: YES
Drug recommendation AMPICILLIN-TRUE
Drug recommendation GENTAMICIN-TRUE
Alternative Prescription rules
Working Memory
● STEP 3:
System : Which drug would you like to delete?
User: AMPICILLIN
COMMENT: System binds ?deleted _drug to AMPICILLIN
Drug recommendation AMPICILLIN-TRUE
Drug recommendation GENTAMICIN-TRUE
Alternative Prescription rules
Working Memory
● STEP 4:
System : What drug would you like to add?
User: STREPTOMYCIN
Drug recommendation AMPICILLIN-TRUE
Drug recommendation GENTAMICIN-TRUE
Alternative Prescription rules
● STEP 5:System : The requested drug STREPTOMYCIN comes from the drug class AMINOGLYCOSIDES and would not be an effective replacement for AMPICILLIN which comes from the drug class PENICILLINS. To be elective, the alternative drug should come from the same drug class.
Drug recommendation AMPICILLIN-TRUE
Drug recommendation GENTAMICIN-TRUE
Working Memory
Alternative drug considered - FALSE
Alternative Prescription rules
● STEP 6:System : Would you like to try another drug?
User: YES
COMMENT: RULE 9 fires and a number of facts are retracted and the system is cycled.
Drug recommendation AMPICILLIN-TRUE
Drug recommendation GENTAMICIN-TRUE
Alternative drug considered – FALSE
Working Memory
Alternative Prescription rules
Working Memory
● STEP 7:System : What drug would you like to add?
User: PENICILLIN
COMMENT. The system again determine the classes of the deleted and requested drugs, and checks to see that they come from the same class-RULE 6.
Drug recommendation AMPICILLIN-TRUE
Drug recommendation GENTAMICIN-TRUE
Alternative drug considered – FALSE
Alternative Prescription rules
● STEP 8:System : The requested drug PENICILLIN comes from the drug class PENICILLINS and would be an effective replacement for AMPICILLIN which also comes from the drug class PENICILLINS.
COMMENT: The system now is satisfied that the new requested drug is an effective replacement for the deleted drug. It next checks to see if the drug should be safe for the patient on the basis of the patient's age.
Drug recommendation AMPICILLIN-TRUE
Drug recommendation GENTAMICIN-TRUE
Alternative drug considered – FALSE
Working Memory
Requested Drug effective - TRUE
Alternative Prescription rules
● STEP 9:
System : What is the age of the patient in years?
User: 30
COMMENT: The system now must check to see if the patient is old enough to take the drug – Rule 8. The system calls the external program “AGE” which obtains the minimum allowable age for the requested drug from the database “DRUGS.”
Drug recommendation AMPICILLIN-TRUE
Drug recommendation GENTAMICIN-TRUE
Alternative drug considered – FALSE
Requested Drug effective - TRUE
Working Memory
Alternative Prescription rules
● STEP 10:
System : The patient is 30 years old which is fine for the drug PENICILLIN which has minimum safe age requirement of 15 years.
Working Memory
Drug recommendation AMPICILLIN-TRUE
Drug recommendation GENTAMICIN-TRUE
Alternative drug considered – FALSE
Requested Drug effective - TRUE
Requested Drug safe - TRUE