Introduction to the Rules Package

The Able Rules package has many parts. At the package's heart is the AbleRuleSet class, a Java bean that provides many different types of inferencing to Java applications. If you are new to this package, please take time to read the Overview provided below. If you are looking for detailed information, select one of the other topics listed.


Index of Related Topics


Note: This documentation assumes the reader is already familiar with fuzzy logic, fuzzy sets, and other mechanisms of inferencing, such as backward and forward chaining. No attempt is made to explain these concepts or their use. The documentation also assumes a familiarity with Java concepts, including JavaBeans. No attempt is made to explain classpaths, compiling Java programs, manifest files, jar files, or JavaBean design patterns. In short, the documentation is written for the experienced Java programmer who has familiarity with reasoning techniques.


Overview

The heart of the Able Rules package is the AbleRuleSet class, a Java bean that provides many different types of inferencing to Java applications.

The Heart of the Package: The AbleRuleSet Object

Because the AbleRuleSet object is a Java bean, it comes with its own customizer, the Able RuleSet Editor, that can be used to define rules of inferencing, specify inferencing strategies, and test and debug rules. The Swing-based RuleSet editor will be replaced by the Able Rule Language Editor plugin for the Eclipse platform. AbleRuleSet objects have an application programming interface, or API, that can be used by Java programs to perform the same sort of tasks programmatically. The API is not discussed in this documentation, however, because it is fully documented in the JavaDoc output generated for the AbleRuleSet and its associated classes.

Because the AbleRuleSet object is also derived from both the AbleObject class and the AbleBean interface, AbleRuleSet objects, can be created, manipulated, customized, and packaged from within Able's Agent Editor Interactive Development Environment, or IDE, meaning that AbleRuleSet objects can be wired to receive input data from and write output data to managed buffer connections; PropertyChangeListeners can register with them; and, because AbleRuleSet objects are yet another type of Able object, AbleUserDefinedFunctionManager objects, rules you author can call and obtain output from the methods of any external Java object.

Creating AbleRuleSet Objects

There are several ways to create AbleRuleSet objects. Bear in mind, though, that a newly created ruleset has no rules or inferencing strategies associated with it; you have to add those later, either by using the customizer (the Swing-based RuleSet Editor), the Able Rule Language Editor plugin for Eclipse, or programmatically. Techniques to customize an empty ruleset object are described in Customizing AbleRuleSet Objects a little further on.

Customizing AbleRuleSet Objects with Rules and Inferencing Strategies

Once you have created a ruleset object, you need to customize it by loading it with a text or XML ruleset source file containing variables, ruleblock and rule specifications.

When you customize a rule set, you need to decide what type of inferencing you want performed when your rules are processed. The next section discusses the types of inferencing available.

Inferencing Algorithms

There are two basic styles of inferencing available: boolean inferencing and fuzzy inferencing, and each of these has subtypes available. For example, boolean inferencing includes traditional backward, forward, and mixed chaining, and of those, forward chaining includes a very simple algorithm using no working memory, to OPS-like pattern matching making use of working memory and rete networks. When using fuzzy rules, the rule language lets the rule author choose different strategies for inferencing, correlating antecedents with consequents, and defuzzifying fuzzy numbers. You can therefore match the tool to the job.

Viewing and Running RuleSet Examples

Able ships with many rule examples, with both boolean logic and fuzzy logic. Most of these examples take the form of source ARL files, which you can use to customize an AbleRuleSet object. Just follow the directions above for creating an AbleRuleSet and then customizing it. In the Eclipse plugin editor, just import an example ruleset into your project, open the ARL file in the ARL perspective, and the parser will verify your ruleset when you save changes just as the Java compiler verifies Java source files. In the Swing Able RuleSet Editor, use one of the Open... editor actions to load a source rule file or XML document, and then compile (verify, in Able terminology) it. Once the rules are compiled, your ruleset is ready to be run or saved as a serialized Java bean.

Some of the other examples are not source rule files, but Java programs that show you how to create, instantiate, and run a ruleset progammatically. If you process these rulesets from within the Able Editor, you may not see anything happen unless you have the Java console window open.

It is beyond the scope of this overview to document how to run all the rule examples. That information is provided in the com.ibm.able.examples.rules package.

Next Steps

From here it is suggested you now go and read up on the Able Rule Language, and experiment with the Able Rule Language Editor for Eclipse or the Swing Able RuleSet Editor.


Last modified: Wed Jun 6 10:24:36 CDT 2001