SlideShare une entreprise Scribd logo
1  sur  21
RULE-BASED
SYSTEM
Dr. C.V. Suresh Babu
(CentreforKnowledgeTransfer)
institute
(CentreforKnowledgeTransfer)
institute
Objective
■ As you look to automate parts of your business, you’ve no doubt come across the
term ‘rule-based system’. (Alongside other, flashier terms like AI, RPA and software
“robots”.) But what is a rule-based system, exactly?
■ Rule-based logic is at the heart of most automated software processes.
Unfortunately, there are a lot of easy-to-make misconceptions of what a rule-based
system is and does.
■ So, to help clarify any confusion, here’s a closer look at rule-based systems and
how they work.
(CentreforKnowledgeTransfer)
institute
What is a rule-based system?
■ A rule-based system or production systems is a computer system that applies
human-made rules to store, sort and manipulate data to provide recommendations
or diagnoses, or to determine a course of action in a particular situation or to solve
a particular problem. In doing so, it mimics human intelligence.
(CentreforKnowledgeTransfer)
institute
Components of RBS
A rule-based system consists of a number of components:
1. Database of rules (also called a knowledge base)
– It consists of a set of rules that represent the knowledge that the system has.
2. Database of facts
– It represents inputs to the system that are used to derive conclusions, or to cause
actions.
3. Interpreter, or inference engine
– It is the part of the system that controls the process of deriving conclusions. It uses
the rules and facts, and combines them together to draw conclusions.
(CentreforKnowledgeTransfer)
institute
So, what is a rule-based system?
It’s a logical program that uses pre-defined
rules to make deductions and choices to
perform automated actions.
(CentreforKnowledgeTransfer)
institute
How rule-based system works?
■ To work, rule-based systems require a set of facts or source of data, and a set of
rules for manipulating that data. These rules are sometimes referred to as ‘If
statements’ as they tend to follow the line of ‘IF X happens THEN do Y’.
■ It automates processes by breaking them down into steps.
– First comes the data or new business event
– Then comes the analysis: the part where the system conditionally processes
the data against its rules
– Then comes any subsequent automated follow-up actions
(CentreforKnowledgeTransfer)
institute
Example
■ Rule-based systems, unsurprisingly, work based on rules. These rules outline triggers
and the actions that should follow (or are triggered). For example, a trigger might be an
email containing the word “invoice”. An action might then be to forward the email to
the finance team.
■ These rules most often take the form of if statements. ‘IF’ outlines the trigger, ‘THEN’
specifies the action to complete. So, if you want to create a rule-based system capable
of handling 100 different actions, you’d have to write 100 different rules. If you want to
then update the system and add actions, then you would need to write new rules.
■ In short, you use rules to tell a machine what to do, and the machine will do exactly as
you tell it. From there, rule-based systems will execute the actions until you tell it to
stop.
■ But remember: if you tell it to do something incorrectly, it will do it incorrectly.
(CentreforKnowledgeTransfer)
institute
What is a rule-based system not?
■ Due to early use in the fields, rule-based systems are commonly confused with
artificial intelligence and machine learning. However, they are not AI, and they are
not machine learning.
■ It’s easy to confuse the two as they can look very similar. Both involve machines
completing tasks, seemingly on their own. The difference is that AI can determine
the action to take itself; it can learn and adapt. Meanwhile, rule-based systems do
exactly as instructed by a human.
■ In other words, unlike artificial intelligence and machine learning, the actions
carried out by rule-based systems (the rules that they follow) are determined by a
human.
■ The system doesn’t work it out for itself, or intelligently make decisions.
(CentreforKnowledgeTransfer)
institute
A rule-based system won’t
change or update on its own,
and it won’t ‘learn’ from
mistakes.
(CentreforKnowledgeTransfer)
institute
Summary
■ What is a rule-based system? It’s not AI, and it’s not machine learning. (Thought it
might be used within them, to power certain aspects.)
■ Rather, rule-based systems simply follow rules laid out by humans. But in doing so,
they are incredibly useful.
https://www.youtube.com/watch?v=bes9e96stk8
(CentreforKnowledgeTransfer)
institute
Types of RBS
Using deduction to reach a conclusion from a
set of antecedents is called forward chaining.
An alternative method, backward chaining,
starts from a conclusion and tries to show it by
following a logical path backward from the
conclusion to a set of antecedents that are in
the database of facts.
(CentreforKnowledgeTransfer)
institute
Forward Chaining
■ Forward chaining employs 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.
■ 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.
(CentreforKnowledgeTransfer)
institute
For example, consider the following set of
rules that is used to control an elevator in a
three-story building:
Rule 1
IF on first floor and button is pressed on first floor
THEN open door
Rule 2
IF on first floor
AND button is pressed on second floor
THEN go to second floor
Rule 3
IF on first floor
AND button is pressed on third floor
THEN go to third floor
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
This represents just a subset of the rules that would be needed,
but we can use it to illustrate how forward chaining works.
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.
(CentreforKnowledgeTransfer)
institute
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.
(CentreforKnowledgeTransfer)
institute
Conflict Resolution
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.
For example, consider the following set of rules:
IF it is cold
THEN wear a coat
IF it is cold
THEN stay at home
IF it is cold
THEN turn on the heat
If there is a single fact in the fact database, which is “it is
cold,” then clearly there are three conclusions that can be
derived. In some cases, it might be fine to follow all three
conclusions, but in many cases the conclusions are
incompatible.
(CentreforKnowledgeTransfer)
institute
In one conflict resolution method, rules are given priority levels, and when a
conflict occurs, the rule that has the highest priority is fired, as in the following
example:
IF patient has pain
THEN prescribe painkillers priority 10
IF patient has chest pain
THEN treat for heart disease priority 100
• Here, it is clear that treating possible heart problems is more important than
just curing the pain.
• An alternative method is the longest-matching strategy.
• This method involves firing the conclusion that was derived from the longest
rule.
(CentreforKnowledgeTransfer)
institute
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.
For example:
In each case, it may be that the system fires one rule and then stops, but in many cases, the system simply
needs to choose a suitable ordering for the rules because each rule that matches the facts needs to be fired at
some point.
(CentreforKnowledgeTransfer)
institute
Meta Rules
In designing an expert system, it is necessary to select the conflict resolution method that
will be used, and quite possibly it will be necessary to use different methods to resolve
different types of conflicts.
For example, in some situations it may make most sense to use the method that involves firing the most
recently added rules.
This method makes most sense in situations in which the timeliness of data is important. It might be, for
example, that as research in a particular field of medicine develops, and new rules are added to the system
that contradicts some of the older rules.
It might make most sense for the system to assume that these newer rules are more accurate than the older
rules.
It might also be the case, however, that the new rules have been added by an expert whose opinion is less
trusted than that of the expert who added the earlier rules.
In this case, it clearly makes more sense to allow the earlier rules priority.
This kind of knowledge is called meta knowledge—knowledge about knowledge. The rules that define how
conflict resolution will be used, and how other aspects of the system itself will run, are called meta rules.
(CentreforKnowledgeTransfer)
institute
Knowledge engineer
■ The knowledge engineer who builds the expert system is responsible for
building appropriate meta knowledge into the system (such as “expert A
is to be trusted more than expert B” or “any rule that involves drug X is
not to be trusted as much as rules that do not involve X”).
■ Meta rules are treated by the expert system as if they were ordinary
rules but are given greater priority than the normal rules that make up
the expert system.
■ In this way, the meta rules are able to override the normal rules, if
necessary, and are certainly able to control the conflict resolution
process
(CentreforKnowledgeTransfer)
institute
Backward Chaining
■ 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.
■ 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.
■ 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 is often used in formulating plans.
■ A plan is a sequence of actions that a program decides to take to solve a particular problem.
■ Backward chaining can make the process of formulating a plan more efficient than forward
chaining.
(CentreforKnowledgeTransfer)
institute
■ Backward chaining in this way 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.

