Before we descend into the logic behind the rules-based system, it's important to understand that there are fundamentally two different types of systems. These are forward chaining systems and backward chaining systems.
The backward chaining system is an inference strategy that begins with a hypothesis (a goal state) and works backwards through the rules to generate a new hypothesis and ultimately the currently known set of facts. By arriving at the initial set of facts from the hypothesis, the hypothesis is proven.
The forward chaining system is an inference strategy that begins with known facts. The rules memory is then consulted to identify the rules that match the given set of facts, which may introduce new facts into the working memory. This process continues until either no new facts may be derived, or a goal state is reached. This is a deduction process, which simply uses the known facts to flow through the working memory (and rules) to generate new facts.
This chapter will focus on forward chaining in both the examples and sample implementation.