Abstract Petri Net Notation

FalkoBause Peter Kemp er Pieter Kritzinger

Forschungsb ericht

der Universitat Dortmund

Lehrstuhl Informatik IV

Universitat Dortmund

D Dortmund

Germany

email fbausekemp erglsinformatikunidortmundde

Pieter Kritzinger is from

Data Network Architecture Lab oratory

Department of

UniversityofCapeTown

Private Bag RONDEBOSCH

South Africa pskcsuctacza

Abstract

The need to interchange the description of Petri Net mo dels amongst re

searchers and users was recognised as long ago as This do cument

prop oses an Abstract Petri Net Notation APNN in whichvarious nets

can b e describ ed using a common notation The use of the notation in the

context of Petri Net software to ols is shown and the general requirements

for such a notation to b e generally acceptable are suggested Keywords in

a

the notation are similar to L T Xcommands in order to supp ort readabil

E

ity By employing an appropriate stylele a net description can thus b e

a

included directly into a L T X source do cument The notation is given for

E

untimed PlaceTransition Nets and Coloured Petri Nets as well as Gener

alised Sto chastic Petri Nets and Hierarchical Petri Nets

So eine Arbeit wird eigentlich nie fertig

man muss sie fur fertig erklaren

wenn man nach Zeit und Umstanden

das Moglichste getan hat

JW Go ethe Italienische Reise

Intro duction

Petri Netshave b ecome widely accepted as a formalism for describing

concurrent systems and an active community of researchers exist in the eld

As the theory of Petri Nets develop ed so were software to ols develop ed to

assist the analysis of Petri Nets

It was thus recognised as long ago as by Berthelot et al that

it would b e an advantage if Petri Net researchers could share their mo del

descriptions in some common notation or interface and thereby exploit the

existing variety of to ols and user interfaces amongst themselves Suchan

interface would have the functionality illustrated in Fig where the P

i

indicate translations from one to the other of the functions illustrated in that gure

PRINTED GRAPHICAL HUMAN ABLE TEXT

REPRESENTATION READ

P

P

PETRI NET DESCRIPTION IN ABSTRACT NOTATION

INDIVIDUAL TOOL

P P

LOCAL INTERNAL

REPRESENTATION

P

P P P

N

GRAPHICAL INTERFACE

ANALYZER ANALYZER N

DISPLAY

RESULTS RESULTS

Figure The context of the APNN

The biggest advantage of such a common notation is the ability to share

analysis algorithms and the implementations of these In this way one can

compare the correctness and eciency of such algorithms and avoid their

rep eated implementation The authors have for instance b een able to use

the Markovchain analyser USENUMdevelop ed at one institution for

the analysis of Petri Net mo dels created with a Petri Net user interface

develop ed at the other

Once one accepts the idea of a common interface description various other

advantages other than sharing co de b ecome apparent One could translate

the description of a net directly into a printed graphical representation or

textual description for do cumentation

Requirements of the Notation

In general the net notation should satisfy the following criteria for it to b e

useful to a wide community

Exchangeable A net description should b e in such a format that it can

b e easily exchanged in electronic form via eg email or ftp b etween

dierent sites Exchangeability is the ma jor reason for having sucha

textual notation at all

Extensible More p owerful ie highlevel Petri Nets should have a nota

tion such that simpler net classes like ConditionEvent Nets app ear

as sp ecial cases of such a formalism in a natural way ie intuitive

and concise Missing information should default to appropriate val

ues A notation should extend from simple nets to highlevel nets

in a straightforward way and b e exible enough to allow for future

extensions

Mo dular and hierarchical These two requirements are strongly related

to each other The notation should b e suchthatPetri Net descriptions

in a le can b e reused as parts of the description of another larger

net or higher level Petri Net

Readable Although the graphical description of Petri Nets is one of its

ma jor advantages in terms of human readability it is a drawback for

interto ol communication Softw are to ols always have a textual de

scription for nets in order to store them in les Such a le format

is in most cases very concise but not human readable A useful no

tation should compromise b etween conciseness and human readability

at least in a way that it is easily transformed into a human readable

format Ideally this transformation should b e p erformed by public

domain software which is generally available

The general idea is then

other p ersons should b e able to read the description even with

out access to the corresp onding to ols or graphical user interfaces

GUIs

it should b e easy to include the description into printed do cu

ments

Portability of the graphical representation of the net derived directly from

an abstract description is another matter Graphical layout where and

whether arcs cross and so on is very much a matter of p ersonal preference

One could sp ecify the p osition of elements of the net with resp ect to some

predened origin in the notation as T X do es in fact This is not simple to

E

do without drawing the net in some form or other on a co ordinate system

Although not imp ossible to do the authors have decided to avoid the issue

for now

For the notation the authors decided to cho ose keywords in the textual

a

description of a net which are similar to L T Xcommands in order to supp ort

E

readabilityByemploying an appropriate stylele a net description can b e

a a

directly included into a L T Xdo cument Since L T X is publicdomain

E E

and widely accepted within the scientic communitywe decided to use

a

the descriptivepower of L T X as a formal language to dene a textual

E

description of Petri Nets

The remainder of this rep ort is structured as follows We distinguish b e

tween timed Petri Nets and untimed Petri Nets In the former category we

dene PlaceTransition Nets and give the grammar describing their abstract

notation in Sec This grammar is then extended to Coloured Petri Nets

in Sec

Where timed Petri Nets are concerned we start with Generalised Sto chastic

Petri Nets GSPN dened in Sec and Coloured Generalised Sto chastic

Petri Nets in Sec Hierarchies are considered in Sec In Sec we

dene Hierarc hical Queueing Petri Nets which are new in that they include

b oth places in the ordinary sense of Petri Nets and a new typ e of place called

queueing places

The abstract notation of everyclassofPetri Net is describ ed in Backus Naur

Form BNF throughout the remainder of this rep ort Common features of

the extended BNF such as rep etition are not used since it clashes with the

terminals used for the description of the notation itself Nonterminals are

