0% found this document useful (0 votes)
20 views35 pages

Introduction To Rule - Based Systems

Rule-based systems in artificial intelligence utilize human-made rules to process data and make decisions, mimicking human reasoning. They consist of a knowledge base, database, inference engine, and other components, and are effective in various fields such as healthcare and finance. While they offer transparency and ease of maintenance, they can struggle with flexibility and scalability compared to machine learning approaches.

Uploaded by

hilegiv205
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views35 pages

Introduction To Rule - Based Systems

Rule-based systems in artificial intelligence utilize human-made rules to process data and make decisions, mimicking human reasoning. They consist of a knowledge base, database, inference engine, and other components, and are effective in various fields such as healthcare and finance. While they offer transparency and ease of maintenance, they can struggle with flexibility and scalability compared to machine learning approaches.

Uploaded by

hilegiv205
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Introduction to Rule- Based

Systems
By Dr. Samta Gajbhiye
Definition of Rule Based System
Rule-based system in artificial intelligence has brought us one step
closer to the dream of creating machines that can reason and make
decisions like humans.

A rule-based system or production system is a type of expert system that


applies human-made rules to store, sort and manipulate data.

Mimics human intelligence.

Rule-based systems require a set of facts or source of data, and a set of


rules for manipulating that data.

These rules are derived from the knowledge of human experts in a


particular domain, which are then codified into a set of rules that the
system can use to reason about new situations.

By using a set of predefined rules to process information and provide


2 solutions, these systems have become an essential tool for solving
Rule-based Systems Approach
Form of “if-then” statements, where if a certain condition is met,
then a certain action should be taken.

Two important elements of rule-based AI models are “a set of rules”


and “a set of facts” and by using these, developers can create a basic
artificial intelligence model.

The steps can be simplified to:

▪ 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

Every rule specifies a relation, recommendation, directive, strategy


or heuristic and has the IF (condition) THEN (action) structure. As
soon as the condition part of the rule is satisfied, the rule gets
3 triggered and the action part gets executed.
Rule-based expert system examples
Healthcare: Used in healthcare to provide medical diagnosis and
treatment recommendations.
▪ Eg:- MYCIN, a rule-based expert system developed in the 1970s, was
designed to assist physicians in the diagnosis and treatment of
bacterial infections.
▪ Eg:- Dxplain, which uses a rule- based approach to assist physicians
in diagnosing medical conditions.
Finance :- Used in finance to provide investment advice and financial
analysis.
▪ Eg:- FICO’s credit scoring system is a rule-based expert system that
uses credit history and other financial data to assess creditworthiness.
▪ Eg:- LegalRuleML, a rule-based system for legal decision making.
Manufacturing :- Used to improve production processes and optimize
supply chain management.
▪ For example, General Electric used a rule-based expert system to
4 optimize the production process of its aircraft engines, resulting in
Characteristics of rule-based systems

They are made up of the combined knowledge of human


experts in the problem domain.

They represent knowledge in a very declarative manner.

They support the implementation of non-deterministic search


and control strategies.

They help in describing fragmentary, ill-structured, heuristic,


judgmental knowledge.

They can help with rule based decision making.

Every rule specifies a relation, recommendation, directive,


strategy or heuristic and has the IF (condition) THEN (action)
structure. As soon as the condition part of the rule is satisfied, the
rule gets triggered and the action part gets executed.
5
Working of Rule Based System

6
Components of a rules-based system

7
Components of a rules-based system Cont…
A typical rule-based system has seven basic components:

1. The knowledge base

▪ It holds the domain knowledge that is necessary for problem solving.

2. The database

▪ The database has a set of facts that are used to compare against the IF (condition)
part of the rules that are held in the knowledge base.

3. Explanation facilities

▪ The expert system needs to be able to explain its reasoning and justify its advice,
analysis, or conclusion.

4. User interface

▪ Through which the user seeking a solution to a problem communicates with the
expert system.
8
Components of a rules-based system Cont…
5. External interface

▪ The external interface enables an expert system to work with external data files
and programs that are written in conventional programming languages like C,
Pascal, FORTRAN and Basic.

6. Working memory

