0% found this document useful (0 votes)
39 views33 pages

Rule-Base Expert System

The document discusses rule-based expert systems, highlighting the importance of knowledge and expertise in problem-solving. It outlines the structure of such systems, including components like the knowledge base, inference engine, and user interface, as well as the reasoning techniques of forward and backward chaining. Additionally, it addresses advantages and challenges of rule-based systems, such as their ability to handle uncertain knowledge and the limitations in learning and search strategies.

Uploaded by

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

Rule-Base Expert System

The document discusses rule-based expert systems, highlighting the importance of knowledge and expertise in problem-solving. It outlines the structure of such systems, including components like the knowledge base, inference engine, and user interface, as well as the reasoning techniques of forward and backward chaining. Additionally, it addresses advantages and challenges of rule-based systems, such as their ability to handle uncertain knowledge and the limitations in learning and search strategies.

Uploaded by

ratul.marketer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Rule-base expert system

Prepared by
Maksuda Rabeya
Lecture of
Southeast University
What is knowledge
Knowledge is a theoretical or practical
understanding of a subject or a domain.
Knowledge is also the sum of what is
currently known, and apparently knowledge
is power.
Those who possess knowledge are called
experts. They are the most powerful and
important people in their organization
Expert
Anyone can be considered a domain expert if
he or she has deep knowledge (of both facts
and rules) and strong practical experience in
a particular domain. The area of the domain
may be limited.
An expert is a skillful person who can do
things other people can not
Rule based system
Rule based knowledge representation used
IF-THEN structure
If The traffic light is green
Then the action is go
If The traffic light is red
Then the action is stop
Rules as Knowledge representation
Technique
Any rules consists of two part:
1. If part which is called antecedent (premise
or condition)
2. Then part called the consequent (conclusion
or action)
The basic syntax of a rule is:
IF <antecedent>
THEN <consequent>
Rules as Knowledge representation
Technique ….Cont.
A rule can have multiple antecedents joined by the keyword
AND (Conjunction), OR(Disjunction) or a combination of
both
It is good habit to avoid mixing conjunctions and disjunctions
in the same rule.
IF <antecedent 1> IF <antecedent 1>
AND <antecedent2> OR <antecedent2>
. .
. .
. .
AND <antecedent n> OR <antecedent n>
THEN <consequent> THEN <consequent>
Rules as Knowledge representation
Technique ….Cont.of a rule can also have multiple
The consequent
clauses:
If <antecedent>
THEN <consequent 1>
<consequent 2>

Example: IF ‘age of the customer’ < 18


AND ‘cash withdrawal’ > 1000
THEN ‘signature of the parent is
required’

Numerical object and even arithmetic expression can


be used:
If ‘age of the customer ‘> 18
AND ‘cash withdrawal’ >1000
THEN ‘signature of the are not’ is required
Rule Represents
 Relation
IF the fuel tank is empty
THEN the car is dead
 Recommendation
IF The season is autumn
AND The sky is cloudy
AND The forecast is drizzle
THEN The advice is take an umbrella
 Directive
IF the car is dead
AND the fuel tank is empty
THEN the action is refuel the car
Rule Represents…Cont
 Strategy
IF The car is dead
THEN the action is check the fuel tank
IF ste1 is complete
AND the fuel tank is full
THEN the action is check the battery
Step 2 is complete
 Heuristic
IF the spill is liquid
AND the spill PH < 6
AND the spill smell is vinegar
THEN the spill material is acetic acid
Expert system development team
 Expert system shell : An expert system shell can be considered as an
expert system with the knowledge removed.
 Domain expert: Knowledgeable and skilled person capable of solving
problems in a specific area or domain.
 Knowledge engineer: A knowledge engineer is someone who is
capable of designing, building and testing an expert system. This person
is responsible for selecting an appropriate task for the expert system
 Programmer: responsible for the actual programming describing the
domain knowledge in terms that a computer can understand. The
programmer needs to have skills in symbolic programming in such AI
language like LISP.
 Project Manager: is the leader of the expert system development team
and responsible for keeping the project on track. He makes sure that all
deliverables and milestones are met, interacts with the expert,
knowledge engineer, programmer and end-user
 End-user: is a person who uses the expert system when it is developed.
Expert system development team
Structure of a rule-based expert system
A rule-based expert system has five component
1. Knowledge base: It contains the domain knowledge useful for
problem solving. Knowledge base represent as a set of rules.
2. Database: Includes a set of facts used to match against the if
(condition) part of a rule is satisfied, the rule is said to fire and
the action part is executed
3. Inference engine: Caries out the reasoning whereby the expert
system reaches a solution.
4. Explanation facilities: Explanation facilities enable the user to
ask the expert system how a particular conclusion is reached and
why a specific fact is needed. An expert system must be able to
explain its reasoning and justify its advice, analysis or conclusion.
5. User interface: It is the means of communication between a
user seeing a solution to the problem and an expert system. The
communication should be as meaningful and friendly as possible
Structure of a rule-based expert system
Comparison of expert system
Human Expert Systems Conventional
programs
Use knowledge in the form Process knowledge Process data and use
of rules of thumb or expressed in the form of algorithms, a series of well-
heuristics to solve problems rules and use symbolic defined operations, to solve
in a narrow domain reasoning to solve problems general numerical problem
in a narrow domain.
In a human brain Provide a clear separation do not support knowledge
knowledge exists in a of knowledge from its from the control structure
compiled form processing to process this knowledge
Capable of explaining a line Trace the rules fired during Do not explain how a
of reasoning and providing a problem-solving session particular result was
the details and explain how a obtained and why input
particular conclusion was data was needed
reached and why specific
data was needed
Use inexact reasoning and Permit inexact reasoning Work only on roblems
can deal with incomplete, and can deal with where data is complete and
uncertain and fuzzy incomplete, uncertain and exact
information fuzzy data
Can make mistakes when Can make mistake when Provide no solution at all or
information is incomplete data is incomplete or fuzzy a wrong one, when data is
or fuzzy incomplete or fuzzy
Enhance the quality of Enhance the quality of Enhance the quality of
problem solving via years of problem solving by adding problem solving by
learning and practical new rules or adjusting old changing the program code.
Reasoning and Inference
 Reasoning: the reasoning involved in drawing a conclusion or
