A rule is an atom of knowledge expressing dependencies amongst field values. A rule consists of one or more premises (Boolean expressions typically testing field values) and, associated with each premise, an action (statements typically changing field values).
A rulebase is a collection of objects defining not only the rules but also organizational objects (e.g., rulesets, domains) and the objects referenced by the rules (e.g., classes, instances and fields). A rulebase may consist of hundreds, even thousands, of rules.
A rule author or rulebase author is one who maintains rulebases - usually via a tool such as a rulebase editor. The rule author is a knowledge expert who encodes some or all of her/his knowledge in the form of rules. The author's expertise may involve any knowledge area - e.g., loan approval, medical analysis, chemical analysis, etc.
At inferencing time, a field may be in either a resolved (has a value) or unresolved (does not have a value) state.
Rules typically have dependencies on one another - i.e., one rule's premises may test field values resolved by another rule's action. Likewise, multiple rules may be alternatives to one another - i.e., perhaps resolving the same fields to different values depending on premise conditions.
The rule author may specify rules in any order - so there needs to be some sort of generic mechanism for determining how best to apply rules for resolving field values. We call this mechanism an inference engine (or Engine).
During inferencing, the Engine maintains a hierarchical agenda of active rulesets and rules.
When the Engine initializes a rule on the agenda, the Engine creates a rule thread. The thread is a runtime instantiation of the rule - and, due to decision iteration, the thread may, in turn, spawn additional child threads; and a child thread may do the same. As such, a rule extends the agenda hierarchy with its own hierarchy of threads.
When visiting a rule thread, the Engine evaluates the thread's premises and, if a premise is TRUE, the Engine performs the corresponding action for the thread. The Engine performs at most one action on behalf of a thread.
If the Engine is unable to evaluate a premise or to complete an action due to an unresolved-field value, the Engine will pend the thread - i.e., defer further processing of the thread until relevant fields are resolved (by the actions of other threads).
| Copyright © 2009 CA. All rights reserved. | Email CA Technologies about this topic |