<s>
A	O
"	O
production	B-Application
system	I-Application
"	O
(	O
or	O
"	O
production	O
rule	O
system	O
"	O
)	O
is	O
a	O
computer	O
program	O
typically	O
used	O
to	O
provide	O
some	O
form	O
of	O
artificial	O
intelligence	O
,	O
which	O
consists	O
primarily	O
of	O
a	O
set	O
of	O
rules	O
about	O
behavior	O
but	O
it	O
also	O
includes	O
the	O
mechanism	O
necessary	O
to	O
follow	O
those	O
rules	O
as	O
the	O
system	O
responds	O
to	O
states	O
of	O
the	O
world	O
.	O
</s>
<s>
Those	O
rules	O
,	O
termed	O
productions	O
,	O
are	O
a	O
basic	O
representation	O
found	O
useful	O
in	O
automated	B-Application
planning	I-Application
,	O
expert	B-Application
systems	I-Application
and	O
action	O
selection	O
.	O
</s>
<s>
If	O
a	O
production	O
's	O
precondition	O
matches	O
the	O
current	O
state	B-Application
of	O
the	O
world	O
,	O
then	O
the	O
production	O
is	O
said	O
to	O
be	O
triggered	O
.	O
</s>
<s>
If	O
a	O
production	O
's	O
action	O
is	O
executed	B-General_Concept
,	O
it	O
is	O
said	O
to	O
have	O
fired	O
.	O
</s>
<s>
A	O
production	B-Application
system	I-Application
also	O
contains	O
a	O
database	O
,	O
sometimes	O
called	O
working	O
memory	O
,	O
which	O
maintains	O
data	O
about	O
current	O
state	B-Application
or	O
knowledge	O
,	O
and	O
a	O
rule	O
interpreter	O
.	O
</s>
<s>
The	O
condition	O
portion	O
of	O
each	O
rule	O
(	O
left-hand	O
side	O
or	O
LHS	O
)	O
is	O
tested	O
against	O
the	O
current	O
state	B-Application
of	O
the	O
working	O
memory	O
.	O
</s>
<s>
In	O
idealized	O
or	O
data-oriented	O
production	B-Application
systems	I-Application
,	O
there	O
is	O
an	O
assumption	O
that	O
any	O
triggered	O
conditions	O
should	O
be	O
executed	B-General_Concept
:	O
the	O
consequent	O
actions	O
(	O
right-hand	O
side	O
or	O
RHS	O
)	O
will	O
update	O
the	O
agent	O
's	O
knowledge	O
,	O
removing	O
or	O
adding	O
data	O
to	O
the	O
working	O
memory	O
.	O
</s>
<s>
The	O
system	O
stops	O
processing	O
either	O
when	O
the	O
user	O
interrupts	O
the	O
forward	O
chaining	O
loop	O
;	O
when	O
a	O
given	O
number	O
of	O
cycles	O
has	O
been	O
performed	O
;	O
when	O
a	O
"	O
halt	O
"	O
RHS	O
is	O
executed	B-General_Concept
,	O
or	O
when	O
no	O
rules	O
have	O
LHSs	O
that	O
are	O
true	O
.	O
</s>
<s>
Real-time	O
and	O
expert	B-Application
systems	I-Application
,	O
in	O
contrast	O
,	O
often	O
have	O
to	O
choose	O
between	O
mutually	O
exclusive	O
productions	O
---	O
since	O
actions	O
take	O
time	O
,	O
only	O
one	O
action	O
can	O
be	O
taken	O
,	O
or	O
(	O
in	O
the	O
case	O
of	O
an	O
expert	B-Application
system	I-Application
)	O
recommended	O
.	O
</s>
<s>
Production	B-Application
systems	I-Application
may	O
vary	O
on	O
the	O
expressive	O
power	O
of	O
conditions	O
in	O
production	O
rules	O
.	O
</s>
<s>
Accordingly	O
,	O
the	O
pattern	B-Language
matching	I-Language
algorithm	O
which	O
collects	O
production	O
rules	O
with	O
matched	O
conditions	O
may	O
range	O
from	O
the	O
naive	O
—	O
trying	O
all	O
rules	O
in	O
sequence	O
,	O
stopping	O
at	O
the	O
first	O
match	O
—	O
to	O
the	O
optimized	O
,	O
in	O
which	O
rules	O
are	O
"	O
compiled	O
"	O
into	O
a	O
network	O
of	O
inter-related	O
conditions	O
.	O
</s>
<s>
The	O
latter	O
is	O
illustrated	O
by	O
the	O
RETE	B-Algorithm
algorithm	I-Algorithm
,	O
designed	O
by	O
Charles	O
L	O
.	O
Forgy	O
in1974	O
,	O
which	O
is	O
used	O
in	O
a	O
series	O
of	O
production	B-Application
systems	I-Application
,	O
called	O
OPS	O
and	O
originally	O
developed	O
at	O
Carnegie	O
Mellon	O
University	O
culminating	O
in	O
OPS5	B-Language
in	O
the	O
early	O
eighties	O
.	O
</s>
<s>
OPS5	B-Language
may	O
be	O
viewed	O
as	O
a	O
full-fledged	O
programming	O
language	O
for	O
production	B-Application
system	I-Application
programming	O
.	O
</s>
<s>
Production	B-Application
systems	I-Application
may	O
also	O
differ	O
in	O
the	O
final	O
selection	O
of	O
production	O
rules	O
to	O
execute	O
,	O
or	O
fire	O
.	O
</s>
<s>
The	O
collection	O
of	O
rules	O
resulting	O
from	O
the	O
previous	O
matching	O
algorithm	O
is	O
called	O
the	O
conflict	O
set	O
,	O
and	O
the	O
selection	O
process	O
is	O
also	O
called	O
a	O
conflict	B-Application
resolution	I-Application
strategy	I-Application
.	O
</s>
<s>
Whichever	O
conflict	B-Application
resolution	I-Application
strategy	I-Application
is	O
implemented	O
,	O
the	O
method	O
is	O
indeed	O
crucial	O
to	O
the	O
efficiency	O
and	O
correctness	O
of	O
the	O
production	B-Application
system	I-Application
.	O
</s>
<s>
The	O
use	O
of	O
production	B-Application
systems	I-Application
varies	O
from	O
simple	O
string	O
rewriting	O
rules	O
to	O
the	O
modeling	O
of	O
human	O
cognitive	O
processes	O
,	O
from	O
term	O
rewriting	O
and	O
reduction	O
systems	O
to	O
expert	B-Application
systems	I-Application
.	O
</s>
<s>
In	O
this	O
production	B-Application
system	I-Application
,	O
x	O
and	O
y	O
are	O
variables	O
matching	O
any	O
character	O
of	O
the	O
input	O
string	O
alphabet	O
.	O
</s>
<s>
Often	O
,	O
the	O
lack	O
of	O
control	O
structure	O
makes	O
production	B-Application
systems	I-Application
difficult	O
to	O
design	O
.	O
</s>
<s>
It	O
is	O
,	O
of	O
course	O
,	O
possible	O
to	O
add	O
control	O
structure	O
to	O
the	O
production	B-Application
systems	I-Application
model	O
,	O
namely	O
in	O
the	O
inference	O
engine	O
,	O
or	O
in	O
the	O
working	O
memory	O
.	O
</s>
<s>
Production	O
rules	O
in	O
OPS5	B-Language
apply	O
to	O
all	O
instances	O
of	O
data	O
structures	O
that	O
match	O
conditions	O
and	O
conform	O
to	O
variable	O
bindings	O
.	O
</s>
<s>
The	O
binding	O
of	O
variables	O
resulting	O
from	O
the	O
pattern	B-Language
matching	I-Language
in	O
the	O
LHS	O
is	O
used	O
in	O
the	O
RHS	O
to	O
refer	O
to	O
the	O
data	O
to	O
be	O
modified	O
.	O
</s>
<s>
Both	O
Russell	O
and	O
Norvig	O
's	O
Introduction	O
to	O
Artificial	O
Intelligence	O
and	O
John	O
Sowa	O
's	O
Knowledge	O
Representation	O
:	O
Logical	O
,	O
Philosophical	O
,	O
and	O
Computational	O
Foundations	O
characterize	O
production	B-Application
systems	I-Application
as	O
systems	O
of	O
logic	O
that	O
perform	O
reasoning	O
by	O
means	O
of	O
forward	O
chaining	O
.	O
</s>
<s>
Similarly	O
,	O
Kowalski	O
and	O
Sadri	O
argue	O
that	O
,	O
because	O
actions	O
in	O
production	B-Application
systems	I-Application
are	O
understood	O
as	O
imperatives	O
,	O
production	B-Application
systems	I-Application
do	O
not	O
have	O
a	O
logical	O
semantics	O
.	O
</s>
<s>
Their	O
logic	O
and	O
computer	O
language	O
Logic	O
Production	B-Application
System	I-Application
(	O
LPS	O
)	O
combines	O
logic	O
programs	O
,	O
interpreted	O
as	O
an	O
agent	O
's	O
beliefs	O
,	O
with	O
reactive	O
rules	O
,	O
interpreted	O
as	O
an	O
agent	O
's	O
goals	O
.	O
</s>
<s>
In	O
the	O
following	O
example	O
,	O
lines	O
1-3	O
are	O
type	O
declarations	O
,	O
4	O
describes	O
the	O
initial	O
state	B-Application
,	O
5	O
is	O
a	O
reactive	O
rule	O
,	O
6-7	O
are	O
logic	O
program	O
clauses	O
,	O
and	O
8	O
is	O
a	O
causal	O
law	O
:	O
</s>
<s>
These	O
subgoals	O
are	O
actions	O
(	O
line	O
2	O
)	O
,	O
at	O
least	O
one	O
of	O
which	O
needs	O
to	O
be	O
executed	B-General_Concept
to	O
satisfy	O
the	O
goal	O
.	O
</s>
<s>
Constraint	B-Application
Handling	I-Application
Rules	I-Application
:	O
rule-based	O
programming	O
language	O
.	O
</s>
<s>
CLIPS	B-Application
:	O
public	O
domain	O
software	O
tool	O
for	O
building	O
expert	B-Application
systems	I-Application
.	O
</s>
<s>
JBoss	B-Language
Drools	I-Language
:	O
an	O
open-source	O
business	O
rule	O
management	O
system	O
(	O
BRMS	O
)	O
.	O
</s>
<s>
JESS	B-Language
:	O
a	O
rule	O
engine	O
for	O
the	O
Java	O
platform	O
-	O
it	O
is	O
a	O
superset	O
of	O
the	O
CLIPS	B-Application
programming	I-Application
language	I-Application
.	O
</s>
<s>
Lisa	B-Language
:	O
a	O
rule	O
engine	O
written	O
in	O
Common	O
Lisp	O
.	O
</s>
<s>
OpenL	B-Language
Tablets	I-Language
:	O
business	O
centric	O
rules	O
and	O
open	O
source	O
BRMS	O
.	O
</s>
<s>
Prolog	B-Language
:	O
a	O
general	O
purpose	O
logic	O
programming	O
language	O
.	O
</s>
<s>
Soar	B-Architecture
,	O
OpenCog	B-Application
:	O
cognitive	O
architectures	O
based	O
on	O
a	O
production	B-Application
system	I-Application
.	O
</s>