making a logical judgment on the basis of circumstantial
evidence and prior conclusions rather than on the basis of
direct observation
 Inference: An inference is an idea or conclusion that's drawn
from evidence and reasoning. An inference is an educated
guess
We learn about some things by experiencing them first-hand,
but we gain other knowledge by inference — the process of
inferring things based on what is already known. When you
make an inference, you're reading between the lines or just
looking carefully at the facts and coming to conclusions. You
can also make faulty inferences. If you hear a person's weight
is 250 pounds, you might make the inference that they're
overweight. But what if they're seven feet tall?
Type of chaining
 Chaining: An expert system can display its inference chain to
explain how a particular conclusion was reached, this is an
essential part of its explanation facilities.
 Forward chaining: Forward chaining is the data-driven
reasoning. The reasoning starts from the known data and
proceeds forward with that data. Each time only the topmost rule
is executed. When fired, ads a new fact in the database. Any rule
can be executed only once. The match-fire cycle stops when no
further rules can be fired.
 Backward chaining: Backward chaining is the goal-driven
reasoning. In backward chaining , and expert system has the goal
and the inference engine attempts to find the evidence to prove it.
First, the knowledge base is searched to find rule that might have
the desired solution. Such rules must have the goal in their THEN
parts. If such a rule is found and its IF(condition) part matches
data in the database, then the rule is fired and the goal is proved
working with and sets up a new goal, a sub-goal, to prove the if
part of this rule. Then the knowledge base is searched again for
rules that can prove the subgoal. The inference engine repeats the
Inference Chaining
Forward Chaining
Rule 1: Y&D →Z
Rule 2: X&B&E →Y
Rule 3: A→X
Rule 4: C→ X
Rule 5: L&M → N
Forward Chaining
Backward Chaining
Y & D →Z
X & B & E → Y
A → X
C → L
L&M → N
Backward Chaining
How to choose between forward and
backward
Choose forward chaining:
 If an expert system need first need to gather
some information and then tries to infer from it
whatever can be inferred.
Forward chaining is a natural way to design
expert systems for analysis and interpretation.
i.e. DENDRAL, an expert system for
determining the molecular structure of
unknown soil based on its mass spectral data.
How to choose between forward and
backward
Choose Backward chaining:
If expert system begins with an hypothetical
solution and then attempts to find facts to
prove it.
Most backward chaining experts system used
for diagnostic purposes. i.e. MYCIN, a medical
expert system for diagnosing infectious blood
diseases use backward chaining.
Can we combine forward and backward
chaining
Many expert system shell use a combination
of forward and backward chaining inference
techniques so the knowledge engineers does
not have to chose between them.
Basic inference mechanism is usually
backward chining
When a new fact is established is forward
chaining employed to maximize the use of the
new data.
Conflict resolution

A method for choosing a rule to fire when ore than


one rule can be fired in a given cycle s called conflict
resolution. Rules order is very important in these
cases.
Conflict resolution
Highest priority
Goal1. Prescription is ? Prescription
Rule1: Meningitis Prescription 1
(Priority:100)
If Infection is Meningitis
And the patient is a child
THEN Prescription is Number_1.
And Drug Recommendation is Ampicillin
And Drug Recommendation is Gentamicin
And Display Meningitis Prescription 1.
(Priority:90)
Rule2: Meningitis Prescription 2
If infection is Meningitis
And the patient is adult
Then Prescription is Number_2
And Drug Recommendation is Penicillin
And Display Meningitis Prescription 2.
Conflict resolution
Longest matching strategy
Rule 1:
If the season is autumn
And the sky is cloudy
And the forecast is rain
Then the advice is stay home

Rule2:
If the season is autumn
Then the advice is take an umbrella
Conflict resolution
Data most recently entered
Rule 1:
If The forecast is rain [8:16 PM 11/25/96]
Then the advice is take and umbrella

Rule 2:
If the weather is wet [10:16 AM 11/26/96]
Then the advice is stay home
Advantage of rule-based expert systems
 Natural knowledge representation: Expert generally explains the
problem solving procedure with such expressions as t his: In such
and such situation, I do so and so. These expression can be
represented quite naturally as IF-THEN production rules
 Uniform structure: Production rules has uniform structure IF-
THEN
 Separation of knowledge from its processing: rule-based expert
system provides and effective separation of the knowledge base
from inference engine
 Dealing with incomplete and uncertain knowledge: Most rule-
based expert systems are capable of representing and reasoning
with incomplete and uncertain knowledge. i.e.:
if season is autumn
and sky cloudy
and wind is low
Then forecast is clear [cf 0.1]
forecast is drizzle [cf 1.0]
Problems of rule-based system
Opaque relations between rules: Logical interactions
within the large set of rules may be opaque. Rule-base
systems make it difficult to observe how individual rules
serve the overall strategy. This problem is related to lack of
hierarchical knowledge representation in the rule-based
expert system
Ineffective search strategy: The inference engine applies
an exhaustive search through all the production rules
during each cycle. Expert systems with a large set of rules
can be slow.
Inability to learn: Rule-based expert system do not have
an ability to learn from the experience. The knowledge
engineer is still responsible for revising and maintaining
system
Reference
Chapter: 2 Rule-Based expert systems

You might also like