DT228/3 Intelligent Systems Development - PowerPoint PPT Presentation

Loading...

PPT – DT228/3 Intelligent Systems Development PowerPoint presentation | free to download - id: 6f5c8e-MTM2M



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

DT228/3 Intelligent Systems Development

Description:

DT228/3 Intelligent Systems Development Rule-Based Expert Systems – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 43
Provided by: Deird3
Learn more at: http://www.comp.dit.ie
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: DT228/3 Intelligent Systems Development


1
DT228/3 Intelligent Systems Development
  • Rule-Based Expert Systems

2
Contents
  • In this lecture we will review rule-based expert
    systems
  • What do we mean by rule-based expert systems?
  • Architecture of a rule-based expert system
  • Inference in rule-based expert systems
  • Forward chaining
  • Backward chaining
  • Limitations of rule-based expert systems

3
What is an Expert System?
  • An expert system is a computer system that
  • Performs functions similar to those normally
    performed by a human expert
  • Uses a representation of human expertise in a
    specialist domain to perform functions similar to
    a human domain expert
  • Operates by applying an inference mechanism to a
    body of specialist expertise represented in a
    knowledge base

4
What is a Rule-Based Expert System?
  • If you had to explain to somebody how to cross a
    road you could do it with simple rules
  • Statements in this IF-THEN form are referred to
    as production rules
  • A rule-based expert system captures the knowledge
    of an expert in a set of production rules and
    combines these with observed data to generate
    inferences

IF the traffic light is green THEN the action
is go IF the traffic light is red THEN the
action is wait
5
Production Rules
  • Production rules
  • IF-THEN expressions
  • IF some condition(s) exists THEN perform some
    action(s)
  • Condition-action pair
  • Condition pattern that determines when a rule
    may be applied to problem instance
  • Action defines associated problem solving step
  • Antecedent Consequent
  • IF ltantecedentgt THEN ltconsequentgt

6
Production Rules (cont)
  • Rule can have multiple antecedents
  • Conjunction AND
  • Disjunction OR
  • Or a combination of both

IF ltantecedent0gt AND ltantecedent1gt AND
ltantecedentngt THEN ltconsequentgt
IF ltantecedent0gt OR ltantecedent1gt OR
ltantecedentngt THEN ltconsequentgt
IF ltantecedent0gt AND ltantecedent1gt AND
ltantecedentngt OR ltantecedent0gt OR ltantecedent1gt
OR ltantecedentngt THEN ltconsequentgt
7
Production Rules (cont)
  • Consequents can also have multiple clauses
  • Some production rule examples

IF ltantecedentgt THEN ltconsequent0gt,
ltconsequent1gt, ltconsequentn-1gt,
ltconsequentngt
IF the fuel tank is empty THEN the car is dead
IF patient has stomach pains AND (temperature gt
98 OR patient is nauseous) THEN diagnosis is
appendicitis, action is call the surgeon
IF the season is autumn AND the sky is
cloudy AND the forecast is drizzle THEN advice
is take an umbrella
8
Rule-Based Expert System Model
Inference Engine
Production System
Explanation Facilities
User Interface
User
9
Characteristics of a Rule-Based Expert System
Human Experts Expert Systems Conventional Programs
Use rules of thumb or heuristics to solve problems in a narrow domain Use rules and inference to solve problems in a narrow domain Process data and use algorithms to solve problems
Experts store their knowledge compiled in their brains Provide a clear separation of knowledge from its processing Do not separate knowledge from the control structures to process this knowledge
Capable of explaining a line of reasoning Trace the rules fired to explain how a particular conclusion was reached and why particular data was needed Do not explain how a particular result was obtained and why input data was needed
Use inexact reasoning and can deal with incomplete, uncertain and fuzzy information Permit inexact reasoning and can deal with incomplete, uncertain and fuzzy data Work only on problems where data is complete and exact
Can make mistakes when data is incomplete or fuzzy Can make mistakes when data is incomplete or fuzzy Provide no solution at all or a wrong one when data is incomplete or fuzzy
Enhance the quality of problem solving via years of learning and practical training. This is slow, inefficient and expensive Enhance the quality of problem solving by adding new rules or adjusting existing ones. This should be cheap and fast Enhance the quality of problem solving by changing the program code
10
Production System Model
Inference (Reasoning)
Conclusion
11
Production System
  • Long-term memory
  • Stores the production rules used to make
    inferences
  • Working memory
  • Current state of world
  • Pattern that is matched against the condition
    part of rules to select appropriate
    problem-solving actions
  • Actions may alter working memory

