Color sets

Color sets

A color set is compound if it is constructed from other color sets; otherwise, it is simple. Simple color sets Unit color sets Boolean color sets Integer color sets Large Integer color sets Real color sets Time color sets String color sets Enumerated color sets Index color sets Compound color sets (using previously declared color sets) Product color sets Record color sets List color sets […]

Read Me Leave comment

Unit color set

Unit color set

The unit color set comprises a single element, denoted (). Declaration Syntax colset name = unit [with new_unit]; Order trivial Optional with clause Renames the value, that is, defines the identifier representing (). The new value name must be a CPN ML identifier. Declaration examples colset U = unit; colset E = unit with e; Operations See color set functions.  

Read Me Leave comment

Union color sets

Union color sets

A union color set is a disjoint union of previously declared color sets. Declaration Syntax colset name = union id1[:name1] + id2[:name2] + … + idn[:namen]; If namei is omitted then idi is treated as a new value, and it can be referred to simply as idi. Order first after selectors, then after ordering of each base color set Values idi v idi(v) where v […]

Read Me Leave comment

Time color sets

Time color sets

NOTE: This type is introduced in CPN Tools 3.5.5. Time values are numerals depending on the . The time color set is large. The type depends on the time mode of the model, and may either be identical to large integer color sets or real color sets Declaration syntax colset name = time Order usual ordering of time stamps Declaration examples colset TME = time; […]

Read Me Leave comment

Subset color sets

Subset color sets

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 […]

Read Me Leave comment

String color sets

String color sets

Strings are specified by sequences of printable ASCII characters surrounded with double quotes. The string color set is large unless restricted by the with … and clause, in which case it is small. Declaration syntax colset name = string [with string-exp1..string-exp2 [and int-exp1..int-exp2]]; Order lexicographic (with the ASCII ordering) Optional with clause Restricts the character set of string color sets. The character set is specified […]

Read Me Leave comment

Size and complexity of color sets

Size and complexity of color sets

Color sets are classified by size and by complexity. Complexity A color set is compound if it is constructed from other color sets, otherwise it is simple. Size Color sets can be classified as large or small. This distinction determines which predefined functions are meaningful for a particular color set. A color set is large if it contains too many (default 100) elements to enumerate, […]

Read Me Leave comment

Record color sets

Record color sets

A fixed-length color set whose set of values is identical to the Cartesian product of the values in previously declared color sets. Each of the component color sets may be a different type and each is identified by a unique label so that each field is position-independent. Declaration Syntax colset name = record id1:name1 * id2:name2 * … * idn:namen; Order lexicographic (with respect to […]

Read Me Leave comment

Real color sets

Real color sets

NOTE: This type is introduced in CPN Tools 3.5.5. Real numbers are distinguished from integers by the decimal point. The period separates the integer part from the fractional part. One or more digits must follow after the decimal point. The real color set is large. IMPORTANT: Reals are NOT equality types in Standard ML. In the CPN ML variant used in CPN Tools this has […]

Read Me Leave comment

Product color sets

Product color sets

Declaration syntax colset name = product name1 * name2 * … * namen; where n>=2 Order lexicographic (with respect to ordering of base color sets). Values (v1, v2, …, vn) where vi has type namei for 1<=i<=n. Declaration examples colset P = product U * I; A product color set is used in the example CP-net for Resource Allocation. Operations #i x: extract the ith […]

Read Me Leave comment