Contenu connexe

Tendances

Presentation on "Knowledge acquisition & validation"
  Presentation on "Knowledge acquisition & validation"  Presentation on "Knowledge acquisition & validation"
Presentation on "Knowledge acquisition & validation"Aditya Sarkar
 
Logics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiLogics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiShaishavShah8
 
Semantic nets in artificial intelligence
Semantic nets in artificial intelligenceSemantic nets in artificial intelligence
Semantic nets in artificial intelligenceharshita virwani
 
Local search algorithm
Local search algorithmLocal search algorithm
Local search algorithmMegha Sharma
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentationusmankiyani1
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesDr. C.V. Suresh Babu
 
Lecture 06 production system
Lecture 06 production systemLecture 06 production system
Lecture 06 production systemHema Kashyap
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceRamla Sheikh
 
Production System in AI
Production System in AIProduction System in AI
Production System in AIBharat Bhushan
 
Conceptual dependency
Conceptual dependencyConceptual dependency
Conceptual dependencyJismy .K.Jose
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed SystemsPritom Saha Akash
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded searchHema Kashyap
 
Propositional logic
Propositional logicPropositional logic
Propositional logicRushdi Shams
 
Lecture 1 introduction to parallel and distributed computing
Lecture 1   introduction to parallel and distributed computingLecture 1   introduction to parallel and distributed computing
Lecture 1 introduction to parallel and distributed computingVajira Thambawita
 
