SlideShare a Scribd company logo
1 of 5
FORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN
ARTIFICIAL INTELIGENCE
BY
Johnleonard Onwuzuruigbo
INTRODUCTION
The inference engine is a computerprogram designedto produce
reasoning on rules. In order to produce reasoning, it should be based on
logic.With logic,the engine is able to generate new information from the
knowledge contained in the rule base and data to be processed.The engine
has two ways to run: batch or conversational. In batch, the expert system
has all the necessary data to process from the beginning. For the user, the
program works as a classicalprogram:he provides data and receives
results immediately. Reasoning is invisible. The conversational method
becomes necessary when the developer knows he cannot ask the user
for all the necessary data at the start, the problem being too complex.The
software must "invent" the way to solve the problem, request the missing
data from the user, gradually approaching the goal as quickly as possible.
The result gives the impressionof a dialogue led by an expert. To guide a
dialogue, the engine may have several levels of sophistication: "forward
chaining" and "backward chaining".
Forward Chaining System
The standard definition of a forward-chaining
system states that the system operates by
repeating the following sequence of operations
as shown in the diagram.
 Examine the rules to find one who's IF
part is satisfied by the current contents of
Working Memory.
 Fire the rule by adding to Working
Memory the facts that are specified in the
rules THEN part.
(The THEN part may perform other actions as
well, but that can also be ignored for now.)
This control cycle continues until no rules have satisfied IF parts.
An inference engine using forward chaining searches the inference rules
until it finds one where the IF clause is known to be true. When found it can
conclude,or infer, the THEN clause, resulting in the addition of new
information to its dataset. In other words, it starts with some facts and
applies rules to find all possible conclusions.Therefore,forward chaining
system is also known as Data Driven system.
In a ForwardChainingsystem:
Process of moving from the “if” patterns to the “then “patterns.
Wheneveran “if” pattern is observed to match a Fact: the antecedentis
satisfied.
Wheneverthe entire “if” patterns of a rule are satisfied ---> the rule is
triggered.
A triggered rule establishes a new Fact ---> it is fired
Example of a Forwardchainingsystem process
Rules
R1: IF hot AND smoky THEN ADD fire
R2: IF alarm_beeps THEN ADD smoky
R3: If fire THEN ADD switch_on_sprinklers
Facts
F1: alarm_beeps [Given]
F2: hot [Given]
F3: smoky [from F1 by R2]
F4: fire [from F2, F4 by R1]
F5: switch_on_sprinklers [from F4 by R3]
In a forward chaining system:Facts are held in a working memory
Condition-action, rules representactions to take when specifiedfacts occur
in working memory. Typically the actions involve adding or deleting facts
from working memory.
Properties of forward chaining System
i. Note that all rules which can fire do fire.
ii. Set of rules that can fire is known as conflict set.
iii. Decisionabout which rule to fire — conflictresolution.
BackwardChainingSystem
Backward-chaining systems try to satisfy
the goals in the goal stack. They do this by
finding rules that can conclude the
information needed by the goal, and trying
to make the If parts of those rules
satisfied.
1. Check the conclusions of the rules to
find all rules that can satisfy the top goal
on the stack.
2. Processthese rules one at a time:
a. Evaluate the conditions in the rules IF
part one at a time:
 If the condition is currently unknown
(if there is not enough information
currently known to determine whether the condition is satisfied)push
a goal to make that condition known, and recursively invoke the
system.
 If the condition is known to be unsatisfied then the system continues
with the loop at Step 2.
 If it was not possibleto determine whether the condition was satisfied
