Subset colour sets
CPN ML


Subsets are a selection of values in a previously declared colour 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 colour 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 colour set name will contain exactly those values that are listed.

Order

ordering of base colour 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 colour set EvenInt is a subset of the set of integers, and it contains only the even integers. A subset colour set is used in the example CP-net of the Distributed Database.

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

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

Operations

See also colour set functions.

All Colour Sets