For a general introduction to inexact rules see What are inexact rules? Rule-type specific windows and issues are explained in Inexact Rules Types. See also inexact rule related input facilities for a description "question series" and "question clusters".

 

Certainty rules and fuzzy sets (fuzzy set rules) are "subordinated" to sentence rules in the way that their ultimate purpose is to return a certainty factor probability or a membership grade to a data element type in the conclusion of a sentence rule. Certainty rules and fuzzy sets are used by (called by) the sentence rule in the same way as functions. The inference engine however deals with functions and certainty rules/fuzzy sets differently. While functions are handled by the core PROLOG-type inference engine, certainty rules and fuzzy sets are handled by special engine used for certainty rules only.  

 

INEXACT RULE COMPONENTS

An inexact rule consists of three parts:

  • terminology
  • sentence model declaration
  • inexact rule definition

Normally, you have to insert these three elements in the KB in the sequence over, and remove (delete) from the KB in the reversed over. 

The terminology defines the rule's KB name and NL name. The sentence model declaration defines the rule's parameters as an ordered list of data element types, and the domain of the rule's return value. The inexact rule definition defines the mapping from parameters to return value (the "program code").

 

Example

TERMINOLOGY

the syntagm with language English, KB-name "cPowerfulBike", syntax class INEXACT_RULE, syntax form SINGULAR_UNDETERMINED and token list "powerful" and "bikes" is in the terminology with segment name "MC"!

SENTENCE MODEL

the inexact rule with NL-name powerful bikes, domain name MEMBERSHIP_GRADE and data element list model name is in the sentence model with segment name "MC"!

DEFINITION

There is no representation of an inexact rule definition on NL-format. However, inexact rules have an XML-format representation which incorporates the definition as well as the sentence model declaration:

<inexactRule format="NL" realm="INEXACT_RULES">
<queryRule>
<heading>
<rule>powerful bikes</rule>
<returnDomain>MEMBERSHIP_GRADE</returnDomain>
<parameter>model name</parameter>
<prior>0</prior>
</heading>
<default>
<intVal>50</intVal>
</default>
<query>first value of bhp where bike with model=this model name has metric specifications</query>
<map>
<mapClass>NUMERIC</mapClass>
<intVal>100</intVal>
<intVal>1</intVal>
<intVal>50</intVal>
<fixVal>0.5</fixVal>
<intVal>20</intVal>
<intVal>0</intVal>
</map>
</queryRule>
</inexactRule>
 

 

Inexact Rules Main Window

Inexact rules are entered, viewed, updated and deleted via the Inexact Rules-window. The window includes all inexact rule declarations, i.e. rules with missing or suspended definitions are also included (but marked with an asterisk).

The rule types to be displayed are controlled by the radio buttons on the left side of the window. The push buttons at the bottom are used as follows:
New Rule/Set To define a new inexact rule. The radio buttons on the left side determine the type of rule to be defined.
Copy Rule/Set Makes a copy of  the selected rule (with a new name). This copy is typically used as a template for new rule.
Delete Rule/Set Deletes the selected rule.
View/Update Rule/Set Displays the selected rule in a rule window.
View Record Opens the selected rule in the Record-window.
XML (NL-based) Displays the XML (NL) representation of the selected rule.
XML (PR-based) Displays the XML (PR) representation of the selected rule.
XML (NL-based) entire tree Generates an XML (NL) text file of the rule network with the selected rule as root in input sequence order (e.g. the selected rule will be last rule in the XML file).
XML (PR-based) entire tree Generates an XML (PR) text file of the rule network with the selected rule as root in input sequence order (e.g. the selected rule will be last rule in the XML file).
Display dependents Displays the selected rule's dependents in a Dependents-window.
Display rule tree Displays the rule tree with the selected rule as root node.

 

Creating a New Rule

Enter a new rule by pressing the New Rule-button or by copying an existing rule (the Copy Rule-button), and then updating the copy. The radio buttons on the upper area of the window determines the type of rule to be created. The type can not be changed.
Enter the rule's NL-name, KB-name and its realm. Realm names are rather unimportant for certainty rules, however it must be specified.
 
