This is an old revision of the document!


RTCP-nets modelling in CPN Tools

This chapter covers RTCP-nets modelling in CPN Tools environment. This approach to the modelling of RTCP-nets was originally introduced in master's thesis of Joanna Woźniak entitled “Modelowanie RTCP-sieci z wykorzystaniem środowiska CPN-Tools” in 2014. With her permission, excerpts of her work here will be used to explain the principles of RTCP-nets modelling in the CPN Tools application.


Introduction

CPN Tools is a popular application for editing, analysis and simulation of the coloured Petri nets - RTCP-nets edition is not supported. The presented approach consists in placing additional information in the model. The modified nets are considered to be incorrect by CPN Tools validation tool, but information about them is stored in an XML file. This file can be used as an input for cpn2rtcpn tool which can convert it to standard RTCP-net file format accepted by the RTCPNC compiler.


Declarations

Net model may include, among others, declarations of colour sets, variables and constants. They are located in the Declarations section of the program menu.

Constants

Constants are declared using the val keyword: val id = exp, where: id - the identifier exp - the expression of any type, determining the value assigned to the identifier.

Below are a few examples of constant declarations (operator '^' denotes concatenation):

val NUMBER1 = 1;
val WORD = "a" ^ "b" ^ "c";

Colour sets

Three types of colour sets are distinguished : simple, compound - using previously declared colour sets and timed (unused in the RTCP-networks). Simple types include, for example, types: Boolean, Integer, Real, Time, String, Enumerated and Index. The compound types include Product, Record, List, Union, Subset, and Alias. For type declarations colset keyword is used. Below are examples of colour sets declarations.

colset i = Integer;
colset ab = with a | b;
colset abc = product ab * ab;

Variables

Variables are basically identifiers which values can be changed during the firing of net transitions. Variables can be used in expressions assigned to model elements. Their scope is local to the transition. Variables are declared using the var keyword:

var ID_1, ID_2, …, id_n: cs_name;

where cs_name is the name of the declared type, for example:

var x1, x2: abc;


Expressions

Expressions are assigned to net elements such as places, transitions, arcs and guards. RTCP-net description uses many notations from the coloured Petri nets, though, due to some simplifications and changes in the structure of the RTCP-net, modifications of used notation were introduced.

Places