SlideShare a Scribd company logo
1 of 32
Forward & backward
chaining
By
Md. Fazle Rabbi
16CSE057
4.2
Forward chaining
4.3
• Forward chaining: We start with the sentences in the
knowledge base and generate new conclusions that in
turn can allow more inferences to be made.
• data-driven
• Automatic, unconscious processing
• May do lots of work that is irrelevant to the goal
Forward chaining
4.4
• It is a down-up approach, as it moves from bottom to top.
• It is a process of making a conclusion based on known facts or
data, by starting from the initial state and reaches the goal
state.
• Forward-chaining approach is also called as data-driven as we
reach to the goal using available data.
• Forward -chaining approach is commonly used in the expert
system, such as CLIPS, business, and production rule systems.
Properties of Forward-Chaining
4.5
Forward Chaining Example
• Knowledge Base:
• If [X croaks and eats flies] Then [X is a frog]
• If [X chirps and sings] Then [X is a canary]
• If [X is a frog] Then [X is colored green]
• If [X is a canary] Then [X is colored yellow]
• [Fritz croaks and eats flies]
• Goal:
• [Fritz is colored Y]?
4.6
Forward Chaining Example
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goal
[Fritz is colored Y]?
4.7
Forward Chaining Example
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goal
[Fritz is colored Y]?
4.8
Forward Chaining Example
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goal
[Fritz is colored Y]?
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
4.9
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
Goal
[Fritz is colored Y]?
4.10
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
Goal
[Fritz is colored Y]?
?
4.11
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
Goal
[Fritz is colored Y]?
4.12
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
Goal
[Fritz is colored Y]?
If [X is a frog]
Then [X is colored green]
[Fritz is colored green]
4.13
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
If [X is a frog]
Then [X is colored green]
[Fritz is colored green]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
[Fritz is colored green]
Goal
[Fritz is colored Y]?
4.14
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
If [X is a frog]
Then [X is colored green]
[Fritz is colored green]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
[Fritz is colored green]
Goal
[Fritz is colored Y]?
?
4.15
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
If [X is a frog]
Then [X is colored green]
[Fritz is colored green]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
[Fritz is colored green]
Goal
[Fritz is colored Y]?
4.16
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
If [X is a frog]
Then [X is colored green]
[Fritz is colored green]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
[Fritz is colored green]
Goal
[Fritz is colored Y]?
[Fritz is colored Y] ?
Y = green
4.17
Backward chaining
4.18
• Backward chaining: We start with something we want
to prove, find implication sentences that would allow
us to conclude it, and then attempt to establish their
premises in turn.
• goal-driven
• Where are my keys? How do I get to my next class
Backward chaining
4.19
Properties of backward chaining
• It is known as a top-down approach.
• In backward chaining, the goal is broken into
sub-goal or sub-goals to prove the facts true.
• It is called a goal-driven approach, as a list of
goals decides which rules are selected and used.
• The backward-chaining method mostly used a
depth-first search strategy for proof.
4.20
Backward Chaining Example
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
4.21
Backward Chaining Example
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
4.22
Backward Chaining Example
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
4.23
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
4.24
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
4.25
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
4.26
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
[X is a canary]
4.27
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
[X is a canary]
4.28
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
[X is a canary]
If [X croaks and eats flies]
Then [X is a frog]
[X croaks and eats flies]
4.29
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
If [X croaks and eats flies]
Then [X is a frog]
[X croaks and eats flies]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
[X is a canary]
[X croaks and eats flies]
4.30
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
If [X croaks and eats flies]
Then [X is a frog]
[X croaks and eats flies]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
[X is a canary]
[X croaks and eats flies]
4.31
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
If [X croaks and eats flies]
Then [X is a frog]
[X croaks and eats flies]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
[X is a canary]
[X croaks and eats flies]
[Fritz croaks and eats flies]
X = Fritz, Y = green
4.32
Thank you

More Related Content

What's hot

Propositional logic
Propositional logicPropositional logic
Propositional logic
Rushdi Shams
 

What's hot (20)

knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rules
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Breadth first search and depth first search
Breadth first search and  depth first searchBreadth first search and  depth first search
Breadth first search and depth first search
 
First order logic
First order logicFirst order logic
First order logic
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
 
Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence
 
Problem space
Problem spaceProblem space
Problem space
 
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
 
