SlideShare a Scribd company logo
10
Most read
19
Most read
20
Most read
CS 484 – Artificial Intelligence 1
Announcements
• Choose Research Topic by today
• Project 1 is due Thursday, October 11
• Midterm is Thursday, October 18
• Book Review is due Thursday, October 25
Rules and Expert Systems
Lecture 8
CS 484 – Artificial Intelligence 3
Rules for Knowledge Representation
• IF… THEN Rules can be used to represent
knowledge:
• IF it rains, then you will get wet
• Rules can also be recommendations:
• IF it rains, then you should wear a coat
CS 484 – Artificial Intelligence 4
Rule Based Production Systems
• Production system - uses knowledge in the form of
rules to provide diagnoses or advice on the basis
of input data.
• Parts
• Database of rules (knowledge base)
• Database of facts
• Inference engine which reasons about the facts using
the rules
CS 484 – Artificial Intelligence 5
Forward Chaining
• Works from a set of facts and rules towards a set
of conclusions, diagnoses or recommendations.
• When a fact matches the antecedent of a rule
• Rule fires
• Conclusion added to facts
CS 484 – Artificial Intelligence 6
Conflict Resolution
• Problem: more than one rule fires at once
• Conflict resolution strategy decides which
conclusions to use.
• Give rules priorities and to use the conclusion that has
the highest priority.
• Apply the rule with the longest antecedent
• Apply the rule that was most recently added to the
database.
CS 484 – Artificial Intelligence 7
Examples
• IF patient has pain
THEN prescribe pain
killers (priority 10)
• IF patient has chest
pain
THEN treat for heart
disease (priority 100)
• IF patient has pain
AND patient is over
60
AND patient has a
history of heart
conditions
THEN take to
emergency room
CS 484 – Artificial Intelligence 8
Meta Rules
• The rules that determine the conflict resolution
strategy are called meta rules.
• Meta rules define knowledge about how the
system will work.
• For example, meta rules might define that
knowledge from Expert A is to be trusted more
than knowledge from Expert B.
• Meta rules are treated by the system like normal
rules, but are given higher priority.
CS 484 – Artificial Intelligence 9
Backward Chaining
• Use backward chaining when proving a
particular conclusion
• Works back from a conclusion towards the
original facts.
• When a conclusion matches the conclusion
of a rule in the database, the antecedents of
the rule are compared with facts in the
database.
CS 484 – Artificial Intelligence 10
Forward Chaining
• Rules
1. A Λ B → C
2. A → D
3. C Λ D → E
4. B Λ E Λ F → G
5. A Λ E → H
6. D Λ E Λ H → I
• Facts
1. A
2. B
3. F
• Goal
• H
Facts
Rules
triggered
Rule fired
A,B,F
CS 484 – Artificial Intelligence 11
Backward Chaining
• Rules
1. A Λ B → C
2. A → D
3. C Λ D → E
4. B Λ E Λ F → G
5. A Λ E → H
6. D Λ E Λ H → I
• Facts
1. A
2. B
3. F
• Goal
• H
Facts Goals
Matching
Rules
A,B,F
How do the methods compare?
CS 484 – Artificial Intelligence 12
The Architecture of Expert Systems (1)
• Expert knowledge
derived from human
experts
• Purpose:
• Diagnose illnesses
• Provide
recommendations
• Solve other problems
CS 484 – Artificial Intelligence 13
The Architecture of Expert Systems (2)
• Knowledge base: database of rules (domain
knowledge).
• Explanation system: explains the decisions the
system makes.
• User Interface: the means by which the user interacts
with the expert system.
• Knowledge base editor: allows the user to edit the
information in the knowledge base.
CS 484 – Artificial Intelligence 14
Expert System Shells
• The part of an expert system that does not contain
any domain specific or case specific knowledge is
the expert system shell.
• A single expert system shell can be used to build a
number of different expert systems.
• An example of an expert system shell is CLIPS.
CS 484 – Artificial Intelligence 15
The Rete Algorithm
• A rete is a directed, acyclic, rooted graph (a tree).
• A path from the root node to a leaf represents the
left hand side of a rule.
• Each node stores details of which facts have been
matched so far.
• As facts are changed, the changes are propagated
through the tree.
• This makes an efficient way for expert systems to
deal with environments which change often.
CS 484 – Artificial Intelligence 16
Knowledge Engineering
• Takes knowledge from experts and inputs it
into the expert system.
• Usually choose which expert system shell to
use.
• Responsible for entering meta-rules.
CS 484 – Artificial Intelligence 17
CLIPS
• CLIPS is C Language
Integrated Production
System – an expert
system shell.
• CLIPS uses a LISP-like
notation to enter rules.
CS 484 – Artificial Intelligence 18
Backward Chaining in Expert
Systems
• Backward chaining is often used in expert systems
that are designed for medical diagnosis:
• For each hypothesis, H:
 If H is in the facts database, it is proved.
 Otherwise, if H can be determined by asking a question,