then system continues with the loop at Step 2.
b. If all the conditions in the selectedrule are satisfied,add to Working
Memory the facts specifiedin the THEN part of the rule, pop the goal off
the stack, and return from this invocation of the system.
The system terminates with success when the goal stack is empty.
In a Backward chaining system
Form a hypothesis.
Use the antecedent-consequentrules to work backward towards
hypothesis-supporting Facts.
An inference engine using backward chaining would search the inference
rules until it finds one which has a THEN clause that matches a desired
goal. If the IF clause of that inference rule is not known to be true, then it is
added to the list of goals (in orderfor goal to be confirmed it must also
provide data that confirms this new rule). In other words, this approach
starts with the desired conclusionand works backward to find supporting
facts. Therefore,it is also known as Goal-Driven System.
In a Backward chaining system:Same rules/facts may be processed
differently,using backward chaining interpreter.
Backward chaining means reasoning from goals back to facts. The idea is
that this focusesthe search.
Checking hypothesis
“Should I switch the sprinklers on?”
Example of Backwardchainingsystem
Hypothesis (“Should I switch the sprinklers on?”)
Rules:
R1: IF hot AND smoky THEN fire
R2: IF alarm_beeps THEN smoky
R3: If fire THEN switch_on_sprinklers
Facts:
F1: hot
F2: alarm_beeps
Goal:
Switch on sprinklers
Comparisonbetween Forward and backward Chain system
i. The exploration of knowledge has differentmechanisms in forward
and backward chaining. Backward chaining is more focusedand tries
to avoid exploring unnecessary paths of reasoning. Forward chaining,
on the other hand is like an exhaustive search (Forward chaining goes
to the extreme to get the all rules fired).
ii. Backward chaining systems are good for diagnostic and classification
tasks, but they are not good for planning, design,process monitoring,
and quite a few other tasks. Forward chaining systems can handle all
these tasks.
iii. Forward chaining system, includes writing rules to manage sub goals.
Whereas,backward chaining systems automatically manage sub
goals .
iv.Lots of output Hypothesis + Lots of data up front => Use Forward
Chaining Fewer output Hypothesis + Must query for data=>
v. In backward chaining, the search is goal directed,so rules can be
applied that are necessaryto achieve the goal. But in forward chaining
the whole process is not directed towards goal, so when to stop the
rules in not known.
vi.If the facts that has to be established lead to a large number of
conclusion, but the number of ways to reach that particular conclusion
is small, then there is more information out rather than information in,
then backward chaining should be used.On the other hand, if the
number of ways to reach a particular conclusion is large, but the
number of conclusions likely to be reach using the facts is small, then
forward chaining is preferred.
Finally
The only way to know how a rule will behave is to profile it and understand
the business case. Many people make the mistake of thinking a rule engine
will magically solve their problems. Writing high performance rules is not
easy or intuitive. The bestway to build efficientapplications using rule
engines is to take the time to learn how each approach works and use
both techniques. Although it increases the learning curve, the choice
between forward and backward chaining isn't something that can be
summed up in 2-3 sentences.It's crucial to considerthe intent of the rule,
size of the dataset and performancerequirements.

More Related Content

What's hot

Rule Based Architecture System
Rule Based Architecture SystemRule Based Architecture System
Rule Based Architecture SystemFirdaus Adib
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rulesHarini Balamurugan
 
Control Strategies in AI
Control Strategies in AI Control Strategies in AI
Control Strategies in AI Bharat Bhushan
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithmMegha V
 
Version spaces
Version spacesVersion spaces
Version spacesGekkietje
 
Local search algorithm
Local search algorithmLocal search algorithm
Local search algorithmMegha Sharma
 
AI simple search strategies
AI simple search strategiesAI simple search strategies
AI simple search strategiesRenas Rekany
 
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 algorithmvikas dhakane
 
Expert system neural fuzzy system
Expert system neural fuzzy systemExpert system neural fuzzy system
Expert system neural fuzzy systemJamil S. Alagha
 
Consistency in Distributed Systems
Consistency in Distributed SystemsConsistency in Distributed Systems
Consistency in Distributed SystemsShane Johnson
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AIvikas dhakane
 
First order predicate logic (fopl)
First order predicate logic (fopl)First order predicate logic (fopl)
First order predicate logic (fopl)chauhankapil
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed systemSunita Sahu
 
2. forward chaining and backward chaining
2. forward chaining and backward chaining2. forward chaining and backward chaining
2. forward chaining and backward chainingmonircse2
 

What's hot (20)

Rule Based Architecture System
Rule Based Architecture SystemRule Based Architecture System
Rule Based Architecture System
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rules
 
Control Strategies in AI
Control Strategies in AI Control Strategies in AI
Control Strategies in AI
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Agent architectures
Agent architecturesAgent architectures
Agent architectures
 
Version spaces
Version spacesVersion spaces
Version spaces
 
Local search algorithm
Local search algorithmLocal search algorithm
Local search algorithm
 
AI simple search strategies
AI simple search strategiesAI simple search strategies
AI simple search strategies
 
