To see how forward chaining works, consider a system with three rules:
1 If someone is a third year, then they need a job. 2 If someone is a third year, then they live in. 3 If someone needs a job, they will become an accountant.
Suppose we put the following fact into STM:
John is a third year.Being a forward chainer, the system is constantly on watch for new data. As soon as this data arrives, the system searches all the rules for any whose conditions weren't true before but are now. It then adds their conclusions to STM.
In this case, rules 1 and 2 have conditions which match this new fact. So the system will immediately create and add the two facts below.
John needs a job. John lives in.
These facts in turn can trigger rules. As each arrives, the system would
look for yet more rules that are made true. In this case, the fact
John needs a job would trigger rule 3, resulting in the addition
of another fact to STM:
John will become an accountant.The fact
John lives inwould not trigger anything else though.