Reference


Top     Installation     Introduction     Samples     Tutorial     Reference     Release Notes


The ARulesXL Reasoning Engine and Excel Calculation

A spreadsheet engine and a rule engine both resolve interconnected facts, rules and formulas, but each in its own way, and each with its own advantages and disadvantages.

Spreadsheet Calculation

Each cell in a spreadsheet can be directly linked to other cells via formula. These direct links are used by the spreadsheet to dynamically change the results of formulas as the values in linked cells change.

The developer is responsible for coding the links between the cells.

The spreadsheet is a powerful tool for implementing numerical modeling applications.

Rule Base Reasoning

A rule base is a collection of rules stating relationships between facts, values and the conditions. Unlike with spreadsheet formulas, the developer does not specify direct links between related rules.

Instead, a rule engine dynamically chooses which rules to use based on the values of input facts and fact values that are derived from the rules. This allows the developer to concentrate on the relationships in the rules without having to worry about a complex web of interconnected dependencies.

The rule engine works by choosing rules based on goals presented in queries to the rules. A query asks for the value of a particular fact. First, the rule engine looks for a table that specifies the value for that fact. If none is found, then the rule engine looks for rules that can be used to set a value for that fact. Those rules might refer to other fact values, so the rule engine then sets sub goals of looking for those values. In this manner, the rules applicable for a given set of input data are dynamically applied to answer a query for a fact value.

The rule base is a powerful tool for implementing business rule applications.

Example

Consider a loan application:

Integration

ARulesXL integrates the two on the spreadsheet, allowing rules to reference spreadsheet calculations, and spreadsheet cells to query rule sets defined on the spreadsheet.

Reasoning Algorithm Step-by-Step

ARulesXL uses a goal-driven reasoning algorithm. This means it starts with the goal of finding a value for some fact. In the course of finding that value, it might determine that it needs to find the values of other facts as well.

The initial goal fact is the one provided in a query.

  1. The reasoning algorithm looks for the first rule that sets the goal fact. If it simply sets the value, then its done. If the rule has a WHEN clause, then the conditions in the WHEN are tested, and if they evaluate to true, then the value is set.
  2. If the WHEN clause evaluates to false, then the reasoning algorithm looks for the next rule that sets a value for the goal fact until a value is found.
  3. If no value is found in the current rule set, then, if there are super sets of that rule set, the same goal is presented to each of the super set rule sets. They might, in turn, call their super sets, and so on.
  4. In testing the conditions of the WHEN clause, it might be necessary to find the values of other facts. These become sub goals, which are pursued as necessary. The sub goals in a WHEN clause are only pursued as long as it is possible that the conditions in that clause might be true.
  5. The pursuit of the sub goals might lead to further sub goals. The nesting of goals can be arbitrarily deep.
  6. If the rule's conditions are true, and that rule sets it's property value using a formula, then sub goals are pursued for each of the facts used in that formula.

Use the Trace facility to see this steps in action for any given ARulesXL RQuery().

Open in New Window to Print


Copyright ©2005-7 Amzi! inc. All Rights Reserved.
ARulesXL and Amzi! are trademarks or registered trademarks of Amzi!
Microsoft and Excel are trademarks or registered trademarks of Microsoft Corporation.