Terminology

This section describes inference engines terminology in simple terms. All examples are based on the Hammurapi rules tutorial.

Reasoning

Reasoning is the process of deriving conclusions from input facts using rules. For example, conclusion Dan is a GrandSon of Victor can be derived from facts Peter is a Parent of Dan and Victor is a Father of Peter using the rule A son of a child is a grandson.

Chaining

Chaining is the process of using conclusions derived by a rule as inputs for another rule. In the example above, Peter is a Parent of Dan might have been derived from Dan is a Child of Peter.

Forward

In forward chaining we start with input facts, feed them to the rule engine and collect conclusions. In the tutorial forward reasoning is used to find all relationships of a person. We can say that forward reasoning uses the “push model” - input facts are pushed to the rule engine to produce conclusions.

Backward

In backward reasoning we start with a type of conclusion we are interested and look for rules and input facts to produce this type of conclusion. Backward reasoning is used to find specific conclusion types. It is more computationally (less rules to fire) and memory (less conclusions to put the knowledge base) efficient than forward chaining, when only certain conclusion types are needed by the application, but the rule set produces many different conclusion types.

For example, the tutorial rule set produces 25 types of conclusions. If we are interested only in GrandFather conclusions we could manually create a specialized rule set with only rules pertaining to inference of GrandFather conclusions. However, this approach is error prone, if possible at all, in rule sets of considerable size. Also, the client application might want to specify conclusion type of interest dynamically.

To find all GrandFathers using forward chaining, we'd have to produce 153 conclusions to find that only 5 of them are GrandFather conclusions. With backward chaining only conclusions which are needed to produce GrandFather conclusion are created and only rules creating these conclusions are fired.

We can say that backward chaining uses the “pull model” - client code pulls conclusions of interest from the rule engine, and the rule engine pulls facts to produce requested conclusions from its input sources.

Rule

Rule is a unit of reasoning. A rule takes one or more input facts and produces zero or more conclusions and/or performs some action, e.g. inserts a record in to a database.

Rule set

Rule set is a collection of rule definitions.

Rule engine

Rule engine is a piece of software which performs reasoning using rules defined in a rule set.

Fact

Fact is something which is believed to be true. E.g. Peter is a Parent of Dan. Facts can be logically divided into two groups:

  • Axioms (or input facts) are facts provided to an inference engine from external source.
  • Conclusions are facts derived from other facts by rules.

Conclusion

Conclusion is a fact derived from other facts by reasoning. E.g. Dan is a GrandSon of Victor is derived from facts Peter is a Parent of Dan and Victor is a Father of Peter using the rule A son of a child is a grandson.

Knowledge base

Knowledge base, also known as working memory, is a place where rule engine stores facts.

Last modified: 2009/11/04 13:21 by Pavel Vlasov
   
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Hammurapi Group