written in upp ercase terminals in lowercase

UntimedPetri Nets

Petri Nets were inventedinby Carl Adam Petri and are a formalism

for the description of concurrency and synchronisation in systems Since rst

describ ed byPetri manyvariations of his original nets have b een dened

Since the simplest of such nets known as ConditionEvent Nets are easily

describ ed by PlaceTransition Nets with a place capacityofonewe shall

regard PlaceTransition Nets as the basic kind of net to b egin with In this

section we dene an APNN for PlaceTransition Nets and then we extend

this notation for Coloured Petri Nets

In this do cumentwehave used simple stylele macros but these can b e changed

andor extended easily to improve readabili ty

In general Petri Nets comprise the following comp onents

places usually drawn by circles whichtypically mo del conditions or ob

jects

tokens usually drawn by black dots which represent the sp ecic value of

the condition or ob ject

transitions usually drawn by rectangles These mo del activities which

change the values of conditions and ob jects

arcs sp ecifying the interconnection of places and transitions

Petri Nets are clearly bipartite graphs ie one may only connect a place to

a transition or vice versa but may not connect places to places or transitions

to transitions

PlaceTransition Nets

Denition A PlaceTransition Net is a PN P T I I M

where

P fp p g is a nite and nonempty set of places

n

T ft t g is a nite and nonempty set of transitions

m

P T

e the backward and forward incidence functions I I P T N ar

respectively

M P N is the initial marking

APN Notation for PlaceTransition Nets

In the notation which follows the authors have adhered to the requirements

describ ed in Sec Nevertheless such a notation is obviously not unique and

frequently a matter of p ersonal preference For instance in the notation ID

is a nonterminal which denotes a unique place transition or arc identier

Place and transition identiers are necessary to sp ecify arcs uniquely The

existence of a unique identier is useful in that it allows one no de description

to refer to another one byanentity likeID

The notation also allows for an additional description whichmaybeempty

and need not b e unique asso ciated with an entity name at eachnode

description to allow the mo del builder to include a name explanation or

comment ab out the function of the no de in the mo del

A net description using the notation will obviously b e more concise if cer

tain attributes are assumed to have generally accepted default values We

thus dene the default value for an arc weight to b e and for the initial

marking of a place A place has a capacity of innity unless explicitly stated

otherwise

In the notation we assume the usual pro duction rules for integers and strings

The keyword empty denotes the empty string

Terminal symb ols

beginnet endnet place transition like arc

name init from to capacity weight

NonTerminal symbols

NET ELEMENT PLACE TRANSITION ARC ID NAME INIT

WEIGHT CAP STRING INTEGER

Pro ductions

NET beginnetID ELEMENT endnet

ELEMENT empty

j PLACE ELEMENT

j TRANSITION ELEMENT

j ARC ELEMENT

ID STRING

PLACE placeID NAME INIT CAP

j placeID likeID

NAME empty j name STRING

INIT empty j init INTEGER

CAP empty j capacity INTEGER

TRANSITION transitionID NAME

ARC arcID fromID toID WEIGHT

WEIGHT empty j weight INTEGER

Startsymbol NET

We omit the explicit denition of nonterminal and terminal symb ols in the

remainder of the descriptions of the APNN since these are distinguished

anywayby upp er and lowercase letters resp ectively p1 p2 p3

2

t1t2 t3

2

p4 p5 p6

Figure Example PlaceTransition Net

Example Consider the PlaceTransition Net il lustratedinFigThe

fol lowing is the corresponding APNN description of that net

beginnetexamplenet

placepinit placep

placeplikep placep

placepinit placep

transitiont transitiont transitiont

arcafromp tot arcafromt top

arcafromp tot arcafromt top

arcafromt top arcafromp tot

arcafromp tot arcafromt top

arcafromp tot weight

arcafromt top weight

endnet

As previously explained the authors decided to cho ose keywords in the

a

textual description of a net which are similar to L T Xcommands In this

E

way the net denition in the previous example can b e translated by use of

a

appropriate L T Xmacros to the following description intended to b e read

E

rather than b e pro cessed bymachine

Example examplenet

Place p marking fg

Place p

Place p is defined as for p

Place p

Place p marking fg

Place p

Transitions t t t

Arc a from p to t

Arc a from t to p

Arc a from p to t

Arc a from t to p

Arc a from t to p

Arc a from p to t

Arc a from p to t

Arc a from t to p

Arc a from p to t weight

Arc a from t to p weight

Coloured Petri Nets

In Coloured Petri Nets as dened by K Jensen eachtoken has an

asso ciated data value or colour which b elongs to a sp ecied typ e of arbitrary

complexity A place can contain various colours which form a set the so

called colour set A colour function assigns a colour set to each place of the

net

entions Since it is widely in use we follow Jensen and use the conv

The typ e of a variable v is denoted byTyp ev

The typ e of an expression expr is denoted byTyp eexpr

Thesetofvariables in an expression expr is denoted byVarexpr

S denotes the set of all over S

MS

Denition A Coloured Petri Net is a tuple PTACGEI where

is a set of nonempty colour sets

P is a nite and nonempty set of places

T is a nite and nonempty set of transitions

A isanitesetofarcs such that

P T P A T A

C is a colour function P

G is the guard function from T into boolean expressions such that

ypeGt B and TypeVarGt t T T

E is the arc function from A into expressions such that

a A TypeE a C pa and TypeVarE a

MS

where pa denotes the placeconnectedbyarc a

I is the initialisation function denedfrom P into closedexpressions

such that

p P TypeI p C p

MS

Programming languages can b e employed for the precise denition of ex

pressions and colour sets In a derivative of Standard ML socalled

CPN ML is used In this rep ort we do not distinguish b etween these two

languages explicitly

APN Notation for Coloured Petri Nets

In order to avoid tedious rep etition only the dierences b etween the nota

tion for PlaceTransition Nets and that needed to sp ecify Coloured Petri

Nets are given next

We assume that the nonterminal MLEXPRESSION is an MLexpression

