next up previous

11.4 CARDINALITY ATTRIBUTE

The cardinality attribute restricts the number of fields which can be stored in a multifield slot. This attribute can not be used with a single field slot.

Syntax

<cardinality-attribute>
                  ::= (cardinality <cardinality-specification>
                                   <cardinality-specification>)
<cardinality-specification> ::= <integer> | ?VARIABLE

Only integers can be used in the cardinality specification with the first value to the cardinality attribute signifying the minimum number of fields which can be stored in the slot and the second value signifying the maximum number of fields which can be stored in the slot. If the keyword ?VARIABLE is used for the minimum value, then the minimum cardinality is zero. If the keyword ?VARIABLE is used for the maximum value, then the maximum cardinality is positive infinity (+_). If the cardinality is not specified for a multifield slot, then it is assumed to be zero to infinity.

The min-number-of-elements and max-number-of-elements attributes found in CLIPS 5.1 are no longer supported. The cardinality attribute should be used in their place.


next up previous