Arc inscriptions | CPN Tools help |
CPN ML |
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
.
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.
In the example below, b
is a free variable.
If a free variable from a large colour set is found on an output arc, an error message will indicate the problem.
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:
An omitted output arc delay is equivalent to a zero delay.exp @+ arc-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.
Examples of output arc delay expressions can be found in the following example nets: Timed Resource Allocation.
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:
When an input arc inscription is of the formexp @+ int
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.
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 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.
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.