according to whichevaluates to the appropriate typ e ie either integer

b o olean or In fact since MLexpressions can contain names of

arbitrary complex userdened MLfunctions such MLfunctions can b e

sp ecied in a separate MLsp ecication le which can b e then referred to

in the net description by the APNN seeMLFILENAME statement The

same holds for ML denitions which are denoted by the nonterminal ML

DEFINITION

Pro ductions

ELEMENT empty

j PLACE ELEMENT

j TRANSITION ELEMENT

j ARC ELEMENT

j TYPEDEF ELEMENT

j seeMLFILENAME ELEMENT

FILENAME STRING

PLACE placeID NAME INIT CAP COLOUR

j placeID likeID

INIT empty j init MULTISET

CAP empty j capacity MULTISET

COLOUR empty j colour COLOURSET

COLOURSET likeID j MLDEFINITION

MULTISET INTEGER j INTEGERSTRING MSLIST

MSLIST empty j MULTISET

TRANSITION transitionID NAME GUARD

j transitionID likeID

GUARD empty j guardBOOLEXPR

BOOLEXPR likeID j MLEXPRESSION

ARC arcID fromID toID WEIGHT

WEIGHT empty j weight MULTISETEXPR

MULTISETEXPR likeID j MLEXPRESSION

TYPEDEF typedefID MLDEFINITION

It is p ossible to omit the guard in a transition sp ecication as dened by

the grammar In this case the guard expression defaults to true Since

PlaceTransition Nets are considered as a sp ecial case of CPNs we dene a

default colour set f g such that a multiset can b e a simple integer value n

which is equivalentton If the colour set consists of a single colour xa

missing arc weight defaults to x and an integer arc weight n is equivalent

to nx

funcx y z

t

x y

z

z

C E F C F

T

C T E

z

x y

z

t

funcx y z

Figure Example Coloured Petri Net

Example Consider the simple Coloured Petri Net il lustratedinFig

which models the wel lknown dining philosophers problem The example is

for philosophers so that

fp p gifp T or p E

C p

ff f g ifp F

The guard function funcxyz in that gure is denedtobe

funcx y z if z p x f y f

i i i

then TRUE

el se F ALS E

and i means i modulo

The following is the description of that net in the APN notation

beginnetColoured Petri Net

seeMLMLSpecification

placeTinitppppp colour with pjpjpjpjp

placeEcolour likeT

placeFinitfffff colour with fjfjfjfjf

transitiont guardfuncxyz

transitiont liket

arcafromT tot weightz

arcafromt toE weightz

arcafromE tot weightz

arcafromt toT weightz

arcafromt toF weightxy

arcafromF tot weightxy

endnet

a

The style macros for the corresp onding L T X description given b elow dier

E

somewhat from those used for PlaceTransition Nets

Coloured Petri Net

for ML function specification see MLSp ecication

fpppppg Place Tmarking

coloursetf with pjpjpjpjp g

Place E

coloursetf is defined as for T g

Place F marking ffffffg

coloursetf with fjfjfjfjf g

Transition t guardf funcxyz g

Transition t is defined as for t

Arc a from T to t weight z

Arc a from t to Eweight z

Arc a from E to t weight z

Arc a from t to Tweight z

Arc a from t to Fweight xy

Arc a from F to t weight xy

Further APN Notation for Coloured Petri Nets

The denition of CPNs as given by Jensen in employs ML expressions

for the description of multisets arc expressions and guards An earlier

denition of CPNs explicitly sp ecies all ring mo des of a transition

by a nite set of transition colours This representation known as the

functional representation has to b e used for the purp ose of analysis It

is also the approach used for Coloured GSPNs dened in and QPNs

b oth of whichuseaow oriented view of a system

When all ring mo des of a transition explicitly sp ecied the denition of

CPNs b ecomes

Denition A Coloured Petri Net CPN is a tuple

CP N PTCI I M where

is a set of nonempty colour sets

P is a nite and nonempty set of places

T is a nite and nonempty set of transitions with P T

C is a colour function P T

I and I are the backward and forward incidence functions dened

on P T such that

I p tI p t C t C p p t P T

MS

M is a function denedon P describing the initial marking such that

M p C p p P

MS

This representation can b e describ ed in the APNN for CPNs of Sec

by mo difying the following pro ductions

COLOURSET likeID

j with STRING COLOURREST

COLOURREST empty

j j STRING COLOURREST

GUARD empty j guard GUARDEXPR

GUARDEXPR likeID

j MODEVAR MODECONST GUARDREST

GUARDREST empty

j orelse MODEVAR MODECONST GUARDREST

MODEVAR STRING

MODECONST STRING

MULTISETEXPR likeID

j MULTISET

j case MODEVAR of MODECONST

MULTISET MSEXPRREST

j if MODEVAR MODECONST

then MULTISET MSEXPRELSE

MSEXPRREST empty

j j MODECONST MULTISET MSEXPRREST

MSEXPRELSE empty

j else MULTISET

j else MULTISETEXPR

MULTISET INTEGER

j INTEGERSTRING MSLIST

MSLIST empty j INTEGERSTRING MSLIST

Note that a guard expression lists all p ossible ring mo des by a disjunction

over all p ossible bindings of a mo de variable eg a transition with ring

mo des black and blue would have a guard guardmodeblack orelse mode

blue

Obviously this is not a straightforward solution in terms of a functional

representation but it integrates b oth kinds of CPNs into a single notational

framework

Sto chastic Petri Nets

In this section we consider Petri Nets to which time has b een added There

are a lot of concepts for intro ducing time eg deterministic and sto chastic

times timing information attached to places or transitions etc see eg

Here we consider timeaugmented nets to show the extensibilityof

the APNN The most wellknown of such nets are Generalised Sto chastic

Petri Nets GSPNs

Generalised Sto chastic Petri Nets

As the name indicates Generalised Sto chastic Petri Nets GSPNs are timed

nets An exp onentially distributed ring time is asso ciated with timed tran

ta sitions Such nets also contain immediate transitions which re instan

