Aspen SCM‎ > ‎Expert System‎ > ‎2. Flow of Control‎ > ‎

2.c CNTLE Parameters

The following parameters in the table CNTLE affect how the interpreter works:

  • CHAIN: forward or backward chaining;

  • LOOP: iteration limit for WHILE loops;

  • EOU: whether the interpreter stops when a statement resolves UNKNOWN;

  • UNIF: predicate unification flag.

CHAIN: Forward or Backward Chaining

There are three possibilities for CNTLE(CHAIN,1): BACKWARD; FORWARD; and FORBACK. Always use BACKWARD. It is the only one which supports the writing of quasi-procedural code.

LOOP: Iteration Limit for WHILE Loops

CNTLE(LOOP,1) defines the absolute upper limit on the number of iterations of a WHILE loop. It should be set sufficiently large that it will never constrain a WHILE loop to be terminated by it but should not be so large that a program which contains bugs has to be killed because it would take too long for it to reach the loop limit.

The interpreter reads this value during linking so you should not consider changing it during the execution of an application. If this is really necessary, you can do this by relinking the application before the new limit is used. This can be achieved either by executing an explicit LINK command or, if automatic linking is in use (CNTLE(LINK,1) = YES) by firing a rule as >MYRULE .

See section 3.5 for further details.

EOU: Error on Unknown

See section 2.d.

UNIF: Predicate Unification

Predicate unification is a mechanism which speeds up the execution of rules but which can have unexpected results with near-duplicate predicates (see section 1.7).

You are strongly advised to define predicates in THEN clauses as a predicate verb (i.e. a string of characters without any embedded blanks) followed by between 0 and 9 predicate arguments (i.e. local variables). If you do this, you can safely switch predicate unification on by setting CNTLE(UNIF,1) = YES.

You can check whether there are any near-duplicate predicates by running the command CHECK PRED at the F3 command prompt.

Eudoxus Systems has developed a rule set UNTRUE which detects non-existent predicates and rules which do not end TRUE (see section 2.d). It uses near-duplicate predicates and so is not compatible with predicate unification. It should only be used during development and should be removed when an application goes into production.

Back                                Next