SlideShare a Scribd company logo
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 Backward Chaining
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
Forward Backward Chaining
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”
Forward Backward Chaining
• 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.
Forward Backward Chaining
Forward Backward Chaining
Forward Backward Chaining
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
Forward Backward Chaining
• 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
Forward Backward Chaining
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”
Forward Backward Chaining
• 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.
Forward Backward Chaining
Forward Backward Chaining
Forward Backward Chaining
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
Ad

More Related Content

What's hot (20)

Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial Intelligence
Ramla Sheikh
 
2. forward chaining and backward chaining
2. forward chaining and backward chaining2. forward chaining and backward chaining
2. forward chaining and backward chaining
monircse2
 
Production System in AI
Production System in AIProduction System in AI
Production System in AI
Bharat Bhushan
 
search strategies in artificial intelligence
search strategies in artificial intelligencesearch strategies in artificial intelligence
search strategies in artificial intelligence
Hanif Ullah (Gold Medalist)
 
Planning
PlanningPlanning
Planning
ahmad bassiouny
 
Conceptual dependency
Conceptual dependencyConceptual dependency
Conceptual dependency
Jismy .K.Jose
 
Learning in AI
Learning in AILearning in AI
Learning in AI
Minakshi Atre
 
I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithm
vikas dhakane
 
Logics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiLogics for non monotonic reasoning-ai
Logics for non monotonic reasoning-ai
ShaishavShah8
 
Means End Analysis (MEA) in Artificial.pptx
Means End Analysis (MEA) in Artificial.pptxMeans End Analysis (MEA) in Artificial.pptx
Means End Analysis (MEA) in Artificial.pptx
suchita74
 
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdfUNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
JenishaR1
 
Rule based system
Rule based systemRule based system
Rule based system
Dr. C.V. Suresh Babu
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & Reasoning
Sajid Marwat
 
Artificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsArtificial intelligence- Logic Agents
Artificial intelligence- Logic Agents
Nuruzzaman Milon
 
Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence
Yasir Khan
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
FellowBuddy.com
 
Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.ppt
karthikaparthasarath
 
Control Strategies in AI
Control Strategies in AI Control Strategies in AI
Control Strategies in AI
Bharat Bhushan
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
Amey Kerkar
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rules
Harini Balamurugan
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial Intelligence
Ramla Sheikh
 
2. forward chaining and backward chaining
2. forward chaining and backward chaining2. forward chaining and backward chaining
2. forward chaining and backward chaining
monircse2
 
Production System in AI
Production System in AIProduction System in AI
Production System in AI
Bharat Bhushan
 
Conceptual dependency
Conceptual dependencyConceptual dependency
Conceptual dependency
Jismy .K.Jose
 
I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithm
vikas dhakane
 
Logics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiLogics for non monotonic reasoning-ai
Logics for non monotonic reasoning-ai
ShaishavShah8
 
Means End Analysis (MEA) in Artificial.pptx
Means End Analysis (MEA) in Artificial.pptxMeans End Analysis (MEA) in Artificial.pptx
Means End Analysis (MEA) in Artificial.pptx
suchita74
 
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdfUNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
JenishaR1
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & Reasoning
Sajid Marwat
 
Artificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsArtificial intelligence- Logic Agents
Artificial intelligence- Logic Agents
Nuruzzaman Milon
 
Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence
Yasir Khan
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
FellowBuddy.com
 
Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.ppt
karthikaparthasarath
 
Control Strategies in AI
Control Strategies in AI Control Strategies in AI
Control Strategies in AI
Bharat Bhushan
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
Amey Kerkar
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rules
Harini Balamurugan
 

