SlideShare uma empresa Scribd logo
1 de 74
Rule-based Systems
John Platt
KBS architecture
KBS architecture (1)
The typical architecture of an KBS is often
described as follows:
user
user
interface
inference
engine
knowledge
base
KBS architecture (1)
The inference engine and knowledge
base are separated because:
the reasoning mechanism needs to be as
stable as possible;
the knowledge base must be able to grow
and change, as knowledge is added;
this arrangement enables the system to be
built from, or converted to, a shell.
KBS architecture (2)
It is reasonable to produce a richer,
more elaborate, description of the
typical KBS.
A more elaborate description, which still
includes the components that are to be
found in almost any real-world system,
would look like this:
KBS architecture (2)
KBS architecture (2)
KBS architecture (2)
The system holds a collection of general
principles which can potentially be applied to
any problem - these are stored in the
knowledge base.
The system also holds a collection of specific
details that apply to the current problem
(including details of how the current
reasoning process is progressing) - these are
held in working memory.
Both these sorts of information are processed
by the inference engine.
KBS architecture (2)
KBS architecture (2)
Any practical expert system needs an
explanatory facility. It is essential that an
expert system should be able to explain
its reasoning. This is because:
it gives the user confidence in the
system;
it makes it easier to debug the system.
KBS architecture (2)
KBS architecture (2)
It is not unreasonable to include an
expert interface & a knowledge base
editor, since any practical KBS is going
to need a mechanism for efficiently
building and modifying the knowledge
base.
KBS architecture (2)
As mentioned earlier, a reliable expert
should be able to explain and justify
his/her advice and actions.
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 -
The Edwin Smith papyrus
The Edwin Smith papyrus is a 3700-
year-old ancient Egyptian text.
ABCDEECDBBACDACDBCDECDADCADBADE
ECDBBACDACDBCDECDADCADBADCDBBACDA
BCDEECDBBACDACDBCDECDAD
BBACDACDBCDECDADCADBADEDCDBBA
DCDBBADCDBBABCDECDADCADBADEACDA
BACDACDBCDECDADBACDACDBCDECDAD
The Edwin Smith papyrus
It contains medical descriptions of 48
different types of head wound.
There is a fixed format for each problem
description: Title - symptoms - diagnosis
- prognosis - treatment.
The Edwin Smith papyrus
There's a fixed style for the parts of
each problem description. Thus, the
prognosis always reads "It is an injury
that I will cure", or "It is an injury that I
will combat", or "It is an injury against
which I am powerless".
An example taken from the Edwin Smith
papyrus:
The Edwin Smith papyrus
Title:
Instructions for treating a fracture of the
cheekbone.
Symptoms:
If you examine a man with a fracture of
the cheekbone, you will find a salient
and red fluxion, bordering the wound.
The Edwin Smith papyrus
Diagnosis and prognosis:
Then you will tell your patient: "A fracture of
the cheekbone. It is an injury that I will
cure."
Treatment:
You shall tend him with fresh meat the first
day. The treatment shall last until the fluxion
resorbs. Next you shall treat him with
raspberry, honey, and bandages to be
renewed each day, until he is cured.
Rule-based reasoning: rules
examples:
if - the leaves are dry, brittle and
discoloured
then - the plant has been attacked by red
spider mite
if - the customer closes the account
then - delete the customer from the
database
Rule-based reasoning: rules
The statement, or set of statements,
after the word if represents some
pattern which you may observe.
The statement, or set of statements,
after the word then represents some
conclusion that you can draw, or some
action that you should take.
Rule-based reasoning: rules
A rule-based system, therefore, either
identifies a pattern and draws
conclusions about what it means,
or
identifies a pattern and advises what
should be done about it,
or
identifies a pattern and takes
appropriate action.
Rule-based reasoning: rules
• The essence of a rule-based reasoning system is
that it goes through a series of cycles.
• In each cycle, it attempts to pick an appropriate rule
from its collection of rules, depending on the
present circumstances, and to use it as described
above.
• Because using a rule produces new information, it's
possible for each new cycle to take the reasoning
process further than the cycle before. This is rather
like a human following a chain of ideas in order to
come to a conclusion.
Terminology
A rule as described above is often
referred to as a production rule.
A set of production rules, together with
software that can reason with them, is
known as a production system.
Terminology
There are several different terms for the statements
that come after the word if, and those that come after
the word then.
The statements after if may be called the
conditions, those after then may be called the
conclusions.
The statements after if may be called the premises,
those after then may be called the actions.
The statements after if may be called the
antecedents, those after then may be called the
consequents.
Terminology
Some writers just talk about the if-part and the
then-part.
Terminology
If a production system chooses a
particular rule, because the conditions
match the current state of affairs, and
puts the conclusions into effect, this is
known as firing the rule.
Terminology
In a production system, the rules are
stored together, in an area called the
rulebase.
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
Production rules have remained the
most popular form of knowledge
representation for expert systems ever
since.
Conditional branching
Is a production rule the same as a
conditional branching statement?
A production rule looks similar to the
if (statement to be evaluated) then (action)
pattern which is a familiar feature of all
conventional programming languages.
Conditional branching
e.g. The following fragment from a C
program:
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”);
}
Conditional branching vs. production
rules
However, the similarity is misleading.
There is a radical difference between a
production system and a piece of
conventional software.
In a conventional program, the
if...then... structure is an integral part
of the code, and represents a point
where the execution can branch in
one of two (or more) directions.
Conditional branching vs. production
rules
In a production system, the if...then...
rules are gathered together in a rule
base, and the controlling part of the
system has some way of choosing a
rule from this knowledge base which
is appropriate to the current
circumstances, and then using it.
Reasoning with production rules
The statements forming the conditions,
or the conclusions, in such rules, may
be structures, following some syntactic
convention (such as three items
enclosed in brackets).
Reasoning with production rules
Very often, these structures will include
variables - such variables can, of
course, be given a particular value, and
variables with the same name in the
same rule will share the same value.
Reasoning with production rules
For example (assuming words
beginning with capital letters are
variables, and other words are
constants):
if [Person, age, Number] &
[Person, employment, none] &
[Number, greater_than, 18] &
[Number, less_than, 65]
then [Person, can_claim,
Reasoning with production rules
Architecture of a typical production
system:
rule
memory
Inference
engine
working
memory
observed data
fire
modifyselect
output
Reasoning with production rules
Architecture of a typical production
system:
rule
memory
interpreter
working
memory
New information
fire
modifyselect
output
Reasoning with production rules
Architecture of a typical production
system:
rule
memory
interpreter
working
memory
New information
fire
modify
select
output
Reasoning with production rules
Architecture of a typical production
system:
rule
memory
Inference
engine
executes
actions
working
memory
New information
fire
modify
select
output
Reasoning with production rules
Architecture of a typical production
system:
rule
memory
Inference
engine
executes
actions
working
memory
New information
fire
modifyselect
output
Reasoning with production rules
Architecture of a typical production
system:
rule
memory
interpreter
working
memory
New information
fire
modify
select
output
Reasoning with production rules
Architecture of a typical production
system:
rule
memory
Inference
engine
executes
actions
working
memory
New information
fire
modify
select
output
Reasoning with production rules
Architecture of a typical production
system:
rule
memory
Inference
engine
executes
actions
working
memory
New information
fire
modifyselect
output
Architecture of a typical production system
Has a working memory.
Holds items of data. Their presence, or
their absence, causes the inference
engine to trigger certain rules.
e.g. W.M. contains [john, age, 29] &
[john, employment, none]
The system decides: does this match
any rules in the rulebase? If so, choose
the rule.
Architecture of a typical production system
has an inference engine. Behaviour of
the inference engine :
the system is started by putting a
suitable data item into working memory.
recognise-act cycle: when data in the
working memory matches the conditions
of one of the rules in the system, the rule
fires (i.e.is brought into action).
Advantages of production
systems ... at first glance
The principle advantage of production
rules is notational convenience - it’s
easy to express suitable pieces of
knowledge in this way.
The principle disadvantage of
production rules is their restricted power
of expression - many useful pieces of
knowledge don’t fit this pattern.
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
Advantages of production
systems ... at first glance
The rules themselves are very easy to
understand, and for someone (who is expert
in the specific subject the system is
concerned with) to criticise and improve.
Advantages of production
systems ... at first glance
It's fairly straightforward to implement a
production system interpreter. Following the
development of the Rete Matching
Algorithm, and other improvements, quite
efficient interpreters are now available.
Advantages of production
systems ... at first glance
However, it isn't that simple. See
"advantages reconsidered" later on.
Operation of a production system
in more detail
The recognise-act cycle (forward-chaining):
Halt
yes
no
Has
the rule
got the
command
"halt" at
Produce some output
Put the right-hand side
of the rule into effect,
using the information
from working memory
Halt
Pick rules on the
basis of what's in
working memory
Set the cycle going
Put the word "start"
in working memory
Use conflict resolution
strategy to cut this
down to one rule.the
end?
Any
rules
eligible
to fire
?
no
yes
Information
sources & recipients
the working
user memory
Operation of a production system
in more detail
The recognise-act cycle (forward-chaining):
Halt
yes
no
Has
therule
gotthe
command
"halt"at
Producesomeoutput
Puttheright-handside
oftheruleintoeffect,
usingtheinformation
fromworkingmemory
Halt
Pickrulesonthe
basisofwhat'sin
workingmemory
Setthecyclegoing
Puttheword"start"
inworkingmemory
Useconflictresolution
strategytocutthis
downtoonerule.the
end?
Any
rules
eligible
tofire
?
no
yes
Information
sources&recipients
the working
user memory
Operation of a production system
in more detail
The recognise-act cycle (forward-chaining):
Halt
yes
no
Has
the rule
got the
comm and
"halt" at
Produce som e output
Put the right-hand side
of the rule into effect,
using the inform ation
from working mem ory
Halt
Pick rules on the
basis of what's in
working m em ory
Set the cycle going
Put the word "start"
in working m emory
Use conflict resolution
strategy to cut this
down to one rule.the
end?
Any
rules
eligible
to fire
?
no
yes
Inform ation
sources & recipients
the working
user m em ory
Operation of a production system
in more detail
The recognise-act cycle (forward-chaining):
Halt
yes
no
Has
therule
gotthe
command
"halt"at
Producesomeoutput
Puttheright-handside
oftheruleintoeffect,
usingtheinformation
fromworkingmemory
Halt
Pickrulesonthe
basisofwhat'sin
workingmemory
Setthecyclegoing
Puttheword"start"
inworkingmemory
Useconflictresolution
strategytocutthis
downtoonerule.the
end?
Any
rules
eligible
tofire
?
no
yes
Information
sources&recipients
the working
user memory
Operation of a production system
in more detail
The recognise-act cycle (forward-chaining):
Halt
yes
no
Has
the rule
got the
comm and
"halt" at
Produce som e output
Put the right-hand side
of the rule into effect,
using the inform ation
from working mem ory
Halt
Pick rules on the
basis of what's in
working m em ory
Set the cycle going
Put the word "start"
in working m emory
Use conflict resolution
strategy to cut this
down to one rule.the
end?
Any
rules
eligible
to fire
?
no
yes
Inform ation
sources & recipients
the working
user m em ory
Operation of a production system
in more detail
The recognise-act cycle (forward-chaining):
Halt
yes
no
Has
the rule
got the
comm and
"halt" at
Produce som e output
Put the right-hand side
of the rule into effect,
using the inform ation
from working mem ory
Halt
Pick rules on the
basis of what's in
working m em ory
Set the cycle going
Put the word "start"
in working m emory
Use conflict resolution
strategy to cut this
down to one rule.the
end?
Any
rules
eligible
to fire
?
no
yes
Inform ation
sources & recipients
the working
user m em ory
Operation of a production system
in more detail
The recognise-act cycle (forward-chaining):
Halt
yes
no
Has
the rule
got the
comm and
"halt" at
Produce som e output
Put the right-hand side
of the rule into effect,
using the inform ation
from working mem ory
Halt
Pick rules on the
basis of what's in
working m em ory
Set the cycle going
Put the word "start"
in working m emory
Use conflict resolution
strategy to cut this
down to one rule.the
end?
Any
rules
eligible
to fire
?
no
yes
Inform ation
sources & recipients
the working
user m em ory
Operation of a production system
in more detail
The recognise-act cycle (forward-chaining):
Halt
yes
no
Has
the rule
got the
comm and
"halt" at
Produce som e output
Put the right-hand side
of the rule into effect,
using the inform ation
from working mem ory
Halt
Pick rules on the
basis of what's in
working m em ory
Set the cycle going
Put the word "start"
in working m emory
Use conflict resolution
strategy to cut this
down to one rule.the
end?
Any
rules
eligible
to fire
?
no
yes
Inform ation
sources & recipients
the working
user m em ory
The recognise-act cycle
N.B. "right-hand side of the rule" means
the part after the word then.
The recognise-act cycle
conflict resolution strategy: if more than
one rule matches working memory
contents, this decides which one is to
fire. Alternatively, the rule base could be
designed so there's never any conflict
(but usually isn't).
The recognise-act cycle
Applying the rule will probably modify
the contents of working memory. Then
the system continues with the
recognise-act cycle.
The system stops when
the rules stop firing, or
a rule fires which specifically tells the
system to halt.
Conflict resolution strategies
Choice of c.r.s. can make a big
difference to system performance.
Three favourite strategies:
Refractoriness: don't allow a rule to fire
twice on same data.
Recency: take the data which arrived in
working memory most recently, and find a
rule that uses this data.
Specificity: use the most specific rule (the
one with the most conditions attached).
Conflict resolution strategies
However, in recent years the fashion (in
expert system shells) has been for very
simple CRSs, coupled with a reluctance
to mention the problem to the potential
system builder.
Simple strategies:
Give each rule a priority number. If a choice
has to be made, choose the rule with the
highest number.
If a choice has to be made, choose the rule
that comes first in the rule base.
Advantages of production
systems reconsidered.
Because of the effect of conflict
resolution strategies, rules interact and
the order of rules matters.
One must go beyond the declarative
meaning of the rules and consider when
(under which circumstances) they will fire.
One cannot properly understand a rule
simply by reading it in isolation; one must
consider the related rules, the meta-rules,
and the conflict resolution strategy as well.
Advantages of production
systems reconsidered.
For the same reason, attempting to
expand a production system by simply
adding more rules at the end is
dangerous.
Unexpected rule interactions are
liable to happen.
The need to consider all these
possible rule interactions makes large
rule-based systems unwieldy and
hard to update.
Advantages of production
systems reconsidered.
Although non-computer-specialists find
it easy to grasp the meaning of
individual rules, they don't find it easy to
grasp these issues concerned with
interactions.
Advantages of production
systems reconsidered.
Although efficient rule interpreters are
available, one may still need to engage
in meta-level programming in order to
achieve a production system that shows
acceptable performance on a large
rulebase.

Mais conteúdo relacionado

Semelhante a Rules

01bkb02p.ppt
01bkb02p.ppt01bkb02p.ppt
01bkb02p.pptoluobes
 
01bkb02p(1).ppt
01bkb02p(1).ppt01bkb02p(1).ppt
01bkb02p(1).pptoluobes
 
Production System1.pdf
Production System1.pdfProduction System1.pdf
Production System1.pdfsajidawazeer8
 
Expert systems from rk
Expert systems from rkExpert systems from rk
Expert systems from rkramaslide
 
Expert System With Python -1
Expert System With Python -1Expert System With Python -1
Expert System With Python -1Ahmad Hussein
 
Expert system (unit 1 & 2)
Expert system (unit 1 & 2)Expert system (unit 1 & 2)
Expert system (unit 1 & 2)Lakshya Gupta
 
EPSAHypACone2005
EPSAHypACone2005EPSAHypACone2005
EPSAHypACone2005Adam Cone
 
SELF LEARNING REAL TIME EXPERT SYSTEM
SELF LEARNING REAL TIME EXPERT SYSTEMSELF LEARNING REAL TIME EXPERT SYSTEM
SELF LEARNING REAL TIME EXPERT SYSTEMcscpconf
 
Mining Frequent Patterns, Associations, and.pptx
 Mining Frequent Patterns, Associations, and.pptx Mining Frequent Patterns, Associations, and.pptx
Mining Frequent Patterns, Associations, and.pptxRushikeshChikane2
 
Ai lecture 02(unit-02)
Ai lecture  02(unit-02) Ai lecture  02(unit-02)
Ai lecture 02(unit-02) vikas dhakane
 
Project Presentation
Project PresentationProject Presentation
Project Presentationbutest
 
Finalpresentation 120711124135-phpapp02
Finalpresentation 120711124135-phpapp02Finalpresentation 120711124135-phpapp02
Finalpresentation 120711124135-phpapp02Bhargava Dutt
 
1_Expertsystems.ppt
1_Expertsystems.ppt1_Expertsystems.ppt
1_Expertsystems.pptRISHI643981
 
Cybernetics in supply chain management
Cybernetics in supply chain managementCybernetics in supply chain management
Cybernetics in supply chain managementLuis Cabrera
 

Semelhante a Rules (20)

01bkb02p.ppt
01bkb02p.ppt01bkb02p.ppt
01bkb02p.ppt
 
01bkb02p(1).ppt
01bkb02p(1).ppt01bkb02p(1).ppt
01bkb02p(1).ppt
 
Production System1.pdf
Production System1.pdfProduction System1.pdf
Production System1.pdf
 
Expert systems from rk
Expert systems from rkExpert systems from rk
Expert systems from rk
 
Expert System With Python -1
Expert System With Python -1Expert System With Python -1
Expert System With Python -1
 
Expert system (unit 1 & 2)
Expert system (unit 1 & 2)Expert system (unit 1 & 2)
Expert system (unit 1 & 2)
 
Lecture 6 expert systems
Lecture 6   expert systemsLecture 6   expert systems
Lecture 6 expert systems
 
Production System
Production SystemProduction System
Production System
 
Data day2017
Data day2017Data day2017
Data day2017
 
Caddie presentation
Caddie presentationCaddie presentation
Caddie presentation
 
EPSAHypACone2005
EPSAHypACone2005EPSAHypACone2005
EPSAHypACone2005
 
SELF LEARNING REAL TIME EXPERT SYSTEM
SELF LEARNING REAL TIME EXPERT SYSTEMSELF LEARNING REAL TIME EXPERT SYSTEM
SELF LEARNING REAL TIME EXPERT SYSTEM
 
Mining Frequent Patterns, Associations, and.pptx
 Mining Frequent Patterns, Associations, and.pptx Mining Frequent Patterns, Associations, and.pptx
Mining Frequent Patterns, Associations, and.pptx
 
Expert system
Expert systemExpert system
Expert system
 
Ai lecture 02(unit-02)
Ai lecture  02(unit-02) Ai lecture  02(unit-02)
Ai lecture 02(unit-02)
 
Project Presentation
Project PresentationProject Presentation
Project Presentation
 
expert systems
expert systemsexpert systems
expert systems
 
Finalpresentation 120711124135-phpapp02
Finalpresentation 120711124135-phpapp02Finalpresentation 120711124135-phpapp02
Finalpresentation 120711124135-phpapp02
 
1_Expertsystems.ppt
1_Expertsystems.ppt1_Expertsystems.ppt
1_Expertsystems.ppt
 
Cybernetics in supply chain management
Cybernetics in supply chain managementCybernetics in supply chain management
Cybernetics in supply chain management
 

Mais de Aman Jaiswal

Transport protocols
Transport protocolsTransport protocols
Transport protocolsAman Jaiswal
 
Congestion control
Congestion controlCongestion control
Congestion controlAman Jaiswal
 
Congestion control 1
Congestion control 1Congestion control 1
Congestion control 1Aman Jaiswal
 
Chapter 8 lan_technologies_and_network_topology
Chapter 8 lan_technologies_and_network_topologyChapter 8 lan_technologies_and_network_topology
Chapter 8 lan_technologies_and_network_topologyAman Jaiswal
 
Bca 221 network fundamentals
Bca 221 network fundamentalsBca 221 network fundamentals
Bca 221 network fundamentalsAman Jaiswal
 
1network security encryption_methods-1
1network security encryption_methods-11network security encryption_methods-1
1network security encryption_methods-1Aman Jaiswal
 
06 1 routing_algorithms
06 1 routing_algorithms06 1 routing_algorithms
06 1 routing_algorithmsAman Jaiswal
 
Transmission medium
Transmission mediumTransmission medium
Transmission mediumAman Jaiswal
 
Networkingdevices 120505003202-phpapp02
Networkingdevices 120505003202-phpapp02Networkingdevices 120505003202-phpapp02
Networkingdevices 120505003202-phpapp02Aman Jaiswal
 

Mais de Aman Jaiswal (13)

Transport protocols
Transport protocolsTransport protocols
Transport protocols
 
Congestion control
Congestion controlCongestion control
Congestion control
 
Congestion control 1
Congestion control 1Congestion control 1
Congestion control 1
 
Chapter 8 lan_technologies_and_network_topology
Chapter 8 lan_technologies_and_network_topologyChapter 8 lan_technologies_and_network_topology
Chapter 8 lan_technologies_and_network_topology
 
Bca 221 network fundamentals
Bca 221 network fundamentalsBca 221 network fundamentals
Bca 221 network fundamentals
 
1network security encryption_methods-1
1network security encryption_methods-11network security encryption_methods-1
1network security encryption_methods-1
 
06 1 routing_algorithms
06 1 routing_algorithms06 1 routing_algorithms
06 1 routing_algorithms
 
Multiplexing
MultiplexingMultiplexing
Multiplexing
 
Transmission medium
Transmission mediumTransmission medium
Transmission medium
 
Osi
OsiOsi
Osi
 
Networkingdevices 120505003202-phpapp02
Networkingdevices 120505003202-phpapp02Networkingdevices 120505003202-phpapp02
Networkingdevices 120505003202-phpapp02
 
Ch03
Ch03Ch03
Ch03
 
Dc unit i
Dc unit iDc unit i
Dc unit i
 

Último

Lucknow Call girls - 8800925952 - 24x7 service with hotel room
Lucknow Call girls - 8800925952 - 24x7 service with hotel roomLucknow Call girls - 8800925952 - 24x7 service with hotel room
Lucknow Call girls - 8800925952 - 24x7 service with hotel roomdiscovermytutordmt
 
Call Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Top Rated Bangalore Call Girls Richmond Circle ⟟ 8250192130 ⟟ Call Me For Gen...
Top Rated Bangalore Call Girls Richmond Circle ⟟ 8250192130 ⟟ Call Me For Gen...Top Rated Bangalore Call Girls Richmond Circle ⟟ 8250192130 ⟟ Call Me For Gen...
Top Rated Bangalore Call Girls Richmond Circle ⟟ 8250192130 ⟟ Call Me For Gen...narwatsonia7
 
(Rocky) Jaipur Call Girl - 09521753030 Escorts Service 50% Off with Cash ON D...
(Rocky) Jaipur Call Girl - 09521753030 Escorts Service 50% Off with Cash ON D...(Rocky) Jaipur Call Girl - 09521753030 Escorts Service 50% Off with Cash ON D...
(Rocky) Jaipur Call Girl - 09521753030 Escorts Service 50% Off with Cash ON D...indiancallgirl4rent
 
♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...
♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...
♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...astropune
 
High Profile Call Girls Coimbatore Saanvi☎️ 8250192130 Independent Escort Se...
High Profile Call Girls Coimbatore Saanvi☎️  8250192130 Independent Escort Se...High Profile Call Girls Coimbatore Saanvi☎️  8250192130 Independent Escort Se...
High Profile Call Girls Coimbatore Saanvi☎️ 8250192130 Independent Escort Se...narwatsonia7
 
VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...
VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...
VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...narwatsonia7
 
Vip Call Girls Anna Salai Chennai 👉 8250192130 ❣️💯 Top Class Girls Available
Vip Call Girls Anna Salai Chennai 👉 8250192130 ❣️💯 Top Class Girls AvailableVip Call Girls Anna Salai Chennai 👉 8250192130 ❣️💯 Top Class Girls Available
Vip Call Girls Anna Salai Chennai 👉 8250192130 ❣️💯 Top Class Girls AvailableNehru place Escorts
 
Best Rate (Guwahati ) Call Girls Guwahati ⟟ 8617370543 ⟟ High Class Call Girl...
Best Rate (Guwahati ) Call Girls Guwahati ⟟ 8617370543 ⟟ High Class Call Girl...Best Rate (Guwahati ) Call Girls Guwahati ⟟ 8617370543 ⟟ High Class Call Girl...
Best Rate (Guwahati ) Call Girls Guwahati ⟟ 8617370543 ⟟ High Class Call Girl...Dipal Arora
 
Call Girls Ooty Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Ooty Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Ooty Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Ooty Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Call Girls Kochi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Kochi Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Kochi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Kochi Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Call Girls Bangalore Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Bangalore Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Bangalore Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Bangalore Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
VIP Call Girls Indore Kirti 💚😋 9256729539 🚀 Indore Escorts
VIP Call Girls Indore Kirti 💚😋  9256729539 🚀 Indore EscortsVIP Call Girls Indore Kirti 💚😋  9256729539 🚀 Indore Escorts
VIP Call Girls Indore Kirti 💚😋 9256729539 🚀 Indore Escortsaditipandeya
 
Call Girls Ludhiana Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Call Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Call Girls Dehradun Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Dehradun Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Dehradun Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Dehradun Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Russian Call Girls in Jaipur Riya WhatsApp ❤8445551418 VIP Call Girls Jaipur
Russian Call Girls in Jaipur Riya WhatsApp ❤8445551418 VIP Call Girls JaipurRussian Call Girls in Jaipur Riya WhatsApp ❤8445551418 VIP Call Girls Jaipur
Russian Call Girls in Jaipur Riya WhatsApp ❤8445551418 VIP Call Girls Jaipurparulsinha
 
Call Girls Siliguri Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Siliguri Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Siliguri Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Siliguri Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Best Rate (Hyderabad) Call Girls Jahanuma ⟟ 8250192130 ⟟ High Class Call Girl...
Best Rate (Hyderabad) Call Girls Jahanuma ⟟ 8250192130 ⟟ High Class Call Girl...Best Rate (Hyderabad) Call Girls Jahanuma ⟟ 8250192130 ⟟ High Class Call Girl...
Best Rate (Hyderabad) Call Girls Jahanuma ⟟ 8250192130 ⟟ High Class Call Girl...astropune
 

Último (20)

Lucknow Call girls - 8800925952 - 24x7 service with hotel room
Lucknow Call girls - 8800925952 - 24x7 service with hotel roomLucknow Call girls - 8800925952 - 24x7 service with hotel room
Lucknow Call girls - 8800925952 - 24x7 service with hotel room
 
Call Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service Available
 
Top Rated Bangalore Call Girls Richmond Circle ⟟ 8250192130 ⟟ Call Me For Gen...
Top Rated Bangalore Call Girls Richmond Circle ⟟ 8250192130 ⟟ Call Me For Gen...Top Rated Bangalore Call Girls Richmond Circle ⟟ 8250192130 ⟟ Call Me For Gen...
Top Rated Bangalore Call Girls Richmond Circle ⟟ 8250192130 ⟟ Call Me For Gen...
 
(Rocky) Jaipur Call Girl - 09521753030 Escorts Service 50% Off with Cash ON D...
(Rocky) Jaipur Call Girl - 09521753030 Escorts Service 50% Off with Cash ON D...(Rocky) Jaipur Call Girl - 09521753030 Escorts Service 50% Off with Cash ON D...
(Rocky) Jaipur Call Girl - 09521753030 Escorts Service 50% Off with Cash ON D...
 
♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...
♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...
♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...
 
Russian Call Girls in Delhi Tanvi ➡️ 9711199012 💋📞 Independent Escort Service...
Russian Call Girls in Delhi Tanvi ➡️ 9711199012 💋📞 Independent Escort Service...Russian Call Girls in Delhi Tanvi ➡️ 9711199012 💋📞 Independent Escort Service...
Russian Call Girls in Delhi Tanvi ➡️ 9711199012 💋📞 Independent Escort Service...
 
High Profile Call Girls Coimbatore Saanvi☎️ 8250192130 Independent Escort Se...
High Profile Call Girls Coimbatore Saanvi☎️  8250192130 Independent Escort Se...High Profile Call Girls Coimbatore Saanvi☎️  8250192130 Independent Escort Se...
High Profile Call Girls Coimbatore Saanvi☎️ 8250192130 Independent Escort Se...
 
VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...
VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...
VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...
 
Vip Call Girls Anna Salai Chennai 👉 8250192130 ❣️💯 Top Class Girls Available
Vip Call Girls Anna Salai Chennai 👉 8250192130 ❣️💯 Top Class Girls AvailableVip Call Girls Anna Salai Chennai 👉 8250192130 ❣️💯 Top Class Girls Available
Vip Call Girls Anna Salai Chennai 👉 8250192130 ❣️💯 Top Class Girls Available
 
Best Rate (Guwahati ) Call Girls Guwahati ⟟ 8617370543 ⟟ High Class Call Girl...
Best Rate (Guwahati ) Call Girls Guwahati ⟟ 8617370543 ⟟ High Class Call Girl...Best Rate (Guwahati ) Call Girls Guwahati ⟟ 8617370543 ⟟ High Class Call Girl...
Best Rate (Guwahati ) Call Girls Guwahati ⟟ 8617370543 ⟟ High Class Call Girl...
 
Call Girls Ooty Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Ooty Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Ooty Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Ooty Just Call 9907093804 Top Class Call Girl Service Available
 
Call Girls Kochi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Kochi Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Kochi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Kochi Just Call 9907093804 Top Class Call Girl Service Available
 
Call Girls Bangalore Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Bangalore Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Bangalore Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Bangalore Just Call 9907093804 Top Class Call Girl Service Available
 
VIP Call Girls Indore Kirti 💚😋 9256729539 🚀 Indore Escorts
VIP Call Girls Indore Kirti 💚😋  9256729539 🚀 Indore EscortsVIP Call Girls Indore Kirti 💚😋  9256729539 🚀 Indore Escorts
VIP Call Girls Indore Kirti 💚😋 9256729539 🚀 Indore Escorts
 
Call Girls Ludhiana Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 9907093804 Top Class Call Girl Service Available
 
Call Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service Available
 
Call Girls Dehradun Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Dehradun Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Dehradun Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Dehradun Just Call 9907093804 Top Class Call Girl Service Available
 
Russian Call Girls in Jaipur Riya WhatsApp ❤8445551418 VIP Call Girls Jaipur
Russian Call Girls in Jaipur Riya WhatsApp ❤8445551418 VIP Call Girls JaipurRussian Call Girls in Jaipur Riya WhatsApp ❤8445551418 VIP Call Girls Jaipur
Russian Call Girls in Jaipur Riya WhatsApp ❤8445551418 VIP Call Girls Jaipur
 
Call Girls Siliguri Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Siliguri Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Siliguri Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Siliguri Just Call 9907093804 Top Class Call Girl Service Available
 
Best Rate (Hyderabad) Call Girls Jahanuma ⟟ 8250192130 ⟟ High Class Call Girl...
Best Rate (Hyderabad) Call Girls Jahanuma ⟟ 8250192130 ⟟ High Class Call Girl...Best Rate (Hyderabad) Call Girls Jahanuma ⟟ 8250192130 ⟟ High Class Call Girl...
Best Rate (Hyderabad) Call Girls Jahanuma ⟟ 8250192130 ⟟ High Class Call Girl...
 

Rules

  • 3. KBS architecture (1) The typical architecture of an KBS is often described as follows: user user interface inference engine knowledge base
  • 4. KBS architecture (1) The inference engine and knowledge base are separated because: the reasoning mechanism needs to be as stable as possible; the knowledge base must be able to grow and change, as knowledge is added; this arrangement enables the system to be built from, or converted to, a shell.
  • 5. KBS architecture (2) It is reasonable to produce a richer, more elaborate, description of the typical KBS. A more elaborate description, which still includes the components that are to be found in almost any real-world system, would look like this:
  • 8. KBS architecture (2) The system holds a collection of general principles which can potentially be applied to any problem - these are stored in the knowledge base. The system also holds a collection of specific details that apply to the current problem (including details of how the current reasoning process is progressing) - these are held in working memory. Both these sorts of information are processed by the inference engine.
  • 10. KBS architecture (2) Any practical expert system needs an explanatory facility. It is essential that an expert system should be able to explain its reasoning. This is because:
  • 11. it gives the user confidence in the system;
  • 12. it makes it easier to debug the system.
  • 14. KBS architecture (2) It is not unreasonable to include an expert interface & a knowledge base editor, since any practical KBS is going to need a mechanism for efficiently building and modifying the knowledge base.
  • 16. As mentioned earlier, a reliable expert should be able to explain and justify his/her advice and actions.
  • 18. 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 -
  • 19. The Edwin Smith papyrus The Edwin Smith papyrus is a 3700- year-old ancient Egyptian text. ABCDEECDBBACDACDBCDECDADCADBADE ECDBBACDACDBCDECDADCADBADCDBBACDA BCDEECDBBACDACDBCDECDAD BBACDACDBCDECDADCADBADEDCDBBA DCDBBADCDBBABCDECDADCADBADEACDA BACDACDBCDECDADBACDACDBCDECDAD
  • 20. The Edwin Smith papyrus It contains medical descriptions of 48 different types of head wound. There is a fixed format for each problem description: Title - symptoms - diagnosis - prognosis - treatment.
  • 21. The Edwin Smith papyrus There's a fixed style for the parts of each problem description. Thus, the prognosis always reads "It is an injury that I will cure", or "It is an injury that I will combat", or "It is an injury against which I am powerless". An example taken from the Edwin Smith papyrus:
  • 22. The Edwin Smith papyrus Title: Instructions for treating a fracture of the cheekbone. Symptoms: If you examine a man with a fracture of the cheekbone, you will find a salient and red fluxion, bordering the wound.
  • 23. The Edwin Smith papyrus Diagnosis and prognosis: Then you will tell your patient: "A fracture of the cheekbone. It is an injury that I will cure." Treatment: You shall tend him with fresh meat the first day. The treatment shall last until the fluxion resorbs. Next you shall treat him with raspberry, honey, and bandages to be renewed each day, until he is cured.
  • 24. Rule-based reasoning: rules examples: if - the leaves are dry, brittle and discoloured then - the plant has been attacked by red spider mite if - the customer closes the account then - delete the customer from the database
  • 25. Rule-based reasoning: rules The statement, or set of statements, after the word if represents some pattern which you may observe. The statement, or set of statements, after the word then represents some conclusion that you can draw, or some action that you should take.
  • 26. Rule-based reasoning: rules A rule-based system, therefore, either identifies a pattern and draws conclusions about what it means, or identifies a pattern and advises what should be done about it, or identifies a pattern and takes appropriate action.
  • 27. Rule-based reasoning: rules • The essence of a rule-based reasoning system is that it goes through a series of cycles. • In each cycle, it attempts to pick an appropriate rule from its collection of rules, depending on the present circumstances, and to use it as described above. • Because using a rule produces new information, it's possible for each new cycle to take the reasoning process further than the cycle before. This is rather like a human following a chain of ideas in order to come to a conclusion.
  • 28. Terminology A rule as described above is often referred to as a production rule. A set of production rules, together with software that can reason with them, is known as a production system.
  • 29. Terminology There are several different terms for the statements that come after the word if, and those that come after the word then. The statements after if may be called the conditions, those after then may be called the conclusions. The statements after if may be called the premises, those after then may be called the actions. The statements after if may be called the antecedents, those after then may be called the consequents.
  • 30. Terminology Some writers just talk about the if-part and the then-part.
  • 31. Terminology If a production system chooses a particular rule, because the conditions match the current state of affairs, and puts the conclusions into effect, this is known as firing the rule.
  • 32. Terminology In a production system, the rules are stored together, in an area called the rulebase.
  • 33. 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.
  • 34. Historical note Production rules have remained the most popular form of knowledge representation for expert systems ever since.
  • 35. Conditional branching Is a production rule the same as a conditional branching statement? A production rule looks similar to the if (statement to be evaluated) then (action) pattern which is a familiar feature of all conventional programming languages.
  • 36. Conditional branching e.g. The following fragment from a C program:
  • 37. 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”); }
  • 38. Conditional branching vs. production rules However, the similarity is misleading. There is a radical difference between a production system and a piece of conventional software. In a conventional program, the if...then... structure is an integral part of the code, and represents a point where the execution can branch in one of two (or more) directions.
  • 39. Conditional branching vs. production rules In a production system, the if...then... rules are gathered together in a rule base, and the controlling part of the system has some way of choosing a rule from this knowledge base which is appropriate to the current circumstances, and then using it.
  • 40. Reasoning with production rules The statements forming the conditions, or the conclusions, in such rules, may be structures, following some syntactic convention (such as three items enclosed in brackets).
  • 41. Reasoning with production rules Very often, these structures will include variables - such variables can, of course, be given a particular value, and variables with the same name in the same rule will share the same value.
  • 42. Reasoning with production rules For example (assuming words beginning with capital letters are variables, and other words are constants): if [Person, age, Number] & [Person, employment, none] & [Number, greater_than, 18] & [Number, less_than, 65] then [Person, can_claim,
  • 43. Reasoning with production rules Architecture of a typical production system: rule memory Inference engine working memory observed data fire modifyselect output
  • 44. Reasoning with production rules Architecture of a typical production system: rule memory interpreter working memory New information fire modifyselect output
  • 45. Reasoning with production rules Architecture of a typical production system: rule memory interpreter working memory New information fire modify select output
  • 46. Reasoning with production rules Architecture of a typical production system: rule memory Inference engine executes actions working memory New information fire modify select output
  • 47. Reasoning with production rules Architecture of a typical production system: rule memory Inference engine executes actions working memory New information fire modifyselect output
  • 48. Reasoning with production rules Architecture of a typical production system: rule memory interpreter working memory New information fire modify select output
  • 49. Reasoning with production rules Architecture of a typical production system: rule memory Inference engine executes actions working memory New information fire modify select output
  • 50. Reasoning with production rules Architecture of a typical production system: rule memory Inference engine executes actions working memory New information fire modifyselect output
  • 51. Architecture of a typical production system Has a working memory. Holds items of data. Their presence, or their absence, causes the inference engine to trigger certain rules. e.g. W.M. contains [john, age, 29] & [john, employment, none] The system decides: does this match any rules in the rulebase? If so, choose the rule.
  • 52. Architecture of a typical production system has an inference engine. Behaviour of the inference engine : the system is started by putting a suitable data item into working memory. recognise-act cycle: when data in the working memory matches the conditions of one of the rules in the system, the rule fires (i.e.is brought into action).
  • 53. Advantages of production systems ... at first glance The principle advantage of production rules is notational convenience - it’s easy to express suitable pieces of knowledge in this way. The principle disadvantage of production rules is their restricted power of expression - many useful pieces of knowledge don’t fit this pattern.
  • 54. 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
  • 55. Advantages of production systems ... at first glance The rules themselves are very easy to understand, and for someone (who is expert in the specific subject the system is concerned with) to criticise and improve.
  • 56. Advantages of production systems ... at first glance It's fairly straightforward to implement a production system interpreter. Following the development of the Rete Matching Algorithm, and other improvements, quite efficient interpreters are now available.
  • 57. Advantages of production systems ... at first glance However, it isn't that simple. See "advantages reconsidered" later on.
  • 58. Operation of a production system in more detail The recognise-act cycle (forward-chaining): Halt yes no Has the rule got the command "halt" at Produce some output Put the right-hand side of the rule into effect, using the information from working memory Halt Pick rules on the basis of what's in working memory Set the cycle going Put the word "start" in working memory Use conflict resolution strategy to cut this down to one rule.the end? Any rules eligible to fire ? no yes Information sources & recipients the working user memory
  • 59. Operation of a production system in more detail The recognise-act cycle (forward-chaining): Halt yes no Has therule gotthe command "halt"at Producesomeoutput Puttheright-handside oftheruleintoeffect, usingtheinformation fromworkingmemory Halt Pickrulesonthe basisofwhat'sin workingmemory Setthecyclegoing Puttheword"start" inworkingmemory Useconflictresolution strategytocutthis downtoonerule.the end? Any rules eligible tofire ? no yes Information sources&recipients the working user memory
  • 60. Operation of a production system in more detail The recognise-act cycle (forward-chaining): Halt yes no Has the rule got the comm and "halt" at Produce som e output Put the right-hand side of the rule into effect, using the inform ation from working mem ory Halt Pick rules on the basis of what's in working m em ory Set the cycle going Put the word "start" in working m emory Use conflict resolution strategy to cut this down to one rule.the end? Any rules eligible to fire ? no yes Inform ation sources & recipients the working user m em ory
  • 61. Operation of a production system in more detail The recognise-act cycle (forward-chaining): Halt yes no Has therule gotthe command "halt"at Producesomeoutput Puttheright-handside oftheruleintoeffect, usingtheinformation fromworkingmemory Halt Pickrulesonthe basisofwhat'sin workingmemory Setthecyclegoing Puttheword"start" inworkingmemory Useconflictresolution strategytocutthis downtoonerule.the end? Any rules eligible tofire ? no yes Information sources&recipients the working user memory
  • 62. Operation of a production system in more detail The recognise-act cycle (forward-chaining): Halt yes no Has the rule got the comm and "halt" at Produce som e output Put the right-hand side of the rule into effect, using the inform ation from working mem ory Halt Pick rules on the basis of what's in working m em ory Set the cycle going Put the word "start" in working m emory Use conflict resolution strategy to cut this down to one rule.the end? Any rules eligible to fire ? no yes Inform ation sources & recipients the working user m em ory
  • 63. Operation of a production system in more detail The recognise-act cycle (forward-chaining): Halt yes no Has the rule got the comm and "halt" at Produce som e output Put the right-hand side of the rule into effect, using the inform ation from working mem ory Halt Pick rules on the basis of what's in working m em ory Set the cycle going Put the word "start" in working m emory Use conflict resolution strategy to cut this down to one rule.the end? Any rules eligible to fire ? no yes Inform ation sources & recipients the working user m em ory
  • 64. Operation of a production system in more detail The recognise-act cycle (forward-chaining): Halt yes no Has the rule got the comm and "halt" at Produce som e output Put the right-hand side of the rule into effect, using the inform ation from working mem ory Halt Pick rules on the basis of what's in working m em ory Set the cycle going Put the word "start" in working m emory Use conflict resolution strategy to cut this down to one rule.the end? Any rules eligible to fire ? no yes Inform ation sources & recipients the working user m em ory
  • 65. Operation of a production system in more detail The recognise-act cycle (forward-chaining): Halt yes no Has the rule got the comm and "halt" at Produce som e output Put the right-hand side of the rule into effect, using the inform ation from working mem ory Halt Pick rules on the basis of what's in working m em ory Set the cycle going Put the word "start" in working m emory Use conflict resolution strategy to cut this down to one rule.the end? Any rules eligible to fire ? no yes Inform ation sources & recipients the working user m em ory
  • 66. The recognise-act cycle N.B. "right-hand side of the rule" means the part after the word then.
  • 67. The recognise-act cycle conflict resolution strategy: if more than one rule matches working memory contents, this decides which one is to fire. Alternatively, the rule base could be designed so there's never any conflict (but usually isn't).
  • 68. The recognise-act cycle Applying the rule will probably modify the contents of working memory. Then the system continues with the recognise-act cycle. The system stops when the rules stop firing, or a rule fires which specifically tells the system to halt.
  • 69. Conflict resolution strategies Choice of c.r.s. can make a big difference to system performance. Three favourite strategies: Refractoriness: don't allow a rule to fire twice on same data. Recency: take the data which arrived in working memory most recently, and find a rule that uses this data. Specificity: use the most specific rule (the one with the most conditions attached).
  • 70. Conflict resolution strategies However, in recent years the fashion (in expert system shells) has been for very simple CRSs, coupled with a reluctance to mention the problem to the potential system builder. Simple strategies: Give each rule a priority number. If a choice has to be made, choose the rule with the highest number. If a choice has to be made, choose the rule that comes first in the rule base.
  • 71. Advantages of production systems reconsidered. Because of the effect of conflict resolution strategies, rules interact and the order of rules matters. One must go beyond the declarative meaning of the rules and consider when (under which circumstances) they will fire. One cannot properly understand a rule simply by reading it in isolation; one must consider the related rules, the meta-rules, and the conflict resolution strategy as well.
  • 72. Advantages of production systems reconsidered. For the same reason, attempting to expand a production system by simply adding more rules at the end is dangerous. Unexpected rule interactions are liable to happen. The need to consider all these possible rule interactions makes large rule-based systems unwieldy and hard to update.
  • 73. Advantages of production systems reconsidered. Although non-computer-specialists find it easy to grasp the meaning of individual rules, they don't find it easy to grasp these issues concerned with interactions.
  • 74. Advantages of production systems reconsidered. Although efficient rule interpreters are available, one may still need to engage in meta-level programming in order to achieve a production system that shows acceptable performance on a large rulebase.