Declare clause
For generating some colour set functions in some versions of CPN Tools CPN ML


In versions 0.1.1 to 0.1.53 of CPN Tools it is necessary to use the declare clause to generate some of the colour set functions. The declare clause can be appended to declarations for enumerated colour sets, product colour sets, record colour sets, and union colour sets.

Many of the versions between 0.1.1 and 0.1.53 are available only as internal releases. The declare clause does NOT need to be used in versions 0.1.54 and above, unless:

If you have declared product or record colour sets with 10 or more components, then you will have to use the declare clause to generate the colour set functions that are mentioned below. Note: it may not be possible to create record or product colour sets with more than ca. 18 components, for more information see bug #731.

Declaration Syntax

colset name = ... declare id1, id2, ..., idn ;

where for i=1..n, idi is one of the following: input, all, ran, size, ord, col, of, or mult. For more details about these functions, read more about colour set functions.

Affected Colour Sets

The declare clause must be used to declare the following functions:

Note: the set_idi functions for product and record colour sets are not available in versions before 0.1.54.

Declaration Example

colset P = product SmallInt * Bool declare mult, all;

This declaration ensures that the functions P.mult and P.all are available.

colset R = record i:INT * s:STRING declare set;

This declaration ensures that the functions R.set_i and R.set_s are available.

colset Packet = union DATA: Data + ACK declare of,size;

This declaration ensures that the functions Packet.of_DATA, Packet.of_ACK, and Packet.size are available.