Frames
FramesFrames
Frames
 
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
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
 
Expert system neural fuzzy system
Expert system neural fuzzy systemExpert system neural fuzzy system
Expert system neural fuzzy system
 
Consistency in Distributed Systems
Consistency in Distributed SystemsConsistency in Distributed Systems
Consistency in Distributed Systems
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
 
Predicate logic
 Predicate logic Predicate logic
Predicate logic
 
First order predicate logic (fopl)
First order predicate logic (fopl)First order predicate logic (fopl)
First order predicate logic (fopl)
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Script
ScriptScript
Script
 
Forward Backward Chaining
Forward Backward ChainingForward Backward Chaining
Forward Backward Chaining
 
2. forward chaining and backward chaining
2. forward chaining and backward chaining2. forward chaining and backward chaining
2. forward chaining and backward chaining
 

Similar to FORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN ARTIFICIAL INTELIGENCE

Meta Machine Learning: Hyperparameter Optimization
Meta Machine Learning: Hyperparameter OptimizationMeta Machine Learning: Hyperparameter Optimization
Meta Machine Learning: Hyperparameter OptimizationPriyatham Bollimpalli
 
Production System1.pdf
Production System1.pdfProduction System1.pdf
Production System1.pdfsajidawazeer8
 
17 2 expert systems
17 2 expert systems17 2 expert systems
17 2 expert systemsTianlu Wang
 
Expert System With Python -1
Expert System With Python -1Expert System With Python -1
Expert System With Python -1Ahmad Hussein
 
50134147-Knowledge-Representation-Using-Rules.ppt
50134147-Knowledge-Representation-Using-Rules.ppt50134147-Knowledge-Representation-Using-Rules.ppt
50134147-Knowledge-Representation-Using-Rules.pptssuserec53e73
 
Coordinated Multi-Agent Control Utilizing Deep Reinforcement Learning
Coordinated Multi-Agent Control Utilizing Deep Reinforcement LearningCoordinated Multi-Agent Control Utilizing Deep Reinforcement Learning
Coordinated Multi-Agent Control Utilizing Deep Reinforcement LearningAlex Gao
 
machine learning
machine learningmachine learning
machine learningMounisha A
 
Predictive job scheduling in a connection limited system using parallel genet...
Predictive job scheduling in a connection limited system using parallel genet...Predictive job scheduling in a connection limited system using parallel genet...
Predictive job scheduling in a connection limited system using parallel genet...Mumbai Academisc
 
End-to-End Machine Learning Project
End-to-End Machine Learning ProjectEnd-to-End Machine Learning Project
End-to-End Machine Learning ProjectEng Teong Cheah
 
NEXT- A System for Real-World Development, Evaluation, and Application of Act...
NEXT- A System for Real-World Development, Evaluation, and Application of Act...NEXT- A System for Real-World Development, Evaluation, and Application of Act...
NEXT- A System for Real-World Development, Evaluation, and Application of Act...Nicholas Glattard
 
Artificial Intelligence for Automated Decision Support Project
Artificial Intelligence for Automated Decision Support ProjectArtificial Intelligence for Automated Decision Support Project
Artificial Intelligence for Automated Decision Support ProjectValerii Klymchuk
 
Efficient instant fuzzy search with proximity ranking
Efficient instant fuzzy search with proximity rankingEfficient instant fuzzy search with proximity ranking
Efficient instant fuzzy search with proximity rankingShakas Technologies
 

Similar to FORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN ARTIFICIAL INTELIGENCE (20)

AI PPT.pptx
AI PPT.pptxAI PPT.pptx
AI PPT.pptx
 
5.11 expert system
5.11 expert system5.11 expert system
5.11 expert system
 
Meta Machine Learning: Hyperparameter Optimization
Meta Machine Learning: Hyperparameter OptimizationMeta Machine Learning: Hyperparameter Optimization
Meta Machine Learning: Hyperparameter Optimization
 
Production System1.pdf
Production System1.pdfProduction System1.pdf
Production System1.pdf
 
17 2 expert systems
17 2 expert systems17 2 expert systems
17 2 expert systems
 
Expert System With Python -1
Expert System With Python -1Expert System With Python -1
Expert System With Python -1
 
