ARL Master Index


ARL Overview

The ABLE Rule Language (ARL) is a programming language that provides tight integration with Java objects along with the power and flexibility of rule-based inferencing. ARL syntax is very Java-like, following the syntax and semantics of Java Object declarations and logical expressions. In Java you define classes with data members and methods. In ARL you define rulesets with variables and ruleblock methods. In Java, methods contain one or more logical statements. In ARL methods contain one or more rules. ABLE Rule Language rulesets are compiled into AbleRuleSet objects and are processed by the specified Able inference engine.

Unlike other languages, however, a collection of ARL statements is not so much a program, but rather the collection of statements is a source ABLE ruleset. The ARL statements in a source ruleset are actually customization directions used to customize AbleRuleSet objects which are a special form of Java bean. AbleRuleSet objects read ARL, either from disk files which you have created or in-memory buffers, and configure themselves to perform the desired inferencing when asked to do so.

You can use any text editor to create source rulesets (a collection of ARL statements, remember), but ABLE provides a RuleSet Editor to assist with this task. The RuleSet Editor also provides the means to compile your rulesets, and save them as customized serialized AbleRuleSet objects or as XML documents. The editor also provides test and debug facilities, so it is recommended you use the editor to develop all your ARL rulesets.

While the ABLE rule language is free-form, ABLE source rulesets have a definite structure. You first write ARL statements to specify Java classes you want to access during inferencing, load domain-specific function libraries, then you define variables, and lastly you write one or more rule methods, which are collections of inferencing rules which examine and manipulate your variables. Depending on the type of rule block, the rules may be processed sequentially or according to some special inferencing algorithm that you specify. You can write rules that invoke other rule blocks or rulesets, allowing rulesets to be chained together, each with its own inferencing strategy. Your rules can also call out to any arbitrary Java code and receive values from that code. All in all, ABLE Rule Language and Able RuleSets are very flexible and powerful. Below is a simple example of a source Able ruleset. Details on how to construct your own rulesets are given in the remaining parts of this document which can be accessed by referring to the ARL master index.

 ruleset FigureOutTheVehicle { 
  variables { 
     Categorical vehicleType = new Categorical( "automobile", "cycle" ); 
     Discrete num_wheels = new Discrete( 2, 3, 4 ); 
     Discrete num_doors = new Discrete( 2, 3, 4 );
     Categorical motor = new Categorical( "no" "yes" ); 
     Categorical vehicle = new Categorical( "Bicycle", "Tricycle", "Motorcycle", "MiniVan", "Sedan", "Sports Car", "Sports Utility Vehicle" );
     Categorical size = new Categorical( "small", "medium", "large" );
  }
  
  inputs { } 
  outputs { vehicle } 


   void init() { 
     a1: size = "medium"; 
     a2: num_wheels = 4; 
     a3: num_doors = 3;
     a4: motor = "yes";
   } 

   void main() using Backward(goal=vehicle) { 

    Bicycle: if ( vehicleType == "cycle" and num_wheels == 2 and motor == "no") then vehicle = "Bicycle"; Tricycle: if ( vehicleType == "cycle" and num_wheels == 3 and motor == "no") then vehicle = "Tricycle"; Motorcycle: if ( vehicleType == "cycle" and num_wheels == 2 and motor == "yes" ) then vehicle = "Motorcycle"; SportsCar: if ( vehicleType == "automobile" and size == "small" and num_doors == 2 ) then vehicle = "Sports Car"; Sedan: if ( vehicleType == "automobile" and size == "medium" and num_doors == 4 ) then vehicle = "Sedan"; MiniVan: if ( vehicleType == "automobile" and size == "medium" and num_doors == 3 ) then vehicle = "MiniVan"; SUV: if ( vehicleType == "automobile" and size == "large" and num_doors == 4 ) then vehicle = "Sports Utility Vehicle"; Cycle: if ( num_wheels < 4 ) then vehicleType = "cycle"; Automobile: if ( num_wheels == 4 and motor == "yes" ) then vehicleType = "automobile"; } }  

Able Rule Language master index.
Able RuleSet Editor master index.
Rules package table of contents.

Last modified: Fri Sep 21 14:19:36 Central Daylight Time 2001