![Page 1: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/1.jpg)
Rule-Based Expert Systems
CPS 4801
![Page 2: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/2.jpg)
About the midterm exam
• Exam on March 13 Tuesday (Tentatively)• Review on March 8 Thursday• Grades will be out by March 15, before
spring break.
![Page 3: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/3.jpg)
Strong AI vs. Weak AI• Strong AI is artificial intelligence that
matches or exceeds human intelligence.o “Artificial general intelligence”
• The weak AI hypothesis: machines can demonstrate intelligence, but do not necessarily have a mind, mental states or consciousness.
![Page 4: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/4.jpg)
“General purpose” intelligence vs. Domain-
specific intelligence• “General purpose” intelligence
o Understand how the world works in generalo requires vast amounts of knowledge about the
world.
• Domain-specific intelligenceo Restricted to a particular domain o Knowledge is deep, but not wide.o Avoids the world knowledge problem, and is
much more feasible for implementation.
![Page 5: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/5.jpg)
Expert Systems• Domain expert: A person who has deep
knowledge (in the form of facts and rules) and strong personal experience in a particular domain.
• An expert system performs at a human expert level in a narrow and specialized domain.
![Page 6: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/6.jpg)
Medical Diagnostics• simple expert system• http
://familydoctor.org/familydoctor/en/health-tools/search-by-symptom.html
![Page 7: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/7.jpg)
DXplainDXplain first launched in 1986
– Users enter clinical information, then ask DXplain to provide diagnostic decision support
– DXplain knowledge base (KB) covers ~2400 diseasesand over 5000 clinical findings (signs, symptoms, epidemiologic data, laboratory findings, etc.)
– Demo: http://dxplain.mgh.harvard.edu/dxp/dxp.sdemo.pl
– Info: http://lcs.mgh.harvard.edu/projects/dxplain.html
![Page 8: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/8.jpg)
GIDEONGlobal Infectious Disease and Epidemiology Network
– Online application that supports the diagnosis and treatment of infectious diseases
– Organized by country of origin– Updated weekly– Info: http://www.gideononline.com/
![Page 9: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/9.jpg)
Characteristics of Expert Systems
• Often a tradeoff between accuracy and speed.
• Expert systems apply heuristics to guidethe reasoning process.
![Page 10: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/10.jpg)
Reasoning + Knowledge + Facts
• Human expertise typically breaks down into: oAbility to reasonoKnowledge about the domainoFacts about the particular situation (e.g.
this patient’s symptoms)• Expert Systems use symbolic reasoning
to solve problemso Symbols represent facts and rules (i.e.
knowledge)
![Page 11: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/11.jpg)
Characteristics of Expert Systems
• Expert systems provide explanation facilities to display reasoning to users.o How did you come to that conclusion or
diagnosis?o E.g., Why do you think I have a migraine?o Well, you have frequent, intense pain in the
temple area, associated with nausea. Also, you aren’t taking any medications that are likely to produce these symptoms.
![Page 12: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/12.jpg)
Characteristics of Expert Systems
• Expert systems make mistakeso So do human experts!o Users have to be aware of this possibility
![Page 13: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/13.jpg)
Rules• Production rules (most commonly used
type)
• IF the ‘traffic light’ is green• THEN the action is go
• IF the ‘traffic light’ is red• THEN the action is stop
![Page 14: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/14.jpg)
Rules• Any rule consists of two parts: the IF part,
called the antecedent (premise or condition) and the THEN part called the consequent (conclusion or action).
• IF <antecedent>• THEN <consequent>• Alternate syntax:• <antecedent> <consequent>
![Page 15: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/15.jpg)
Multiple antecedents• A rule can have multiple antecedents
joined by the keywords AND (conjunction), OR (disjunction) or a combination of both.
• IF animal is horse-shaped• AND animal has stripes• THEN animal is zebra
• IF animal is hippo• OR animal is lion• THEN animal is dangerous
![Page 16: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/16.jpg)
Multiple consequents• Multiple consequents are possible, and are
connected by conjunctions.
• IF tsunami alarm is sounding• AND date is not first Monday in month• THEN Condition is dangerous • AND Advice is “move away from the ocean”
![Page 17: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/17.jpg)
Structure of antecedents and
consequents• The antecedent of a rule incorporates two
parts: an object and its value. The object and its value are linked by an operator.
• Operators o is, are, is not, are not are used to assign a
symbolic value to a linguistic object.o mathematical operators to define an object as
numerical and assign it to the numerical value.
o IF ‘age of the customer’ < 18o AND ‘cash withdrawal’ > 1000o THEN ‘signature of the parent’ is required
![Page 18: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/18.jpg)
Semantics of rules Relation
IF the ‘fuel tank’ is empty THENthe car is dead
Recommendation IF the season is autumn AND the sky is cloudy AND the forecast is drizzle THEN
the advice is ‘take an umbrella’ Directive
IF the car is dead AND the ‘fuel tank’ is empty
THEN the action is ‘refuel the car’
![Page 19: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/19.jpg)
Strategy IF the car is dead THEN the action is ‘check the fuel tank’; step1 is complete
IF step1 is complete AND the ‘fuel tank’ is full THEN
the action is ‘check the battery’; step2 is complete
Heuristic IF the spill is liquid AND the ‘spill pH’ < 6 AND the ‘spill smell’ is vinegar THEN the ‘spill material’ is ‘acetic acid’
![Page 20: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/20.jpg)
So what are facts?
![Page 21: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/21.jpg)
Rule-based expert system
• An expert system whose knowledge base (KB) contains a set of production rules.
![Page 22: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/22.jpg)
The Main Players In The Expert System Development
Team
![Page 23: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/23.jpg)
Structure of a rule-based expert system
![Page 24: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/24.jpg)
Inference Engine• domain knowledge: IF-THEN rules• data: facts about the current situation
• When the IF (condition) part of the rule matches a fact, the rule is fired.
• The matching of the rule IF parts to the facts produces inference chains (new facts are discovered).
![Page 25: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/25.jpg)
Knowledge Base
Database
Fact: A is x
Match Fire
Fact: B is y
Rule: IF A is x THEN B is y
![Page 26: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/26.jpg)
Inference engine algorithm
• Inference engine compares each rulewith facts it already “knows” about,matching the antecedent (IF condition)
• When the antecedent matches one ormore known facts, the rule fires andits consequent (THEN) is executed
![Page 27: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/27.jpg)
Inference Chain• An inference chain indicates how an expert
system applies rules to reach a conclusion
Rule1: IF Y is trueAND D is trueTHEN Z is true
Rule2: IF X is trueAND B is trueAND E is trueTHEN Y is true
Rule3: IF A is trueTHEN X is true
A X
B
E
Y
D
Z
given: A, B, D, E
![Page 28: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/28.jpg)
Inference Chain• An inference chain indicates how an expert
system applies rules to reach a conclusion
Rule1: IF Y is trueAND D is trueTHEN Z is true
Rule2: IF X is trueAND B is trueAND E is trueTHEN Y is true
Rule3: IF A is trueTHEN X is true
A X
B
E
Y
D
Z
given: A, B, D, E
![Page 29: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/29.jpg)
Inference Chain• An inference chain indicates how an expert
system applies rules to reach a conclusion
Rule1: IF Y is trueAND D is trueTHEN Z is true
Rule2: IF X is trueAND B is trueAND E is trueTHEN Y is true
Rule3: IF A is trueTHEN X is true
A X
B
E
Y
D
Z
given: A, B, D, E
![Page 30: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/30.jpg)
Two approaches• Forward chaining • Backward chaining
![Page 31: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/31.jpg)
Forward chaining (data-driven search)
• Starts with known data (facts).• Fire the rules that have an antecedent
that matches facts in the database, and add any resulting facts to the database.
• Each rule can fire only once.• Each time only the topmost rule is
executed.• When no more rules can fire, stop.
![Page 32: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/32.jpg)
Forward Chaining
Match Fire Match Fire Match Fire Match Fire
Knowledge Base
Database
A C E
X
Database
A C E
L
Database
A D
YL
B
X
Database
A D
ZY
B
LX
Cycle 1 Cycle 2 Cycle 3
X & B & E
ZY & D
LC
L & M
A X
N
X & B & E
ZY & D
LC
L & M
A X
N
X & B & E
ZY & D
LC
L & M
A X
N
X & B & E
ZY & D
LC
L & M
A X
N
Knowledge Base Knowledge Base Knowledge Base
X
C E C EB D B D
Y Y Y Y
![Page 33: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/33.jpg)
Forward Chaining Exercise 1
• Use forward chaining to prove the following:
![Page 34: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/34.jpg)
Forward Chaining Exercise 1
• Facts:
• Rules fired: A X A YA & D Q Q R R S Q T T Z
A B C D E
Proven:Z
A B C D E X Y Q R S T ZA B C D E X A B C D E X Y A B C D E X Y Q A B C D E X Y Q R A B C D E X Y Q R S A B C D E X Y Q R S T
Use forward chaining to prove the following:
![Page 35: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/35.jpg)
Forward Chaining Exercise 2
• Use forward chaining to prove the following:
![Page 36: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/36.jpg)
Forward Chaining Exercise 2
• Facts:
• Rules fired: A X A YA & D Q Q R R S Q T T Z
A B C D E X Y Q R S T Z
Cannot prove:
– No more rules left to fire
L
Use forward chaining to prove the following:
![Page 37: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/37.jpg)
Forward Chaining +/-• Good for answering “What is the
situation?” kind of questions (e.g. “What kind of animal is this?”)
• Fires a lot of rules, and generates a lot of facts that might be irrelevant to the problem
• If our goal is to infer only one particular fact, the forward chaining inference technique would not be efficient.
![Page 38: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/38.jpg)
Backward chaining (goal-driven search)
• System has hypothetical solution(s) (e.g. “The patient has type I diabetes”), and tries to prove it.o Find rules that consequents that match the
goal.o If antecedents match the facts, stop.o If not, make the antecedents the new subgoals,
and repeat.
![Page 39: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/39.jpg)
Match Fire
KnowledgeBase
Database
AB CD E
X
Match Fire
KnowledgeBase
Database
AC DE
YX
B
Sub-Goal: X Sub-Goal: Y
Knowledge Base
Database
AC DE
ZY
B
X
Match Fire
Goal: Z
Pass 2
KnowledgeBase
Goal: Z
Knowledge Base
Sub-Goal: Y
KnowledgeBase
Sub-Goal: X
Pass 1 Pass 3
Pass 5Pass 4 Pass 6
Database
AB CD E
Database
AB CD E
Database
BC DEA
YZ
?
X
?
X & B & E
LCL &M
A X
N
ZY & DX & B & EY
ZY & D
LCL &M
A X
NLC
L &M N
X & B & EYZY & D
A X
X & B & EYZY & D
LC
L & M
A X
N
X & B & E
LCL & M
A X
N
ZY & DX & B & E
ZY & D
LC
L & M
A X
N
Y
YY
Backward chaining algorithm
o At the first iteration, rule(s) with thedesired goal in the consequent are selected
o Stack up and attain many subgoals until....o If the antecedent matches known data,
the rule is fired and the goal is proveno Otherwise, if no rules remain,
the desired goal is not proven
![Page 40: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/40.jpg)
Backward chaining
Match Fire
KnowledgeBase
Database
AB CD E
X
Match Fire
KnowledgeBase
Database
AC DE
YX
B
Sub-Goal: X Sub-Goal: Y
Knowledge Base
Database
AC DE
ZY
B
X
Match Fire
Goal: Z
Pass 2
KnowledgeBase
Goal: Z
Knowledge Base
Sub-Goal: Y
KnowledgeBase
Sub-Goal: X
Pass 1 Pass 3
Pass 5Pass 4 Pass 6
Database
AB CD E
Database
AB CD E
Database
BC DEA
YZ
?
X
?
X & B & E
LCL &M
A X
N
ZY & DX & B & EY
ZY & D
LCL &M
A X
NLC
L &M N
X & B & EYZY & D
A X
X & B & EYZY & D
LC
L & M
A X
N
X & B & E
LCL & M
A X
N
ZY & DX & B & E
ZY & D
LC
L & M
A X
N
Y
YY
![Page 41: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/41.jpg)
Backward chaining
Match Fire
KnowledgeBase
Database
AB CD E
X
Match Fire
KnowledgeBase
Database
AC DE
YX
B
Sub-Goal: X Sub-Goal: Y
Knowledge Base
Database
AC DE
ZY
B
X
Match Fire
Goal: Z
Pass 2
KnowledgeBase
Goal: Z
Knowledge Base
Sub-Goal: Y
KnowledgeBase
Sub-Goal: X
Pass 1 Pass 3
Pass 5Pass 4 Pass 6
Database
AB CD E
Database
AB CD E
Database
BC DEA
YZ
?
X
?
X & B & E
LCL &M
A X
N
ZY & DX & B & EY
ZY & D
LCL &M
A X
NLC
L &M N
X & B & EYZY & D
A X
X & B & EYZY & D
LC
L & M
A X
N
X & B & E
LCL & M
A X
N
ZY & DX & B & E
ZY & D
LC
L & M
A X
N
Y
YY
![Page 42: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/42.jpg)
Backward chaining Exercise 1
• Use backward chaining to prove the following:
![Page 43: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/43.jpg)
Backward chaining Exercise 1
• Facts:
• Stack of rules: (subgoals)
• Rules fired:A & D Q Q T T Z
A B C D E Q T Z
Proven:ZA & D Q Q T T Z
A B C D E
Use backward chaining to prove the following:
![Page 44: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/44.jpg)
Backward chaining Exercise 2
• Use backward chaining to prove the following:
![Page 45: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/45.jpg)
Backward chaining Exercise 2
• Facts:
• Stack of rules: (subgoals)
• Cannot prove:o Subgoal N cannot be proven
A B C D E
N L
L
Use backward chaining to prove the following:
![Page 46: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/46.jpg)
Backward chaining +/-• Efficient way to prove or disprove a
particular hypothesis.• Sometimes more efficient with a small set
of hypotheses• Less efficient than forward chaining if large
number of hypotheses
![Page 47: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/47.jpg)
Forward vs. backward chaining
• If an expert first needs to gather some information and then tries to infer from it whatever can be inferred, choose the forward chaining inference engine.
• However, if your expert begins with a hypothetical solution and then attempts to find facts to prove it, choose the backward chaining inference engine.
![Page 48: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/48.jpg)
Forward vs. backward chaining
• Forward chaining: best for analysis and interpretation (e.g. DENDRAL (1971) determines molecular structure of soil sample).
• Backward chaining: best for diagnosis (e.g. MYCIN (1976) diagnoses infectious blood diseases).
![Page 49: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/49.jpg)
Forward + backward chaining
• Most real expert systems use both.• Primary inference is backward chaining.• Switches to forward chaining when new
data is added.• Minimizes pointless queries to user
(backward chaining), but exploits any facts that are acquired.
![Page 50: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/50.jpg)
Conflict resolution Rules with identical antecedents (IF conditions) can cause
conflicts via their consequents (THEN clauses) Rule 1:
IF the ‘traffic light’ is green THEN the action is go Rule 2:
IF the ‘traffic light’ is red THEN the action is stop Rule 3:
IF the ‘traffic light’ is red THEN the action is go
![Page 51: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/51.jpg)
Conflict sets• A subset of the rules in a knowledge base
that can fire at the same time, but have inconsistent consequents.
• X is dog X is not smart• X is dog & X has breed = “border collie” X is smart
![Page 52: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/52.jpg)
Conflict resolution• Conflict resolution provides a specific
method for choosing which rule to fire.o Highest priorityo Most specific ruleo Most recent first
![Page 53: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/53.jpg)
Conflict resolution methods (1)
• Rules fire one at a time. But which fires first?
• Order of rules determines order of firing.• Give rules explicit priority.
o In simple applications, the priority can be established by placing the rules in an appropriate order in the knowledge base.
![Page 54: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/54.jpg)
Conflict resolution methods (2)
• Fire the most specific rule (longest matching strategy). o Assumes that a specific rule processes more
info than a general one. o X is dog X is not smarto X is dog & X has breed = “border collie”
X is smart
![Page 55: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/55.jpg)
Conflict resolution methods (3)
• Fire the rule based on the data most recently entered in the databaseo Assumes that recent data is more important
than older data.o Relies on time tags attached to each fact in the
database.o R1: …… [08:16 PM 02/27/2012]o R2: …… [10:18 AM 02/28/2012]
![Page 56: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/56.jpg)
Pros of rule-based expert systems
• Natural knowledge representationo Represent knowledge in near-linguistic,
declarative manner that is close to how experts explain their own reasoning.
• Uniform structureo uniform IF-THEN structure
• Separation of knowledge from processing.• Good at handling incomplete or uncertain
knowledge (next topic).
![Page 57: Rule-Based Expert Systems CPS 4801. About the midterm exam Exam on March 13 Tuesday (Tentatively) Review on March 8 Thursday Grades will be out by March](https://reader030.vdocuments.net/reader030/viewer/2022032803/56649e385503460f94b291b6/html5/thumbnails/57.jpg)
Cons of rule-based expert systems
• Opaque relations between rules o How do the rules relate to each other? o Difficult to avoid conflicts in large knowledge
bases.
• Ineffective search strategyo The inference engine applies an exhaustive
search through all the rules during each cycle.o unsuitable for real-time applications
• Unable to learno An expert system cannot automatically modify
its knowledge base, adjust existing rules or add new ones.