50134147-Knowledge-Representation-Using-Rules.ppt
50134147-Knowledge-Representation-Using-Rules.ppt50134147-Knowledge-Representation-Using-Rules.ppt
50134147-Knowledge-Representation-Using-Rules.ppt
 
Coordinated Multi-Agent Control Utilizing Deep Reinforcement Learning
Coordinated Multi-Agent Control Utilizing Deep Reinforcement LearningCoordinated Multi-Agent Control Utilizing Deep Reinforcement Learning
Coordinated Multi-Agent Control Utilizing Deep Reinforcement Learning
 
Lecture 6 expert systems
Lecture 6   expert systemsLecture 6   expert systems
Lecture 6 expert systems
 
Chapter 5 (final)
Chapter 5 (final)Chapter 5 (final)
Chapter 5 (final)
 
machine learning
machine learningmachine learning
machine learning
 
Expert Systems
Expert SystemsExpert Systems
Expert Systems
 
Predictive job scheduling in a connection limited system using parallel genet...
Predictive job scheduling in a connection limited system using parallel genet...Predictive job scheduling in a connection limited system using parallel genet...
Predictive job scheduling in a connection limited system using parallel genet...
 
End-to-End Machine Learning Project
End-to-End Machine Learning ProjectEnd-to-End Machine Learning Project
End-to-End Machine Learning Project
 
Production System
Production SystemProduction System
Production System
 
NEXT- A System for Real-World Development, Evaluation, and Application of Act...
NEXT- A System for Real-World Development, Evaluation, and Application of Act...NEXT- A System for Real-World Development, Evaluation, and Application of Act...
NEXT- A System for Real-World Development, Evaluation, and Application of Act...
 
Artificial Intelligence for Automated Decision Support Project
Artificial Intelligence for Automated Decision Support ProjectArtificial Intelligence for Automated Decision Support Project
Artificial Intelligence for Automated Decision Support Project
 
Efficient instant fuzzy search with proximity ranking
Efficient instant fuzzy search with proximity rankingEfficient instant fuzzy search with proximity ranking
Efficient instant fuzzy search with proximity ranking
 
Unit 2
Unit 2Unit 2
Unit 2
 
10.pdf
10.pdf10.pdf
10.pdf
 

Recently uploaded

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 