neously and with priorityover timed transitions Furthermore the deni

tion of a GSPN p ermits inhibitor arcs and dierent levels of priority for

immediate transitions

Denition A GSPN cf is a tuple GS P N PNPrHW

where

PN P T I I M is the underlying PlaceTransition Net

H P T is a set of inhibitor arcs

Pr is an assignment of priorities to transitions with priority for

timedtransitions and higher priorities for immediate transitions

and

W w w is an array whose entry w R

m i

is a rate of a negative exponential distribution specifying the ring

delay when transition t is a timedtransition or

i

is a weight specifying the relative ring frequency when transition

t is an immediate transition

i

APN Notation for GSPNs

The default value for arc weights and ring rates or frequencies is Unless

otherwise sp ecied a transition is considered to b e timed Note that if

all priorities equal zero then the denition of a GSPN coincides with the

denition of a Sto chastic Petri Net SPN

The grammar for GSPNs extends the grammar of PlaceTransition Nets

by the concepts of priorityweights and inhibitor arcs This leads to the

following mo dications

TRANSITION transitionID NAME PRIO TWEIGHT

j transitionID likeID

PRIO empty j prio INTEGER

TWEIGHT empty j weight REAL

ARC arcID fromID toID WEIGHT ATYPE

ATYPE empty j typeordinary j typeinhibitor

A missing typ e sp ecication of an arc defaults to an ordinary arc We assume

the usual pro duction rules for the derivation of real constants from REAL

Note that marking dep endent ring rates are not considered for now p1 p2 p3

2

t1t2 t3

2

p4 p5 p6

Figure Example GSPN

Example Consider the simple GSPN il lustrated in Fig The fol lowing

is the denition of that net using the APN notation

beginnetgspnexample

placepinit placep

placeplikep placep

placepinit placep

transitiontprio weight

transitiontprio weight

transitiont

arcafromp tot arcafromt top

arcafromp tot arcafromt top

arcafromt top arcafromp tot

arcafromp tot arcafromt top

arcafromp tot weight

arcafromt top weight

endnet

a

The L T X Output is

E

gspnexample

Place p marking fg

Place p

Place p is defined as for p

Place p

Place p marking fg

Place p

Transition t priority weight

Transition t priority weight

Transition t

Arc a from p to t

Arc a from t to p

Arc a from p to t

Arc a from t to p

Arc a from t to p

Arc a from p to t

Arc a from p to t

Arc a from t to p

Arc a from p to t weight

Arc a from t to p weight

Coloured Generalised Sto chastic Petri Nets

In the case of Generalised Sto chastic Petri Nets tokens do not have colours

In order to merge the two concepts of coloured tokens and timed nets tokens

have colours and an execution rate is now asso ciated with every ring mode

of a transition We call the resultant net a Coloured Generalised Sto chastic

Petri Net CGSPN

Such nets are however not yet considered to b e hierarchical Hierarc hical

nets are describ ed in Sec

Denition Using the same convention as that in Sec we dene a

CGSPN as a tuple CGSPN PTACPrHGWEI where

is a set of nonempty colour sets

P is a nite and nonempty set of places

T is a nite and nonempty set of transitions

A isanitesetofarcs such that

P T P A T A

C is a colour function P

Pr is an assignment of priorities to transitions with priority for

timedtransitions and higher priorities for immediate transitions

H P T is a set of inhibitor arcs

G is the guard function from T into expressions such that

ypeVarGt t T TypeGt B and T



The semantics of inhibitor arcs in CGSPNs follows that of

W is the weight function from the transitions T into expressions such

that t T

TypeW t R and TypeVarW t which species the

ring delay when transition t is a timedtransition and the relative

ring frequency when transition t is an immediate transition

E is the arc function from A into expressions such that

a A TypeE a C pa and TypeVarE a

MS

wherewe pa denotes the placeconnectedbyarc a

I is the initialisation function denedfrom P into closedexpressions

such that

p P TypeI p C p

MS

APN Notation for CGSPNs

The notation clearly has to provide the sp ecication of colour sets for places

and typ es of colour sets Furthermore transitions can re according to dier

ent ring mo des which results in generalising arc weights to expressions that

evaluate to multisets and a guard expression whichevaluates to a b o olean

value Therefore transition descriptions are extended by guards arc weights

are generalised to contain expressions whichevaluate to a multiset over the

colour set attached to the input place Place descriptions haveacolourset

description and its attributes for initialisation and capacity are generalised

to expressions of the appropriate typ e

In the following the complete set of pro ductions for CGSPNs is given

NET beginnetID ELEMENT endnet

ELEMENT empty

j PLACE ELEMENT

j TRANSITION ELEMENT

j ARC ELEMENT

j TYPEDEF ELEMENT

j seeML FILENAME ELEMENT

FILENAME STRING

ID STRING

PLACE placeID NAME INIT CAP COLOUR

j placeID likeID

name STRING NAME empty j

INIT empty j init MULTISET

CAP empty j capacity MULTISET

COLOUR empty j colour COLOURSET

COLOURSET likeID j MLDEFINITION

TRANSITION transitionID NAME PRIO TWEIGHT GUARD

j transitionID likeID

PRIO empty j prio INTEXPR

TWEIGHT empty j weight REALEXPR

GUARD empty j guard BOOLEXPR

ARC arcID fromID toID WEIGHT ATYPE

WEIGHT empty j weight MULTISETEXPR

ATYPE empty j typeordinary j typeinhibitor

MULTISET INTEGERSTRING MSLIST

MSLIST empty j MULTISET

INTEXPR likeID j MLEXPRESSION

REALEXPR likeID j MLEXPRESSION

MULTISETEXPR likeID j MLEXPRESSION

BOOLEXPR likeID j MLEXPRESSION

TYPEDEF typedefID MLDEFINITION

Denitions of integer b o olean real and multiset expressions follow the ML

syntax Arcs default to those of typ e ordinary

Example Consider the familiar ProducerConsumer problem modiedto

