Inference Engine

An application that finds and executes rules to solve a problem.
Inference engine architecture diagram

How does it work?

A rule-based machine is an application in itself, but it is executed by an execution engine, which is also an application. So we need to explain the working on two levels.

Let's start with the inference engine itself. The engine is fed a goal. It tries to find rules that match the goal. The matching rules are then executed, and this produces more goals. These are solved as well. This involves recursion. When a rule is resolved, the answer is fed back to the parent rule.


  • Expert systems
  • The programming language Prolog

When should you use it?

The rules form a program in the logic programming paradigm. It is declarative and lends itself for solving problems recursively. The main reason for using this paradigm is that it allows a non-programmer to contribute to the rules of the business logic.

Such a program can be transparent: the rules that are executed can be logged and show you how the answer was found. The program can also be executed step-by-step, by an end-user.