Recently uploaded (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 

FORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN ARTIFICIAL INTELIGENCE

  • 1. FORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN ARTIFICIAL INTELIGENCE BY Johnleonard Onwuzuruigbo INTRODUCTION The inference engine is a computerprogram designedto produce reasoning on rules. In order to produce reasoning, it should be based on logic.With logic,the engine is able to generate new information from the knowledge contained in the rule base and data to be processed.The engine has two ways to run: batch or conversational. In batch, the expert system has all the necessary data to process from the beginning. For the user, the program works as a classicalprogram:he provides data and receives results immediately. Reasoning is invisible. The conversational method becomes necessary when the developer knows he cannot ask the user for all the necessary data at the start, the problem being too complex.The software must "invent" the way to solve the problem, request the missing data from the user, gradually approaching the goal as quickly as possible. The result gives the impressionof a dialogue led by an expert. To guide a dialogue, the engine may have several levels of sophistication: "forward chaining" and "backward chaining". Forward Chaining System The standard definition of a forward-chaining system states that the system operates by repeating the following sequence of operations as shown in the diagram.  Examine the rules to find one who's IF part is satisfied by the current contents of Working Memory.  Fire the rule by adding to Working Memory the facts that are specified in the rules THEN part. (The THEN part may perform other actions as well, but that can also be ignored for now.) This control cycle continues until no rules have satisfied IF parts.
  • 2. An inference engine using forward chaining searches the inference rules until it finds one where the IF clause is known to be true. When found it can conclude,or infer, the THEN clause, resulting in the addition of new information to its dataset. In other words, it starts with some facts and applies rules to find all possible conclusions.Therefore,forward chaining system is also known as Data Driven system. In a ForwardChainingsystem: Process of moving from the “if” patterns to the “then “patterns. Wheneveran “if” pattern is observed to match a Fact: the antecedentis satisfied. Wheneverthe entire “if” patterns of a rule are satisfied ---> the rule is triggered. A triggered rule establishes a new Fact ---> it is fired Example of a Forwardchainingsystem process Rules R1: IF hot AND smoky THEN ADD fire R2: IF alarm_beeps THEN ADD smoky R3: If fire THEN ADD switch_on_sprinklers Facts F1: alarm_beeps [Given] F2: hot [Given] F3: smoky [from F1 by R2] F4: fire [from F2, F4 by R1] F5: switch_on_sprinklers [from F4 by R3] In a forward chaining system:Facts are held in a working memory Condition-action, rules representactions to take when specifiedfacts occur in working memory. Typically the actions involve adding or deleting facts from working memory. Properties of forward chaining System i. Note that all rules which can fire do fire. ii. Set of rules that can fire is known as conflict set. iii. Decisionabout which rule to fire — conflictresolution. BackwardChainingSystem
  • 3. Backward-chaining systems try to satisfy the goals in the goal stack. They do this by finding rules that can conclude the information needed by the goal, and trying to make the If parts of those rules satisfied. 1. Check the conclusions of the rules to find all rules that can satisfy the top goal on the stack. 2. Processthese rules one at a time: a. Evaluate the conditions in the rules IF part one at a time:  If the condition is currently unknown (if there is not enough information currently known to determine whether the condition is satisfied)push a goal to make that condition known, and recursively invoke the system.  If the condition is known to be unsatisfied then the system continues with the loop at Step 2.  If it was not possibleto determine whether the condition was satisfied then system continues with the loop at Step 2. b. If all the conditions in the selectedrule are satisfied,add to Working Memory the facts specifiedin the THEN part of the rule, pop the goal off the stack, and return from this invocation of the system. The system terminates with success when the goal stack is empty. In a Backward chaining system Form a hypothesis. Use the antecedent-consequentrules to work backward towards hypothesis-supporting Facts. An inference engine using backward chaining would search the inference rules until it finds one which has a THEN clause that matches a desired goal. If the IF clause of that inference rule is not known to be true, then it is added to the list of goals (in orderfor goal to be confirmed it must also provide data that confirms this new rule). In other words, this approach starts with the desired conclusionand works backward to find supporting facts. Therefore,it is also known as Goal-Driven System.
  • 4. In a Backward chaining system:Same rules/facts may be processed differently,using backward chaining interpreter. Backward chaining means reasoning from goals back to facts. The idea is that this focusesthe search. Checking hypothesis “Should I switch the sprinklers on?” Example of Backwardchainingsystem Hypothesis (“Should I switch the sprinklers on?”) Rules: R1: IF hot AND smoky THEN fire R2: IF alarm_beeps THEN smoky R3: If fire THEN switch_on_sprinklers Facts: F1: hot F2: alarm_beeps Goal: Switch on sprinklers Comparisonbetween Forward and backward Chain system i. The exploration of knowledge has differentmechanisms in forward and backward chaining. Backward chaining is more focusedand tries to avoid exploring unnecessary paths of reasoning. Forward chaining, on the other hand is like an exhaustive search (Forward chaining goes to the extreme to get the all rules fired). ii. Backward chaining systems are good for diagnostic and classification tasks, but they are not good for planning, design,process monitoring, and quite a few other tasks. Forward chaining systems can handle all these tasks. iii. Forward chaining system, includes writing rules to manage sub goals. Whereas,backward chaining systems automatically manage sub goals . iv.Lots of output Hypothesis + Lots of data up front => Use Forward Chaining Fewer output Hypothesis + Must query for data=>
  • 5. v. In backward chaining, the search is goal directed,so rules can be applied that are necessaryto achieve the goal. But in forward chaining the whole process is not directed towards goal, so when to stop the rules in not known. vi.If the facts that has to be established lead to a large number of conclusion, but the number of ways to reach that particular conclusion is small, then there is more information out rather than information in, then backward chaining should be used.On the other hand, if the number of ways to reach a particular conclusion is large, but the number of conclusions likely to be reach using the facts is small, then forward chaining is preferred. Finally The only way to know how a rule will behave is to profile it and understand the business case. Many people make the mistake of thinking a rule engine will magically solve their problems. Writing high performance rules is not easy or intuitive. The bestway to build efficientapplications using rule engines is to take the time to learn how each approach works and use both techniques. Although it increases the learning curve, the choice between forward and backward chaining isn't something that can be summed up in 2-3 sentences.It's crucial to considerthe intent of the rule, size of the dataset and performancerequirements.