Forms of learning in ai
Forms of learning in aiForms of learning in ai
Forms of learning in aiRobert Antony
 
Stuart russell and peter norvig artificial intelligence - a modern approach...
Stuart russell and peter norvig   artificial intelligence - a modern approach...Stuart russell and peter norvig   artificial intelligence - a modern approach...
Stuart russell and peter norvig artificial intelligence - a modern approach...Lê Anh Đạt
 

Tendances (20)

Presentation on "Knowledge acquisition & validation"
  Presentation on "Knowledge acquisition & validation"  Presentation on "Knowledge acquisition & validation"
Presentation on "Knowledge acquisition & validation"
 
Logics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiLogics for non monotonic reasoning-ai
Logics for non monotonic reasoning-ai
 
Semantic nets in artificial intelligence
Semantic nets in artificial intelligenceSemantic nets in artificial intelligence
Semantic nets in artificial intelligence
 
Local search algorithm
Local search algorithmLocal search algorithm
Local search algorithm
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
 
Predicate logic
 Predicate logic Predicate logic
Predicate logic
 
Recognition-of-tokens
Recognition-of-tokensRecognition-of-tokens
Recognition-of-tokens
 
Lecture 06 production system
Lecture 06 production systemLecture 06 production system
Lecture 06 production system
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial Intelligence
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Production System in AI
Production System in AIProduction System in AI
Production System in AI
 
Conceptual dependency
Conceptual dependencyConceptual dependency
Conceptual dependency
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded search
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Lecture 1 introduction to parallel and distributed computing
Lecture 1   introduction to parallel and distributed computingLecture 1   introduction to parallel and distributed computing
Lecture 1 introduction to parallel and distributed computing
 
Forms of learning in ai
Forms of learning in aiForms of learning in ai
Forms of learning in ai
 
Code generation
Code generationCode generation
Code generation
 
Stuart russell and peter norvig artificial intelligence - a modern approach...
Stuart russell and peter norvig   artificial intelligence - a modern approach...Stuart russell and peter norvig   artificial intelligence - a modern approach...
Stuart russell and peter norvig artificial intelligence - a modern approach...
 

Similaire à Rule based system

FORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN ARTIFICIAL INTELIGENCE
FORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN ARTIFICIAL INTELIGENCEFORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN ARTIFICIAL INTELIGENCE
FORWARD CHAINING AND BACKWARD CHAINING SYSTEMS IN ARTIFICIAL INTELIGENCEJohnLeonard Onwuzuruigbo
 
Production System1.pdf
Production System1.pdfProduction System1.pdf
Production System1.pdfsajidawazeer8
 
Production System l 10.pptx
Production System l 10.pptxProduction System l 10.pptx
Production System l 10.pptxKirti Verma
 
Expert System With Python -1
Expert System With Python -1Expert System With Python -1
Expert System With Python -1Ahmad Hussein
 
KScope14 Understanding the Zombies that lurk within your system
KScope14 Understanding the Zombies that lurk within your systemKScope14 Understanding the Zombies that lurk within your system
KScope14 Understanding the Zombies that lurk within your systemAlithya
 
System Analysis & Design - I
System Analysis & Design - ISystem Analysis & Design - I
System Analysis & Design - IGagan Deep
 
Book 2 chapter-8
Book 2 chapter-8Book 2 chapter-8
Book 2 chapter-8GTU
 
Intrusion Detection System
Intrusion Detection SystemIntrusion Detection System
Intrusion Detection SystemAbhishek Walter
 
Unit 2 Concepts of system bca sem 5 unix comnecpr
Unit 2 Concepts of system bca sem 5 unix comnecprUnit 2 Concepts of system bca sem 5 unix comnecpr
Unit 2 Concepts of system bca sem 5 unix comnecprdharmikmangukiya2
 
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
 
Systems Thinking for agile service design
Systems Thinking for agile service designSystems Thinking for agile service design
Systems Thinking for agile service designjohanna kollmann
 
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
 
Beyond pretty charts, Analytics for the rest of us. Toufic Boubez DevOps Days...
Beyond pretty charts, Analytics for the rest of us. Toufic Boubez DevOps Days...Beyond pretty charts, Analytics for the rest of us. Toufic Boubez DevOps Days...
Beyond pretty charts, Analytics for the rest of us. Toufic Boubez DevOps Days...tboubez
 
Automatic Assessment of Failure Recovery in Erlang Applications
Automatic Assessment of Failure Recovery in Erlang ApplicationsAutomatic Assessment of Failure Recovery in Erlang Applications
Automatic Assessment of Failure Recovery in Erlang ApplicationsJan Henry Nystrom
 

Similaire à Rule based system (20)

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
 
Lecture 6 expert systems
Lecture 6   expert systemsLecture 6   expert systems
Lecture 6 expert systems
 
Forward Backward Chaining
Forward Backward ChainingForward Backward Chaining
Forward Backward Chaining
 
Production System
Production SystemProduction System
Production System
 
Production System1.pdf
Production System1.pdfProduction System1.pdf
Production System1.pdf
 
Production System l 10.pptx
Production System l 10.pptxProduction System l 10.pptx
Production System l 10.pptx
 
Expert System With Python -1
Expert System With Python -1Expert System With Python -1
Expert System With Python -1
 
10.pdf
10.pdf10.pdf
10.pdf
 
KScope14 Understanding the Zombies that lurk within your system
KScope14 Understanding the Zombies that lurk within your systemKScope14 Understanding the Zombies that lurk within your system
KScope14 Understanding the Zombies that lurk within your system
 
System Analysis & Design - I
System Analysis & Design - ISystem Analysis & Design - I
System Analysis & Design - I
 
Book 2 chapter-8
Book 2 chapter-8Book 2 chapter-8
Book 2 chapter-8
 
Intrusion Detection System
Intrusion Detection SystemIntrusion Detection System
Intrusion Detection System
 
Expert Systems
Expert SystemsExpert Systems
Expert Systems
 
