Aspen SCM‎ > ‎Expert System‎ > ‎1. Elements‎ > ‎

1.8 Rules and Rule Sets

Rule Sets and RULES

Several rules may be held together in a rule set which is vaguely similar to a module. However, there is no sharing or hiding of information within the rule set: everything is either local (private to the rule) or global (public to the world). Rule sets are identified as such by their being listed in the set RULES (this is the conventional name for this set; its name is actually specified as the contents of the table entry CNTLE(RULES,1)).

Rule sets are Aspen SCM Expert System sets just as any other and so have a Code section and a Description section. The standard lengths of these are 8 characters for the Code and 64 for the Description. In earlier versions of Aspen SCM Expert System (then called Mimi) the length of the Code plus the length of the Description was limited to 64 characters. For this reason some rule sets may be found with Descriptions which are 56 characters long. These can now be increased to 64 characters.

COLLECT and Maintenance of RULES

You can either maintain the set RULES yourself or you can execute the command COLLECT. This searches all sets for ones which have the keyword IF in the Code section and writes their names into RULES. Clearly it is possible for COLLECT to find things which are not rule sets. Also, if you have old versions of rules it will find them and include them in RULES. This can have unfortunate consequences because of the way that duplicate predicates are handled (see Duplicate Predicates in section 1.7).

COLLECT processes sets in the order in which they appear in the set catalogue (you can see what this order is by selecting Catalogue Index as the Sort Order in the dialog which appears when you press the button on the toolbar; it is also used in the listing of all sets produced when you execute the command PRINT SCAT).

As a consequence, COLLECT places sets in RULES in the order in which those sets appear in the set catalogue. If you are using multiple predicates (see section 1.7) you should use the POSITION command to ensure that rule sets containing them appear in the set catalogue in the order in which you want them to be processed. If you do not, your program will stop working if someone executes COLLECT.



Back                                Next
Comments