EMA-XPS Online



syntax: (define-rule <rule-name> <ruleset-task-name>
           [:DOCUMENTATION <documentation>]
           [:EXPLANATION <explanation>]
           [:PRIORITY <lisp-type: number>]
           IF <rule-premise>
           {THEN | THEN-ONCE} <rule-conclusion>+)

Warning: The explanation facility is not sup-
         ported, hence :documentation and
         :explanation are ignored.
         The priority is ignored here! When loading
         a babylon3 KB, priorities influence the 
         placement of a given rule within a ruleset.
         Babylon2 rules have high priority, when
         they are placed at the beginning of a ruleset!

This definition form describes the exact syntax 
for making a rule.
<rule-name> is the name of the rule, <ruleset> is
the name of a set of rules, related to
the new rule. The keywords ':documentation',
':explanation' and ':priority' are optional.
The keywords:
                 if <left-side> then <right-side>
                 if <left-side> then-once <right-side>

follow the rule in the natural notation.
The priority is an integer. If more than one rule
have valid instances and the rule evaluation has to
be controlled by the priority, then the rule with
the highest priority number will be executed first.

It is possible to use all the BQL-expressions and
Lisp-expressions in the rule-premise, as long as they
do not have side effects on the knowledge base.

All the BQL-expressions and Lisp-expressions can be
used in the rule conclusion. Here you will
normaly change the knowledge base with
tell or retell.

example: >(define-rule HOLIDAYCHOICE
             :documentation "choose a city"
             :explanation (("this rule has
               to pick out a city"))
             :priority 1
             [and [holidayinterests a-client _x]
               [countries _country]
               (client-satisfied a-client _country)
               [cities _country _city]
               [offer _city _offer]
               (is-of-frame _offer _x)]
             (kb-format "~%Visit ~:(~A~)
                  in ~: (~A~)."
             (name-of _offer) (name-of _city)))

EMA-XPS Online