CS 74.420 Expert Systems

Download Report

Transcript CS 74.420 Expert Systems

COMP 4200:
Expert Systems
Dr. Christel Kemke
Department of Computer Science
University of Manitoba
© C. Kemke
Reasoning - Introduction
1
Reasoning in Expert Systems
knowledge representation in Expert Systems
 shallow and deep reasoning
 forward and backward reasoning
 alternative inference methods
 metaknowledge

© C. Kemke
Reasoning - Introduction
2
Experts and Expert Systems

Human Experts achieve high performance because
of extensive knowledge concerning their field

Generally developed over many years
Expert performance
depends on expert knowledge!
© C. Kemke
Reasoning - Introduction
3
Types of Knowledge
Knowledge Representation in XPS can include:

conceptual knowledge


derivative knowledge


conclusions between facts
causal connections


terminology, domain-specific terms
causal model of domain
procedural knowledge

© C. Kemke
guidelines for actions
Reasoning - Introduction
4
Knowledge Modeling in XPS
Knowledge Modeling Technique in XPS
 mostly rule-based systems (RBS)
 rule system models elements of knowledge
formulated independently as rules
 rule set is easy to expand
 often only limited ‘deep’ knowledge, i.e. no
explicit coherent causal or functional model of
the domain
© C. Kemke
Reasoning - Introduction
5
Shallow and Deep Reasoning

shallow reasoning
also called “experiential reasoning”
 aims at describing aspects of the world heuristically
 short inference chains
 complex rules


deep reasoning
also called causal reasoning
 aims at building a model that behaves like the “real thing”
 long inference chains
 simple rules that describe cause and effect relationships

© C. Kemke
Reasoning - Introduction
6
Dilbert on Reasoning 1
© C. Kemke
Reasoning - Introduction
7
Dilbert on Reasoning 2
© C. Kemke
Reasoning - Introduction
8
Dilbert on Reasoning 3
© C. Kemke
Reasoning - Introduction
9
General Technology of XPS
Knowledge + Inference
 core of XPS
 Most often Rule-Based Systems (RBS)
 other forms: Neural Networks, Case-Based
Reasoning
© C. Kemke
Reasoning - Introduction
10
Rule-Based Expert Systems
Work with
 a set of facts describing the current world
state
 a set of rules describing the expert
knowledge
 inference mechanisms for combining facts
and rules in reasoning
© C. Kemke
Reasoning - Introduction
11
Inference Engine
Knowledge Base
(rules)
Agenda
Working Memory
(facts)
Knowledge
Acquisition
Facility
Explanation
Facility
User Interface
© C. Kemke
Reasoning - Introduction
12
Architecture of Rule-Based XPS 1
Knowledge-Base / Rule-Base


stores expert knowledge as “condition-action-rules” (or: ifthen- or premise-consequence-rules)
objects or frame structures are often used to represent
concepts in the domain of expertise, e.g. “club” in the golf
domain.
Working Memory


stores initial facts and generated facts derived by the
inference engine
additional parameters like the “degree of trust” in the truth
of a fact or a rule ( certainty factors) or probabilistic
measurements can be added
© C. Kemke
Reasoning - Introduction
13
Architecture of Rule-Based XPS 2
Inference Engine
 matches condition-part of rules against facts stored in
Working Memory (pattern matching);
 rules with satisfied condition are active rules and are
placed on the agenda;
 among the active rules on the agenda, one is selected
(see conflict resolution, priorities of rules) as next rule
for
 execution (“firing”) – consequence of rule can add new
facts to Working Memory, modify facts, retract facts, and
more
© C. Kemke
Reasoning - Introduction
14
Architecture of Rule-Based XPS 3
Inference Engine + additional components
might be necessary for other functions, like
 calculation of certainty values,
 determination of priorities of rules
 and conflict resolution mechanisms,
 a truth maintenance system (TMS) if reasoning with
