SlideShare a Scribd company logo
1 of 14
RULED-BASED EXPERT SYSTEM
(FORWARD CHAINING AND BACKWARD CHAINING)
-Amit Singh Dahal
-g5638545
FIRST STEP: WRITE THE RULES BASED ON
DIAGRAMS:
 R1: IF the animal has hair
THEN it is a mammal
 R2: IF the animal gives milk
THEN it is a mammal
 R3: IF the animal has feathers
THEN it is a bird
 R4: IF the animal flies
the animal lays eggs
THEN it is a bird
 R5: IF the animal is a mammal
the animal eats meat
THEN it is a carnivore
CONTD…
 R6: IF the animal is a mammal
the animal has pointed teeth
the animal has claws
the animal's eyes point forward
THEN it is a carnivore
 R7: IF the animal is a mammal
the animal has hooves
THEN it is an ungulate
 R8: IF the animal is a mammal
the animal chews cud
THEN it is an ungulate AND
it is even-toed
CONTD…
 R9: IF the animal is a carnivore
the animal has a tawny colour
the animal has dark spots
THEN it is a cheetah
 R10: IF the animal is a carnivore
the animal has a tawny colour
the animal has black stripes
THEN it is a tiger
 R11: IF the animal is an ungulate
the animal has long legs
the animal has a long neck
the animal has dark spot
THEN it is a giraffe
 R12: IF the animal is an ungulate
the animal has a white colour
the animal has black stripes
THEN it is a zebra
CONTD…
 R13 :IF the animal is a bird
the animal does not fly
the animal has long legs
the animal has a long neck
the animal is black and white
THEN it is an ostrich
 R14 :IF the animal is a bird
the animal does not fly
the animal swims
the animal is black and white
THEN it is a penguin
 R15 :IF the animal is a bird
the animal is a good flier
THEN it is an albatross
FORWARD CHAINING
 Facts in the working memory:
-the animal gives milk
-the animal chew cuds
-the animal has long legs
-the animal has a long neck
-the animal has a dark spot
 Assume GOAL:
the animal is Giraffe
 Round 1:
R2: IF the animal gives milk
THEN it is a mammal  fires mammal
 Round 2:
R8: IF the animal is mammal
the animal chews cud
THEN it is an ungulate  fires ungulate
 Round 3:
R11: IF the animal is an ungulate
the animal has long legs
the animal has a long neck
the animal has dark spot
THEN it is a GIRAFFE
Hence, goal reached. The used rules are: R2, R8
and R11.
BACKWARD CHAINING
 Facts in the working memory:
-the animal has hair
-the animal has claws
-the animal has pointed teeth
-the animal’s eyes point forward
-the animal has a tawny color
-the animal has dark spots
 Assume GOAL:
the animal is Cheetah
 Pass 1:
Based on R9:
?the animal is carnivore
the animal has a tawny color
the animal has dark spot
Stack:
Cheetah
S1
S1
AND
 Pass 2:
Based on R5 and R6:
?the animal is a mammal
?the animal can eat meat
?the animal is a mammal
the animal has pointed teeth
the animal has claws
the animal eyes point forward
Stack:
AND
AND
OR
S2
Carnivore
S1
S2
 Pass 3:
Based on R1 and R2:
the animal has hair
the animal gives milk
Stack:
OR Mammal
S1
S2
 Pass 4:
Based on R5 and R6:
 the animal is a mammal
? the animal can eat meat
 the animal is a mammal
the animal has pointed teeth
the animal has claws
the animal eyes point forward
Stack:
AND
OR
AND
Carnivore
S1
 Pass 5:
 the animal is carnivore
the animal has a tawny color
the animal has dark spot
Stack: Clear
Hence, goal is correct using backward chaining
provided the information and the rules used are:
R9, R6, R1.
AND Cheetah
THE END
Any Questions??

More Related Content

What's hot

Is Is Routing Protocol
Is Is Routing ProtocolIs Is Routing Protocol
Is Is Routing Protocol
hayenas
 
The Javan Rhinoceros researched by Vincent Jansen Van Rensburg
The Javan Rhinoceros researched by Vincent Jansen Van Rensburg The Javan Rhinoceros researched by Vincent Jansen Van Rensburg
The Javan Rhinoceros researched by Vincent Jansen Van Rensburg
simonshore
 
An intoroduction to the IS-IS IGP routing protocol
An intoroduction to the IS-IS IGP routing protocolAn intoroduction to the IS-IS IGP routing protocol
An intoroduction to the IS-IS IGP routing protocol
Iftach Ian Amit
 

What's hot (20)

