How a production system works


next up previous contents
Next: So what are production systems for?
Up: Production systems
Previous: Production systems
Back: to main list of student notes

How a production system works

A production system works by repeating the same cycle over and over again. Each cycle consists of three stages: recognise; resolve; and act. In the first stage, the system searches for all the rules which match the symbols in working memory - that is, all the rules whose left-hand sides are somehow satisfied by these symbols. In the second, resolution, stage, it chooses one and only one of these rules. And in the third, act, stage, it fires it. This means that it adds the symbols in its right-hand side to working memory.

How would this work with the example shown above in figures 2 and 1? Our initial working memory contains the pattern . Looking at the left-hand sides of the rules, only one rule matches - number 1. So the first stage - recognise - returns just one rule. This makes the resolve stage trivial - it returns the same rule. Finally, the act stage fires the rule. This adds the symbols to working memory, which now looks like this:

That's the end of the first cycle. We now go round again. This time, two rules match: number 1 and number 4. So the recognise stage returns these two rules. What is the resolve stage to do? There are various possible answers. One method, used in Eden, is to prefer rules that haven't been used recently over those that have. The system notes when each rule fired, and chooses the least recently fired to fire again.

The justification of this is that it prevents the system applying the same rule over and over again, and so helps to stop it getting stuck in a loop. In the jargon of production systems, we could call this resolution by inverse rule-firing-recency. It would sometimes also be called resolution by rule-refractoriness, the idea being that recently-fired rules are supressed by less recently-fired rules, and suffer a ``refractory'' or non-firing period.

In our example, rule number 4 is definitely less recent, since it hasn't been fired at all. The system therefore chooses it in preference to rule 1. The act stage can then add the symbols on the right-hand side of rule 4 to working memory, giving this:

We are now ready for the third cycle. This time, three rules match, rules 1, 4, and 2. Rule 2 is less recent than the others, since it has never fired. So the resolve stage chooses it. Firing it then adds to working memory, giving:

Now the fourth cycle. Again, only three rules match, the same as above. So the recognise stage returns them. What should the resolve stage do? If we go strictly by recency, then rule 1 is now the least recent, so we would choose it, and fire it, adding again. However, taking this approach isn't very helpful, because we will continually add the same pieces of data over and over again.

An alternative approach might be to say that once a rule has fired, it should never be allowed to fire again until it can add something different. This would eliminate all of rules 1, 2, and 4. And there are many other possible resolution methods. Which ones we choose depends on what we are using the system for.


next up previous contents
Next: So what are production systems for?
Up: Production systems
Previous: Production systems
Back: to main list of student notes



Jocelyn Ireson-Paine
Thu Feb 15 00:10:39 GMT 1996