defaults and beliefs is requested
© C. Kemke
Reasoning - Introduction
15
Rule-Based Systems
- Example ‘Grades’ -
Rules to determine ‘grade’
1. study  good_grade
2. not_study  bad_grade
3. sun_shines  go_out
4. go_out  not_study
5. stay_home  study
6. awful_weather  stay_home
© C. Kemke
Reasoning - Introduction
16
Example ‘Grades’
Rule-Base to determine the ‘grade’:
1.
2.
3.
4.
5.
6.
study  good_grade
not_study  bad_grade
sun_shines  go_out
go_out  not_study
stay_home  study
awful_weather  stay_home
Q1: If the weather is awful, do you get a good or bad grade?
Q2: When do you get a good grade?
© C. Kemke
Reasoning - Introduction
17
Forward and Backward Reasoning
forward reasoning

Facts are given. What is the conclusion?
A set of known facts is given (in WM); apply rules to
derive new facts as conclusions (forward chaining of
rules) until you come up with a requested final goal fact.
backward reasoning

Hypothesis (goal) is given. Is it supported by facts?
A hypothesis (goal fact) is given; try to derive it based on
a set of given initial facts using sub-goals (backward
chaining of rules) until goal is grounded in initial facts.
© C. Kemke
Reasoning - Introduction
18
Example ‘Grades’
1. study  good_grade
2. not_study  bad_grade
3. sun_shines  go_out
4. go_out  not_study
5. stay_home  study
6. awful_weather  stay_home
forward reasoning
given fact: awful_weather
backward reasoning
hypothesis/goal: good_grade
© C. Kemke
Reasoning - Introduction
rule chain
6,5,1
1,5,6
19
Example ‘Grades’ – Reasoning Tree
© C. Kemke
good grade
bad grade
study
not study
stay home
go out
awful weather
sun shines
Reasoning - Introduction
20
Example – Grades
Working Memory
awful weather
Agenda
Rule 6
Select and apply Rule 6
awful weather
stay home
Rule 5
Select and apply Rule 5
© C. Kemke
Reasoning - Introduction
21
Example – Grades
Working Memory
awful weather
stay home
study
Agenda
Rule 1
Select and apply Rule 1
awful weather
stay home
study
good grade
empty
DONE!
© C. Kemke
Reasoning - Introduction
22
Example ‘Police’ – Reasoning Tree
forward reasoning:
backward reasoning:
Shield AND Pistol  Police
Police  Badge AND gun
Police
Badge
AND
Bad Boy
Gun
OR
Shield
Revolver
Pistol
Q: What if only ‘Gun’ is known?
© C. Kemke
Reasoning - Introduction
23
Example ‘Police’ – Reasoning Tree
Police
Badge
AND
Bad Boy
Gun
OR
Shield
Revolver
Pistol
Q: What if only ‘Pistol’ is known as ground fact?
© C. Kemke
Reasoning - Introduction
24
Example ‘Police’ – Reasoning Tree
Bad Boy
Police
Badge
AND
Gun
OR
Shield
Revolver
Pistol
Task: Write down the Rule-Base for this example!
© C. Kemke
Reasoning - Introduction
25
Forward vs. Backward Chaining
Forward Chaining
Backward Chaining
diagnosis
construction
data-driven
goal-driven (hypothesis)
bottom-up reasoning
top-down reasoning
find possible conclusions
supported by given facts
antecedents (LHS) control
evaluation
find facts that support a
given hypothesis
consequents (RHS) control
evaluation
© C. Kemke
Reasoning - Introduction
26
Alternative Reasoning Methods

Theorem Proving


Probabilistic Reasoning


integrates probabilities into the reasoning process
Certainty Factors


emphasis on mathematical proofs and correctness,
not so much on performance and ease of use
Express subjective assessment of truth of fact or rule
Fuzzy Reasoning

© C. Kemke
allows the use of vaguely defined predicates and rules
Reasoning - Introduction
27
Metaknowledge

deals with “knowledge about knowledge”
e.g. reasoning about properties of knowledge
representation schemes, or inference mechanisms
 usually relies on higher order logic





© C. Kemke
in (first order) predicate logic, quantifiers are applied to variables
second-order predicate logic allows the use of quantifiers for
function and predicate symbols
may result in substantial performance problems
CLIPS uses meta-knowledge to define itself, i.e. CLIPS
constructs, classes, etc. - in a bootstrapping form
Reasoning - Introduction
28