Subsets are a selection of values in a previously declared color set.

Declaration syntax

The subset specification can take two different forms: function and list.

colset name = subset name0 by subset-function;

The by clause specifies a function whose return value is a boolean. The color set name will contain exactly those values from name0 that are mapped into the boolean value true.

colset name = subset name0 with subset-list;

The with clause specifies a list with elements from name0. The color set name will contain exactly those values that are listed.


ordering of base color set

Declaration examples

fun even i = (i mod 2)=0;

The function even returns true when i is even and false when i is odd.

colset EvenInt = subset Int by even;

The color set EvenInt is a subset of the set of integers, and it contains only the even integers. A subset color set is used in the example CPN of the Distributed Database.

colset Weekend = subset Day with [Sat,Sun];

The color set Weekend is a subset of the color set Day which is an enumerated color set.


color set functions.


Union color sets
Real color sets

You must be logged in to post a comment.