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

More Related Content

What's hot

Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logicAmey Kerkar
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligencesandeep54552
 
Lecture 06 production system
Lecture 06 production systemLecture 06 production system
Lecture 06 production systemHema Kashyap
 
State Space Representation and Search
State Space Representation and SearchState Space Representation and Search
State Space Representation and SearchHitesh Mohapatra
 
Conceptual dependency
Conceptual dependencyConceptual dependency
Conceptual dependencyJismy .K.Jose
 
Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2DigiGurukul
 
Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AIMegha Sharma
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AIAmey Kerkar
 
Issues in knowledge representation
Issues in knowledge representationIssues in knowledge representation
Issues in knowledge representationSravanthi Emani
 
Game Playing in Artificial Intelligence
Game Playing in Artificial IntelligenceGame Playing in Artificial Intelligence
Game Playing in Artificial Intelligencelordmwesh
 
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCEIntelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCEKhushboo Pal
 
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain RatioLecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain RatioMarina Santini
 
Artificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsArtificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsNuruzzaman Milon
 
Production System in AI
Production System in AIProduction System in AI
Production System in AIBharat Bhushan
 
Planning in Artificial Intelligence
Planning in Artificial IntelligencePlanning in Artificial Intelligence
Planning in Artificial Intelligencekitsenthilkumarcse
 

What's hot (20)

Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 
Frames
FramesFrames
Frames
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
 
Lecture 06 production system
Lecture 06 production systemLecture 06 production system
Lecture 06 production system
 
State Space Representation and Search
State Space Representation and SearchState Space Representation and Search
State Space Representation and Search
 
Conceptual dependency
Conceptual dependencyConceptual dependency
Conceptual dependency
 
Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2
 
Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AI
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AI
 
Issues in knowledge representation
Issues in knowledge representationIssues in knowledge representation
Issues in knowledge representation
 
search strategies in artificial intelligence
search strategies in artificial intelligencesearch strategies in artificial intelligence
search strategies in artificial intelligence
 
Game Playing in Artificial Intelligence
Game Playing in Artificial IntelligenceGame Playing in Artificial Intelligence
Game Playing in Artificial Intelligence
 
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCEIntelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
 
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain RatioLecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
 
Artificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsArtificial intelligence- Logic Agents
Artificial intelligence- Logic Agents
 
Production System in AI
Production System in AIProduction System in AI
Production System in AI
 
Forward Backward Chaining
Forward Backward ChainingForward Backward Chaining
Forward Backward Chaining
 
Informed search
Informed searchInformed search
Informed search
 
Planning in Artificial Intelligence
Planning in Artificial IntelligencePlanning in Artificial Intelligence
Planning in Artificial Intelligence
 

Similar to 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
 

Similar to 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
 
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
 
Chapter 5 (final)
Chapter 5 (final)Chapter 5 (final)
Chapter 5 (final)
 

More from 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
 

More from 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
 

Recently uploaded

(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 

Recently uploaded (20)

(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 

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.