Let's now look at the phases of a rules-based system, per the forward chaining inference strategy (as shown in Figure 8.2).
In the match phase, each of the rules is checked to see if the set of antecedents for the rule can be matched with facts in the working memory. If so, then the rule is added to the conflict set. Rules whose antecedents are not matched are ignored. Once all rules have been checked, the conflict set is then reviewed by the next phase, the conflict resolution phase.
The purpose of the conflict resolution phase is to pick a rule to fire out of the conflict set. If only one rule exists in the set, then the process is simple. Given more than one rule in the set, some criteria must be defined to determine which rule to fire. This can be as elaborate as identifying the rule with the greatest number of antecedents (or consequents), or as simple as picking the first rule matched. Upon identifying the rule to be fired , it is passed on to the action phase.
The action phase performs the set of consequents for the particular rule to be fired. These actions could be adding facts to working memory, removing facts from working memory, or performing some other action. For example, if our rules-based system was connected to the outside world, the actions could manipulate the environment (such as moving a robotic arm or disabling a switch).