| Prev | Next | Start of Chapter | Next Chapter | Contents | Glossary | Index | Comments | (10 out of 10)

The Rule Class

Rules have the following class-specific attributes:

Attribute Description
Options
Declares whether the rule can be invoked using chaining, and also declares whether the rule can invoke other rules by using chaining. For any rule except a when or whenever rule, edit this attribute to declare participation in chaining to or from this rule.
Allowable values:
invocable via forward chaining
not invocable via forward chaining
invocable via backward chaining
not invocable via backward chaining
may cause data seeking
may not cause data seeking
may cause forward chaining
may not cause forward chaining

Default value:
if rules, initially rules, and unconditionally rules: when rules and whenever rules:
Notes:
See Backward Chaining and Forward Chaining. By setting this attribute to not invocable via forward chaining and not invocable via backward chaining, you can make an if rule behave like a when rule.


Tracing-and-breakpoints
Declares the message levels for warning messages and tracing messages, and declares the breakpoint level. These settings pertain only to this rule. Use warning messages, tracing messages, and breakpoints when debugging your KB.
Allowable values:
default
or,
optionally, one of the following warning message levels:
and, optionally, one of the following tracing message levels: and, optionally, one of the following breakpoint levels:
Default value:
default
Notes:
See Chapter 42, Debugging and Tracing. A value of default in this attribute directs G2 to use the settings in the Warning-message-level attribute, Tracing-message-level attribute, and Breakpoint-level attribute of the Debugging Parameters system table. The Tracing-and-breakpoints-enabled? attribute of the Debugging Parameters system table must have the value yes for G2 to produce tracing messages and to recognize breakpoints.


Scan-interval
Specifies how often G2 should invoke this rule. G2 ignores this attribute for initially rules and whenever rules.
Allowable values:
none
Any time interval

Default value:
none
Notes:
See Scanning Rules. If a generic rule has a scan interval, G2 invokes each generic rule invocation at the beginning of each scan interval.


Focal-classes
Associates the rule with one or more classes of objects. By executing a focus action that names a class of objects, your KB can invoke all rules whose Focal-classes attribute names that class.
Allowable values:
none
object
Name of any subclass of OBJECT

Default value:
none
Notes:
See Focusing on Rules and Invoking Rules by Category.


Focal-objects
Associates the rule with one or more named objects. By executing a focus action that names an object, your KB can invoke all rules whose Focal-objects attribute names that object.
Allowable values:
none
Name of any object

Default value:
none
Notes:
See Focusing on Rules and Invoking Rules by Category.


Categories
Names one or more rule categories that pertain to this rule. When executing an invoke action that names a rule category as its only argument, G2 invokes all rules whose Categories attribute names that category. When executing an invoke action that names both a rule category and an object or an object class, G2 invokes all rules whose Categories attribute names that category and whose Focal-objects attribute name that object or whose Focal-classes attribute names that class.
Allowable values:
none
Any non-reserved symbol

Default value:
none
Notes:
A rule category exists only if named in at least one enabled rule. See Focusing on Rules and Invoking Rules by Category.


Rule-priority
Specifies the priority for the rule invocation that G2 creates when this rule is invoked.
Allowable values:
Literal integer, from 1 (highest priority) to 10 (lowest priority)
Default value:
6
Notes:
See Prioritizing Rules. A rule's priority does not control the ordering of G2 scheduler tasks. Priorities propagate from rule to rule due to backward chaining. Priorities do not propagate due to forward chaining, or due to invoking a rule by executing a focus or invoke action.


Depth-first-backward-chaining-precedence
Specifies the precedence among a group of rules that G2 identifies for execution by using depth-first backward chaining. This attribute does not affect breadth-first backward chaining.
Allowable values:
Literal integer, 1 or greater
Default value:
1 (highest priority)
Notes:
By default, depth-first backward chaining causes G2 to invoke rules with lower precedence after rules with higher precedence have completed. Precedence differs from rule priority. For more information, see Using Depth-First Backward Chaining.


Timeout-for-rule-completion
Determines how long G2 attempts to invoke and execute a rule invocation before performing time-out processing.
Allowable values:
none
(the rule never times out)

use default
(use the value in the Timeout-for-inference-completion attribute of the Inference Engine Parameters system table)

Any time interval

Default value:
use default

Actions that Manipulate Rules

focus on {object | object-class}
invoke rule-category-name [ { , | or } rule-category-name ] ... rules 
for { object | object-class }

Expressions that Refer to Rules

One expression refers directly to rules.

To refer directly to a rule:

This expression produces the invoked rule within which this expression is evaluated. This expression is valid only in a rule. For example:

This whenever rule detects events that are associated with objects on its own workspace.

| Prev | Next | Start of Chapter | Next Chapter | Contents | Glossary | Index | Comments | (10 out of 10)

Copyright © 1997 Gensym Corporation, Inc.