SlideShare uma empresa Scribd logo
1 de 49
FORWARD AND BACKWARD
CHAINING
PREPARED BY: QURAT UL AIN
FORWARD CHAINING
DEFINITION
• Forward chaining is a data driven method of
deriving a particular goal from a given
knowledge base and set of inference rules
• Inference rules are applied by matching facts
to the antecedents of consequence relations
in the knowledge base
• The application of inference rules results in
new knowledge (from the consequents of the
relations matched), which is then added to
the knowledge base
FORWARD CHAINING (Ben Coppin)
In Forward chaining, the system starts from a set
of facts, and a set of
rules, and tries to find a way of using those rules
and facts to deduce a conclusion or come up
with a suitable course of action.
This is known as data-driven reasoning because
the reasoning starts from
a set of data and ends up at the goal, which is
the conclusion.
Forward Chaining Mechanism
(Ben Coppin)
When applying forward chaining, the first step is to take
the facts in the fact database and see if any combination
of these matches all the antecedents of one of the rules
in the rule database. When all the antecedents of a rule
are matched by facts in the database, then this rule is
triggered.
Usually, when a rule is triggered, it is then fired, which
means its conclusion is added to the facts database. If
the conclusion of the rule that has fired is an action or a
recommendation, then the system may cause that action
to take place or the recommendation to be made.
FORWARD CHAINING EXAMPLE
Ben Coppin
Rule 4
IF on second floor
AND button is pressed on first floor
AND already going to third floor
THEN remember to go to first floor later
Let us imagine that we start with the following facts in our
database:
Fact 1
At first floor
Fact 2
Button pressed on third floor
Fact 3
Today is Tuesday
Now the system examines the rules and finds that
Facts 1 and 2 match the antecedents of Rule 3.
Hence, Rule 3 fires, and its conclusion “Go to
third floor” is added to the database of facts.
Presumably, this results in the elevator heading
toward the third floor. Note that Fact 3 was
ignored altogether because it did not match the
antecedents of any of the rules.
Now let us imagine that the elevator is on its way to
the third floor and has reached the second
floor,when the button is pressed on the first floor.
The fact “Button pressed on first floor” Is now
added to the database, which results in Rule 4
firing.
Now let us imagine
that later in the day the facts database contains the
following information:
Fact 1
At first floor
Fact 2
Button pressed on second floor
Fact 3
Button pressed on third floor
In this case, two rules are triggered—Rules 2 and 3.
In such cases where there is more than one
possible conclusion, conflict resolution needs to
be applied to decide which rule to fire.
Forward chaining applies a set of rules and facts
to deduce whatever conclusions can be
derived, which is useful when a set of facts are
present, but you do not know what
conclusions you are trying to prove.
In some cases,forward chaining can be
inefficient because it may end up proving a
number of conclusions that are not currently
interesting. In such cases, where a single
specific conclusion is to be proved, backward
chaining is more appropriate.
FORWARD CHAINING
(ANOTHER EXAMPLE)
“WEATHER FORECASTING SYSTEM”
• Suppose we have been given the following
facts,
a) Sun is behind the clouds.
b) Air is very heavy and cool.
• Problem: Using Forward chaining try to
conclude that there are chances of rain.
CONFLICT RESOLUTION
CONFLICT RESOLUTION (Ben Coppin)
In a situation where more than one conclusion
can be deduced from a set of facts, there are a
number of possible ways to decide which rule
to fire (i.e., which conclusion to use or which
course of action to take).
CONFLICT RESOLUTION
• Example:
IF you’re bored
AND you’ve no cash
THEN go to a friend’s place.
IF you’re bored
AND You’ve no cash
THEN go to a park.
CONFLICT RESOLUTION STRATEGIES
• We have different resolution strategies:
1) Fire the first rule in sequence.
2) Assign rule priorities (by importance).
3) More specific rules are preferred over more
general rules.(e.g. a rule having 5 IF’s(handle more info)
will be preferred over one having 3 IF’s)
4) Prefer rules whose premises are added more
recently (time stamping)
5) Parallel strategy (create view points)
EXAMPLE (Ben Coppin)
CONFLICT RESOLUTION
TECHNIQUES
BEN COPPIN
• An alternative method is the longest-matching strategy. This
method involves firing the conclusion that was derived from
the longest rule.
• For example:
IF patient has pain
THEN prescribe painkiller
IF patient has chest pain
AND patient is over 60
AND patient has history of heart conditions
THEN take to emergency room
Here, if all the antecedents of the second rule match, then
this rule’s conclusion should be fired rather than the
conclusion of the first rule because it is a more specific match.
A further method for conflict resolution is to fire
the rule that has matched the facts most
recently added to the database. In each case,
it may be that the system fires one rule and
then stops (as in medical diagnosis), but in
many cases, the system simply needs to
choose a suitable ordering for the rules (as
when controlling an elevator) because each
rule that matches the facts needs to be fired
at some point.
BACKWARD CHAINING
DEFINITION
• Backward chaining is a goal driven method of
deriving a particular goal from a given
knowledge base and set of inference rules
• Inference rules are applied by matching the
goal of the search to the consequents of the
relations stored in the knowledge base
Definition (Ben Coppin)
In backward chaining, we start from a
conclusion, which is the hypothesis we wish to
prove, and we aim to show how that
conclusion can be reached from the rules and
facts in the database.
The conclusion we are aiming to prove is called a
goal, and so reasoning in this way is known as
goal-driven reasoning.
Backward Chaining Mechanism
(Ben Coppin)
Backward chaining starts with the goal state,
which is the set of conditions the agent wishes to
achieve in carrying out its plan. It now examines
this state and sees what actions could lead to it.
For example, if the goal state involves a block
being on a table, then one possible action would
be to place that block on the table. This action
might not be possible from the start state, and so
further actions need to be added before this
action in order to reach it from the start state. In
this way, a plan can be formulated starting from
the goal and working back toward the start state.
The benefit in this method is particularly clear in
situations where the first state allows a very large
number of possible actions. In this kind of
situation, it can be very inefficient to attempt to
formulate a plan using forward chaining because
it involves examining every possible action,
without paying any attention to which action
might be the best one to lead to the goal state.
Backward chaining ensures that each action that
is taken is one that will definitely lead to the goal,
and in many cases this will make the planning
process far more efficient.
BACKWARD CHAINING EXAMPLE
“WEATHER FORECAST SYSTEM”
• Suppose we have been given the following
facts,
a) Sun is behind the clouds.
b) Air is very heavy and cool.
• Problem: Using Backward chaining try to
conclude that there are chances of rain.
COMPARING FORWARD AND
BACKWARD CHAINING
BEN COPPIN
Let us use an example to compare forward and
backward chaining. In this case, we will revert
to our use of symbols for logical statements, in
order to clarify the explanation, but we could
equally well be using rules about elevators
or the weather.
Forward Backward Chaining
Forward Backward Chaining
Forward Backward Chaining
Forward Backward Chaining
Forward Backward Chaining
Forward Backward Chaining
Forward Backward Chaining
Forward Backward Chaining