Is Is Routing Protocol
Is Is Routing ProtocolIs Is Routing Protocol
Is Is Routing Protocol
 
Knowledge representation
Knowledge representationKnowledge representation
Knowledge representation
 
Local search algorithm
Local search algorithmLocal search algorithm
Local search algorithm
 
Splay tree
Splay treeSplay tree
Splay tree
 
AI PPT-ALR_Unit-3-1.pdf
AI PPT-ALR_Unit-3-1.pdfAI PPT-ALR_Unit-3-1.pdf
AI PPT-ALR_Unit-3-1.pdf
 
The Javan Rhinoceros researched by Vincent Jansen Van Rensburg
The Javan Rhinoceros researched by Vincent Jansen Van Rensburg The Javan Rhinoceros researched by Vincent Jansen Van Rensburg
The Javan Rhinoceros researched by Vincent Jansen Van Rensburg
 
An intoroduction to the IS-IS IGP routing protocol
An intoroduction to the IS-IS IGP routing protocolAn intoroduction to the IS-IS IGP routing protocol
An intoroduction to the IS-IS IGP routing protocol
 
bengal tiger
bengal tigerbengal tiger
bengal tiger
 
Rule based expert system
Rule based expert systemRule based expert system
Rule based expert system
 
weak slot and filler
weak slot and fillerweak slot and filler
weak slot and filler
 
Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AI
 
Dogs
DogsDogs
Dogs
 
the tiger
the tiger the tiger
the tiger
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing Machine
 
Frames
FramesFrames
Frames
 
ADVANCED ALGORITHMS-UNIT-3-Final.ppt
ADVANCED   ALGORITHMS-UNIT-3-Final.pptADVANCED   ALGORITHMS-UNIT-3-Final.ppt
ADVANCED ALGORITHMS-UNIT-3-Final.ppt
 
Segment Routing Lab
Segment Routing Lab Segment Routing Lab
Segment Routing Lab
 
OSPF
OSPF OSPF
OSPF
 
Ll(1) Parser in Compilers
Ll(1) Parser in CompilersLl(1) Parser in Compilers
Ll(1) Parser in Compilers
 
Skip lists (Advance Data structure)
Skip lists (Advance Data structure)Skip lists (Advance Data structure)
Skip lists (Advance Data structure)
 

Viewers also liked

Introduction to Rule-based Applications
Introduction to  Rule-based ApplicationsIntroduction to  Rule-based Applications
Introduction to Rule-based Applications
giurca
 
Expert Systems
Expert SystemsExpert Systems
Expert Systems
osmancikk
 
Expert system 21 sldes
Expert system 21 sldesExpert system 21 sldes
Expert system 21 sldes
Yasir Khan
 
Lecture5 Expert Systems And Artificial Intelligence
Lecture5 Expert Systems And Artificial IntelligenceLecture5 Expert Systems And Artificial Intelligence
Lecture5 Expert Systems And Artificial Intelligence
Kodok Ngorex
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
Vishal Singh
 
Backward chaining rule-based system
Backward chaining rule-based systemBackward chaining rule-based system
Backward chaining rule-based system
Jenny Padillo
 
04 reasoning systems
04 reasoning systems04 reasoning systems
04 reasoning systems
John Issac
 

Viewers also liked (20)

Rule Based System
Rule Based SystemRule Based System
Rule Based System
 
Introduction to Rule-based Applications
Introduction to  Rule-based ApplicationsIntroduction to  Rule-based Applications
Introduction to Rule-based Applications
 
Rule Based Architecture System
Rule Based Architecture SystemRule Based Architecture System
Rule Based Architecture System
 
Expert Systems
Expert SystemsExpert Systems
Expert Systems
 
FORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN ARTIFICIAL INTELIGENCE
FORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN ARTIFICIAL INTELIGENCEFORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN ARTIFICIAL INTELIGENCE
FORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN ARTIFICIAL INTELIGENCE
 
Expert system 21 sldes
Expert system 21 sldesExpert system 21 sldes
Expert system 21 sldes
 
Expert Systems
Expert SystemsExpert Systems
Expert Systems
 
Forward Backward Chaining
Forward Backward ChainingForward Backward Chaining
Forward Backward Chaining
 
Introduction to Expert Systems {Artificial Intelligence}
Introduction to Expert Systems {Artificial Intelligence}Introduction to Expert Systems {Artificial Intelligence}
Introduction to Expert Systems {Artificial Intelligence}
 
Lecture5 Expert Systems And Artificial Intelligence
Lecture5 Expert Systems And Artificial IntelligenceLecture5 Expert Systems And Artificial Intelligence
Lecture5 Expert Systems And Artificial Intelligence
 
Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
 
