next up previous

9.7.2 Instanceset Determination

COOL uses straightforward permutations to generate instance-sets that match an instance-set template from the actual instances in the system. The rules are as follows:

1) When there is more than one member in an instance-set template, vary the rightmost members first.

2) When there is more than one class that an instance-set member can be, iterate through the classes from left to right.

3) Examine instances of a class in the order that they were defined.

3a) Recursively examine instances of subclasses in the order that the subclasses were defined. If the specified query class was in scope of the current module, then only subclasses which are also in scope will be examined. Otherwise, only subclasses which are in scope of the module to which the query class belongs will be examined.

Example

For the instance-set template given in section 9.7.1, thirty instance-sets would be generated in the following order:

1.  [Boy-1] [Girl-1]                 16. [Boy-4] [Girl-1]
2.  [Boy-1] [Girl-2]                 17. [Boy-4] [Girl-2]
3.  [Boy-1] [Woman-1]                18. [Boy-4] [Woman-1]
4.  [Boy-1] [Woman-2]                19. [Boy-4] [Woman-2]
5.  [Boy-1] [Woman-3]                20. [Boy-4] [Woman-3]
6.  [Boy-2] [Girl-1]                 21. [Man-1] [Girl-1]
7.  [Boy-2] [Girl-2]                 22. [Man-1] [Girl-2]
8.  [Boy-2] [Woman-1]                23. [Man-1] [Woman-1]
9.  [Boy-2] [Woman-2]                24. [Man-1] [Woman-2]
10. [Boy-2] [Woman-3]                25. [Man-1] [Woman-3]
11. [Boy-3] [Girl-1]                 26. [Man-2] [Girl-1]
12. [Boy-3] [Girl-2]                 27. [Man-2] [Girl-2]
13  [Boy-3] [Woman-1]                28. [Man-2] [Woman-1]
14. [Boy-3] [Woman-2]                29. [Man-2] [Woman-2]
15. [Boy-3] [Woman-3]                30. [Man-2] [Woman-3]


Example

Consider the following instance-set template:

((?f1 FEMALE) (?f2 FEMALE))

Twentyfive instance-sets would be generated in the following order:

1. [Girl-1] [Girl-1]                    14.[Woman-1] [Woman-2]
2. [Girl-1] [Girl-2]                    15.[Woman-1] [Woman-3]
3. [Girl-1] [Woman-1]                   16.[Woman-2] [Girl-1]
4. [Girl-1] [Woman-2]                   17.[Woman-2] [Girl-2]
5. [Girl-1] [Woman-3]                   18.[Woman-2] [Woman-1]
6. [Girl-2] [Girl-1]                    19.[Woman-2] [Woman-2]
7. [Girl-2] [Girl-2]                    20.[Woman-2] [Woman-3]
8. [Girl-2] [Woman-1]                   21.[Woman-3] [Girl-1]
9. [Girl-2] [Woman-2]                   22.[Woman-3] [Girl-2]
10.[Girl-2] [Woman-3]                   23.[Woman-3] [Woman-1]
11.[Woman-1] [Girl-1]                   24.[Woman-3] [Woman-2]
12.[Woman-1] [Girl-2]                   25.[Woman-3] [Woman-3]
13.[Woman-1] [Woman-1]


The instances of class GIRL are examined before the instances of class WOMAN because GIRL was defined before WOMAN.


next up previous