Mais conteúdo relacionado

Mais procurados

Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & ReasoningSajid Marwat
 
Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AIMegha Sharma
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AIvikas dhakane
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agentsMegha Sharma
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMvikas dhakane
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesDr. C.V. Suresh Babu
 
Dempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th SemDempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th SemDigiGurukul
 
Lecture 06 production system
Lecture 06 production systemLecture 06 production system
Lecture 06 production systemHema Kashyap
 
State Space Search in ai
State Space Search in aiState Space Search in ai
State Space Search in aivikas dhakane
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}FellowBuddy.com
 
Production system in ai
Production system in aiProduction system in ai
Production system in aisabin kafle
 
5.3 dynamic programming
5.3 dynamic programming5.3 dynamic programming
5.3 dynamic programmingKrish_ver2
 
Longest Common Subsequence
Longest Common SubsequenceLongest Common Subsequence
Longest Common SubsequenceKrishma Parekh
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceRamla Sheikh
 
Fuzzy Set Theory
Fuzzy Set TheoryFuzzy Set Theory
Fuzzy Set TheoryAMIT KUMAR
 

Mais procurados (20)

Planning
PlanningPlanning
Planning
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & Reasoning
 
Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AI
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
 
First order logic
First order logicFirst order logic
First order logic
 
Reasoning in AI
Reasoning in AIReasoning in AI
Reasoning in AI
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agents
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
 
Dempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th SemDempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th Sem
 
Lecture 06 production system
Lecture 06 production systemLecture 06 production system
Lecture 06 production system
 
State Space Search in ai
State Space Search in aiState Space Search in ai
State Space Search in ai
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
Production system in ai
Production system in aiProduction system in ai
Production system in ai
 
5.3 dynamic programming
5.3 dynamic programming5.3 dynamic programming
5.3 dynamic programming
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
 
Longest Common Subsequence
Longest Common SubsequenceLongest Common Subsequence
Longest Common Subsequence
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial Intelligence
 
Fuzzy Set Theory
Fuzzy Set TheoryFuzzy Set Theory
Fuzzy Set Theory
 

Destaque

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 INTELIGENCEJohnLeonard Onwuzuruigbo
 
Natural language-processing
Natural language-processingNatural language-processing
Natural language-processingHareem Naz
 
weak slot and filler structure
weak slot and filler structureweak slot and filler structure
weak slot and filler structureAmey Kerkar
 
Weak Slot and Filler Structure (by Mintoo Jakhmola LPU)
Weak Slot and Filler Structure (by Mintoo Jakhmola LPU)Weak Slot and Filler Structure (by Mintoo Jakhmola LPU)
Weak Slot and Filler Structure (by Mintoo Jakhmola LPU)Mintoo Jakhmola
 
Rule Based Architecture System
Rule Based Architecture SystemRule Based Architecture System
Rule Based Architecture SystemFirdaus Adib
 
Project Report: After Sales service of Automobiles in India
Project Report: After Sales service of Automobiles in IndiaProject Report: After Sales service of Automobiles in India
Project Report: After Sales service of Automobiles in IndiaAnkit Tripathi
 

Destaque (8)

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
 
Natural language-processing
Natural language-processingNatural language-processing
Natural language-processing
 
weak slot and filler structure
weak slot and filler structureweak slot and filler structure
weak slot and filler structure
 
Weak Slot and Filler Structure (by Mintoo Jakhmola LPU)
Weak Slot and Filler Structure (by Mintoo Jakhmola LPU)Weak Slot and Filler Structure (by Mintoo Jakhmola LPU)
Weak Slot and Filler Structure (by Mintoo Jakhmola LPU)
 
Rule Based Architecture System
Rule Based Architecture SystemRule Based Architecture System
Rule Based Architecture System
 
Utility theory
Utility theoryUtility theory
Utility theory
 
Project Report: After Sales service of Automobiles in India
Project Report: After Sales service of Automobiles in IndiaProject Report: After Sales service of Automobiles in India
Project Report: After Sales service of Automobiles in India
 
Rule Based System
Rule Based SystemRule Based System
Rule Based System
 

Semelhante a Forward Backward Chaining