represent a gizmo assembly process The associated CGSPN is il lustratedin

Fig Gizmos areonlyassembledasneededandrequirethreewheels a

body and a door It takes dierent exponential ly distributed times to build

els body and door respectively and assembling a gizmo takes an the whe

exponential time with a dierent mean rate

In other words transition CONSUME transition CO is enabledwhenthree

of the tokens with colour WHEEL and one token eachofcolour BODY

and DOOR areonplace B A token of colour GIZMO on place C indi

cates that a gizmo needs to be assembled if possible Parts areonlyproduced

as they areconsumed

The various functions are dened as fol lows

fWHEEL BODY DOORg if p fB P g

C p

fGIZMOg if p fC C P g

if t fI I g

Prt

otherwise

H

x WHEEL y BODY z DOOR g GIZMO if t fI COg

Gt

TRUE otherwise



case x of WHEEL











j BODY



W t j DOOR if t PR







if t CO







otherwise





x if a fP PR PRBg



x y z if a fB C O I P g E a





g if a fCO P P I CO C C I I C C COg

fGIZMOg if p fC P g

I p

otherwise

P

x

C

PR xyz

PRODUCE

I

x

B

g

g

g

xyz

CO

I

g

P CONSUME

g

g

C

Figure Coloured GSPN of a gizmo assembly pro cess

beginnetcgspnexample

placeP colourwith WHEELjBODYjDOOR

placeP initGIZMO colourwith GIZMO

placeB likeP

placeC initGIZMO colourwith GIZMO

placeC colourwith GIZMO

transitionI prio

guardxWHEEL and yBODY and zDOOR and gGIZMO

transitionI prio

transitionPR namePRODUCE prio

weight case x of WHEEL j BODY j DOOR

transitionCO nameCONSUME prio

guard likeI weight

arc fromP toPR weightx

arc fromPR toB weightx

arc fromB toCO weightxyz

arc fromCO toP weightg

arc fromP toI weightg

arc fromI toP weightxyz

arc fromC toCO weightg

arc fromCO toC weightg

arc fromC toI weightg

arc fromI toC weightg

endnet

Hierarchies

Petri Nets tend to b ecome very large if used for mo deling real world prob

lems One wayofavoiding the diculty of representing such nets graphically

is to dene one or more subnets and to p ossibly build a hierarchyofsub

nets In this way large nets can b e represented in a structured way which

moreover allows one to use a topdown design for complex mo dels as well

as the reuse of net descriptions or identical submo dels

Hub er et al describ e ve concepts of hierarchical CPNs substitution

transitions substitution places invo cation transitions fusion sets for places

and fusion sets for transitions They dene the semantics of these hierarchy

concepts by giving a translation into an equivalent nonhierarchical CPN

In the following we demonstrate how these concepts can b e expressed in

an extended APNN but give only a very brief informal description of the

semantics of these hierarchical concepts for details the reader is referred to

Substitution transitions

We use the notation in and consider a hierarchical CPN as a set of

related pages If a page has a rened no de n this page is called sup erpage

in relation to the subpage whichgives the renement of n In this section

we consider the renement of transitions by substitution Substitution of

transitions is very much like macroexpansion in programming languages

Figure gives an example with a page N containing a substitution transition

n and the subpage N which corresp onds to n No des in the preset or p ostset

of n are called so cket no des Their counterparts inside the subpage are called

p ort no des and a binding function b must b e given which assigns a p ort

no de to eachsocket no de Note that this function need not b e injectiveor



surjective eg bp bp and p is not b ound to anysocket no de of n

p1 Superpage N

p2 np3

b b b

Substitution transition

Subpage N’

p1’ t1 p3’

p2’ t2 p4’

Figure Trivial example of substitution transition

An APNN description has to provide the following information

for the substitution transition

the ID of the subpage given by substituteID

the binding function b sp ecied in the arc description which

connects the transition with its input and output places

The binding b of an input place is given within an arc descrip

tion by a sequence of bindSOCKETIDwithTRANSITIONID

contPORTID arc attributes

contPORTID means that a no de with identity PORTID is an

element of the subpage contained in the no de of the preceding

attribute namely the no de with TRANSITIONID

For an output place the corresp onding arc attributes are

bindTRANSITIONIDcontPORTIDwithSOCKETID

for no des of a subpage

an attribute which denotes input and output p orts ie portin

portout and portio

Since the preset and p ostset of a substitution transition dene the set of

so cket no des a sp ecial notation to distinguish so cket no des is not necessary

The new elements of an APNN description for the example pages N and N

are

beginnetN

transitionn substituteN

arcpnfromp ton bindp withn contp

arcpnfromp ton bindp withn contp

arcnpfromn top bindn contp withp

endnet

beginnetN

placepportin placepportin

placepportout placepportout

endnet

The reason for distributing the binding information over arcs connecting

the preset transition and p ostset is that the existence of such a binding

dep ends on the existence of suchanarcFurthermore in case of rening

adjacent no des the binding information dep ends on b oth renements and

is not exclusive to one of its no des

Substitution places

Substitution places are analogous to substitution transitions apart from a

dierent semantics ie the translation into a nonhierarchical net is dierent

from the translation of substitution transitions Nevertheless the APNN

description can b e handled analogously a substitution place sp ecication

contains the subpage ID by substituteID and the binding function is

distributed over the arc description just as for substitution transitions Port

no des of the subpage have an additional attribute portin portout

or portio

Invo cation transitions

Invo cation transitions are like function calls in fact they even allow recur

sive reuse of subpages The binding of so cket and p ort no des is equivalent

to substitution transitions Wechange substituteID to invokeID

to distinguish invo cation transitions from substitution transitions in the

APNN Since subpages of invo cation transitions allow for explicit exit

statements to denote termination conditions of an invo cation place and

transition sp ecications can b e extended byanexit attribute in the APN

notation

Fusion sets for places and fusion sets for transitions

The main idea ab out fusion is to fold a set of no des into a single no de

Consequently a fusion set contains an arbitrary numb er of places or an

