ARL Master Index


ARL Overview

The Able Rule Language (ARL) is essentially like any other programming language, but one that is geared toward providing inferencing capabilities. Like most other languages, ARL syntax is completely free-form. Like other languages, you declare variables and write language statements referencing those variables. Like other languages, you can compile the source statements and save them in object form.

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 inferencing and other processing options, then you define variables, and lastly you write one or more rule blocks, which are nothing more than 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 (

      InferenceMethod(Backward)

      Variables(
        vehicleType Categorical( "automobile" "cycle" )

        num_wheels  Discrete( 2, 3, 4 )
        num_doors   Discrete( 2, 3, 4 )

        motor       Categorical( "no" "yes" )
        vehicle     Categorical( "Bicycle", "Tricycle", "Motorcycle",
                                 "MiniVan", "Sedan",    "Sports Car",
                                 "Sports Utility Vehicle" )

        size        Categorical( "small" "medium" "large" )
      )

      GoalVariable(vehicle)

      InputVariables()
      OutputVariables(vehicle)

      Rules Init (
        a1: size       = "medium"
        a2: num_wheels = 4
        a3: num_doors  = 3
        a4: motor      = "yes"
      )


      Rules(
        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