I. FSSP(Progression Planner) II. BSSP(Regression Planner
I. FSSP(Progression Planner) II. BSSP(Regression PlannerI. FSSP(Progression Planner) II. BSSP(Regression Planner
I. FSSP(Progression Planner) II. BSSP(Regression Plannervikas dhakane
 
Learning set of rules
Learning set of rulesLearning set of rules
Learning set of rulesswapnac12
 
Expert System (Forward and Backward Chaining)
Expert System (Forward and Backward Chaining)Expert System (Forward and Backward Chaining)
Expert System (Forward and Backward Chaining)Sohail Ahmed
 
Production System1.pdf
Production System1.pdfProduction System1.pdf
Production System1.pdfsajidawazeer8
 
Graph 1= no massGraph 2= no massGraph 3 mass added .docx
Graph 1= no massGraph 2= no massGraph 3 mass added .docxGraph 1= no massGraph 2= no massGraph 3 mass added .docx
Graph 1= no massGraph 2= no massGraph 3 mass added .docxwhittemorelucilla
 
Power Laws: Optimizing Demand-side Strategies. Second Prize Solution
Power Laws: Optimizing Demand-side Strategies. Second Prize SolutionPower Laws: Optimizing Demand-side Strategies. Second Prize Solution
Power Laws: Optimizing Demand-side Strategies. Second Prize SolutionGuillermo Barbadillo Villanueva
 
2.Problems Problem Spaces and Search.ppt
2.Problems Problem Spaces and Search.ppt2.Problems Problem Spaces and Search.ppt
2.Problems Problem Spaces and Search.pptDr. Naushad Varish
 
New_ML_Lecture_9.ppt
New_ML_Lecture_9.pptNew_ML_Lecture_9.ppt
New_ML_Lecture_9.pptEmmaMaria6
 
Ai lecture 07 inference engine
Ai lecture 07 inference engineAi lecture 07 inference engine
Ai lecture 07 inference engineAhmad sohail Kakar
 
Project Analytics
Project AnalyticsProject Analytics
Project AnalyticsDanTrietsch
 
17 2 expert systems
17 2 expert systems17 2 expert systems
17 2 expert systemsTianlu Wang
 
Wolfram Physics - A Quick Introduction.pptx
Wolfram Physics - A Quick Introduction.pptxWolfram Physics - A Quick Introduction.pptx
Wolfram Physics - A Quick Introduction.pptxVinayak (Vin) Bhalerao
 
50134147-Knowledge-Representation-Using-Rules.ppt
50134147-Knowledge-Representation-Using-Rules.ppt50134147-Knowledge-Representation-Using-Rules.ppt
50134147-Knowledge-Representation-Using-Rules.pptssuserec53e73
 

Semelhante a Forward Backward Chaining (20)

Lab 07-sol
Lab 07-solLab 07-sol
Lab 07-sol
 
I. FSSP(Progression Planner) II. BSSP(Regression Planner
I. FSSP(Progression Planner) II. BSSP(Regression PlannerI. FSSP(Progression Planner) II. BSSP(Regression Planner
I. FSSP(Progression Planner) II. BSSP(Regression Planner
 
10.pdf
10.pdf10.pdf
10.pdf
 
Chapter 5 (final)
Chapter 5 (final)Chapter 5 (final)
Chapter 5 (final)
 
Learning set of rules
Learning set of rulesLearning set of rules
Learning set of rules
 
Expert System (Forward and Backward Chaining)
Expert System (Forward and Backward Chaining)Expert System (Forward and Backward Chaining)
Expert System (Forward and Backward Chaining)
 
Production System1.pdf
Production System1.pdfProduction System1.pdf
Production System1.pdf
 
Graph 1= no massGraph 2= no massGraph 3 mass added .docx
Graph 1= no massGraph 2= no massGraph 3 mass added .docxGraph 1= no massGraph 2= no massGraph 3 mass added .docx
Graph 1= no massGraph 2= no massGraph 3 mass added .docx
 
Power Laws: Optimizing Demand-side Strategies. Second Prize Solution
Power Laws: Optimizing Demand-side Strategies. Second Prize SolutionPower Laws: Optimizing Demand-side Strategies. Second Prize Solution
Power Laws: Optimizing Demand-side Strategies. Second Prize Solution
 
2.Problems Problem Spaces and Search.ppt
2.Problems Problem Spaces and Search.ppt2.Problems Problem Spaces and Search.ppt
2.Problems Problem Spaces and Search.ppt
 
New_ML_Lecture_9.ppt
New_ML_Lecture_9.pptNew_ML_Lecture_9.ppt
New_ML_Lecture_9.ppt
 
Ai lecture 07 inference engine
Ai lecture 07 inference engineAi lecture 07 inference engine
Ai lecture 07 inference engine
 
Project Analytics
Project AnalyticsProject Analytics
Project Analytics
 
Analyzing Performance Test Data
Analyzing Performance Test DataAnalyzing Performance Test Data
Analyzing Performance Test Data
 
Feynman.pdf
Feynman.pdfFeynman.pdf
Feynman.pdf
 
17 2 expert systems
17 2 expert systems17 2 expert systems
17 2 expert systems
 
Wolfram Physics - A Quick Introduction.pptx
Wolfram Physics - A Quick Introduction.pptxWolfram Physics - A Quick Introduction.pptx
Wolfram Physics - A Quick Introduction.pptx
 
50134147-Knowledge-Representation-Using-Rules.ppt
50134147-Knowledge-Representation-Using-Rules.ppt50134147-Knowledge-Representation-Using-Rules.ppt
50134147-Knowledge-Representation-Using-Rules.ppt
 
AI IoT data science and consumer behaviour with assortment planning , pricing...
AI IoT data science and consumer behaviour with assortment planning , pricing...AI IoT data science and consumer behaviour with assortment planning , pricing...
AI IoT data science and consumer behaviour with assortment planning , pricing...
 
Expert system
Expert systemExpert system
Expert system
 

Último

Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 

Último (20)

Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 

Forward Backward Chaining

  • 3. DEFINITION • Forward chaining is a data driven method of deriving a particular goal from a given knowledge base and set of inference rules • Inference rules are applied by matching facts to the antecedents of consequence relations in the knowledge base • The application of inference rules results in new knowledge (from the consequents of the relations matched), which is then added to the knowledge base
  • 4.
  • 5. FORWARD CHAINING (Ben Coppin) In Forward chaining, the system starts from a set of facts, and a set of rules, and tries to find a way of using those rules and facts to deduce a conclusion or come up with a suitable course of action. This is known as data-driven reasoning because the reasoning starts from a set of data and ends up at the goal, which is the conclusion.
  • 6. Forward Chaining Mechanism (Ben Coppin) When applying forward chaining, the first step is to take the facts in the fact database and see if any combination of these matches all the antecedents of one of the rules in the rule database. When all the antecedents of a rule are matched by facts in the database, then this rule is triggered. Usually, when a rule is triggered, it is then fired, which means its conclusion is added to the facts database. If the conclusion of the rule that has fired is an action or a recommendation, then the system may cause that action to take place or the recommendation to be made.
  • 8.
  • 9. Rule 4 IF on second floor AND button is pressed on first floor AND already going to third floor THEN remember to go to first floor later Let us imagine that we start with the following facts in our database: Fact 1 At first floor Fact 2 Button pressed on third floor Fact 3 Today is Tuesday
  • 10. Now the system examines the rules and finds that Facts 1 and 2 match the antecedents of Rule 3. Hence, Rule 3 fires, and its conclusion “Go to third floor” is added to the database of facts. Presumably, this results in the elevator heading toward the third floor. Note that Fact 3 was ignored altogether because it did not match the antecedents of any of the rules. Now let us imagine that the elevator is on its way to the third floor and has reached the second floor,when the button is pressed on the first floor. The fact “Button pressed on first floor” Is now added to the database, which results in Rule 4 firing.
  • 11. Now let us imagine that later in the day the facts database contains the following information: Fact 1 At first floor Fact 2 Button pressed on second floor Fact 3 Button pressed on third floor In this case, two rules are triggered—Rules 2 and 3. In such cases where there is more than one possible conclusion, conflict resolution needs to be applied to decide which rule to fire.
  • 12. Forward chaining applies a set of rules and facts to deduce whatever conclusions can be derived, which is useful when a set of facts are present, but you do not know what conclusions you are trying to prove. In some cases,forward chaining can be inefficient because it may end up proving a number of conclusions that are not currently interesting. In such cases, where a single specific conclusion is to be proved, backward chaining is more appropriate.
  • 14.
  • 15. • Suppose we have been given the following facts, a) Sun is behind the clouds. b) Air is very heavy and cool. • Problem: Using Forward chaining try to conclude that there are chances of rain.
  • 16.
  • 17.
  • 18.
  • 20. CONFLICT RESOLUTION (Ben Coppin) In a situation where more than one conclusion can be deduced from a set of facts, there are a number of possible ways to decide which rule to fire (i.e., which conclusion to use or which course of action to take).
  • 21. CONFLICT RESOLUTION • Example: IF you’re bored AND you’ve no cash THEN go to a friend’s place. IF you’re bored AND You’ve no cash THEN go to a park.
  • 22. CONFLICT RESOLUTION STRATEGIES • We have different resolution strategies: 1) Fire the first rule in sequence. 2) Assign rule priorities (by importance). 3) More specific rules are preferred over more general rules.(e.g. a rule having 5 IF’s(handle more info) will be preferred over one having 3 IF’s) 4) Prefer rules whose premises are added more recently (time stamping) 5) Parallel strategy (create view points)
  • 25.
  • 26. • An alternative method is the longest-matching strategy. This method involves firing the conclusion that was derived from the longest rule. • For example: IF patient has pain THEN prescribe painkiller IF patient has chest pain AND patient is over 60 AND patient has history of heart conditions THEN take to emergency room Here, if all the antecedents of the second rule match, then this rule’s conclusion should be fired rather than the conclusion of the first rule because it is a more specific match.
  • 27. A further method for conflict resolution is to fire the rule that has matched the facts most recently added to the database. In each case, it may be that the system fires one rule and then stops (as in medical diagnosis), but in many cases, the system simply needs to choose a suitable ordering for the rules (as when controlling an elevator) because each rule that matches the facts needs to be fired at some point.
  • 29. DEFINITION • Backward chaining is a goal driven method of deriving a particular goal from a given knowledge base and set of inference rules • Inference rules are applied by matching the goal of the search to the consequents of the relations stored in the knowledge base
  • 30.
  • 31. Definition (Ben Coppin) In backward chaining, we start from a conclusion, which is the hypothesis we wish to prove, and we aim to show how that conclusion can be reached from the rules and facts in the database. The conclusion we are aiming to prove is called a goal, and so reasoning in this way is known as goal-driven reasoning.
  • 32. Backward Chaining Mechanism (Ben Coppin) Backward chaining starts with the goal state, which is the set of conditions the agent wishes to achieve in carrying out its plan. It now examines this state and sees what actions could lead to it. For example, if the goal state involves a block being on a table, then one possible action would be to place that block on the table. This action might not be possible from the start state, and so further actions need to be added before this action in order to reach it from the start state. In this way, a plan can be formulated starting from the goal and working back toward the start state.
  • 33. The benefit in this method is particularly clear in situations where the first state allows a very large number of possible actions. In this kind of situation, it can be very inefficient to attempt to formulate a plan using forward chaining because it involves examining every possible action, without paying any attention to which action might be the best one to lead to the goal state. Backward chaining ensures that each action that is taken is one that will definitely lead to the goal, and in many cases this will make the planning process far more efficient.
  • 35.
  • 36. • Suppose we have been given the following facts, a) Sun is behind the clouds. b) Air is very heavy and cool. • Problem: Using Backward chaining try to conclude that there are chances of rain.
  • 37.
  • 38.
  • 39.
  • 40. COMPARING FORWARD AND BACKWARD CHAINING BEN COPPIN
  • 41. Let us use an example to compare forward and backward chaining. In this case, we will revert to our use of symbols for logical statements, in order to clarify the explanation, but we could equally well be using rules about elevators or the weather.