12
Production System (cont)
  • Inference cycle (Recognize-Act Cycle)
  • Working memory is initialized at start of
    reasoning
  • Current state is maintained as set of patterns in
    working memory
  • Patterns matched against conditions in rules to
    find a satisfied rule
  • Fire the selected rule
  • An action is performed changing working memory
  • Repeat until working memory no longer matches
    rule conditions

13
Data Driven Search Strategy
  • Forward Chaining Begins with problem description
    and infers new knowledge from the data
  • Applies rules of inference to current description
    of world and adds inferred results to problem
    description
  • Many rules may be executed that have nothing to
    do with the goal
  • Rule matching continues until the goal has been
    reached
  • May not be efficient

14
Data-Driven How Does it Work?
  • Data-driven search proceeds in cycles
  • Inference cycle matches the current state of the
    world against the sets of production rules
  • The current state of the world is the data that
    is assumed to be true or deduced as true from
    previously fired production rules
  • Action of a rule adds new fact(s) to the working
    memory when fired
  • Cycle stops when no further rules can be fired

15
Forward Chaining Example
  • Suppose that we know the facts A, B, C, D, E and
    the rules shown in the knowledge base to the left
  • What facts can we infer from this?

16
Forward Chaining Example
Database
A
B
C
D
E
X
Knowledge Base
Y D ? Z
X B E ? Y
A ? X
C ? L
L M ? N
Inference Cycle 1
17
Forward Chaining Example
Database
A
B
C
D
E
X
L
Knowledge Base
Y D ? Z
X B E ? Y
A ? X
C ? L
L M ? N
Inference Cycle 1
18
Forward Chaining Example
Database
Database
A
B
C
D
E
A
B
C
D
E
X
X
L
L
Knowledge Base
Knowledge Base
Y D ? Z
Y D ? Z
X B E ? Y
X B E ? Y
A ? X
A ? X
C ? L
C ? L
L M ? N
L M ? N
Inference Cycle 1
Inference Cycle 2
19
Forward Chaining Example
Database
Database
A
B
C
D
E
A
B
C
D
E
X
X
L
Y
L
Knowledge Base
Knowledge Base
Y D ? Z
Y D ? Z
X B E ? Y
X B E ? Y
A ? X
A ? X
C ? L
C ? L
L M ? N
L M ? N
Inference Cycle 1
Inference Cycle 2
20
Forward Chaining Example
Database
Database
Database
A
B
C
D
E
A
B
C
D
E
A
B
C
D
E
X
X
L
Y
L
X
L
Y
Knowledge Base
Knowledge Base
Knowledge Base
Y D ? Z
Y D ? Z
Y D ? Z
X B E ? Y
X B E ? Y
X B E ? Y
A ? X
A ? X
A ? X
C ? L
C ? L
C ? L
L M ? N
L M ? N
L M ? N
Inference Cycle 1
Inference Cycle 2
Inference Cycle 3
21
Forward Chaining Example
Database
Database
Database
A
B
C
D
E
A
B
C
D
E
A
B
C
D
E
X
X
L
Y
L
X
L
Y
Z
Knowledge Base
Knowledge Base
Knowledge Base
Y D ? Z
Y D ? Z
Y D ? Z
X B E ? Y
X B E ? Y
X B E ? Y
A ? X
A ? X
A ? X
C ? L
C ? L
C ? L
L M ? N
L M ? N
L M ? N
Inference Cycle 1
Inference Cycle 2
Inference Cycle 3
22
Forward Chaining Example
Database
Database
Database
A
B
C
D
E
A
B
C
D
E
A
B
C
D
E
After inferring facts X, L, Y and Z there are no
more rules that can be fired
X
X
L
Y
L
X
L
Y
Z
Knowledge Base
Knowledge Base
Knowledge Base
Y D ? Z
Y D ? Z
Y D ? Z
X B E ? Y
X B E ? Y
X B E ? Y
A ? X
A ? X
A ? X
C ? L
C ? L
C ? L
L M ? N
L M ? N
L M ? N
Inference Cycle 1
Inference Cycle 2
Inference Cycle 3
23
Goal-Driven Search Strategy
  • Backward Chaining A desired goal is placed in
    working memory, inference cycle attempts to find
    evidence to prove it
  • Search knowledge base for rules that might lead
    to goal
  • Rules that have the goal in their action parts
  • If condition of such rule matches fact in working
    memory then rule is fired and goal is proved

