SlideShare a Scribd company logo
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

N queen problem
N queen problemN queen problem
N queen problem
Ridhima Chowdhury
 
Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2
DigiGurukul
 
AI 6 | Adversarial Search
AI 6 | Adversarial SearchAI 6 | Adversarial Search
AI 6 | Adversarial Search
Mohammad Imam Hossain
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptx
kitsenthilkumarcse
 
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
 
Artificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsArtificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsNuruzzaman Milon
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction Problem
Mohammad Imam Hossain
 
Ai lab manual
Ai lab manualAi lab manual
Ai lab manual
Shipra Swati
 
Simulated Annealing
Simulated AnnealingSimulated Annealing
Simulated Annealing
Joy Dutta
 
Unification and Lifting
Unification and LiftingUnification and Lifting
Unification and Lifting
Megha Sharma
 
Logics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiLogics for non monotonic reasoning-ai
Logics for non monotonic reasoning-ai
ShaishavShah8
 
Uncertainty in AI
Uncertainty in AIUncertainty in AI
Uncertainty in AI
Amruth Veerabhadraiah
 
Classical Planning
Classical PlanningClassical Planning
Classical Planning
ahmad bassiouny
 
AI Propositional logic
AI Propositional logicAI Propositional logic
AI Propositional logic
SURBHI SAROHA
 
AI 5 | Local Search
AI 5 | Local SearchAI 5 | Local Search
AI 5 | Local Search
Mohammad Imam Hossain
 
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
Asst.prof M.Gokilavani
 
Fuzzy logic in approximate Reasoning
Fuzzy logic in approximate ReasoningFuzzy logic in approximate Reasoning
Fuzzy logic in approximate Reasoning
Hoàng Đức
 
Lecture 06 production system
Lecture 06 production systemLecture 06 production system
Lecture 06 production system
Hema Kashyap
 

What's hot (20)

N queen problem
N queen problemN queen problem
N queen problem
 
Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2
 
AI 6 | Adversarial Search
AI 6 | Adversarial SearchAI 6 | Adversarial Search
AI 6 | Adversarial Search
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptx
 
Expert System (Forward and Backward Chaining)
Expert System (Forward and Backward Chaining)Expert System (Forward and Backward Chaining)
Expert System (Forward and Backward Chaining)
 
Artificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsArtificial intelligence- Logic Agents
Artificial intelligence- Logic Agents
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction Problem
 
Ai lab manual
Ai lab manualAi lab manual
Ai lab manual
 
Simulated Annealing
Simulated AnnealingSimulated Annealing
Simulated Annealing
 
Unification and Lifting
Unification and LiftingUnification and Lifting
Unification and Lifting
 
Logics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiLogics for non monotonic reasoning-ai
Logics for non monotonic reasoning-ai
 
Uncertainty in AI
Uncertainty in AIUncertainty in AI
Uncertainty in AI
 
Classical Planning
Classical PlanningClassical Planning
Classical Planning
 
AI Propositional logic
AI Propositional logicAI Propositional logic
AI Propositional logic
 
AI 5 | Local Search
AI 5 | Local SearchAI 5 | Local Search
AI 5 | Local Search
 
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
 
Fuzzy logic in approximate Reasoning
Fuzzy logic in approximate ReasoningFuzzy logic in approximate Reasoning
Fuzzy logic in approximate Reasoning
 
Lecture 06 production system
Lecture 06 production systemLecture 06 production system
Lecture 06 production system
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
Ai 7
Ai 7Ai 7
Ai 7
 

Similar to FORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN ARTIFICIAL INTELIGENCE

Rule based system
Rule based systemRule based system
Rule based system
Dr. C.V. Suresh Babu
 
AI PPT.pptx
AI PPT.pptxAI PPT.pptx
AI PPT.pptx
TheMusicFever
 
5.11 expert system
5.11 expert system5.11 expert system
5.11 expert system
Moshikur Rahman
 
Meta Machine Learning: Hyperparameter Optimization
Meta Machine Learning: Hyperparameter OptimizationMeta Machine Learning: Hyperparameter Optimization
Meta Machine Learning: Hyperparameter Optimization
Priyatham Bollimpalli
 
Production System1.pdf
Production System1.pdfProduction System1.pdf
Production System1.pdf
sajidawazeer8
 
17 2 expert systems
17 2 expert systems17 2 expert systems
17 2 expert systems
Tianlu Wang
 
Expert System With Python -1
Expert System With Python -1Expert System With Python -1
Expert System With Python -1
Ahmad Hussein
 
50134147-Knowledge-Representation-Using-Rules.ppt
50134147-Knowledge-Representation-Using-Rules.ppt50134147-Knowledge-Representation-Using-Rules.ppt
50134147-Knowledge-Representation-Using-Rules.ppt
ssuserec53e73
 
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
Alex Gao
 
Lecture 6 expert systems
Lecture 6   expert systemsLecture 6   expert systems
Lecture 6 expert systems
Vajira Thambawita
 
Chapter 5 (final)
Chapter 5 (final)Chapter 5 (final)
Chapter 5 (final)
Nateshwar Kamlesh
 
machine learning
machine learningmachine learning
machine learning
Mounisha A
 
Expert Systems
Expert SystemsExpert Systems
Expert Systems
Anjan Mahanta
 
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 Project
Eng Teong Cheah
 
Production System
Production SystemProduction System
Production System
Varunjeet Singh Rekhi
 
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 Project
Valerii 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 ranking
Shakas Technologies
 
2. forward chaining and backward chaining
2. forward chaining and backward chaining2. forward chaining and backward chaining
2. forward chaining and backward chaining
monircse2
 

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

Rule based system
Rule based systemRule based system
Rule based system
 
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
 
2. forward chaining and backward chaining
2. forward chaining and backward chaining2. forward chaining and backward chaining
2. forward chaining and backward chaining
 

Recently uploaded

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 

Recently uploaded (20)

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 

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.