Arc inscriptions
CPN ML


Related pages

Inscriptions

Arc Inscriptions

Arcs have only one inscription -- the arc inscription. An arc inscription is a CPN ML expression that evaluates to a multi-set or a single element.

Before an arc inscription has been added, the default text for an arc inscription is expr.

Default arc inscription

The colour set of the arc expression must match the colour set of the place attached to the arc. If the colour set of an arc expression does not match the colour set of the place attached to the arc, an error message will appear near the arc during syntax checking.

Examples of arc inscriptions

Free variables

Free variables are output arc variables that have not been bound on an input arc or in the guard. They are assigned random values when executing a CP-net. The type of free variables must be small colour sets.

In the example below, b is a free variable.

Free variable in arc inscription

If a free variable from a large colour set is found on an output arc, an error message will indicate the problem.

Free variable from large colour set

Arc delay

Output arc inscriptions may have an arc delay expression if the colour set of the attached place is one of the timed colour sets.

An output arc delay must be an expression have type integer, and it must be appended to an output arc inscription, using @+ as a separator. The syntax is:

exp @+ arc-delay

An omitted output arc delay is equivalent to a zero delay.

Arc delays can, in exactly the same way as transition delays, use, e.g., values, CPN variables, functions, and time(), and they may be dependent on token values.

Arc inscription time delay

Examples of output arc delay expressions can be found in the following example nets: Timed Resource Allocation.

Preempting time stamps

Input arc inscriptions may have a time value expression if the colour set of the corresponding input place is one of the timed colour sets.

A time expression on an input must be an integer, and it must be appended to an input arc inscription, using @+ as a separator. The syntax is:

exp @+ int

When an input arc inscription is of the form exp@+int, then the transition can consume a token a specified amount of time before the time specified by its time stamp.

As an example, the input arc expression exp@+5 will allow the transition to consume token(s) from a place up to 5 time units before the time stamp carried by the token(s). In the example below, transition t2 is enabled at time 3 (even though all tokens on the input place have time stamps equal to 8) due to the time expression on its input arc. The transition t1 will not be enabled until time 8.

Preempting time stamps

Note that the time expression on an input arc must be an integer. If it is not an integer, then an error may occur during simulation.

Conditional arc inscriptions

Conditional arc inscriptions may be used on input arcs, if all the variables are bound in the guard or in another input arc.

Conditional arc inscriptions on output arcs may bind output variables mentioned in the output clause of the code segment.

Examples of conditional arc inscriptions can be found in the following example nets: Resource Allocation, Ring Protocol.

Function application

Functions used in arc inscriptions must not have side effects.

Functions may be used on input arcs only if the function parameters are bound elsewhere at that transition.

Functions on output arc inscriptions may bind output variables.

Examples of functions on input arcs can be found in the following example nets: Distributed Database.

Side effects

Arc inscriptions are not allowed to have side effects and cannot: These restrictions are currently not checked by CPN Tools, and the system may malfunction if the restrictions are violated.