arbitrary numb er of transitions

Hub er et al distinguish three typ es of fusion sets

Page fusion set This is just a drawing convenience in graphical user

interfaces in case of a single page instance Incaseofseveral page

instances a page fusion set folds all memb ers from all page instances

into a single no de

Instance fusion set This means that all memb ers p er instance of a page

are folded into a single instancesp ecic no de

Global fusion set This allows fusion set memb ers from all pages and all

page instances to b e merged into a single no de

Fusion sets are integrated into the APNN by extending a net description

with fuseIDTYPEIDLIST where ID provides a unique identier for

a fusion set TYPE is a string constant page inst or global IDLIST is a

jseparated list of unique no de identier This is not critical in case of page

or instance fusion sets but multiple reuse of a page can lead to diculties

in global fusion sets In order to handle this we assume an appropriate

naming convention as mentioned in eg for DesignCPN to obtain

unique identier

The information contained in a fusion set denition is aggregated into a

new net element in APNN instead of distributing the information over its

memb ers One reason for this is to avoid rep etitive sp ecication of typ e and

ID But mainly b ecause conceptually a new no de is created by a fusion set

ie the fusion of eg transitions results into a new transition whose guard

is a conjunction of all guards of the fusion set members



Using indep endent copies of subpages lead to the notion of instances of a page a x y

Substitution place Substitution transition y1 px x1 py

x2 y2 Substitution transition Substitution place Port refinement Port refinement ppx1 py1 px1 ppy1

px2 ppy2

ppx2 py2

Figure Pathological example for rened adjacent no des with p ort rene

ment

Renement of adjacentnodes

The hierarchical concepts regarded so far reveal certain diculties to handle

the renement of adjacent no des a case which is esp ecially considered in

We try to demonstrate the diculties by means of an articial example as

shown in Fig whicheven contains renement of p ort no des

In Chapter R Fehling suggests to sp ecify a binding b etween

rened p orts eg b etween ppx and ppy Here for consistencywe suggest

instead an explicit binding b etween so cket no des eg x and x and rened

p ort no des eg ppy and ppy The binding information is describ ed with

arc axy in APNN by the following statement

arca fromx toy

bindx contpx contppx withy conty

bindx contpx contppx withy conty

bindx contx withy contpy contppy

bindx contx withy contpy contppy

In p ort renements do not contain p ort no des to match their environ

ment We decided to supp ort this as well in order to avoid arcs b etween

separate page descriptions and to keep the descriptions homogeneous In

our example arcs xpx and xpx carry the binding for the p ort rene

mentofpx

arcxpxfromx topx

bindx withpx contpx

arcxpxfromx topx

bindx withpx contpx

Note that all implicit bindings like the binding b etween px and y can b e

extracted from the given binding sp ecication by shortening the sequences

of contstatements eg bindx contpx withy Implicit bindings

and implicit arcs are regarded in detail in

All these concepts of a hierarchyarenow used for the notation of Hierarchical

CGSPNs which serve as an example The grammar of CGSPNs is extended

by the following to accommo date Hierarchical CGSPNs

APN Notation for Hierarchical CGSPNs

Mo died Pro ductions

NET empty

j inputnetID NET

j beginnetID ELEMENT endnet NET

j beginnetID likeID endnet NET

ELEMENT empty

j PLACE ELEMENT

j TRANSITION ELEMENT

j ARC ELEMENT

j TYPEDEF ELEMENT

j seeML FILENAME ELEMENT

j FUSION ELEMENT

FUSION fuseIDTYPEID IDLIST

TYPE page j inst j global

IDLIST empty j j ID IDLIST

PLACE placeID NAME INIT CAP COLOUR PTYPE PORT EXIT

j placeID likeID

PTYPE empty j substituteID

j portio PORT empty j portin j portout

EXIT empty j exit

TRANSITION transitionID NAME TTYPE PRIO TWEIGHT GUARD

PORT EXIT

j transitionID likeID

TTYPE empty j substituteID j invokeID

ARC arcID fromID toID WEIGHT ATYPE BIND

BIND empty j bindID CONT withID CONT

CONT empty j contID CONT

Hierarchical Queueing Petri Nets

Hierarchical Queueing Petri Nets HQPNs are a sp ecial kind of hierarchi

cal Petri Nets with certain extensions to integrate queueing networks The

main motivation is to combine hierarchical description techniques with cor

resp onding hierarchical solution techniques We describ e the APNN for

this mo deling formalism for several reasons

to demonstrate the extensibility of the APNN to further Petri net

formalisms

currently workisunderway to supp ort HQPNs by an adequate soft

ware to ol which supp orts the APNN

In Bause et alintro duced the concept of a queued place into

net theory for the purp ose of p erformance analysis see Fig A queued

place combines the notion of a queue where tokens are queued and served

according to a certain scheduling strategy with a dep ository which is iden

tical to an ordinary place Input transitions of a queued place re tokens

into the queue where they are not available to the output transitions until

service completion On service completion the tokens are put into the de

p ository whence they are available to output transitions in the conventional

way They called the new typ e of net a Queueing Petri Net QPN

QPNs additionally allow the renement of places leading to Hierarc hical

QPNs see Fig

dep ository

queue

Figure Example queued place of a HQPN and its shorthand notation

Figure Example subnet place of a HQPN and its shorthand notation

Denition HQPN A Hierarchically Queueing Petri Net HQPN is a

triple HQPN CGSPN QS RF where

CGSPN PTACPrHGWEI as denedbefore is the

underlying coloured GSPN

QS is a function denedonP P giving an assignment of a queue

Q

ing specication to a queuedplace p P

Q

RF is a function denedon P P n P giving the renement of a

R Q

place p P as a HQPN

R

Hence HQPNs are CGSPNs where some places are queued places and some

places are substitution places Note that by denition no des cannot b e b oth

a substitution place and a queued place Fusion sets are supp orted with the

constraint that only substitution places can b e fused and that all substitution

places of a fusion set share the same subpage The page hierarchy which