Viewers also liked (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
JohnLeonard Onwuzuruigbo
 
Natural language-processing
Natural language-processingNatural language-processing
Natural language-processing
Hareem Naz
 
weak slot and filler structure
weak slot and filler structureweak slot and filler structure
weak slot and filler structure
Amey 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 System
Firdaus Adib
 
Utility theory
Utility theoryUtility theory
Utility theory
lailamemdani
 
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
Ankit Tripathi
 
Rule Based System
Rule Based SystemRule Based System
Rule Based System
Suresh Sambandam
 
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
JohnLeonard Onwuzuruigbo
 
Natural language-processing
Natural language-processingNatural language-processing
Natural language-processing
Hareem Naz
 
weak slot and filler structure
weak slot and filler structureweak slot and filler structure
weak slot and filler structure
Amey 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 System
Firdaus 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 India
Ankit Tripathi
 
Ad

Similar to Forward Backward Chaining (20)

Lab 07-sol
Lab 07-solLab 07-sol
Lab 07-sol
Ahmad sohail Kakar
 
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
vikas dhakane
 
10.pdf
10.pdf10.pdf
10.pdf
abdulmawlanajih1
 
Chapter 5 (final)
Chapter 5 (final)Chapter 5 (final)
Chapter 5 (final)
Nateshwar Kamlesh
 
Learning set of rules
Learning set of rulesLearning set of rules
Learning set of rules
swapnac12
 
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.pdf
sajidawazeer8
 
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
whittemorelucilla
 
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
Guillermo 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.ppt
Dr. Naushad Varish
 
New_ML_Lecture_9.ppt
New_ML_Lecture_9.pptNew_ML_Lecture_9.ppt
New_ML_Lecture_9.ppt
EmmaMaria6
 
Ai lecture 07 inference engine
Ai lecture 07 inference engineAi lecture 07 inference engine
Ai lecture 07 inference engine
Ahmad sohail Kakar
 
Project Analytics
Project AnalyticsProject Analytics
Project Analytics
DanTrietsch
 
Analyzing Performance Test Data
Analyzing Performance Test DataAnalyzing Performance Test Data
Analyzing Performance Test Data
Optimus Information Inc.
 
Feynman.pdf
Feynman.pdfFeynman.pdf
Feynman.pdf
kirti617012
 
17 2 expert systems
17 2 expert systems17 2 expert systems
17 2 expert systems
Tianlu Wang
 
Wolfram Physics - A Quick Introduction.pptx
Wolfram Physics - A Quick Introduction.pptxWolfram Physics - A Quick Introduction.pptx
Wolfram Physics - A Quick Introduction.pptx
Vinayak (Vin) Bhalerao
 
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...
Sandeep Sharma IIMK Smart City,IoT,Bigdata,Cloud,BI,DW
 
Chapter 02-artificialPROBLEM SOLVING.ppt
Chapter 02-artificialPROBLEM SOLVING.pptChapter 02-artificialPROBLEM SOLVING.ppt
Chapter 02-artificialPROBLEM SOLVING.ppt
jenyisblessed
 
Expert system
Expert systemExpert system
Expert system
Sagar Sharma
 
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
vikas dhakane
 
Learning set of rules
Learning set of rulesLearning set of rules
Learning set of rules
swapnac12
 
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.pdf
sajidawazeer8
 
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
whittemorelucilla
 
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
Guillermo 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.ppt
Dr. Naushad Varish
 
New_ML_Lecture_9.ppt
New_ML_Lecture_9.pptNew_ML_Lecture_9.ppt
New_ML_Lecture_9.ppt
EmmaMaria6
 
Ai lecture 07 inference engine
Ai lecture 07 inference engineAi lecture 07 inference engine
Ai lecture 07 inference engine
Ahmad sohail Kakar
 
Project Analytics
Project AnalyticsProject Analytics
Project Analytics
DanTrietsch
 
17 2 expert systems
17 2 expert systems17 2 expert systems
17 2 expert systems
Tianlu Wang
 
Wolfram Physics - A Quick Introduction.pptx
Wolfram Physics - A Quick Introduction.pptxWolfram Physics - A Quick Introduction.pptx
Wolfram Physics - A Quick Introduction.pptx
Vinayak (Vin) Bhalerao
 
Chapter 02-artificialPROBLEM SOLVING.ppt
Chapter 02-artificialPROBLEM SOLVING.pptChapter 02-artificialPROBLEM SOLVING.ppt
Chapter 02-artificialPROBLEM SOLVING.ppt
jenyisblessed
 
Ad

Recently uploaded (20)

One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-26-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-26-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-26-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-26-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Open Access: Revamping Library Learning Resources.
Open Access: Revamping Library Learning Resources.Open Access: Revamping Library Learning Resources.
Open Access: Revamping Library Learning Resources.
Rishi Bankim Chandra Evening College, Naihati, North 24 Parganas, West Bengal, India
 
Diabetic neuropathy peripheral autonomic
Diabetic neuropathy peripheral autonomicDiabetic neuropathy peripheral autonomic
Diabetic neuropathy peripheral autonomic
Pankaj Patawari
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Unit 5: Dividend Decisions and its theories
Unit 5: Dividend Decisions and its theoriesUnit 5: Dividend Decisions and its theories
Unit 5: Dividend Decisions and its theories
bharath321164
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Fundamentals of PR: Wk 4 - Strategic Communications
Fundamentals of PR: Wk 4 - Strategic CommunicationsFundamentals of PR: Wk 4 - Strategic Communications
Fundamentals of PR: Wk 4 - Strategic Communications
Jordan Williams
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Diabetic neuropathy peripheral autonomic
Diabetic neuropathy peripheral autonomicDiabetic neuropathy peripheral autonomic
Diabetic neuropathy peripheral autonomic
Pankaj Patawari
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Unit 5: Dividend Decisions and its theories
Unit 5: Dividend Decisions and its theoriesUnit 5: Dividend Decisions and its theories
Unit 5: Dividend Decisions and its theories
bharath321164
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Fundamentals of PR: Wk 4 - Strategic Communications
Fundamentals of PR: Wk 4 - Strategic CommunicationsFundamentals of PR: Wk 4 - Strategic Communications
Fundamentals of PR: Wk 4 - Strategic Communications
Jordan Williams
 

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
  • 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.
  • 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.
  • 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.
  • 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)
  • 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
  • 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.
  • 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.
  • 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.