Rules
Rules
KBS architecture
user
user
inference
knowledge
interface
engine
base
Rule-based reasoning
Rule-based reasoning
One can often represent the expertise
that someone uses to do an expert task
as rules.
A rule means a structure which has an if
component and a then component.
This is actually a very old idea indeed
ABCDEECDBBACDACDBCDECDADCADBADE
ECDBBACDACDBCDECDADCADBADCDBBACDA
BCDEECDBBACDACDBCDECDAD
BBACDACDBCDECDADCADBADEDCDBBA
DCDBBADCDBBABCDECDADCADBADEACDA
BACDACDBCDECDADBACDACDBCDECDAD
Terminology
Terminology
Terminology
Some
Terminology
Terminology
Historical note
Mathematicians, linguists, psychologists
and artificial intelligence specialists
explored the possibilities of production
rules during the 40s, 50s and 60s.
When the first expert systems were
invented in the 70s, it seemed natural to
use production rules as the knowledge
representation formalism for the
knowledge base.
Historical note
Conditional branching
Conditional branching
Conditional branching
{ int magic;
int guess;
magic = rand( );
printf(guess the magic number: );
scanf(%d, &guess);
if (guess == magic) printf(** Right **);
else {
printf(Wrong, );
if (guess > magic) printf(too high);
else printf(too low);
}
}
select
rule
memory
working
memory
fire
modify
Inference
engine
output
select
rule
memory
working
memory
fire
modify
interpreter
output
select
rule
memory
working
memory
fire
modify
interpreter
output
select
rule
memory
working
memory
modify
Inference
engine
fire
executes
actions
output
select
rule
memory
working
memory
modify
Inference
engine
fire
executes
actions
output
select
rule
memory
working
memory
fire
modify
interpreter
output
select
rule
memory
working
memory
fire
modify
Inference
engine
executes
actions
output
select
rule
memory
working
memory
fire
modify
Inference
engine
executes
actions
output
Advantages of production
systems ... at first glance
Advantages of production
systems ... at first glance
This would seem to be a purely declarative
form of knowledge representation. One
gathers pieces of knowledge about a
particular subject, and puts them into a
rulebase. One doesn't bother about when or
how or in which sequence the rules are used;
the production system can deal with that.
When one wishes to expand the knowledge,
one just adds more rules at the end of the
rulebase.
Advantages of production
systems ... at first glance
Advantages of production
systems ... at first glance
Advantages of production
systems ... at first glance
Halt
no
no
Has
the rule
got the
command
"halt" at
the
end?
Information
sources & recipients
the
user
working
memory
yes
Halt
Any
rules
eligible
to fire
?
yes
Use conflict resolution
strategy to cut this
down to one rule.
Information
sources & recipients
the
user
working
memory
yes
Halt
Any
rules
Pick rules on the
(forward-chaining):
eligible
basis of what's in
to fire
working memory
?
yes
Use conflict resolution
strategy to cut this
down to one rule.
Put the right-hand side
of the rule into effect,
using the information
from working memory
Information
sources & recipients
the
user
working
memory
yes
Halt
Any
rules
Pick rules on the
(forward-chaining):
eligible
basis of what's in
to fire
working memory
?
yes
Use conflict resolution
strategy to cut this
down to one rule.
Put the right-hand side
of the rule into effect,
using the information
from working memory
Put the
worda
"start"
Operation
of
production
system
Halt
in working memory
in more detail
no
Set the cycle going
Information
sources & recipients
the
user
working
memory
yes
Halt
Any
rules
Pick rules on the
(forward-chaining):
eligible
basis of what's in
to fire
working memory
?
yes
Use conflict resolution
strategy to cut this
down to one rule.
Put the right-hand side
of the rule into effect,
using the information
from working memory
Information
sources & recipients
the
user
working
memory
yes
Halt
Any
rules
Pick rules on the
(forward-chaining):
eligible
basis of what's in
to fire
working memory
?
yes
Use conflict resolution
strategy to cut this
down to one rule.
Put the right-hand side
of the rule into effect,
using the information
from working memory
Information
sources & recipients
the
user
working
memory
yes
Halt
Any
rules
Pick rules on the
(forward-chaining):
eligible
basis of what's in
to fire
working memory
?
yes
Use conflict resolution
strategy to cut this
down to one rule.
Put the right-hand side
of the rule into effect,
using the information
from working memory
Information
sources & recipients
the
user
working
memory
yes
Halt
Any
rules
Pick rules on the
(forward-chaining):
eligible
basis of what's in
to fire
working memory
?
yes
Use conflict resolution
strategy to cut this
down to one rule.
Put the right-hand side
of the rule into effect,
using the information
from working memory
Information
sources & recipients
the
user
working
memory
yes
Halt
Any
rules
Pick rules on the
(forward-chaining):
eligible
basis of what's in
to fire
working memory
?
yes
Use conflict resolution
strategy to cut this
down to one rule.
Put the right-hand side
of the rule into effect,
using the information
from working memory
Refractoriness:
Give
Advantages of production
systems reconsidered.
Advantages of production
systems reconsidered.
Advantages of production
systems reconsidered.
Advantages of production
systems reconsidered.