13. Indexing MTrees - Data Structures using C++ by Varsha Patil
13. Indexing MTrees - Data Structures using C++ by Varsha Patil13. Indexing MTrees - Data Structures using C++ by Varsha Patil
13. Indexing MTrees - Data Structures using C++ by Varsha Patil
 
09
0909
09
 
Local beam search example
Local beam search exampleLocal beam search example
Local beam search example
 
Breadth first search (Bfs)
Breadth first search (Bfs)Breadth first search (Bfs)
Breadth first search (Bfs)
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AI
 
Structured Knowledge Representation
Structured Knowledge RepresentationStructured Knowledge Representation
Structured Knowledge Representation
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded search
 
Knowledge representation
Knowledge representationKnowledge representation
Knowledge representation
 
Module - 1 Discrete Mathematics and Graph Theory
Module - 1 Discrete Mathematics and Graph TheoryModule - 1 Discrete Mathematics and Graph Theory
Module - 1 Discrete Mathematics and Graph Theory
 
Dempster shafer theory
Dempster shafer theoryDempster shafer theory
Dempster shafer theory
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 

More from MdFazleRabbi18

Topic4 data encryption standard(des)
Topic4 data encryption standard(des)Topic4 data encryption standard(des)
Topic4 data encryption standard(des)
MdFazleRabbi18
 

More from MdFazleRabbi18 (20)

5.programmable interval timer 8253
5.programmable interval timer 82535.programmable interval timer 8253
5.programmable interval timer 8253
 
4.programmable dma controller 8257
4.programmable dma controller 82574.programmable dma controller 8257
4.programmable dma controller 8257
 
3.programmable interrupt controller 8259
3.programmable interrupt controller 82593.programmable interrupt controller 8259
3.programmable interrupt controller 8259
 
1.ppi 8255
1.ppi 8255 1.ppi 8255
1.ppi 8255
 
Topic4 data encryption standard(des)
Topic4 data encryption standard(des)Topic4 data encryption standard(des)
Topic4 data encryption standard(des)
 
Topic3 playfain
Topic3 playfainTopic3 playfain
Topic3 playfain
 
Topic2 caser hill_cripto
Topic2 caser hill_criptoTopic2 caser hill_cripto
Topic2 caser hill_cripto
 
Topic5 advanced encryption standard (aes)
Topic5 advanced encryption standard (aes)Topic5 advanced encryption standard (aes)
Topic5 advanced encryption standard (aes)
 
Topic1 substitution transposition-techniques
Topic1 substitution transposition-techniquesTopic1 substitution transposition-techniques
Topic1 substitution transposition-techniques
 
11. lzw coding
11. lzw coding11. lzw coding
11. lzw coding
 
9. hofman coding in DIP
9. hofman coding in DIP9. hofman coding in DIP
9. hofman coding in DIP
 
7. image enhancement using spatial filtering
7. image enhancement using spatial filtering7. image enhancement using spatial filtering
7. image enhancement using spatial filtering
 
5. gray level transformation
5. gray level transformation5. gray level transformation
5. gray level transformation
 
1. steps in image processing
1. steps in image processing1. steps in image processing
1. steps in image processing
 
5. convolution and correlation of discrete time signals
5. convolution and correlation of discrete time signals 5. convolution and correlation of discrete time signals
5. convolution and correlation of discrete time signals
 
4. operations of signals
4. operations of signals 4. operations of signals
4. operations of signals
 
3. systems
3. systems 3. systems
3. systems
 
2. classification of signals
2. classification of signals 2. classification of signals
2. classification of signals
 
1. elementary signals
1. elementary signals 1. elementary signals
1. elementary signals
 
4. random number and it's generating techniques
4. random number and it's generating techniques 4. random number and it's generating techniques
4. random number and it's generating techniques
 

Recently uploaded

FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 

Recently uploaded (20)

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 

