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

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

Boolean color set

Boolean color set

The Boolean values are true and false. Declaration syntax colset name = bool [with (new_false, new_true)]; Order false before true Optional with clause Renames the values; that is, defines the identifiers representing true and false. The new value names must be identifiers. Declaration examples colset B = bool; colset Answer = bool with (no, yes); Boolean operations not b: negation of the Boolean value b […]

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

Integer color sets

Integer color sets

Integers are numerals without a decimal point. The integer color set is large unless restricted by the with clause, in which case it is small.  Declaration syntax colset name = int [with int-exp1..int-exp2]; Order usual ordering of integers Optional with clause Restricts the integer color set to an interval determined by the two expressions in int-exp1 and int-exp2. It must be the case that int-exp1<=int-exp2. […]

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

List color sets

List color sets

A variable-length color set. The values are a sequence whose color set must be the same type. Declaration syntax colset name = list name0 [with int-exp1..int-exp2]; Order lexicographic (with respect to ordering of base color set) Values [v1, v2, …, vn] where vi has type name0 for i=1..n. Optional with clause The with clause specifies the minimum and maximum length of the lists. Declaration examples […]

Read Me Leave comment

Large Integer color sets

Large Integer color sets

NOTE: This type is introduced in CPN Tools 3.5.5. Large Integers are numerals without a decimal point and no upper limit. The large integer color set is large unless restricted by the with clause, in which case it is small. Declaration syntax colset name = intinf [with int-exp1..int-exp2]; Order usual ordering of integers Optional with clause Restricts the integer color set to an interval determined […]

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