# Forward chaining

As a forward chaining (engl .: forward chaining or forward reasoning ) is called a strategy of linking rules in a system for deriving a logical inferences, a so-called inference engine . On the basis of a rule that is in the form

```wenn Faktum, dann Folgerung
```

is represented, a simple conclusion can be drawn. Often, however, one wants to draw more complex conclusions from several given rules. One way of doing this is to chain rules together. The forward chaining is transitive , i.e. H. A conclusion is drawn from a fact using a rule and an inference method (e.g. modus ponens ), which in turn is used as a premise and a further rule for a further conclusion, etc. Since a mostly case-specific fact is assumed, one designates this inference strategy also as data-driven inference .

A related inference strategy is backward chaining .

## Example of a forward chaining rule interpreter

Working memory: X, Y, Z

Standard knowledge base:

1. X, Y -> S
2. S, Z -> T
3. S, Y -> A
4. Y, T -> B
5. X, T -> C

Goal: C is in memory

Conflict resolution:

1. Ignore rules that add symbols that are already in memory again
2. Consider rules according to their order in the rule memory

Possible solution:

step random access memory applied rule
1 X, Y, Z X, Y -> S (rule 1)
2 X, Y, Z, S S, Z -> T (rule 2)
3 X, Y, Z, S, T S, Y -> A (rule 3)
4th X, Y, Z, S, T, A Y, T -> B (rule 4)
5 X, Y, Z, S, T, A, B X, T -> C (rule 5)
6th X, Y, Z, S, T, A, B, C (Goal achieved)