The General Rule Definitions window is used for all, but fuzzy set type of rules.

The Return domain specifies the domain of the value returned by the rule. 

The rule can optionally have one or more input parameters. These are selected in the  Input parameters-control (note that changing the sequence of parameters will require changes to all rules calling the rule). 

Prior probability and Return-value if out of context are entered. The latter is not mandatory unless a context is specified (described under). The prior probability field is only visible if the return domain is relevant (certainty factor or probability).

CHANGING A RULE'S TYPE

You can change the rule type by deleting and then re-creating the rule with the new type. However, this has the disadvantage that knowledge nodes with references to the rule must be deleted or suspended. To avoid this you can instead use the following procedure:

  1. Delete the rule's definition in the Inexact Rules-window (i.e. retain the declaration to avoid creating referential problems).
  2. In the same window, select the new rule type and press New Rule-button.
  3. Enter the rule's NL- and KB-names (the spelling must be identical to existing rue declaration).
  4. Re-enter the appropriate rule definition.

INPUT PARAMETERS

Input parameters (which are data element types) are selected from the list button on the right side (you can also type in the data element name rather than selecting it). Use the Look up data element to open the data element window i.e. to see the definition of a selected data element type, or to define a new. The Refresh-button is used to refresh the list (e.g. if you have defined a new data element type).

Use the <---Add-button to add the selected data element as a new input parameter (i.e. include in the left-side listbox). The Remove--->-button removes an existing parameter. The Move Up and Move Down-buttons are used to change the sequence of the selected input parameters. Note that the sequence is significant such that existing calls to the rule (if any) must be modified if the sequence is changed.

 

Calling Rules - Rule Call Dialog

The core aspect of inexact rules is to call other inexact rules. All types of certainty rules and fuzzy set rules can call other rules, and all types except data rules, always call other rules (the term referencing rather than calling is sometimes used in the context of fuzzy set rules).
RULE TYPE

CALL/REFERENCE TYPE

CERTAINTY RULES
logical AND call
logical OR call
logical NOT call
bayesian call
increment call
decrement call
combination call
FUZZY SETS
intersection reference
union reference
complement
ordered weighted average reference
weight call
SUPPORT RULES
context call
switch criterion call
switch call
map call
parameter call
parameterized call

The general rule-call dialog are used for all types of inexact rule calls. The upper part of the window shows the calling rule's type and name, and under the names, the type of call. The rule to be called is selected from the list-button. You must do a listbutton-select to trigger the display of the selected rule's parameters in the listbox under it.

If an input parameter in the selected rule has the same name as one of the calling rule's parameters, then this parameter is assigned to it by default (to save data entry effort - you can of course change the value assigned to the parameter as something else).

Setting/re-setting actual parameter values:

Select the parameter in the list-box. Then type the actual parameter value in the edit-control on the right side of the (Re-)set parameter value-button and press the button. The typed value must be of the same domain as the parameter.

All parameters must have a value assigned to it before the OK-button is pressed.

 

CALL-TYPE SPECIFIC CONTROLS

Some call-types need additional details related to or qualifying the call.

CALL-TYPE

