|
The rule editor is used to enter, view, update and delete sentence rules in the form of rule-trees. The rule editor consists of two windows: a rule-tree window containing the rule and a rule-tree palette window from which rule components and commands can be selected. This page describes the structure and elements of rule-tree windows, and how the rule tree is created (drawn) by using the rule-tree palette window. Mastering the rule-tree editor is essential for building knowledge bases with Pro/3! |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The rule editor palette is used to insert new rule tree elements or delete existing ones (there is no change-function - rule tree elements are deleted or inserted). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Argument
numbering The same entity type can occur several times in the rule (e.g. manufacturer in the example), and the different entity type arguments can have one or more data element types in common. It is thus necessary to qualify data element references. This is done by numbering the arguments (entity types and predicate types) in each sentence condition and in the conclusion. The sentence conditions are numbered sequentially from top to bottom starting with 10, then 20, 30 etc. The conclusion has number 0. The first entity argument in a sentence condition has sub-number 1 and the optional second has sub-number 2. Data elements of parameterized predicate types also need qualifications. These are per convention considered to belong to argument 0. The first entity argument in the third sentence condition thus gets argument number 31. The argument numbers are shown in brackets [ ]. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The region name data element in the conclusion is similarly
assigned the value of region name[22] i.e. from the
world region entity type in the condition. The conclusion is then
complete.
The condition is still missing something. There is no association between the country where a manufacturer is located (the first sentence condition), and the country which is a part of a world region (the second sentence condition). This is accomplished by assigned the name[12] data element (the name in argument 12) to the name[21] data element (the name in argument 21). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
An empty element is automatically inserted to the right of the =
(since clearly an element needs to be placed there for the = to
make sense). That element is name[12], which is selected in the
same way as the data element types inserted in the conclusion. A complete simple implication rule has been entered. The rule is inserted in the KB by pressing the Store-button. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sentence condition elements (in a rule's condition) optionally have conditions specified for one or more of its data element types: The conditions are specified by using one of the comparison operators and value (literal, data element, simple variable or expression) on this operator's right side. Two or more conditions can be used with logical AND or OR: Note the automatically assigned argument numbers used to qualify multiple occurrences of the same data element type. Sentence conditions can also correspond to a sentence group. The first entity type argument to the is located in predicate is simply specified as an entity type argument variable X, which can represent any entity type in this sentence group (likewise the entity argument to is conditionally projected in the conclusion). Inexact rule calls are treated in exactly the same way as function calls, however, they can only be used as assignments to a data element type in the rule's conclusion. Inexact rule names have [C] concatenated. Rule calls can not form a part of an expression, and can not be used as actual parameters to a function, inexact rule or procedure. Procedures can only be assigned to data elements in the conclusion of statistical rules. Procedure calls can not form a part of an expression, and can not be used as an actual parameter to a function, certainty rule or other procedure. Procedure calls are only permitted in the conclusion. Most, but not all, procedures have parameters. These appears in the same way as function call parameters. Note that two or more different procedures can be used in the conclusion of the rule. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Variable condition sub-trees consists of a simple variable (local to the rule tree), with either a value assigned to the variable or a condition imposed on it. The structure of the assignment or condition is the same as that for data element types in sentence conditions. Note that a variable can occur in more than condition, however the first (highest up in the rule tree), must be an assignment-type condition. The domain of the variable is indicated in the first occurrence by /SD (where SD is the short domain name). The variable's domain is determined by the selected domain in the domain list edit control when the variable is introduced. See also values, expressions and assignments. Variables can be used in expressions further down in the rule tree (including obviously in the rule's conclusion). Function calls (as in the example above) are included in the rule-tree as a sub-tree where the root-node is the function name (with [F] concatenated for clarify). The branches of this sub-tree are the formal parameters of the function with the actual parameters assigned through the equality/assignment operator. Note that the =* operator must be used when calling the non-deterministic function integer series (otherwise the function will return only the first value). Function calls can not form a part of an expression, and can not be used as an actual parameter to a function, certainty rule or procedure. Sentence-count conditions assign an integer representing the number of sentences which satisfy a given sentence condition. The integer is assigned to a variable in a variable condition-component of the rule. Use the #-button and then insert the sentence condition to the right side of the #-node. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The &-button inserts logical AND over the current node: The v-button works in the same way for logical OR. The vv- and ^^-buttos are used to insert more empty branches under an AND or OR node. The new branches are inserted under (vv) or over (^^) the current node: The vv and ^^ buttons can also be used to insert elements in list literals. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|