These HTML pages are available in book form as a postscript file.
The Able Rules package has many parts. At the package's heart is the AbleRuleSet class, a Java bean that, when customized, can provide 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.
A brief look at the
com.ibm.able.rules
package and how it fits into, and can be used outside of, the
ABLE environment.
com.ibm.able.examples.rules
package, explains how to view and run the ruleset examples.
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.
The heart of the Able Rules package is the AbleRuleSet class, a Java bean that, when customized, can provide many different types of inferencing to Java applications.
Precisely because the AbleRuleSet object is a Java bean, this object 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. And, like any Java bean, AbleRuleSet objects also 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, like any other object derived from these Able classes, 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 (perhaps filtered) input from and write output 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.
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 RuleSet Editor) or programmatically. Techniques to customize an empty ruleset object are described in Customizing AbleRuleSet Objects a little further on.
runRsEditor
shell
script in Able's
.../bin/
directory
to start the ruleset editor. The RuleSet Editor will open on a
new, empty ruleset, which you can begin customizing, or you can
load an existing ruleset into the editor by using the editor's
menus
(see Customizing AbleRuleSet Objects below)
or by passing the name of an Able Rule Language (ARL) source
file via the command line.
AbleRuleSet rs = new AbleRuleSet();
rs.addVariable(new AbleContinuousVariable(1,100,50));
rs.instantiateFrom("mySourceFile.rs");
rs.instantiateFromXml("mySourceFile.rs_xml");
Once you have created a ruleset, you need to customize it by loading it with variables, rules, inferencing strategies, and the like. Fortunately, this is easy to do, and, as always seems true when using Java, there are multiple ways to do it!
The Able Rule Language is documented in a separate document, Rule Language Documentation, and you can learn about the intricacies of the RuleSet Editor in RuleSet Editor Documentation.
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.
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.
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. When the Able RuleSet Editor appears, use one of the many 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.
From here it is suggested you now go and read up on the Able Rule Language, and experiment with the Able RuleSet Editor.