then enter the user’s answer in the facts database.
Hence, it can be determined whether H is true or false,
according to the user’s answer.
 Otherwise, find a rule whose conclusion is H. Now apply
this algorithm to try to prove this rule’s antecedents.
 If none of the above applies, we have failed to prove H.
• Usually backward chaining is used in conjunction with
forward chaining.
CS 484 – Artificial Intelligence 19
Simple Medical Expert System
• Rules
1. If headache then prescribe pain killer
2. If headache and sore throat and coughing than
diagnose flu
3. If tired and headache then diagnose glandular
fever
4. If tired and sore throat then diagnose
tonsillitis
5. If tired than diagnose stress
CS 484 – Artificial Intelligence 20
Simple Medical Expert System
• User interaction
• Patient: I have a headache
• System: I suggest you take a pain killer. Do you have a sore
throat?
• Patient: Yes, I do.
• System: Have you been coughing?
• Patient: No, why do you ask?
• System: If you had a head ache and a sore throat and had been
coughing, I would have to conclude you might have the flu. It
doesn't sound as though you have the flu? Have you been feeling
tired recently?
• Patient: Yes, I have.
• System: It sounds as though you may have glandular fever or
tonsillitis.
CS 484 – Artificial Intelligence 21
CYC
• A frame based production system.
• Uses a database of over 1,000,000 facts and
rules, encompassing all fields of human
knowledge.
• CYC can answer questions about all kinds
of knowledge in its database, and can even
understand analogies, and other complex
relations.

More Related Content

PPT
Artificial Intelligence Lecture Slide-03
PPT
Expert System Full Details
PPT
AI and Expert Systems
PPT
Chapter 8.ppt
PDF
Expert Systems: Definition, Functioning, and Development Approach - [Part: 1]
PPTX
Expert Systems in Artificial Inteligence
PPTX
presentation for your college and school about ai
PDF
Expert systems
Artificial Intelligence Lecture Slide-03
Expert System Full Details
AI and Expert Systems
Chapter 8.ppt
Expert Systems: Definition, Functioning, and Development Approach - [Part: 1]
Expert Systems in Artificial Inteligence
presentation for your college and school about ai
Expert systems

Similar to Rules and expert system (20)

PPT
1010 chapter11
PPT
1010 chapter11
PPT
Artificial Intelligence Lecture Slide-04
PPT
Lecture_8.ppt
PPT
PPTX
AI system mimicking human expert decision-making..pptx
PPT
Artificial Intelligence and expert system
PPT
Introduction to Expert Systems {Artificial Intelligence}
PPTX
presentation for artificial inteeligence in kurukhetra university
PPT
Expert system 21 sldes
PPT
Chapter 4.ppt mizan Tepi university student population
PPT
Artificial Intelligence and Expert Systems
PDF
Expert System With Python -1
PPT
Expert systems 1
PPTX
Expert Systems in Artificial Intelligence: Revolutionizing Problem Solving
PPTX
Knowledge based systems
PPTX
Module 5 - Expert System-in artificial intelligence
PPTX
Applied Artificial Intelligence NOTES (1).pptx
PDF
AI R16 - UNIT-5.pdf
1010 chapter11
1010 chapter11
Artificial Intelligence Lecture Slide-04
Lecture_8.ppt
AI system mimicking human expert decision-making..pptx
Artificial Intelligence and expert system
Introduction to Expert Systems {Artificial Intelligence}
presentation for artificial inteeligence in kurukhetra university
Expert system 21 sldes
Chapter 4.ppt mizan Tepi university student population
Artificial Intelligence and Expert Systems
Expert System With Python -1
Expert systems 1
Expert Systems in Artificial Intelligence: Revolutionizing Problem Solving
Knowledge based systems
Module 5 - Expert System-in artificial intelligence
Applied Artificial Intelligence NOTES (1).pptx
AI R16 - UNIT-5.pdf
Ad