CALL-RELATED DETAILS
bayesian Requires an increment number (range [1,..> ) and a decrement number (range <0,1> ) - one or both can optionally be specified as a call (which returns the value)
parameter Requires the name of a variable (simple variable) which is used to represent the returned value in the calling rule. 
switch branch Requires a condition for this branch specified by using one or two operator/operand pairs or the default-operator.
context call Same as above, but the default-operator is not used for context conditions.
ordered weighted averaging call Requires a weight (a positive number) or optionally a call in which case the value returned is used as the weight.
Note in particular the qualifiers for bayesian calls and ordered weighted averaging calls, which either can be specified explicitly as a number, or alternatively as another call. The number (increment, decrement, weight) is then the value returned by this called rule. This dynamic feature can be used in various ways, the most common being the KE or user providing a value (e.g. depending on his/her preference) during run-time.

A switch condition where the return value must be UNSURFACED ROADS

The default-switch branch.
A context condition where the returned value must be in the range [2.0,3.0].
 

CALL SYNTAX-FORMATS (AS DISPLAYED)

The syntax conventions used for displaying calls in the various inexact rule windows are mostly self-explanatory. The call proper is shown as follows:

  • <Call> ::= called_rule [ <Parameter> [{, <Parameter>}* and <Parameter>] ]
  • <Parameter> ::= parameter_name = <Value>
  • <Value> ::= this parameter_name | calling_rule's parameter_name | literal_value

A context call is associated with a value or a range of values for which the calling rule is deemed to be in context:

  • <ContextCall> ::= <Range> :: <Call>
  • <Range> ::= {=|<>|<|<=|>|>=} literal_value [& {=|<>|<|<=|>|>=} literal_value ]

A switch call additionally has a default-option:

<SwitchCall> ::= ::= <Range> :: <Call> | default :: <Call>

A call in a bayesian combination has increment and decrement values, which either are literal values or another call:

<BayesianCall> ::= ::= <Call> :: INC: {<Call> | literal_value>} DEC: {<Call> | literal_value>}

A reference (call) in an ordered weighted average (OWA) fuzzy set combination has a weight value, which either is literal values or another call:

<OWA_Call> ::= ::= <Call> :: WEIGHT: {<Call> | literal_value>}

A call to a parameter-returning rule in a parameter rule is shown as:

<ParamaterCall> ::= ::= variable :: <Call>

Rule Networks - Rule Trees

The rule calls form a directed acyclic graph (rule network) where the nodes correspond to rules and the connections correspond to calls

Pro/3 can draw rule networks as trees. Rule trees are drawn with the calling rule to the left of the rules called. The example under shows a portion of rule network from the MC-model:

The example (left) is a small rule network. The root rule is a fuzzy set called bikes with high cost factors, i.e. the set of bikes which have characteristics which make them costly. The set is an ordered weighted averaging of five other fuzzy sets big engine bikes, complex engine bikes, heavy bikes, high performance bikes and highly rated bikes. The integer prefixing these five sets are the weighting factors used in the combination.
RULE TREE DRAWING CONVENTIONS
  • Each rectangle represents a rule. The rule's name is drawn inside the rectangle with an optional header text (left side) and trailer text (right side).  
  • The following header texts are used:
  • CONTEXT <condition>:: the rule is called as context-call.
  • CRIT:: the rule is a called as criterion rule in call-type switch rule.
  • PAR:: the rule is called to return a parameter value in a parameter rule.
  • WEIGHT:: the rule is called to return a weighting factor used in a fuzzy set ordered weight4ed averaging operation.
  • The following trailer texts are used:
  • ::AND AND call
  • ::OR OR call
  • ::NOT NOT call
  • ::BAY bayesian call
  • ::MAP map call
  • ::SWI switch call
  • <condition>:: condition in switch rule branch
  • ::ISx x-type fuzzy set intersection (x: a=algebraic product, b=bounded difference, d=drastic, blank=standard)
  • ::UNx x-type fuzzy set union (x: a=algebraic sum, b=bounded sum, d=drastic, blank=standard)
  • ::CMPL fuzzy set complement
  • ::OWA fuzzy set ordered weighted averaging combintion

The rule tree can be used to navigate the rules for the purpose of viewing or editing (the rule window can be opened by right-doubleclicking the rule node). The following mouse-gestures are available in certainty rule trees:
 

MOUSE GESTURE

EFFECT
left button single click highlights the clicked node
left button double click toggle for opening/closing the clicked node's sub-tree 
right button single click (on highlighted certainty rule node) makes the highlighted certainty rule current in the annotation part of the KE Assistant window
right button double click opens the certainty rule editor with the highlighted certainty rule selected; highlights the clicked node