Illegal Tokens
Illegal tokens may be generated when transitions occur Errors and Bugs


During simulation or state space generation of a CP-net, tokens with illegal colours may be added to places. This can happen for places with the following kinds of colour sets: Tokens with illegal colours are added to places when an arc inscription on an output arc evaluates to a multi-set that contains a colour that is not an element of the colour set of the appropriate place.

When an illegal token is added to a place during a simulation, an error message indicates that a problem has occurred.

A guard can be used to ensure that illegal tokens are not added to places. For example, the colour set function legal can be used to check that the colours of the added tokens are legal.

Example

In the net below, an illegal token is added to place P when transition T occurs with the binding <i=5>. The colour set of place P consists of the integers in the interval [1, 5]. An error occurs when a token with illegal colour 6 is added to place P, since 6 is not an element of the colour set of the place.

Illegal token added to place

Here a guard is used to ensure that only tokens with legal colours will be added to place P.

Guarding against illegal tokens