results from a HQPN forms a directed acyclic graph

The description of the underlying CPN is based on the APNN of the func

tional representation as given in Sec such that all ring mo des are

explicitly describ ed and hence no external MLdenitions are necessary

APN Notation for HQPNs

Pro ductions

NET empty

j inputnetID NET

j beginnetID ELEMENT endnet NET

likeID endnet NET j beginnetID

ELEMENT empty

j PLACE ELEMENT

j TRANSITION ELEMENT

j ARC ELEMENT

j TYPEDEF ELEMENT

j FUSION ELEMENT

ID STRING

TYPEDEF typedefID COLOURSET

FUSION fuseIDTYPEID IDLIST

TYPE page j inst j global

IDLIST empty j j ID IDLIST

PLACE placeID NAME INIT CAP COLOUR PTYPE

j placeID likeID

NAME empty j name STRING

INIT empty j init MULTISET

CAP empty j capacity MULTISET

COLOUR empty j colour COLOURSET

PTYPE empty

j substituteID

j queueimmediate SCHED weight TUPLEEXPR

j queuetimed SCHED weight TUPLEEXPR

SCHED empty

j schedSTRING SCHED

j noserver INTEGER SCHED

j rank INTEXPR SCHED

j prio INTEXPR SCHED

TRANSITION transitionID NAME PRIO TWEIGHT GUARD PORT

j transitionID likeID

PRIO empty j prio INTEXPR

TWEIGHT empty j weight REALEXPR

GUARD empty j guard GUARDEXPR

PORT empty j portin j portout j portio

ARC arcID fromID toID WEIGHT ATYPE BIND

WEIGHT empty j weight MULTISETEXPR

j typeinhibitor ATYPE empty j typeordinary

BIND empty j bindID CONT withID CONT

CONT empty j contID CONT

var TUPLEEXPR denotes an MLexpression whichevaluates to a tuple meancoe

of real values where mean is the mean and coe var the co ecientofvari

ation for the service time of a customer in the queue The rank expression

allows the sp ecication of priorities for dierent colours of tokens to deter

mine the state of the queue in case of bulk arrivals

subnetblue

queuedplace t1 t2

subnetblack

Figure Example net with a queued place and two rened places

port node p1 p2 p3 in

2

t5 t4 t3

port node 2 out

p4 p5 p6

Figure Subpage for substitution places

Fig is an example intended merely to demonstrate the APNN for HQPNs

The queued place has a FCFS scheduling strategy and its colour set contains

only two colours black and blueTransitions t and t eachhavetwo ring

mo des reblack and reblue The transitions merely transp ort a token to

or from the queued place to subnetblack or to subnetblue The renement

of the places subnetblack and subnetblue are instances of the singlecoloured

GSPN given in Fig with input p ort in and output p ort out

Sp ecication of the example

inputnetsubpagespecification

beginnethqpnexample

placequeuedplaceinitblack blue colour with black j blue

queuetimed schedFCFS noserver

rankcase colour of black j blue

weightcase colour of black j blue

placesubnetblacksubstitutesubpagespecification

placesubnetbluesubstitutesubpagespecification

transitiontprio

weightcase mode of fireblack j fireblue

guardmode fireblack orelse mode fireblue

transitiontliket

arcafromt toqueuedplace

weightcase mode of fireblack black j fireblue blue

arcbfromqueuedplace tot weightlikea

arccfromt tosubnetblue

weightif mode fireblue else empty

bindt withsubnetblue contin

arcdfromt tosubnetblack

weightif mode fireblack else empty

bindt withsubnetblack contin

arcefromsubnetblue tot

weightif mode fireblue else empty

bindsubnetblue contout witht

arcffromsubnetblack tot

weightif mode fireblack else empty

bindsubnetblack contout witht

endnet

In this case the keyword empty in the weight expressions of arcs denotes

the emptymultiset Note that substituteID creates a fresh instance

from the net with this ID If two substitution places shall share the same

instance they must b e memb ers of the same fusion set

a

The L T X output of the example is

E

Net description imported from subpagesp ecication

hqpnexample

Place queuedplace

marking fblack blueg

coloursetf with black j blue g

timed queueing place with FCFS scheduling servers

order of arrival in case of bulk arrivals

j blue case colour of black

weight case colour of black j blue

Place subnetblack is an instance of subpagesp ecication

Place subnetblue is an instance of subpagesp ecication

Transition t priority

weight case mo de of reblack j reblue

guardfmo de black orelse mo de blueg

Transition t is defined as for t

Arc a from t to queuedplace

weight case mo de of reblack black j reblue blue

Arc b from queuedplace to t

weight is defined as for a

Arc c from t to subnetblue

weight if mo de reblue else empty

binding t with subnetblue wherein it binds in

Arc d from t to subnetblack

weight if mo de reblack else empty

binding t with subnetblack whereinitbindsin

Arc e from subnetblue to t

weight if mo de reblue else empty

binding subnetblue wherein it binds out with t

Arc f from subnetblack to t

weight if mo de reblack else empty

out with t binding subnetblack wherein it binds

Summary

The rst attempt at dening a universal notation for describing Petri Net

mo dels was made in The authors could nd no other or any subse

quent reference to the sub ject when the need arose for suchaninterface in

the collab oration b etween their resp ective research groups In their partic

ular case they wanted to exchange mo del descriptions for analysis by the

QPNanalyser develop ed and b eing develop ed by one group with the

DNAnet develop ed by the other

The notation describ ed in this rep ort prop oses an uniform extensible for

malism which should accommo date a large class of nets For Coloured Petri

Nets the APNN employs ML so far The APNN can easily b e mo died to

supp ort other programming languages The notation moreover allows for

ahuman readable mo del description which can b e derived directly using

a

L T X commands known to a wide audience allowing a single format for the

E

incorp oration of the net description

At the same time the APNN allows dierent researchers to discuss and ex

p eriment with variations of mo dels of actual systems using p ossibly dierent

analysis algorithms implemented in to ols which for dierent reasons they