Unit 2 Concepts of system bca sem 5 unix comnecpr
Unit 2 Concepts of system bca sem 5 unix comnecprUnit 2 Concepts of system bca sem 5 unix comnecpr
Unit 2 Concepts of system bca sem 5 unix comnecpr
 
End-to-End Machine Learning Project
End-to-End Machine Learning ProjectEnd-to-End Machine Learning Project
End-to-End Machine Learning Project
 
Systems Thinking for agile service design
Systems Thinking for agile service designSystems Thinking for agile service design
Systems Thinking for agile service design
 
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
 
Beyond pretty charts, Analytics for the rest of us. Toufic Boubez DevOps Days...
Beyond pretty charts, Analytics for the rest of us. Toufic Boubez DevOps Days...Beyond pretty charts, Analytics for the rest of us. Toufic Boubez DevOps Days...
Beyond pretty charts, Analytics for the rest of us. Toufic Boubez DevOps Days...
 
Automatic Assessment of Failure Recovery in Erlang Applications
Automatic Assessment of Failure Recovery in Erlang ApplicationsAutomatic Assessment of Failure Recovery in Erlang Applications
Automatic Assessment of Failure Recovery in Erlang Applications
 
Production based system
Production based systemProduction based system
Production based system
 

Plus de Dr. C.V. Suresh Babu

Diagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AIDiagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AIDr. C.V. Suresh Babu
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”Dr. C.V. Suresh Babu
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”Dr. C.V. Suresh Babu
 
A study on “the impact of data analytics in covid 19 health care system”
A study on “the impact of data analytics in covid 19 health care system”A study on “the impact of data analytics in covid 19 health care system”
A study on “the impact of data analytics in covid 19 health care system”Dr. C.V. Suresh Babu
 
A study on the impact of data analytics in COVID-19 health care system
A study on the impact of data analytics in COVID-19 health care systemA study on the impact of data analytics in COVID-19 health care system
A study on the impact of data analytics in COVID-19 health care systemDr. C.V. Suresh Babu
 

Plus de Dr. C.V. Suresh Babu (20)

Data analytics with R
Data analytics with RData analytics with R
Data analytics with R
 
Association rules
Association rulesAssociation rules
Association rules
 
Clustering
ClusteringClustering
Clustering
 
Classification
ClassificationClassification
Classification
 
Blue property assumptions.
Blue property assumptions.Blue property assumptions.
Blue property assumptions.
 
Introduction to regression
Introduction to regressionIntroduction to regression
Introduction to regression
 
DART
DARTDART
DART
 
Mycin
MycinMycin
Mycin
 
Expert systems
Expert systemsExpert systems
Expert systems
 
Dempster shafer theory
Dempster shafer theoryDempster shafer theory
Dempster shafer theory
 
Bayes network
Bayes networkBayes network
Bayes network
 
Bayes' theorem
Bayes' theoremBayes' theorem
Bayes' theorem
 
Knowledge based agents
Knowledge based agentsKnowledge based agents
Knowledge based agents
 
Formal Logic in AI
Formal Logic in AIFormal Logic in AI
Formal Logic in AI
 
Game playing in AI
Game playing in AIGame playing in AI
Game playing in AI
 
Diagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AIDiagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AI
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”
 
A study on “the impact of data analytics in covid 19 health care system”
A study on “the impact of data analytics in covid 19 health care system”A study on “the impact of data analytics in covid 19 health care system”
A study on “the impact of data analytics in covid 19 health care system”
 
A study on the impact of data analytics in COVID-19 health care system
A study on the impact of data analytics in COVID-19 health care systemA study on the impact of data analytics in COVID-19 health care system
A study on the impact of data analytics in COVID-19 health care system
 

Dernier

Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxNadaHaitham1
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilVinayVitekari
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 

Dernier (20)

Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 