Recently uploaded (20)

PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
Empowerment Technology for Senior High School Guide
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
Environmental Education MCQ BD2EE - Share Source.pdf
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PDF
Trump Administration's workforce development strategy
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
International_Financial_Reporting_Standa.pdf
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PPTX
History, Philosophy and sociology of education (1).pptx
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PDF
Complications of Minimal Access-Surgery.pdf
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
AI-driven educational solutions for real-life interventions in the Philippine...
B.Sc. DS Unit 2 Software Engineering.pptx
Empowerment Technology for Senior High School Guide
LDMMIA Reiki Yoga Finals Review Spring Summer
Environmental Education MCQ BD2EE - Share Source.pdf
TNA_Presentation-1-Final(SAVE)) (1).pptx
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
Trump Administration's workforce development strategy
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
International_Financial_Reporting_Standa.pdf
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
History, Philosophy and sociology of education (1).pptx
202450812 BayCHI UCSC-SV 20250812 v17.pptx
What if we spent less time fighting change, and more time building what’s rig...
FORM 1 BIOLOGY MIND MAPS and their schemes
Complications of Minimal Access-Surgery.pdf
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Ad

Rules and expert system

  • 1. CS 484 – Artificial Intelligence 1 Announcements • Choose Research Topic by today • Project 1 is due Thursday, October 11 • Midterm is Thursday, October 18 • Book Review is due Thursday, October 25
  • 2. Rules and Expert Systems Lecture 8
  • 3. CS 484 – Artificial Intelligence 3 Rules for Knowledge Representation • IF… THEN Rules can be used to represent knowledge: • IF it rains, then you will get wet • Rules can also be recommendations: • IF it rains, then you should wear a coat
  • 4. CS 484 – Artificial Intelligence 4 Rule Based Production Systems • Production system - uses knowledge in the form of rules to provide diagnoses or advice on the basis of input data. • Parts • Database of rules (knowledge base) • Database of facts • Inference engine which reasons about the facts using the rules
  • 5. CS 484 – Artificial Intelligence 5 Forward Chaining • Works from a set of facts and rules towards a set of conclusions, diagnoses or recommendations. • When a fact matches the antecedent of a rule • Rule fires • Conclusion added to facts
  • 6. CS 484 – Artificial Intelligence 6 Conflict Resolution • Problem: more than one rule fires at once • Conflict resolution strategy decides which conclusions to use. • Give rules priorities and to use the conclusion that has the highest priority. • Apply the rule with the longest antecedent • Apply the rule that was most recently added to the database.
  • 7. CS 484 – Artificial Intelligence 7 Examples • IF patient has pain THEN prescribe pain killers (priority 10) • IF patient has chest pain THEN treat for heart disease (priority 100) • IF patient has pain AND patient is over 60 AND patient has a history of heart conditions THEN take to emergency room
  • 8. CS 484 – Artificial Intelligence 8 Meta Rules • The rules that determine the conflict resolution strategy are called meta rules. • Meta rules define knowledge about how the system will work. • For example, meta rules might define that knowledge from Expert A is to be trusted more than knowledge from Expert B. • Meta rules are treated by the system like normal rules, but are given higher priority.
  • 9. CS 484 – Artificial Intelligence 9 Backward Chaining • Use backward chaining when proving a particular conclusion • Works back from a conclusion towards the original facts. • When a conclusion matches the conclusion of a rule in the database, the antecedents of the rule are compared with facts in the database.
  • 10. CS 484 – Artificial Intelligence 10 Forward Chaining • Rules 1. A Λ B → C 2. A → D 3. C Λ D → E 4. B Λ E Λ F → G 5. A Λ E → H 6. D Λ E Λ H → I • Facts 1. A 2. B 3. F • Goal • H Facts Rules triggered Rule fired A,B,F
  • 11. CS 484 – Artificial Intelligence 11 Backward Chaining • Rules 1. A Λ B → C 2. A → D 3. C Λ D → E 4. B Λ E Λ F → G 5. A Λ E → H 6. D Λ E Λ H → I • Facts 1. A 2. B 3. F • Goal • H Facts Goals Matching Rules A,B,F How do the methods compare?
  • 12. CS 484 – Artificial Intelligence 12 The Architecture of Expert Systems (1) • Expert knowledge derived from human experts • Purpose: • Diagnose illnesses • Provide recommendations • Solve other problems
  • 13. CS 484 – Artificial Intelligence 13 The Architecture of Expert Systems (2) • Knowledge base: database of rules (domain knowledge). • Explanation system: explains the decisions the system makes. • User Interface: the means by which the user interacts with the expert system. • Knowledge base editor: allows the user to edit the information in the knowledge base.
  • 14. CS 484 – Artificial Intelligence 14 Expert System Shells • The part of an expert system that does not contain any domain specific or case specific knowledge is the expert system shell. • A single expert system shell can be used to build a number of different expert systems. • An example of an expert system shell is CLIPS.
  • 15. CS 484 – Artificial Intelligence 15 The Rete Algorithm • A rete is a directed, acyclic, rooted graph (a tree). • A path from the root node to a leaf represents the left hand side of a rule. • Each node stores details of which facts have been matched so far. • As facts are changed, the changes are propagated through the tree. • This makes an efficient way for expert systems to deal with environments which change often.
  • 16. CS 484 – Artificial Intelligence 16 Knowledge Engineering • Takes knowledge from experts and inputs it into the expert system. • Usually choose which expert system shell to use. • Responsible for entering meta-rules.
  • 17. CS 484 – Artificial Intelligence 17 CLIPS • CLIPS is C Language Integrated Production System – an expert system shell. • CLIPS uses a LISP-like notation to enter rules.
  • 18. CS 484 – Artificial Intelligence 18 Backward Chaining in Expert Systems • Backward chaining is often used in expert systems that are designed for medical diagnosis: • For each hypothesis, H:  If H is in the facts database, it is proved.  Otherwise, if H can be determined by asking a question, then enter the user’s answer in the facts database. Hence, it can be determined whether H is true or false, according to the user’s answer.  Otherwise, find a rule whose conclusion is H. Now apply this algorithm to try to prove this rule’s antecedents.  If none of the above applies, we have failed to prove H. • Usually backward chaining is used in conjunction with forward chaining.
  • 19. CS 484 – Artificial Intelligence 19 Simple Medical Expert System • Rules 1. If headache then prescribe pain killer 2. If headache and sore throat and coughing than diagnose flu 3. If tired and headache then diagnose glandular fever 4. If tired and sore throat then diagnose tonsillitis 5. If tired than diagnose stress
  • 20. CS 484 – Artificial Intelligence 20 Simple Medical Expert System • User interaction • Patient: I have a headache • System: I suggest you take a pain killer. Do you have a sore throat? • Patient: Yes, I do. • System: Have you been coughing? • Patient: No, why do you ask? • System: If you had a head ache and a sore throat and had been coughing, I would have to conclude you might have the flu. It doesn't sound as though you have the flu? Have you been feeling tired recently? • Patient: Yes, I have. • System: It sounds as though you may have glandular fever or tonsillitis.
  • 21. CS 484 – Artificial Intelligence 21 CYC • A frame based production system. • Uses a database of over 1,000,000 facts and rules, encompassing all fields of human knowledge. • CYC can answer questions about all kinds of knowledge in its database, and can even understand analogies, and other complex relations.