Production Systems
A production, quite simply, is a rule. Productions were first introduced as a formal means of expressing languages within the discipline of Computer Science. For example, each rule in a Backus Normal Form (BNF) specification of a context-free language is called a production. BNF is commonly used to describe the syntax of programming languages.
A production system is a rule-based system, such as BNF, in which the order of rules does not matter. As such, production systems implement rules as independent programming statements rather than conditional logic arranged in a flow chart or expressed using a procedural language.
Any rule-based language in which rule order matters has little distinction (other than syntax) from the functionality of if-then or similar conditional logic statements in a third generation procedural language (3GL). This includes 3GLs such as Cobol and C. Furthermore, any rule-based language which triggers the checking of rules by requiring the attachment of rules or their conditions to classes or attributes of classes adds no value beyond that of encapsulation provided by object-oriented languages such as C++ or Smalltalk. An if-then attached to one or more triggering classes or attributes is no more functional that a function call from a member function of a well defined class or data type. In effect, object-oriented attachment is a form of flow charting.
A production system eliminates flow charting by repeatedly:
- determining the set of applicable rules
- selecting a rule to be applied
- executing the actions (the then part) of the selected rule
The fact that the production system itself is responsible for determining the set of applicable rules eliminates the tedious and error prone activities of producing or maintaining a flow chart involving large numbers of conditional nodes (i.e, nodes with one input that branch to either of two outputs). Furthermore, the production system relieves the programmer from considering, let alone charting or codifying, all the paths by which a rule may become applicable or inapplicable.
Although a production system can be implemented as a Markov chain in which rules are checked in sequential or random order, such implementations suffer from performance that is linear with repect to the number of rules (i.e., they do not scale well). Furthermore, such implementations are prone to redundancies or even loops in which a rule is executed but remains applicable and is again selected for execution.
The only algorithm for implementing production systems whose performance is demonstrably independent of the number of rules is the Rete Algorithm.