24
Goal Driven How Does it Work?
  • Goal driven search proceeds in cycles
  • Stack rule
  • Set up sub-goal to prove condition
  • Search for rules to prove sub-goal
  • Continue process of stacking until no rules found
    that can prove sub-goal
  • Most efficient when want to infer one particular
    fact
  • User may be asked to input additional facts

25
Backward Chaining Example
  • Suppose that we know the facts A, B, C, D, E and
    the rules shown in the knowledge base to the left
  • Can we infer the fact Z?

Knowledge Base
Y D ? Z
X B E ? Y
A ? X
C ? L
L M ? N
26
Backward Chaining Example
Z
Knowledge Base
Y D ? Z
X B E ? Y
A ? X
C ? L
L M ? N
Goal Z
27
Backward Chaining Example
Z
Knowledge Base
Y D ? Z
X B E ? Y
A ? X
C ? L
L M ? N
Goal Z
28
Backward Chaining Example
?
Z
Y
Knowledge Base
Knowledge Base
Y D ? Z
Y D ? Z
X B E ? Y
X B E ? Y
A ? X
A ? X
C ? L
C ? L
L M ? N
L M ? N
Goal Z
Sub-goal Y
29
Backward Chaining Example
?
Z
Y
Knowledge Base
Knowledge Base
Y D ? Z
Y D ? Z
X B E ? Y
X B E ? Y
A ? X
A ? X
C ? L
C ? L
L M ? N
L M ? N
Goal Z
Sub-goal Y
30
Backward Chaining Example
?
?
Z
Y
X
Knowledge Base
Knowledge Base
Knowledge Base
Y D ? Z
Y D ? Z
Y D ? Z
X B E ? Y
X B E ? Y
X B E ? Y
A ? X
A ? X
A ? X
C ? L
C ? L
C ? L
L M ? N
L M ? N
L M ? N
Goal Z
Sub-goal Y
Sub-goal X
31
Backward Chaining Example
?
?
Z
Y
X
Knowledge Base
Knowledge Base
Knowledge Base
Y D ? Z
Y D ? Z
Y D ? Z
X B E ? Y
X B E ? Y
X B E ? Y
A ? X
A ? X
A ? X
C ? L
C ? L
C ? L
L M ? N
L M ? N
L M ? N
Goal Z
Sub-goal Y
Sub-goal X
32
Backward Chaining Example
Database
A
B
C
D
E
X
?
Z
Y
Knowledge Base
Knowledge Base
Knowledge Base
Y D ? Z
Y D ? Z
Y D ? Z
X B E ? Y
X B E ? Y
X B E ? Y
A ? X
A ? X
A ? X
C ? L
C ? L
C ? L
L M ? N
L M ? N
L M ? N
Goal Z
Sub-goal Y
Sub-goal X
33
Backward Chaining Example
Database
Database
A
B
C
D
E
A
B
C
D
E
X
Y
X
Z
Knowledge Base
Knowledge Base
Knowledge Base
Y D ? Z
Y D ? Z
Y D ? Z
X B E ? Y
X B E ? Y
X B E ? Y
A ? X
A ? X
A ? X
C ? L
C ? L
C ? L
L M ? N
L M ? N
L M ? N
Goal Z
Sub-goal Y
Sub-goal X
34
Backward Chaining Example
Database
Database
Database
A
B
C
D
E
A
B
C
D
E
A
B
C
D
E
X
Y
Z
X
Y
X
Knowledge Base
Knowledge Base
Knowledge Base
Y D ? Z
Y D ? Z
Y D ? Z
X B E ? Y
X B E ? Y
X B E ? Y
A ? X
A ? X
A ? X
C ? L
C ? L
C ? L
L M ? N
L M ? N
L M ? N
Goal Z
Sub-goal Y
Sub-goal X
35
Backward Chaining Example
Database
Database
Database
A
B
C
D
E
A
B
C
D
E
A
B
C
D
E
Backward chaining inferred Z from the facts and
rules that were available
X
Y
Z
X
Y
X
Knowledge Base
Knowledge Base
Knowledge Base
Y D ? Z
Y D ? Z
Y D ? Z
X B E ? Y
X B E ? Y
X B E ? Y
A ? X
A ? X
A ? X
C ? L
C ? L
C ? L
L M ? N
L M ? N
L M ? N
Goal Z
Sub-goal Y
Sub-goal X
36
Data Driven Vs. Goal Driven
  • Data-driven reasoning is appropriate when there
    exist many equally acceptable goal states, a
    narrow body of facts and rules and a single
    initial state
  • Required facts are available
  • It is difficult to form a goal to verify
  • Goal directed inference is relevant when-
  • Relevant data must be acquired during the
    inference process
  • Large number of applicable rules exist
  • An obvious goal to verify is available