2. forward chaning

  • 1. Forward & backward chaining By Md. Fazle Rabbi 16CSE057
  • 3. 4.3 • Forward chaining: We start with the sentences in the knowledge base and generate new conclusions that in turn can allow more inferences to be made. • data-driven • Automatic, unconscious processing • May do lots of work that is irrelevant to the goal Forward chaining
  • 4. 4.4 • It is a down-up approach, as it moves from bottom to top. • It is a process of making a conclusion based on known facts or data, by starting from the initial state and reaches the goal state. • Forward-chaining approach is also called as data-driven as we reach to the goal using available data. • Forward -chaining approach is commonly used in the expert system, such as CLIPS, business, and production rule systems. Properties of Forward-Chaining
  • 5. 4.5 Forward Chaining Example • Knowledge Base: • If [X croaks and eats flies] Then [X is a frog] • If [X chirps and sings] Then [X is a canary] • If [X is a frog] Then [X is colored green] • If [X is a canary] Then [X is colored yellow] • [Fritz croaks and eats flies] • Goal: • [Fritz is colored Y]?
  • 6. 4.6 Forward Chaining Example Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goal [Fritz is colored Y]?
  • 7. 4.7 Forward Chaining Example Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goal [Fritz is colored Y]?
  • 8. 4.8 Forward Chaining Example Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goal [Fritz is colored Y]? If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog]
  • 9. 4.9 Forward Chaining Example If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] Goal [Fritz is colored Y]?
  • 10. 4.10 Forward Chaining Example If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] Goal [Fritz is colored Y]? ?
  • 11. 4.11 Forward Chaining Example If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] Goal [Fritz is colored Y]?
  • 12. 4.12 Forward Chaining Example If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] Goal [Fritz is colored Y]? If [X is a frog] Then [X is colored green] [Fritz is colored green]
  • 13. 4.13 Forward Chaining Example If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] If [X is a frog] Then [X is colored green] [Fritz is colored green] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] [Fritz is colored green] Goal [Fritz is colored Y]?
  • 14. 4.14 Forward Chaining Example If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] If [X is a frog] Then [X is colored green] [Fritz is colored green] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] [Fritz is colored green] Goal [Fritz is colored Y]? ?
  • 15. 4.15 Forward Chaining Example If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] If [X is a frog] Then [X is colored green] [Fritz is colored green] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] [Fritz is colored green] Goal [Fritz is colored Y]?
  • 16. 4.16 Forward Chaining Example If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] If [X is a frog] Then [X is colored green] [Fritz is colored green] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] [Fritz is colored green] Goal [Fritz is colored Y]? [Fritz is colored Y] ? Y = green
  • 18. 4.18 • Backward chaining: We start with something we want to prove, find implication sentences that would allow us to conclude it, and then attempt to establish their premises in turn. • goal-driven • Where are my keys? How do I get to my next class Backward chaining
  • 19. 4.19 Properties of backward chaining • It is known as a top-down approach. • In backward chaining, the goal is broken into sub-goal or sub-goals to prove the facts true. • It is called a goal-driven approach, as a list of goals decides which rules are selected and used. • The backward-chaining method mostly used a depth-first search strategy for proof.
  • 20. 4.20 Backward Chaining Example Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]?
  • 21. 4.21 Backward Chaining Example Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]?
  • 22. 4.22 Backward Chaining Example Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [Fritz is colored Y] If [X is a frog] Then [X is colored green] [X is a frog]
  • 23. 4.23 Backward Chaining Example [Fritz is colored Y] If [X is a frog] Then [X is colored green] [X is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog]
  • 24. 4.24 Backward Chaining Example [Fritz is colored Y] If [X is a frog] Then [X is colored green] [X is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog]
  • 25. 4.25 Backward Chaining Example [Fritz is colored Y] If [X is a frog] Then [X is colored green] [X is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary]
  • 26. 4.26 Backward Chaining Example [Fritz is colored Y] If [X is a frog] Then [X is colored green] [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] [X is a canary]
  • 27. 4.27 Backward Chaining Example [Fritz is colored Y] If [X is a frog] Then [X is colored green] [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] [X is a canary]
  • 28. 4.28 Backward Chaining Example [Fritz is colored Y] If [X is a frog] Then [X is colored green] [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] [X is a canary] If [X croaks and eats flies] Then [X is a frog] [X croaks and eats flies]
  • 29. 4.29 Backward Chaining Example [Fritz is colored Y] If [X is a frog] Then [X is colored green] [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary] If [X croaks and eats flies] Then [X is a frog] [X croaks and eats flies] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] [X is a canary] [X croaks and eats flies]
  • 30. 4.30 Backward Chaining Example [Fritz is colored Y] If [X is a frog] Then [X is colored green] [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary] If [X croaks and eats flies] Then [X is a frog] [X croaks and eats flies] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] [X is a canary] [X croaks and eats flies]
  • 31. 4.31 Backward Chaining Example [Fritz is colored Y] If [X is a frog] Then [X is colored green] [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary] If [X croaks and eats flies] Then [X is a frog] [X croaks and eats flies] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] [X is a canary] [X croaks and eats flies] [Fritz croaks and eats flies] X = Fritz, Y = green