6.expert systems
6.expert systems6.expert systems
6.expert systems
 
Truth management system
Truth  management systemTruth  management system
Truth management system
 
Artificial intelligence cs607 handouts lecture 11 - 45
Artificial intelligence   cs607 handouts lecture 11 - 45Artificial intelligence   cs607 handouts lecture 11 - 45
Artificial intelligence cs607 handouts lecture 11 - 45
 
Pengantar Sistem Pakar
Pengantar Sistem PakarPengantar Sistem Pakar
Pengantar Sistem Pakar
 
Pengantar Sistem Pakar
Pengantar Sistem PakarPengantar Sistem Pakar
Pengantar Sistem Pakar
 
Backward chaining rule-based system
Backward chaining rule-based systemBackward chaining rule-based system
Backward chaining rule-based system
 
04 reasoning systems
04 reasoning systems04 reasoning systems
04 reasoning systems
 
Sistem Pakar.ppt
Sistem Pakar.pptSistem Pakar.ppt
Sistem Pakar.ppt
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Ruled based expert system

  • 1. RULED-BASED EXPERT SYSTEM (FORWARD CHAINING AND BACKWARD CHAINING) -Amit Singh Dahal -g5638545
  • 2. FIRST STEP: WRITE THE RULES BASED ON DIAGRAMS:  R1: IF the animal has hair THEN it is a mammal  R2: IF the animal gives milk THEN it is a mammal  R3: IF the animal has feathers THEN it is a bird  R4: IF the animal flies the animal lays eggs THEN it is a bird  R5: IF the animal is a mammal the animal eats meat THEN it is a carnivore
  • 3. CONTD…  R6: IF the animal is a mammal the animal has pointed teeth the animal has claws the animal's eyes point forward THEN it is a carnivore  R7: IF the animal is a mammal the animal has hooves THEN it is an ungulate  R8: IF the animal is a mammal the animal chews cud THEN it is an ungulate AND it is even-toed
  • 4. CONTD…  R9: IF the animal is a carnivore the animal has a tawny colour the animal has dark spots THEN it is a cheetah  R10: IF the animal is a carnivore the animal has a tawny colour the animal has black stripes THEN it is a tiger  R11: IF the animal is an ungulate the animal has long legs the animal has a long neck the animal has dark spot THEN it is a giraffe  R12: IF the animal is an ungulate the animal has a white colour the animal has black stripes THEN it is a zebra
  • 5. CONTD…  R13 :IF the animal is a bird the animal does not fly the animal has long legs the animal has a long neck the animal is black and white THEN it is an ostrich  R14 :IF the animal is a bird the animal does not fly the animal swims the animal is black and white THEN it is a penguin  R15 :IF the animal is a bird the animal is a good flier THEN it is an albatross
  • 6. FORWARD CHAINING  Facts in the working memory: -the animal gives milk -the animal chew cuds -the animal has long legs -the animal has a long neck -the animal has a dark spot  Assume GOAL: the animal is Giraffe
  • 7.  Round 1: R2: IF the animal gives milk THEN it is a mammal  fires mammal  Round 2: R8: IF the animal is mammal the animal chews cud THEN it is an ungulate  fires ungulate  Round 3: R11: IF the animal is an ungulate the animal has long legs the animal has a long neck the animal has dark spot THEN it is a GIRAFFE Hence, goal reached. The used rules are: R2, R8 and R11.
  • 8. BACKWARD CHAINING  Facts in the working memory: -the animal has hair -the animal has claws -the animal has pointed teeth -the animal’s eyes point forward -the animal has a tawny color -the animal has dark spots  Assume GOAL: the animal is Cheetah
  • 9.  Pass 1: Based on R9: ?the animal is carnivore the animal has a tawny color the animal has dark spot Stack: Cheetah S1 S1 AND
  • 10.  Pass 2: Based on R5 and R6: ?the animal is a mammal ?the animal can eat meat ?the animal is a mammal the animal has pointed teeth the animal has claws the animal eyes point forward Stack: AND AND OR S2 Carnivore S1 S2
  • 11.  Pass 3: Based on R1 and R2: the animal has hair the animal gives milk Stack: OR Mammal S1 S2
  • 12.  Pass 4: Based on R5 and R6:  the animal is a mammal ? the animal can eat meat  the animal is a mammal the animal has pointed teeth the animal has claws the animal eyes point forward Stack: AND OR AND Carnivore S1
  • 13.  Pass 5:  the animal is carnivore the animal has a tawny color the animal has dark spot Stack: Clear Hence, goal is correct using backward chaining provided the information and the rules used are: R9, R6, R1. AND Cheetah