37
Conflict Resolution
  • What if more than one rule matches a in a
    particular situation?
  • We have actually already seen this in one of our
    examples
  • What should we do?

Database
A
B
C
D
E
Knowledge Base
Y D ? Z
X B E ? Y
A ? X
C ? L
L M ? N
38
Conflict Resolution
  • What if more than one rule matches a in a
    particular situation?
  • We have actually already seen this in one of our
    examples
  • What should we do?
  • The answer is referred to as conflict resolution

Database
A
B
C
D
E
X
L
?
?
Knowledge Base
Y D ? Z
X B E ? Y
A ? X
C ? L
L M ? N
39
Conflict Resolution (cont..)
  • What if more than one rule matches a in a
    particular situation?
  • Patterns are matched against conditions in rules
    to produce a set of satisfied rules
  • These rules are known as the conflict set
  • Conflict Resolution
  • One rule is selected and fired
  • Action is performed which changes working memory
  • Repeat until working memory no longer matches
    rule conditions

40
Conflict Resolution (cont..)
  • How do you choose which rule from the conflict
    set to fire?
  • Rule Ordering
  • Choose the first rule in the text, ordered
    top-to-bottom.
  • Recency
  • Prefers rules that use facts most recently added
  • Focuses on single line of reasoning
  • Specificity
  • More specific rules are preferable to more
    general
  • A rule is more specific if it has more conditions
    - implies a rule will match fewer potential
    working memory patterns

41
Conflict Resolution (cont..)
  • Refraction
  • Once a rule has fired it may not fire again until
    working memory elements that match its conditions
    have been modified
  • Discourages looping
  • Structure of rules and the conflict resolution
    scheme used controls the fashion in which the
    space is searched
  • Allows us to encode heuristics into production
    rules

42
Summary
  • In this lecture we have covered
  • What is a rule-based expert systems?
  • Overall architecture of rule-based expert systems
  • How inference works in a rule-based expert system
About PowerShow.com