▪ The working memory stores temporary information and data.

7. The inference engine or semantic reasoned

▪ Performs the reasoning through which the expert system comes to a solution.

▪ The job of the inference engine is to link the rules that are defined in the
knowledge base with the facts that are stored in the database.

▪ It infers information or performs required actions on the basis of input and the rule
base that's present in the knowledge base.
9
Components of a rules-based system
Cont…

▪ Involves a match-resolve-act cycle that works like this:

✔ Match - A section of the production rule system gets matched with the contents
of the working memory to gain a conflict, where there are several instances of
the satisfied productions.

✔ Conflict-Resolution - After the production system is matched, one of the


production instances in the conflict is selected for execution for the purpose of
determining the progress of the process.

✔ Act - The production instance selected in the previous stage is s executed,


impacting the contents of the working memory.

10
Advantages of using a rule-based approach

One of the main advantages of using a rule-based approach is its transparency and
interpretability. Since the rules are derived from the knowledge of human experts, the
decision-making process can be easily understood and explained.

It can be easier to maintain and update compared to other AI models that use more complex
algorithms.

In the rule-based approach, the rules can be easily modified or updated based on new
information or changing requirements. This makes it more flexible and adaptable to changes
in the environment.

11
Disadvantages of using a rule-based approach

1. One of the main disadvantages of using a rule-based approach is its inflexibility in


handling situations that fall outside of the predefined rules.

2. If a situation is not covered by the rules, the system may not be able to provide an
accurate solution.

3. Additionally, in cases where the rules are incomplete or incorrect, the system may
provide inaccurate or incomplete solutions

4. Another potential disadvantage of using a rule-based approach is its scalability. As


the number of rules increases, the complexity of the system also increases, which
can make it more difficult to maintain and update. This can also lead to longer
processing times and increased computational requirements.

12
How impactful are rule-based expert systems on
their respective industries?
The impact of rule-based expert systems on their respective industries can be significant.

By providing a transparent and interpretable framework for decision-making, rule-based


systems have been able to improve the efficiency and effectiveness of many business
processes.

Rule-based systems can provide faster and more accurate decision-making, resulting in
increased efficiency and productivity.

They can also provide consistent and reliable solutions, reducing the risk of errors and
improving overall quality.

Additionally, rule-based expert systems can reduce the need for human experts in certain
areas, resulting in cost savings and increased scalability.

Note that rule-based expert systems are not always a replacement for human experts, and
should be used as a tool to enhance human decision-making.
13
Machine learning : Alternative Approach
A system designed to achieve AI utilizing the power of machine learning (ML) is known as
a machine learning model.

Machine learning systems are designed to define its own set of rules based on data outputs
it has access to, without human intervention.

By only taking the outputs from data or experts, ML systems thus utilise a probabilistic
approach: one that takes into account variations and probabilities to create informed
results.

Constantly evolve, develop, and adapt when new information is added.

ML used as an alternative method to address some of the challenges of rule-based


systems, such as practical training of large datasets, ML systems are used on larger
projects that require scalability.

As a direct counterpart to rules-based AI systems, ML systems are mutable and nimble


(agile), allowing them to transform data or value through mutable coding languages. The
14more data you feed the system, the more accurate it becomes in identifying patterns.
Choosing the right approach

Depends on your project requirements.

Rules-based systems:

▪ Suited to projects and applications that require small amounts of data and simple,
straightforward rules.

▪ Great for repetitive processes that require little-to-no human decision making, such
as fault analysis, email routing using triggers, and basic searching, among many
others.

▪ Great if you need information quickly, as the limited parameters of the systems allow
for speedy results.

▪ Used in processes where errors cannot be tolerated, such as medical diagnosis and
finance processing.

15
Choosing the right approach Cont….
Machine learning systems:

▪ Used when large volumes of relevant data records are available for making more
accurate predictions.

▪ For any processes that have multiple factors, situations, numerous potential outcomes,
ML systems are your best bet.

▪ ML systems are used when you are required to predict an outcome but do not
necessarily know how to do so.

▪ ML systems are best suited to rapidly changing environments like e-commerce


recommendations and general forecasting.

