Contents - Index - Previous - Next


Depth-first backward chaining

 

Before running a knowledge base (model), InterModeller first checks that it has correct syntax and is loop-free. InterModeller next analyses the model to identify top-level rules. These are investigated in listed order using backward chaining and, if the conditions of a rule are validated, the rule's conclusion is presented as advice. 

 

Click below to learn more about:

Checking syntax

Loop detection

Identifying top-level rules

Backward chaining

 

InterModeller Help Contents


Checking syntax

Checking the syntax (or grammatical form) of a model is easy in the case of decision table models and decision tree models, since for these types of model errors are mostly eliminated by the representational structure. Errors can arise in classification tree models via invalid feature descriptions but these can be trapped at the time tree labels are created. Rule models require the most extensive checking. Click here to learn more.

 

 

Loop detection

An example of a (backward) rule containing a loop is:

 

size is large if size is large.

 

An example of a loopy classification tree is:

 

 

InterModeller checks for such loops before a model is run (or transformed) and reports them to the user.

 

 

Identifying top-level rules

A top-level rule is one with a conclusion that does not occur in any other rule's conditions. Top-level rules provide the conclusions that might be presented ultimately as advice during a runtime consultation. Lower-level rules never directly generate advice - their purpose is to provide a means whereby the conditions of other rules, including top-level rules, can be validated. For example, in the following Forward rules model the first two rules are top-level rules and the other two rules are lower-level:

 

IF a=2 THEN x=x2.

IF a=1 THEN x=x1.

IF q=1 THEN a=1.

IF q=2 THEN a=2.

 

The first rule is a top-level rule because its conclusion x=x2 does not occur in the conditions of any other rule. The third rule is a lower-level rule because its conclusion a=1 occurs as a condition in the second rule. Note that this distinction is nothing to do with the way in which rules are sequenced: the lower-level rules could just as well be listed first.

 

 

Backward chaining

During the run the conclusions of these top-level rules specify top-level goals which are investigated in the order given by the rule listing. For each top-level rule, the rule's conditions are tested in strict left-to-right order (or what would be left-to-right if the rule's text was set out on a single physical line). The term 'depth-first' refers to the way in which each condition is exhaustively investigated before its right-hand neighbour is considered. If all the conditions of a top-level rule are validated (proved to be true) then the conclusion of the rule is presented to the user as advice. If any condition fails to be validated then the investigation of the rule is immediately abandoned, without checking the condition's right-hand neighbours.

 

There are three possible methods by which a condition can be validated:

 

 

Notice that in the second method, a rule's condition links to another rule's conclusion. In a deeply-structured set of rules (one in which concepts are defined in terms of concepts that are defined in terms of other concepts, and so on) this linking of rules, which is called backward chaining, could continue at length.

 

The third method, in which the user is questioned, generates either a true/false question or a menu question. In the case where the condition being validated is either a proposition or a feature A=V for which the model only ever associates one value for the attribute A, a true/false question is generated. If two or more values are associated with A then the system generates a menu question which offers the set of all values that are paired with that attribute anywhere in the rule set. Answers once acquired are stored for later retrieval, so the same question will never be asked twice in the one run (this is sometimes called 'answer tracking').

 

The above description applies to InterModeller's binary logic mode. If certainty factor logic is active, a variation in the method is used.