Rule based system

  • 1. RULE-BASED SYSTEM Dr. C.V. Suresh Babu (CentreforKnowledgeTransfer) institute
  • 2. (CentreforKnowledgeTransfer) institute Objective ■ As you look to automate parts of your business, you’ve no doubt come across the term ‘rule-based system’. (Alongside other, flashier terms like AI, RPA and software “robots”.) But what is a rule-based system, exactly? ■ Rule-based logic is at the heart of most automated software processes. Unfortunately, there are a lot of easy-to-make misconceptions of what a rule-based system is and does. ■ So, to help clarify any confusion, here’s a closer look at rule-based systems and how they work.
  • 3. (CentreforKnowledgeTransfer) institute What is a rule-based system? ■ A rule-based system or production systems is a computer system that applies human-made rules to store, sort and manipulate data to provide recommendations or diagnoses, or to determine a course of action in a particular situation or to solve a particular problem. In doing so, it mimics human intelligence.
  • 4. (CentreforKnowledgeTransfer) institute Components of RBS A rule-based system consists of a number of components: 1. Database of rules (also called a knowledge base) – It consists of a set of rules that represent the knowledge that the system has. 2. Database of facts – It represents inputs to the system that are used to derive conclusions, or to cause actions. 3. Interpreter, or inference engine – It is the part of the system that controls the process of deriving conclusions. It uses the rules and facts, and combines them together to draw conclusions.
  • 5. (CentreforKnowledgeTransfer) institute So, what is a rule-based system? It’s a logical program that uses pre-defined rules to make deductions and choices to perform automated actions.
  • 6. (CentreforKnowledgeTransfer) institute How rule-based system works? ■ To work, rule-based systems require a set of facts or source of data, and a set of rules for manipulating that data. These rules are sometimes referred to as ‘If statements’ as they tend to follow the line of ‘IF X happens THEN do Y’. ■ It automates processes by breaking them down into steps. – First comes the data or new business event – Then comes the analysis: the part where the system conditionally processes the data against its rules – Then comes any subsequent automated follow-up actions
  • 7. (CentreforKnowledgeTransfer) institute Example ■ Rule-based systems, unsurprisingly, work based on rules. These rules outline triggers and the actions that should follow (or are triggered). For example, a trigger might be an email containing the word “invoice”. An action might then be to forward the email to the finance team. ■ These rules most often take the form of if statements. ‘IF’ outlines the trigger, ‘THEN’ specifies the action to complete. So, if you want to create a rule-based system capable of handling 100 different actions, you’d have to write 100 different rules. If you want to then update the system and add actions, then you would need to write new rules. ■ In short, you use rules to tell a machine what to do, and the machine will do exactly as you tell it. From there, rule-based systems will execute the actions until you tell it to stop. ■ But remember: if you tell it to do something incorrectly, it will do it incorrectly.
  • 8. (CentreforKnowledgeTransfer) institute What is a rule-based system not? ■ Due to early use in the fields, rule-based systems are commonly confused with artificial intelligence and machine learning. However, they are not AI, and they are not machine learning. ■ It’s easy to confuse the two as they can look very similar. Both involve machines completing tasks, seemingly on their own. The difference is that AI can determine the action to take itself; it can learn and adapt. Meanwhile, rule-based systems do exactly as instructed by a human. ■ In other words, unlike artificial intelligence and machine learning, the actions carried out by rule-based systems (the rules that they follow) are determined by a human. ■ The system doesn’t work it out for itself, or intelligently make decisions.
  • 9. (CentreforKnowledgeTransfer) institute A rule-based system won’t change or update on its own, and it won’t ‘learn’ from mistakes.
  • 10. (CentreforKnowledgeTransfer) institute Summary ■ What is a rule-based system? It’s not AI, and it’s not machine learning. (Thought it might be used within them, to power certain aspects.) ■ Rather, rule-based systems simply follow rules laid out by humans. But in doing so, they are incredibly useful. https://www.youtube.com/watch?v=bes9e96stk8
  • 11. (CentreforKnowledgeTransfer) institute Types of RBS Using deduction to reach a conclusion from a set of antecedents is called forward chaining. An alternative method, backward chaining, starts from a conclusion and tries to show it by following a logical path backward from the conclusion to a set of antecedents that are in the database of facts.
  • 12. (CentreforKnowledgeTransfer) institute Forward Chaining ■ Forward chaining employs 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. ■ 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.
  • 13. (CentreforKnowledgeTransfer) institute For example, consider the following set of rules that is used to control an elevator in a three-story building: Rule 1 IF on first floor and button is pressed on first floor THEN open door Rule 2 IF on first floor AND button is pressed on second floor THEN go to second floor Rule 3 IF on first floor AND button is pressed on third floor THEN go to third floor 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 This represents just a subset of the rules that would be needed, but we can use it to illustrate how forward chaining works. 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.
  • 14. (CentreforKnowledgeTransfer) institute 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.
  • 15. (CentreforKnowledgeTransfer) institute Conflict Resolution 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. For example, consider the following set of rules: IF it is cold THEN wear a coat IF it is cold THEN stay at home IF it is cold THEN turn on the heat If there is a single fact in the fact database, which is “it is cold,” then clearly there are three conclusions that can be derived. In some cases, it might be fine to follow all three conclusions, but in many cases the conclusions are incompatible.
  • 16. (CentreforKnowledgeTransfer) institute In one conflict resolution method, rules are given priority levels, and when a conflict occurs, the rule that has the highest priority is fired, as in the following example: IF patient has pain THEN prescribe painkillers priority 10 IF patient has chest pain THEN treat for heart disease priority 100 • Here, it is clear that treating possible heart problems is more important than just curing the pain. • An alternative method is the longest-matching strategy. • This method involves firing the conclusion that was derived from the longest rule.
  • 17. (CentreforKnowledgeTransfer) institute 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. For example: In each case, it may be that the system fires one rule and then stops, but in many cases, the system simply needs to choose a suitable ordering for the rules because each rule that matches the facts needs to be fired at some point.
  • 18. (CentreforKnowledgeTransfer) institute Meta Rules In designing an expert system, it is necessary to select the conflict resolution method that will be used, and quite possibly it will be necessary to use different methods to resolve different types of conflicts. For example, in some situations it may make most sense to use the method that involves firing the most recently added rules. This method makes most sense in situations in which the timeliness of data is important. It might be, for example, that as research in a particular field of medicine develops, and new rules are added to the system that contradicts some of the older rules. It might make most sense for the system to assume that these newer rules are more accurate than the older rules. It might also be the case, however, that the new rules have been added by an expert whose opinion is less trusted than that of the expert who added the earlier rules. In this case, it clearly makes more sense to allow the earlier rules priority. This kind of knowledge is called meta knowledge—knowledge about knowledge. The rules that define how conflict resolution will be used, and how other aspects of the system itself will run, are called meta rules.
  • 19. (CentreforKnowledgeTransfer) institute Knowledge engineer ■ The knowledge engineer who builds the expert system is responsible for building appropriate meta knowledge into the system (such as “expert A is to be trusted more than expert B” or “any rule that involves drug X is not to be trusted as much as rules that do not involve X”). ■ Meta rules are treated by the expert system as if they were ordinary rules but are given greater priority than the normal rules that make up the expert system. ■ In this way, the meta rules are able to override the normal rules, if necessary, and are certainly able to control the conflict resolution process
  • 20. (CentreforKnowledgeTransfer) institute Backward Chaining ■ 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. ■ 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. ■ 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 is often used in formulating plans. ■ A plan is a sequence of actions that a program decides to take to solve a particular problem. ■ Backward chaining can make the process of formulating a plan more efficient than forward chaining.
  • 21. (CentreforKnowledgeTransfer) institute ■ Backward chaining in this way 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.