do not share

Comments ab out the APNN are clearly most welcome and should b e ad

dressed to anyone of the authors We trust that while almost certainly

not acceptable in its entirety at present it will b e the start of a discussion

leading to a generally accepted abstract formalism for describing highlevel

Petri Nets

References

M AjmoneMarsan G Balb o and G Conte A class of Generalised

Sto chastic Petri Nets for the p erformance evaluation of multipro cessor

systems ACM Transactions on Computer Systems

M AjmoneMarsan G Balb o and G Conte PerformanceModels of

Multiprocessor Systems MIT Press Series in Computer Science

F Bause Queueing Petri Nets a formalism for the combined quali

tative and quantitative analysis of systems In th International Work

shop on Petri Nets and PerformanceModels Toulouse France pages

F Bause and H Beilner Eine Mo dellwelt zur Integration

von Warteschlangen und PetriNetzMo dellen In Proceedings of

the th GIITGFachtagung Messung Model lierung und Bewer

tung von Rechensystemen und Netzen pages Braunschweig

Gesellschaft fur Informatik GI Germany

F Bause PBuchholz and P Kemp er Hierarchically combined Queue

ing Petri Nets In th International ConferenceonAnalysis and

Optimizations of Systems Discrete Event Systems SophiaAntipolis

France June

F Bause and P Kemp er QPNto ol for qualitative and quantitative

analysis of queueing Petri Nets In th International Conferenceon

Model ling Techniques and Tools for Computer Performance Evaluation

Vienna Austria pages

G Chiola G Bruno and T Demaria Intro ducing a color formalism

into Generalized Sto chastic Petri Nets In Proceedings of the th In

ternational Workshop on Application and Theory of Petri Nets Venice

Italy pages

A Attieh et al Functional and temp oral analysis of concurrent systems

Technical rep ort UniversityofCapeTown

G Berthelot et al A syntax for the description of Petri Nets Petri

Net Newsletter pages April

R Fehling Hierarchische Petrinetze PhD thesis Universitat Dort

mund Verlag Dr Kovac

R Fehling A concept of hierarchical Petri Nets with building blo cks

In G Rozenb erg editor Advances in Petri Nets LNCS pages

Springer Berlin

F Feldbrugge Petri net to ols Lecture Notes in Computer Science No

pages

P Hub er K Jensen and RM Shapiro Hierarchies in Coloured Petri

Nets In G Rozenb erg editor Advances in Petri Nets LNCS

pages Springer Berlin

K Jensen Coloured Petri Nets and the invariant metho d Mathematical

Foundations on Computer Science Lecture Notes in Computer Science

K Jensen Coloured Petri Nets Basic Concepts Analysis Methods and

Practical UseEATCS Monographs on Theoretical Computer Science

Vol I

U Krieger B MullerClostermann and M Sczittnick Mo delling and

analysis of communication systems based on computational metho ds for

markovchains IEEE Transactions on Communications Special Issue

on Model ling and Analysis of Telecommunication Systems

T Murata Petri Nets Prop erties analysis and applications Proceed

ings of IEEE April

A Pagnoni Sto chastic nets and p erformance evaluation In Petri Nets

Central Models and Their Properties Advances in Petri Nets pages

Lecture Notes in Computer Science No

C A Petri Kommunikation mit Automaten PhD thesis Universitat

Bonn

A Wikstrom using Standar dML Prentice

Hall International

A Complete APNN grammar

In the following we present the pro ductions of a complete APNN for CGSPNs

including hierarchical description and queued places As throughout the

rep ort terminal symb ols are given bylowercase letters nonterminals by

upp ercase letters For conciseness we use the APNN for CPNs with gen

eral MLexpressions as given in Sec Note that one can easily mo dify

the APNN to supp ort other programming languages empty denotes the

empty string

With this APNN a wide range of Petri Nets is covered Possible extensions

of the notation can b e incorp orated as demonstrated in this rep ort

NET empty

j inputnetID NET

j beginnetID ELEMENT endnet NET

j beginnetID likeID endnet NET

ELEMENT empty

j PLACE ELEMENT

j TRANSITION ELEMENT

j ARC ELEMENT

j TYPEDEF ELEMENT

j seeML FILENAME ELEMENT

j FUSION ELEMENT

ID STRING

FILENAME STRING

TYPEDEF typedefID COLOURSET

FUSION fuseIDTYPEID IDLIST

TYPE page j inst j global

IDLIST empty j j ID IDLIST

PLACE placeID NAME INIT CAP COLOUR PTYPE PORT EXIT

j placeID likeID

NAME empty j name STRING

INIT empty j init MULTISETEXPR

CAP empty j capacity MULTISETEXPR

COLOUR empty j colour COLOURSET

PTYPE empty

j substituteID

j queueimmediate SCHED weight TUPLEEXPR

j queuetimed SCHED weight TUPLEEXPR

SCHED empty

j schedSTRING SCHED

j noserver INTEGER SCHED

j rank INTEXPR SCHED

j prio INTEXPR SCHED

PORT empty j portin j portout j portio

EXIT empty j exit

TRANSITION transitionID NAME TTYPE PRIO TWEIGHT GUARD

PORT EXIT

j transitionID likeID

empty j substituteID j invokeID TTYPE

PRIO empty j prio INTEXPR

TWEIGHT empty j weight REALEXPR

GUARD empty j guard BOOLEXPR

ARC arcID fromID toID WEIGHT ATYPE BIND

WEIGHT empty j weight MULTISETEXPR

ATYPE empty j typeordinary j typeinhibitor

BIND empty j bindID CONT withID CONT

CONT empty j contID CONT

INTEXPR likeID j MLEXPRESSION

REALEXPR likeID j MLEXPRESSION

BOOLEXPR likeID j MLEXPRESSION

TUPLEEXPR likeID j MLEXPRESSION

MULTISETEXPR likeID j MLEXPRESSION

COLOURSET likeID j MLDEFINITION

TYPEDEF typedefID MLDEFINITION

Startsymbol NET