▪ For example, ML systems are great for sales lead qualifications and customer support
automated responses — any situations that have multi-variables.

▪ YouTube and Netflix auto-suggestions: algorithms learn from your activity and are
trained to assess your preferences and suggest content based on your preferences.
16
Choosing the right approach Cont….
Best of both

▪ There are some systems available that combine rules-based AI systems with ML

systems in a ‘best of both worlds’ situation.

▪ This comes in the form of rule-based machine learning (RBML) systems that are able

to identify and adapt their own set of rules.

Summary

Depending on project requirements,

▪ If you are in need of precision within a relatively small framework parameter then

rules-based systems are for you.

▪ If, on the other hand, you have access to large amounts of data and need to predict
something, then ML systems are your best bet.

▪ If, however, you have business needs that require both precision and large data

processing used to inform predictions and forecasting, then a hybrid approach may
17
very well be what you are after.
Comparison with other AI approaches
Include machine learning, deep learning, and natural language processing.
Key differences between the rule-based approach and other AI approaches:
▪ Machine learning: Machine learning is an approach in AI that involves the use of

algorithms to learn patterns from data. In machine learning, the system is trained on a
large dataset and uses statistical models to make predictions or decisions about new
data.
▪ Deep learning: Deep learning is a subset of machine learning that involves the use of

neural networks to learn from data. In deep learning, the system is trained on a large
dataset using multiple layers of artificial neurons. Deep learning is often used in
applications that require image recognition, speech recognition, and natural language
processing.
▪ Natural language processing: Interaction between computers and humans using natural

language.
✔ NLP involves the use of algorithms and techniques to analyze, understand, and
generate human language and often used in applications such as chatbots, virtual
18
assistants, and sentiment analysis.
Rules of Inference

In artificial intelligence, we need intelligent computers which


can create new logic from old logic or by evidence, so
generating the conclusions from evidence and facts is
termed as Inference.
Inference rules:
▪ Inference rules are the templates for generating valid
arguments.
▪ Inference rules are applied to derive proofs in artificial
intelligence
▪ The proof is a sequence of the conclusion that leads to the
desired goal.
19 ▪ In inference rules, the implication among all the
Rules of Inference Cont…..

Following are some terminologies related to inference rules:


▪ Implication: It is one of the logical connectives which can
be represented as P → Q. It is a Boolean expression.
▪ Inverse: The negation of implication is called inverse. It
can be represented as ¬ P → ¬ Q.
▪ Converse: The converse of implication, which means the
right-hand side proposition goes to the left-hand side and
vice-versa. It can be written as Q → P.
▪ Contrapositive: The negation of converse is termed as
contrapositive, and it can be represented as ¬ Q → ¬ P.

20
Rules of Inference Cont…..

⚫ Some of the compound statements are equivalent to each other, which can be proved using
truth table:

⚫ Hence from the above truth table, we can prove that P → Q is equivalent to ¬ Q → ¬ P, and Q→
P is equivalent to ¬ P → ¬ Q.

21
Rules of Inference Cont…..
Types of Inference rules:

1. Modus Ponens:

The Modus Ponens rule is one of the most important rules of


inference, and it states that if P and P → Q is true, then we can
infer that Q will be true. It can be represented as:

Example:

Statement-1: "If I am sleepy then I go to bed" ==> P→ Q


Statement-2: "I am sleepy" ==> P
Conclusion: "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and P is true then Q
will be true.

⚫ Proof by Truth table:


22
Rules of Inference Cont…..
2. Modus Tollens:

⚫ The Modus Tollens rule state that if P→ Q is true and ¬ Q is true,

then ¬ P will also true. It can be represented as:

⚫ Statement-1: "If I am sleepy then I go to bed" ==> P→ Q

Statement-2: "I do not go to the bed."==> ~Q


Statement-3: Which infers that "I am not sleepy" => ~P

⚫ Proof by Truth table:

23
Rules of Inference Cont…..
3. Hypothetical Syllogism

The Hypothetical Syllogism rule state that if P→R is true whenever P→Q
is true, and Q→R is true. It can be represented as the following notation:
P → Q, Q→ R

P→R
Example:

Statement-1: If you have my home key then you can unlock my


home. P→Q
Statement-2: If you can unlock my home then you can take my
money. Q→R
Conclusion: If you have my home key then you can take my
money. P→R

Proof by truth table:

24
Rules of Inference Cont…..
4. Disjunctive Syllogism:

The Disjunctive syllogism rule state that if P∨Q is true, and ¬P is true,
then Q will be true. It can be represented as:

Example:

Statement-1: Today is Sunday or Monday. ==>P∨Q


Statement-2: Today is not Sunday. ==> ¬P
Conclusion: Today is Monday. ==> Q

Proof by truth-table:

25
Rules of Inference Cont…..
5. Addition:

The Addition rule is one the common inference rule, and it states that
If P is true, then P∨Q will be true.

Example:

Statement: I have a vanilla ice-cream. ==> P


Statement-2: I have Chocolate ice-cream.
Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨Q)

⚫ Proof by Truth-Table:

26
Rules of Inference Cont…..
6. Simplification:

The simplification rule state that if P∧ Q is true, then Q or P will


also be true. It can be represented as:

Proof by Truth-Table:

27
Rules of Inference Cont…..
7. Resolution:

The Resolution rule state that if P∨Q and ¬ P∧R is true, then Q∨R
will also be true.

It can be represented as

Proof by Truth-Table:

28
Applications of Rule-based Systems

1. Healthcare, finance, and engineering are just a few examples of the

sectors and applications that use rule-based systems. Following are

some instances of a rule-based system in AI:

Medical Diagnosis: Based on a patient's symptoms, medical history,

and test findings, a rule-based system in AI can make a diagnosis. The

system can make a diagnosis by adhering to a series of guidelines

developed by medical professionals.

Fraud Detection: Based on particular criteria, such as the transaction's

value, location, and time of day, a rule-based system in AI can be used

to spot fraudulent transactions. The system, for the additional

29
examination, can then flag the transaction.
Applications of Rule-based Systems
Cont…

Quality Control: A rule-based system in AI can ensure that products

satisfy particular quality standards. Based on a set of guidelines

developed by quality experts, the system can check for flaws.

Decision support systems: They are created to aid decision-making,

such as choosing which assets to buy or what to buy.

30
Rule-based expert system examples

Examples of industries that have used rule-based expert systems:

1. Healthcare: Rule-based expert systems have been used in healthcare

to provide medical diagnosis and treatment recommendations.

▪ For example, MYCIN, a rule-based expert system developed in the

1970s, was designed to assist physicians in the diagnosis and

treatment of bacterial infections.

▪ Another example is Dxplain, which uses a rule-based approach to

assist physicians in diagnosing medical conditions.

31
Rule-based expert system examples
Cont..

Examples of industries that have used rule-based expert systems:

2. Finance: Rule-based expert systems used in finance to provide

investment advice and financial analysis.

▪ For example, FICO’s credit scoring system is a rule-based expert

system that uses credit history and other financial data to assess

creditworthiness.

▪ Another example is the LegalRuleML, a rule-based system for

legal decision making.

3. Manufacturing :- Used to improve production processes and


optimize supply chain management.

▪ For example, General Electric used a rule-based expert system to


32
optimize the production process of its aircraft engines, resulting
Examples of the Expert System Cont..

Below are some popular examples of the Expert System:

⚫ DENDRAL: It was an artificial intelligence project that was made as a

chemical analysis expert system.

❖ Used in organic chemistry to detect unknown organic molecules

with the help of their mass spectra and knowledge base of

chemistry.

⚫ MYCIN: Earliest backward chaining expert systems designed to find

the bacteria causing infections like bacteraemia and meningitis.

❖ Also used for the recommendation of antibiotics and the diagnosis

of blood clotting diseases.


33
Examples of the Expert System Cont…

Below are some popular examples of the Expert System:

⚫ PXDES: used to determine the type and level of lung cancer.

❖ To determine the disease, it takes a picture from the upper body,

which looks like the shadow. This shadow identifies the type and

degree of harm.

⚫ CaDeT: Diagnostic support system that can detect cancer at early

stages.

34
Thank You

35

You might also like