CDL Compatibility Statements and the COMPATIBLE ...OF Keyword

The COMPATIBLE keyword is used at the beginning of a compatibility statement that defines compatibility based on user-defined attribute values common to standard items of different option classes.

A Compatibility statement requires the keyword COMPATIBLE and two or more identifiers. The syntax of COMPATIBLE...OF is essentially the same as that of FOR ALL....IN. For each formal identifier in the COMPATIBLE clause, there must be a matching identifier in the OF clause. The conditional expression determining the set of desired combinations is in the WHERE clause.

The CDL of a compatibility rule must include at least two iterators.

Example

In the following example, the rule iterates over all the items of the Tint option class in the Glass child model and over all the items of the Color option class in the Frame child model of a Window model. A color and tint are compatible whenever the Stain user-defined attribute in an item of the Color option class equals the Stain user-defined attribute in an item of the Tint option class.

COMPATIBLE 
&color OF Frame.Color,
&tint OF Glass.Tint
WHERE &color.userAttrs["Paints_AG.Stain"] = &tint.userAttrs["Paints_AG.Stain"];