• Ingen resultater fundet

View of The Symmetry Method for Coloured Petri Nets

N/A
N/A
Info
Hent
Protected

Academic year: 2022

Del "View of The Symmetry Method for Coloured Petri Nets"

Copied!
170
0
0

Indlæser.... (se fuldtekst nu)

Hele teksten

(1)

Petri Nets

- Theory, Tools and Practical Use

Louise Elgaard

PhD Dissertation

Department ofComputer Science

Universityof Aarhus

Denmark

(2)
(3)

- Theory, Tools and Practical Use

A Dissertation

Presented to theFacultyof Science

ofthe Universityof Aarhus

inPartialFullmentof theRequirementsforthe

PhDDegree

by

LouiseElgaard

July31,2002

(4)
(5)

Short Summary in Danish

I dag indgar computer systemer imange kritiske sammenhnge, f.eks. hospi-

talsudstyr,maleinstrumenter,yogbilmotorer,hvordetervigtigtatcomputer

systemet virkersom forventet. Indenfor datalogiener deritidens lbudviklet

ere metoder til at undersge omcomputer systemer virker som de skal, men

ikke allemetoder erligeanvendelige ipraksis. Ph.d. afhandlingen\The Sym-

metry Method for Coloured Petri Nets { Theory, Tools, and Practical Use"

beskftiger sig med en sadan metode. Arbejdet tilstberat udvikle teori og

vrktjer, der gr at metoden bliver mere anvendelig ipraksis. Ph.d. afhan-

dlingen omfatter derfor to industrielle projekter hvor de udviklede teorier og

vrktjereranvendtog evalueret iindustriellesammenhnge.

Summary

A way to increase reliability of systems is to use formal methods, which are

mathematicallybasedmethodsforspecifyingandreasoningaboutsystems. An

example of a formal method for reasoning about systems is the state space

method. The fullstate space of a system is a directed graph with a node for

each reachable state of the system and an arc for each state change. From

thefullstate space it ispossibleto verify whether thesystem satisesa set of

desiredproperties.

Several reduction techniques have been suggested for reducing the state

space. With these reduction techniques only a subset of the full state space

is represented or the full state space is represented in a compact form. An

example of such a reduction technique is the symmetry method. The basic

observation is that many distributed and concurrent systems posses a certain

degree of symmetry, e.g., a system composed of identical components whose

identities are interchangeable from a verication point of view. This kind of

structuralsymmetryinthesystemisalso reectedinthefullstatespaceof the

system. The ideabehindthesymmetry methodis tofactor outthissymmetry

and obtain a condensed state space which is typically much smaller than the

fullstate space,butfrom which thesame kindof properties of thesystem can

be derived withoutunfoldingthecondensedstate space to thefullstate space.

Statespacesandthesymmetrymethodarenotrestrictedtoaspecicmod-

ellinglanguage. However, in the work presented in this thesis the symmetry

(6)

witchsummarises thework which have beendone. PartIIis composedof four

individualpapers. Threeofthepapershavebeenpublishedasconferencepapers

in international conferences. One paper has been published as a workshop

paper.

The overview paper introduces the symmetry method in the context of

Coloured Petri Nets and summarises the four papers. An important part of

theoverview paperis a comparisonof thework donewithother research work

withintheeld. Thisis doneinform ofa discussionofrelated work.

The rst paper is based on an industrialcooperation project in which the

symmetry methodis putinto practicaluse. The purposeof theprojectwasto

investigatetheapplicationofColouredPetriNetsforvalidationofthecommuni-

cationprotocolsusedintheDanishmanufacturingcompanyDanfoss. Analysis

bymeansofstate spacessuccessfullyidentiedproblemsinthecommunication

protocolsand analternativedesignwasanalysedusingstatespacesreducedby

takingadvantageoftheinherentsymmetriesinthesystem. Exploitingthesym-

metries made it possible to analyse larger congurations of the system. The

project also presents a rst step towards improving the tool support for the

symmetry method inform of a semi-automated consistency check, i.e., check-

ingthatthesymmetriesusedforthereductionaresymmetriesthatareactually

present inthesystem.

A recurrent problemof the symmetry method is the hightime complexity

of the orbit problem, i.e., the problemof determining whether two states are

symmetric. The secondpaperpresentstechniquesto alleviatethenegative im-

pactoftheorbitprobleminstatespacegenerationwiththesymmetrymethod.

The paperattacks the problemintwo ways. Firstly,bypresenting algorithms

which exploit stabilizers of states, i.e., symmetries that map a state to itself,

to potentially reduce the complexity of the orbit problem during state space

generation. Secondly, by presenting a parallel version of the basic generation

algorithmforstatespacesreducedbymeansofsymmetries. Thetechniquesare

implementedand evaluatedon anumberof practicalexperiments.

Thethirdpaperpresentsan importantstep towards making thesymmetry

method forColouredPetriNetsapplicable inpractice. Thepaperpresentsthe

development of a tool which fully automates state space generation with the

symmetrymethod. Priortoolsupport(theDesign/CPNOE/OSTool)required

the user to implement two predicates determiningwhether two states/actions

are symmetricornot. Thisrequires bothprogrammingskillsaswellasa deep

knowledge of the symmetry method. This is especially the case if the predi-

catesarerequiredtobeeÆcient. Whenconstructingcondensedstatespacesfor

CP-nets it can be observed that the predicates can be automatically deduced

provided that thealgebraicgroupsof permutations usedfor thereductionhas

been specied. The above observation motivated the construction of the tool

which given an assignment of algebraic groupsof permutations to the atomic

coloursetsoftheCPNmodelautomaticallygenerates thepredicatesneededby

thetool. During development ofthe tool dierentstrategies forthepredicates

areinvestigatedtoseewhetheritispossibletodevelopgeneraltechniqueswhich

(7)

presentedalgorithmsare implementedintheDesign/CPN OPStooland their

applicabilityisevaluatedbasedonpracticalexperiments. Thepracticalexperi-

mentsshowthatthechosenstrategiesfortheimplementationofthepredicates

greatlyinuenceswhether thesymmetry methodis applicableinpractice.

The fourth paper dier from the three rst papers in the sense that it

does not deal with the symmetry method. The paper is based on an indus-

trialproject. The paperpresents resultson theuse of ColouredPetri Nets for

themodellingandanalysis offeaturesandfeature interactionsinNokiamobile

phones. The paperpresents how Coloured Petri Nets have beenused to con-

struct a model of parts of the software system in Nokia mobilephones. The

paperis concerned with the interaction between features (the functionality of

themobilephone)implementedinindividualmodules. Featureinteractionsare

investigatedusingsimulationsandstatespaceanalysis. Thepaperpresentsthe

ColouredPetri Nets model constructed in the project, describeshow domain-

specicgraphics andMessageSequenceChartsareusedasaninterfacetosim-

ulations, and discusses how the project and in particular the construction of

themodelhaveinuencedthedevelopmentprocessoffeaturesinNokiamobile

phones.

(8)
(9)

During my PhD studies I have been associated to the Coloured Petri Nets

Group(CPNGroup) at theUniversityof Aarhus. It has beena pleasant time

which I have benetted from both professionally and socially. For that I will

expressmythanksto bothformerand current membersof theCPN group.

Especially,I would like to thank myadviser SrenChristensen forencour-

aging me to start my PhD studies and for guidance and support during the

fouryears. Alsothanksto KurtJensenforhisinvolvementandguidancewhich

Ihave highlyappreciated.

Thanks to Lars M. Kristensenwho besides co-authoring two of thepapers

taught me how to writeresearch papers and from whom I have learned a lot.

Thanks for support, help and encouragement during my PhD studies. Also

thanks to the other three PhD students in the CPN group: Lisa Wells, Bo

LindstrmandThomasMailund. Wehave oftensharedthesame problemsand

concernsand Ihave appreciatedthehelp and supportfrom all ofyou.

DuringmyPhDstudiesIhave spent sixmonthsat NokiaResearch Centre

in Helsinki, Finland. Thanks to the Software Architecture Group headed by

JuhaKuusela. The entiregroup has beenvery friendly and helpful and made

my stay inHelsinki very pleasant. Especially thanks to Jianli Xu and Antti-

Pekka Tuovinen who I worked closely together with and also co-authored one

ofthe papersinthisthesis. Alsothanksto Francis Tam forintroducingme to

Finnishsocial lifeand letting me borrowhis wonderful Finnishfriends during

mystay inHelsinki.

Finally, I would like to thank Kurt Jensen, Sren Christensen and Jacob

Elgaardforreadingand commenting on theoverview paperinthe thesis. The

errorsthat mayremain areentirelymine.

The work done for thisthesis is supported bya grant from the Faculty of

Science,Universityof Aarhus, Denmark.

Louise Elgaard,

Arhus, Juli31, 2002.

(10)
(11)

Preface v

Short SummaryinDanish . . . v

Summary . . . v

Acknowledgements . . . ix

I Overview 1

1 Introduction 3

1.1 GeneralIntroduction . . . 3

1.2 ColouredPetriNetsand theSymmetry Method . . . 4

1.2.1 Coloured Petri Nets for the Modelling of a Flowmeter

System . . . 5

1.2.2 Analysis bymeans ofState Spaces withSymmetries . . . 7

1.3 Motivation and Aims oftheThesis . . . 11

1.4 Outlineand Structure oftheThesis . . . 12

1.4.1 Reader's Guide . . . 13

2 The SymmetryMethod in Practice 15

2.1 Background . . . 15

2.2 Summaryof Paper . . . 16

2.3 RelatedWork . . . 21

3 Exploting Stabilizers and Parallelism 25

3.1 Background . . . 25

3.2 Summaryof Paper . . . 26

3.3 RelatedWork . . . 29

4 Algorithms and Tool Support for the Symmetry Method 33

4.1 Background . . . 33

4.2 Summaryof Paper . . . 34

4.3 RelatedWork . . . 37

5 Modelling and Analysis of Feature Interactions 41

5.1 Background . . . 41

5.2 Summaryof Paper . . . 42

5.3 RelatedWork . . . 48

(12)

6.2 Future Work . . . 55

II Papers 59 7 Modelling and Analysis of a Danfoss Flowmeter System 61 7.1 Introduction. . . 63

7.2 Overview oftheProject . . . 64

7.3 The DanfossFlowmeter System . . . 66

7.3.1 System Architectureand CommunicationProtocols . . . 66

7.3.2 CANAPPDesign Patterns. . . 68

7.4 CPN Modelof theFlowmeterSystem . . . 69

7.4.1 CPNModelOverview . . . 70

7.4.2 Modellingof theCANAPPs . . . 70

7.5 Analysis of two InitialDesign Proposals . . . 72

7.5.1 AnalysisGoals . . . 72

7.5.2 AnalysisResults . . . 73

7.6 Analysis of athirdDesign Proposal. . . 77

7.6.1 SymmetrySpecication . . . 77

7.6.2 ConsistencyCheck . . . 79

7.6.3 AnalysisResults . . . 79

7.7 Conclusions . . . 81

8 Exploiting Stabilizers and Parallelism 83 8.1 Introduction. . . 85

8.2 Background . . . 87

8.2.1 ColouredPetriNets . . . 87

8.2.2 TheSymmetry Method . . . 88

8.3 Canonical Representatives . . . 90

8.4 ExploitingStabilizers. . . 91

8.4.1 Fewer Iterations . . . 92

8.4.2 Fewer MarkingsCanonicalized . . . 93

8.5 ExploitingParallelism . . . 94

8.6 ExperimentalResults. . . 96

8.6.1 StabilizerAlgorithms. . . 97

8.6.2 Parallel Algorithm . . . 99

8.7 Conclusionsand Related Work . . . 100

9 State Space Generation with the SymmetryMethod 103 9.1 Introduction. . . 105

9.2 The SymmetryMethod forCP-nets . . . 107

9.2.1 Example: DistributedDatabase . . . 107

9.2.2 SymmetrySpecication . . . 109

9.2.3 RestrictionSets. . . 109

9.3 CondensedState SpaceGeneration . . . 110

(13)

M

9.4.1 Presentationof theAlgorithm . . . 112

9.4.2 Experimental Resultsof theP Basic M Algorithm . . . 113

9.5 Approximation Techniques. . . 115

9.5.1 Presentationof theAlgorithm . . . 115

9.5.2 Experimental Resultsof theP Approx M Algorithm . . . 118

9.6 LazyListing. . . 120

9.6.1 Presentationof theAlgorithm . . . 120

9.6.2 Experimental Resultsof theP Approx+Lazy M Algorithm . . . 123

9.7 Conclusions . . . 124

10Modelling Features and Feature Interactions 127 10.1 Introduction. . . 129

10.2 TheMAFIA Project . . . 130

10.3 TheCPN Model . . . 132

10.3.1 Overviewof theCPN model. . . 132

10.3.2 ModellingoftheFeatures . . . 135

10.4 Simulationsand Visualisation . . . 140

10.4.1 Animationof thedisplay . . . 140

10.4.2 Controllingthesimulations . . . 142

10.4.3 MessageSequence Charts . . . 142

10.5 Relatedand Future Work . . . 143

10.6 Conclusions . . . 145

Bibliography 149

(14)
(15)

Overview

(16)
(17)

Introduction

Thischapter givesanintroductiontothesymmetrymethodforColouredPetri

Netsand motivates thework presentedin thisPhD thesiswithinthisresearch

eld. Section1.1givesageneralintroductiontoandmotivationforthesymme-

trymethod. Section 1.2givesan informalintroductionto ColouredPetriNets

andthesymmetrymethodinthecontextofColouredPetriNetsbymeansofan

example. Section1.3 presentsmotivations forand aimsof the thesis. Finally,

Sect. 1.4gives anoverview of thework included inthethesis and presents the

structureofthe rest ofthethesis.

1.1 General Introduction

Today many computer systems are distributed and concurrent, ranging from

smallembeddedsystemsinelectronicequipmenttolargeindustrialproduction

systems and geographically distributed systems. What is common for these

systems is that the execution can proceed in many dierent ways depending

on the individual components, their individual relative behaviour, and their

interplayinthesystem. Therefore, itisextremely diÆcultto reasonaboutthe

total behaviour of such systems and errors can go undetected for a long time.

Aswe depend more and more on electronic systems in criticalsituations, e.g.,

in hospital equipment, traÆc lights and car engines, the importance of being

ableto establishthecorrectness, orat leastincreasereliabilityofsuchsystems

isof great interest.

One way to increase reliabilityof systems is to use formal methods, which

aremathematicallybasedmethodsforspecifyingandreasoningaboutsystems.

Anexampleof a formalmethodforreasoning aboutsystemsis thestate space

method. The fullstate space of a system is a directed graph with a node for

each reachable state of thesystemand an arcfor each state change. From the

fullstatespaceitispossibletoverifywhetherasystemsatisesasetofdesired

properties,e.g., absenceofdeadlocks,thepossibilityto alwaysreenterthesys-

tem'sinitialstate,etc. Ifasystemdoesnotpossesthedesiredproperties,then

thefullstate space can be used to obtaincounter examples, i.e., an execution

ofthesystemwhichleadstoan undesiredsituation. Thismeansthatthestate

space can also be used to locate errors in the system. The main drawback in

(18)

thepractical useof thestate space methodis thestate explosion problem [90]:

thenumberofreachablestatesgrowsexponentiallyinthenumberofconcurrent

components, thusmaking it impossibleto construct thefullstate space of the

system.

Several reduction techniques have beensuggested to alleviatethe state ex-

plosionproblem. Withthesereductiontechniquesonlyasubsetofthefullstate

space is represented or the full state space is represented in a compact form.

An exampleof such a reductiontechnique isthesymmetry method [22,23,47].

The basicobservation is thatmanydistributedand concurrentsystems posses

a certaindegree ofsymmetry,e.g.,asystemcomposedof identicalcomponents

whoseidentitiesareinterchangeablefromavericationpointofview. Thiskind

of structural symmetryinthe systemis also reectedin thefullstate space of

thesystem. Theideabehindthesymmetrymethodistofactoroutthissymme-

tryandobtainacondensed statespace whichistypicallymuchsmallerthanthe

fullstatespace,butfromwhichthesamekindofpropertiesofthesystemcanbe

derivedwithoutunfoldingthecondensedstatespacetothefullstatespace. The

useofthesymmetrymethodishighlydependentontheexistenceofsupporting

computer tools. Without suitable computer tools calculation, generation, and

inspectionofcondensedstatespacesisimpossibleformorethantrivialsystems.

Statespacesandthesymmetrymethodarenotrestrictedtoaspecicmod-

elling language [29]. However, in the work presented in this thesis the sym-

metry method is considered in the context of Coloured Petri Nets (CP-nets

or CPNs) [46,58]. CP-nets is a graphical modelling language based on Petri

Nets [79] allowingmodellingandformal analysisofdistributedand concurrent

systems. Design/CPN [19,50]isa computertoolsupportingspecication, sim-

ulation,andstatespaceanalysisofCP-nets. ThetoolisdevelopedbytheCPN

GroupattheUniversityofAarhus. IntheareaofCP-netsstatespacesarealso

calledoccurrencegraphsorreachabilitytrees,statespaceswithsymmetriesare

alsocalledoccurrencegraphswithsymmetriesandoccurrencegraphswithper-

mutationsymmetries. Inthisthesisthetermsstate spacesandstate spaceswith

symmetries willbeused.

1.2 Coloured Petri Nets and the Symmetry Method

In this section the concepts of CP-nets and the symmetry method for CP-

nets [47,48]areinformally introducedthroughaconcrete example. The exam-

ple consideredis the Danfossowmeter system investigatedin [65]. The work

presented in [65] will be discussed in more detail in Chap. 2. The paper is

includedinits fullversioninChap.7. Section1.2.1 containsan briefintroduc-

tion to the Danfossowmeter system, followed byan informalintroductionto

CP-nets using a CPN model of the owmeter system. Section 1.2.2 presents

(19)

1.2.1 Coloured Petri Nets for the Modelling of a Flowmeter

System

CP-nets have proven powerful for modelling of concurrent systems [49]. An

example of a concurrent system is the Danfoss owmeter system which will

brieybeintroducedinthe following.

Flowmeters are primarily used to make measurements on the ow of liq-

uid through pipes. The owmeter system studied in [65] consisted of several

processes each conducting measurements on the ow of liquid. Examples are

processesmeasuringtheamountofwaterowingthroughapipe,processesmea-

suringthetemperatureofthewater,and processesdoingcalculationsbasedon

measurements obtained by other processes. Figure 1.1 illustrates the overall

architectureofaowmetersystem. Aowmetersystemconsistsofoneormore

modules connected via a Controller Area Network (CAN) [62]. Each module

consistsof a numberof processes calledCAN Applications (CANAPPs) and a

driverthat interfaces themodule to theCAN.Figure 1.1shows an exampleof

aowmetersystemconsistingofthree modulescontaining two,three,and four

CANAPPs, respectively. Each CANAPP in the system has a local memory

whichholdsa numberofattributes. Thecommunicationinthesystemconsists

ofasynchronousmessagepassingbetweentheCANAPPs. Thismessagepassing

allowseachCANAPPto readandwritetheattributesoftheotherCANAPPs.

CANAPP

CANAPP CANAPP CANAPP

DRIVER DRIVER

MODULE 1 MODULE 2

CAN

CANAPP CANAPP

DRIVER MODULE 3

CANAPP

CANAPP

CANAPP

Figure 1.1: Overall architectureof aowmeter system.

InthefollowinganinformalintroductiontoCP-netsisgivenusingtheCPN

modelof theowmetersystemcreated intheprojectreported on in[65] asan

example. This section willinformally introduce CP-nets as they are formally

dened in [46] as well as the style in which CP-nets appear in the rest of

this thesis. A more detailed introduction to CP-nets can be found in [58].

The CPN model is created in the Design/CPN tool [26] and the introduction

given here reects the terminology used in the Design/CPN tool. A CP-net

is hierarchically structured into modules (subnets), also referred to as pages

in Design/CPN terminology. Figure 1.2 gives an overview of the CPN model

of the owmeter system by showing how it hasbeen hierarchically structured

into 12 pages. Each node in Fig. 1.2 represents a page of the CPN model.

An arc between two nodes indicates that thesource node contains a so-called

substitutiontransition whosebehaviourisdescribedonthepagerepresentedby

thedestinationnode.

(20)

debug#21 Hierarchy#10

PrimaryWaitpoint#18 InternalWaitpoint#17

CANAPPOut#13

Internal#20 masterp#100 Init#11

M Prime GlobalDecl#2 Control#10

CANAPP#3 Driver#5 Network#4

Flowmeter_System# M Prime

CANAPPIn#14

MIn#8

MOut#9

ReadWrite#7 Generation#6

MarkingToKey MarkingToKey

CPNOSfig#26 CPNOSFigBU#29 CPNOGfig#28 CPNOGfig_reorganized CPNOGfigNEW_reorg CPNOGfigNEW#32 CPNOSfigNEW#35

PN2000 figurer Thesis figurer CPNOSfigNEW_smallno CPNOSfigNE

Internal Primary

Figure1.2: The hierarchypage.

thefollowingit isshownhow CANAPPsaremodelledasaCP-net. Figure 1.3

depictsthe pageCANAPPOut,whichmodelsthepartof aCANAPPgenerating

requests to theother CANAPPsand awaiting responses.

Incontrastto manyother modellinglanguagesCP-netsare bothstate and

action oriented. A state of a CP-net is representedby means of places which

aredrawnasellipseswithanamepositionedinside. Theplacescontaintokens,

which carry datavalues. The data valuesare in CPN terminology referred to

ascolours. Eachplacehasatype,inCPNterminologyreferredtoascolour set

thatdeterminesthekindoftokensthatcanreside ontheplace. Thecolourset

of a place iswrittennext to the place. A state of aCP-net is adistribution of

tokensontheindividualplaces. A stateisinCPNterminology alsoreferredto

asamarking. ACP-nethasadistinguishedmarkingcalledtheinitialmarking,

correspondingto the initialstate of thesystem.

InFig.1.3thetwoplacesRequestOutandResponseInbothhavethecolourset

Waiting CANxCanMsg Attributes

CANAPPxAttr FG Attributes

Services CANAPPxService

FG Services

Request

[canapp<>tocanapp, canmsg=MakeRequest (canapp,tocanapp,theservice)]

Config CANAPP FG

Config

Confirm

[(#cansource canmsg’)=

(#candest canmsg)]

ResponseIn CANxCanMsg P

In

RequestOut CANxCanMsg P

Out

Idle CANAPP P

I/O

PWPStatu s

CANAPPxPWPStatus P I/

rem_idle(canapp)

(canapp,canmsg)

(canapp,theservice)

(canapp,canmsg) tocanapp

(canapp,canmsg) (canapp,

read_update_attr(attr,canmsg’)) (canapp,attr)

(canapp,canmsg’)

rem_idle(canapp)

(canapp,PWPWait) (canapp,PWPIdle) (canapp,PWPIdle) (canapp,PWPWait)

Figure 1.3: The pageCANAPPOut.

(21)

CANxCanMsg,whichdenotesthecartesianproductofCANAPPsandmessages.

Thesetwoplacesmodelthebuersusedtotemporarilystoreoutgoingrequests

to other CANAPPs in the system and incoming responses to previously sent

requests. The places Idle and Waiting model the control ow in the part of a

CANAPPgeneratingrequeststo theother CANAPPs andawaiting responses.

TheplaceAttributesisusedtomodeltheattributesoftheCANAPP.Theplaces

Cong and Services are used to model conguration information (information

aboutother CANAPPsintheowmetersystem)whichcanbe accessedbythe

CANAPP.

Actionsofa CP-netarerepresentedastransitions whicharedrawnasrect-

angleswith a name positioned inside. The transitionsand places of a CP-net

areconnectedbyarcs. Transitionsremove tokensfromtheplacesconnectedto

incoming arcs and add tokens to the places connected to outgoing arcs. The

tokensremovedandaddedaredeterminedbyarcexpressions whichareinscrip-

tionspositionednexttothearcs. IntheDesign/CPNtooltheseinscriptionsare

writtenintheStandardMLprogramminglanguage[70]. InFig.1.3thesending

ofarequestismodelledbythetransitionRequest,whichcausestheCANAPPto

changeits state from being Idleto Waitingand passesthemessage tothedriver

by puttingit into thebuermodelledbythe place RequestOut. The token put

onplace RequestOutisspeciedbytheexpression(canapp,canmsg) whichis the

cartesianproductof a CANAPPand amessage.

A transition can remove and add tokens when two conditions arefullled.

Firstly,suÆcient tokens must be present on theplaces connected to incoming

arcs, i.e., it must be possible to assign data values to the free variables of

thetransitioninsuch awaythat eacharcexpressionevaluate to amulti-setof

tokenswhichisasubsetofthetokenspresentonthecorrespondinginputplace.

Secondly,a boolean expression assigned to the transition called a guard must

evaluateto true. When these two conditionsare fullledthetransition is said

tobeenabled anditmayoccur,therebyremovingtokensfrom theinputplaces

and adding tokens on the output places of the transition. A pair consisting

of a transition and an assignment of data values to the free variables of the

transitionis calleda bindingelement.

When a message is putinthebuer modelledbythe place RequestOut, the

driver in the module will remove the message from the place RequestOut and

deliver it to the destination. When the response returns, the corresponding

message is put inthe buer modelled by the place ResponseIn. The actual re-

ception of a response is modelled by the transition Conrm. An occurrence of

thistransition removes theresponsefrom theplace ResponseIn, updates theat-

tributesoftheCANAPP(modelledbyplaceAttributes)andcausestheCANAPP

to change itsstate fromWaiting to Idle.

1.2.2 Analysis by means of State Spaces with Symmetries

Asseenabove CP-netshave a graphicalrepresentation. Furthermore, CP-nets

haveaformallydenedsemanticsallowingformalanalysis[46]. TheCPNmodel

introduced above can therefore beused to analyse whether theCPN model of

(22)

1

4 5 7

2 3 6

14 15

12 13 16

10

9 11

8

Figure1.4: Initialfragment of thefullstate space.

Afull state space [46] of a CP-netis adirected graph witha nodeforeach

reachable state of the CP-net and an arc foreach state changeof theCP-net.

Figure 1.4 shows the initial fragment of the full state space for a owmeter

system consisting of two modules containing one and two CANAPPs, respec-

tively. This system conguration is graphically represented as . The

nodesinthestate space colouredblackarethenodeswhichare fullyexplored,

i.e., thenodesforwhichallsuccessors have beencalculatedand includedinthe

state space. Modules are numbered from left to right, and the CANAPPs in

a module from top to bottom. The notation CANAPP

(i;j)

is used to denote

CANAPP j in module i. Similarly, a communication in the system will be

graphicallyrepresented. A situation whereCANAPP

(2;1)

has initiatedrequest

towards CANAPP

(2;2)

willbe representedas .

Node 1 in Fig. 1.4 corresponds to the initial marking/state and has six

immediate successor nodes corresponding to the possible requests which can

be initiated in the system (each CANAPP can initiate a request to the two

other CANAPPsintheowmetersystem). Onlythesuccessornodesofnode 4

and 5 are shown in the layer of the state space corresponding to two steps

from the initial state. For each of the nodes it is indicated in the associated

dashed box what communicationhave beeninitiated,e.g., node 4corresponds

to astate of thesysteminwhichCANAPP

(2;1)

hasinitiatedarequest towards

CANAPP

(1;1) .

EvenforsmallCP-netssuchafullstatespace maybecomevery large,thus

encountering the state explosion problem [90], i.e., the state space starts to

growrapidlywhenanalysingsystemsofincreasingsize,e.g.,owmetersystems

with an increasingnumberof CANAPPs. Inthe owmetersystemCANAPPs

(23)

1

4 5 7

2 3 6

14

15 12

13 10 9 11 16

8

Figure1.5: Reorganisedinitialfragmentofthefullstatespace. Thegrey boxes

indicatesymmetric markings.

CANAPP

(2;1)

andCANAPP

(2;2)

aresymmetricseenfromavericationpointof

view. Also modulescontaining the same numberof CANAPPs can be consid-

eredsymmetric. Thereis, however, no such modulesin thecongurationused

asexample. Whenconsideringthestatespaceoftheowmetersystemitcanbe

seenthatthiskindofstructuralsymmetryalsoisreectedinthestate spaceof

thesystem. Node 4 inFig. 1.4 corresponds to a marking whereCANAPP

(2;1)

hasinitiated a request to CANAPP

(1;1)

, whilenode 5 corresponds to a mark-

ing where CANAPP

(2;2)

has initiated a request to CANAPP

(1;1)

. For node n

thecorresponding marking is denoted M

n . M

4

and M

5

can be obtained from

each other by a permutation which swaps the identity of CANAPP

(2;1) and

CANAPP

(2;2)

,hence M

4

and M

5

can beconsideredsymmetric.

Figure 1.5 shows thesame fragment of the fullstate space as Fig.1.4, but

in Fig. 1.5 the states are reorganised such that symmetric markings are posi-

tionednext to each other in grey boxes. The grey boxes indicateequivalence

classes of symmetric markings. The rst box represents the equivalence class

containing theinitial marking only,the second boxrepresents theequivalence

classcontainingthemarkingsM

2

andM

3

,thethirdboxrepresentstheequiva-

lenceclass containingthemarkingsM

4

andM

5

,and thefourthboxrepresents

theequivalenceclasscontainingM

6

and M

7

. Thesuccessors ofM

4

andM

5 are

grouped into equivalenceclasses inasimilarway. FromFig. 1.5it can beseen

that two symmetric markings, such as M

4

and M

5

, have symmetric successor

markings. Hence, fora setofsymmetric markingsitis suÆcientto explore the

possiblebehavioursofthesystem foronlyone ofthese markings.

Thebasicideabehindthesymmetrymethodistolumptogethersymmetric

setsofmarkings/bindingelementsintoequivalenceclassesasshowninFig.1.5.

Itis suÆcient to storeasingle representative from each equivalenceclass, e.g.,

the marking M can be chosen as a representative for the equivalence class

(24)

1

4

2 6

10 12 9 11

8

Figure 1.6: Initialfragment of thecondensedstate space containingone repre-

sentative from eachequivalenceclass.

containing the markings M

4

and M

5

. In this way a condensed state space is

obtained which is typically much smaller than the full state space. The ini-

tial fragment of the condensed state space for the owmeter system is shown

in Fig. 1.6. From Fig. 1.6 it can be seen that only one marking from each

equivalence class is included in the condensed state space. The total number

of markings reachable within two steps from the initial marking is 23. The

total number of equivalence classes reachable within two steps from the ini-

tial marking is 13. Hence it is possible to represent the 23 markings which

can be reached in two steps from the initial marking using only 13 nodes in

the condensed state space. These number may notat rst sight seem impres-

sive. However, in general the highest possiblereduction for a conguration is

n2N

(n!thenumberof modulescontainingn CANAPPs). Hence,thehighest

possiblereductionfortheconguration is120. Practicalexperiments

show thatthereductionobtainedis verycloseto thehighesttheoreticallypos-

sible.

The symmetries used forthe reduction are obtainedfrom permutations of

the atomic colours in theCP-nets. Hence, in the rest of the thesis such sym-

metries are denoted permutation symmetries and a condensed state space is

also called a state space with permutation symmetries (SSPS). The permuta-

tionsymmetriesusedforthereductionmustbechoseninsucha waythatthey

capture the symmetriesactually present inthe system. When thisis the case

the choice of symmetries are said to be consistent [47]. Consistency of the

choice of symmetriesensuresthat thefullstate space can beconstructed from

the SSPS. When thechoice of symmetriesused forthe reductionis consistent

theSSPShasanarcfromoneequivalenceclasstoanotherifandonlyifthereis

(25)

equivalence class. The fact that symmetric markings have symmetric sets of

successormarkings andbindingelementsensures thateither all ornoneof the

markingsintherstequivalenceclasshaveanenabledbindingelementleading

to amarkinginthe secondequivalenceclass.

1.3 Motivation and Aims of the Thesis

The symmetry method is a general state space reduction technique and is as

suchnotrestrictedto acertainmodellinglanguage. Severalvariantshave been

suggested for reasoning about dierent classes of properties, e.g., for safety

properties [44], for temporal logics formulae speciedin CTL* [23,24,28] and

LTL [30,38], for properties of P/T nets [85], and in the context of CP-nets a

variant forreasoningaboutstandarddynamicpropertiesof CP-nets[47,48].

One of thecommon problems forall the variants of thesymmetry method

is how to determinewhether two states are symmetric. A selection of papers,

e.g., [55,80,81] presents results and techniques for this problem for low level

PetriNets.

InthecontextofCP-netsthetheoryofthesymmetrymethodiswelldevel-

oped [47,48]. However, no papers document theuse of the symmetry method

inpractice inthe context of Coloured Petri Nets. A rst step toward making

the symmetry method for Coloured Petri Nets applicable in practice is made

in1996 wheretheDesign/CPN tool wasextended withsupportfor generation

ofSSPSs. The toolis calledtheDesign/CPN OE/OStool [52] and istogether

with a case study documented in [53]. However, the tool requires the user to

implementtwopredicatesexpressingwhethertwostates/actionsaresymmetric.

Hence,thetooldoesnotaddresstheproblemofdeterminingwhethertwostates

are symmetric,i.e., the orbitproblem. [4,32,51] all presents ideas foreÆcient

solutionsto theorbitproblemforCP-netsbuttheideasarenotintegratedinto

state spacegenerationand in[4,32]theideasare notevaluatedinpractice.

Theabove motivatedtheresearchworkdoneasa partof thisthesis. Early

experimental results [65] show that in practice an eÆcient implementation of

theorbitproblemiscrucialforwhether thesymmetry method isapplicable in

practiceforlargermodels,i.e.,modelswitha potentiallylargenumberofsym-

metries. Furthermore,abasicobservationinthesymmetrymethodforCP-nets

is that when the symmetries of the system are known, the problem of deter-

mining whether two states are symmetric can be performed fully automatic.

This motivates development for general algorithms and techniques forthe or-

bitproblem as wellas toolsupportsuch that thetechniquesand ideascan be

integratedintostate spacegenerationwithoutmanualimplementationorother

(model specic)user invention.

One of thekey issues motivating the work donein thisthesis isto develop

techniquesand toolswhich make thesymmetrymethodforCP-netsapplicable

inpractice. ThroughoutmyPhDstudiestheworkhasincludedthreeaspectsof

thesymmetrymethodofColouredPetriNets: Theory,tools,andpracticaluse. I

ndthatallthreeaspectsandtheinterplaybetweenthemareimportantaspects

(26)

ideas and techniques are developed during research work, these are applied

and explored in small examples and later in industrial settings. This may

again motivatefurtherdevelopment ofthetechniques. Theapplicabilityofthe

developed techniques is closely related to the existence of suitable computer

tools. Without proper computer supportit is impossibleto calculate and use

SSPSs for more than small examples. This should imply that neither of the

three aspects: theory,tools and practicaluseshouldbetreated inisolation.

Theory. The research work concentrates on the development of general tech-

niques and algorithmsfor theorbitproblem of CP-nets. The algorithms

areintegratedintostate space generationforCP-nets.

Tools. The developed algorithms are implemented ina tool which automates

the symmetry method for CP-nets thus making it possible to automat-

ically calculate the SSPSs of a CP-net with when the user has specied

thepermutationsymmetriesusedfor thereduction.

Practical Use. Thedevelopedalgorithmsandtoolsareevaluatedinanumber

of practicalexperiments.

1.4 Outline and Structure of the Thesis

The thesis is divided into two parts. Part I is the mandatory overview paper

whichsummarisesthework whichhave beendone. PartIIiscomposedoffour

individualpapers. Three of the papers [65{67]have been publishedasconfer-

ence papers in international conferences. One paper [63] has been published

as aworkshoppaper. Threeof thepapers [63,65,66] document workwith the

symmetry method for CP-nets. The fourth paper [67] document work with

application ofCP-netsin anindustrialsetting.

Chapter 2 summarisesthepaperModellingandAnalysisofaDanfossFlowme-

terSystem using Coloured PetriNets[65]. Thepaperpresentsjointwork

with Lars M. Kristensen and has been published in M. Nielsen and D.

Simpson, editors, Proceedings of the 21th International Conference on

Application and Theory of Petri Nets, volume 1825 of Lecture Notes in

Computer Science, pages 346{366, Springer-Verlag, 2000. The paper is

containedinfullinChapter 7.

Chapter 3 summarises the paper Exploiting Stabilizers and Parallelism in

StateSpaceGenerationwiththeSymmetryMethod[66]. Thepaperpresents

jointworkwithLarsM.KristensenandhasbeenpublishedinProceedings

of the SecondInternational Conferenceon Application of Concurrency to

System Design,IEEE, 2001. The paperiscontainedinfullinChapter 8.

Chapter 4 summarises the paperColoured Petri Nets and State Space Gen-

eration withtheSymmetry Method[63]. The paperhasbeenpublishedin

K.Jensen,editor, Proceedings ofthe FourthWorkshopon Applicationsof

(27)

University of Aarhus, Denmark, 2002. The paper is contained in full in

Chapter 9.

Chapter5 summarises thepaper Modelling of Features and Feature Interac-

tions in Nokia Mobile Phones using Coloured Petri Nets [67]. The pa-

per presents joint work with Antti-Pekka Tuovinen and Jianli Xu and

has been published in J. Esparza and C. Lakos, editors, Proceedings of

the 23rd International Conference on Application and Theory of Petri

Nets, volume2360 ofLectureNotesinComputerScience,pages294{313,

Springer-Verlag, 2002. The paperiscontainedinfullinChapter 10.

Chapter 2{5 are all dividedinto three sections; Background gives a briefin-

troduction to and some background for the topic of the paper, Summary of

Paper gives a briefsummary of the mainconclusions presented in thepaper,

andRelated Workdiscusses andcompares thepaperto relatedwork. Chap-

ter6 concludesthe work presentedinthisthesis anddiscusses some directions

andideas forfuturework.

1.4.1 Reader's Guide

The reader of this thesis is assumed to be familiar with the concepts of Petri

Nets. CP-netsareinformallyintroducedinChapter1and furtherknowledgeof

CP-netsisnota prerequisite. However, more knowledge maybe anadvantage

for the reader who wants to study the symmetry method for Coloured Petri

Nets inmore detail. Foran introductionto CP-nets[58] is recommended asa

startingpoint,aformaldenitionofCP-netscanbefoundin[46],andaformal

denitionof thesymmetry methodforCP-netscan be foundin [47,48].

The orderin whichthe fourpapers[63,65{67] areincluded inthisthesis is

inuencedbypart Iof thethesis. The presentationofthe papersisstructured

intheorder whichfeels mostnaturalfor thethesis asa whole. Forthe reader

who isonlyinterested inparts ofthe thesis thefollowingguidelinesaregiven:

Chapter1containsanintroductiontotheresearcheldand canbeskippedby

readers who are already familiar with CP-nets and the symmetry method for

CP-nets. Chapter 2-4 presents work on the symmetry method. The reader is

recommendedtoreadChapter3beforeChapter4. Chapter5presentsworkon

theapplication of ColouredPetriNets to feature interactions inmobile phone

software and can be readindependentlyof theother chapters.

(28)
(29)

The Symmetry Method in Practice:

Analysis of a Flowmeter System

ThischapterdiscussesthepaperModelling andAnalysisof aDanfossFlowme-

terSystemusingColouredPetriNets[65]. Section2.1describesthebackground

ofthepaperandcontainsanintroductiontotheresultspresentedinthepaper.

Section2.2givesasummaryof thepaperanddiscusses themainresultsof the

paper. Finally,Sect. 2.3containsa discussionofrelated work.

2.1 Background

ThepaperModellingandAnalysisofaDanfossFlowmeterSystemusingColoured

Petri Nets [65] presents an industrialcooperation project where CP-nets and

state space methods are applied in practice for the modelling and analysis of

a real product: a owmeter system from the Danish manufacturing company

Danfoss. The project was carried out as a joint project between Danfoss In-

strumentation(asubgroupoftheDanfosscompany)andtheCPNgroupat the

UniversityofAarhus. Intherestofthechapter theprojectisreferredtoasthe

Danfossproject.

The aim of the project was to investigate the application of CP-nets for

validationofthecommunicationprotocolusedintheowmetersystem; atopic

of increasing interest withinDanfoss due to realised problems, e.g., deadlocks

found via practical tests. Before the project started two dierent communi-

cation strategies (in [65] denoted design alternatives) were suggested for the

communication protocol used in the owmeter system. The project aims at

investigating both communication strategies using CP-nets and its support-

ingDesign/CPN tool. The CPN model created capturesbothcommunication

strategies. The strategy used as well as the conguration of the owmeter

systemanalysedisdetermined bythe initialmarking.

Thevalidationintheprojectisdoneusingstate spacesasaformalanalysis

method. A state space of the CPN model created in the project contains a

nodeforeachofthereachablestatesoftheCPNmodeloftheowmetersystem

and an arcfor each state change. From thestate spaces constructedit can be

veriedwhether theCPNmodel(withthechosencommunicationstrategyand

conguration) possesses a number of desired properties. If the properties are

(30)

violatedthestate space canbeused toobtaincounter examples,i.e., a pathof

states/actions leadingto a state wherea propertyisviolated.

Theprojectextendstheanalysisresultsusingstatespaceswithpermutation

symmetries(SSPS)to beabletoanalyse largercongurationsoftheowmeter

system. In the construction of SSPSs CANAPPs located in the same module

are considered symmetric as well as modules containing the same number of

CANAPPs areconsideredsymmetric. Byexploitingthissymmetryinthecon-

struction of the state spaces it is possibleto obtain a signicant reduction in

the numberof states and actions included in thestate spaces. Hence, making

itpossibleto potentiallyanalyse largercongurationsoftheCPNmodelofthe

owmetersystem.

The project group consisted of both members from Danfoss and from the

CPN group, i.e., both members with expertise in the domain (the owmeter

system) and members with expertise in the methodsand tools to be applied.

The members from Danfoss had beside a basic familiarity of the concepts of

low level Petri Nets no prior knowledge of Coloured Petri Nets, modelling or

formalanalysis. Hence,itwasdecidedto visualisethecommunicationbetween

CANAPPsintheCPNmodeloftheowmetersystemusingMessageSequence

Charts (MSCs) [45].

2.2 Summary of Paper

The project wasstructured into three phases: modelling, state space analysis,

and analysisbymeansofstate spaceswithpermutationsymmetries. Themain

contribution of the paper is the application of state spaces and state spaces

withpermutationsymmetriesto alargeCPNmodeldeveloped inanindustrial

setting. Hence, the discussions in this chapter focus on the two last phases

constitutingtheformal analysisof theCPN modelof theowmetersystem.

Modelling of the Flowmeter System. The CPN model of thecommuni-

cationprotocolintheowmetersystemcreated intheprojectis ahierarchical

CPN modeldevelopedin theDesign/CPN tool[19,26].

The owmeter system and parts of the CPN model created inthe project

are presented in Chapter 1 where it was used to introduce CP-nets and the

symmetry method for CP-nets. The construction of the CPN model or the

CPN model itself will therefore not be discussed in more detail. More details

can befoundin [65]whichis containedinfullinChapter7.

The CPN model is validated using simulations; both interactive (step-by-

step) simulations and later (when reliability of the model is increased) more

automatic simulations. For that purpose the CPN model is extended to au-

tomatically produce MSCs from simulations which allow the communication

betweentheCANAPPsintheowmetersystemtobeobservedat amore high

levelthan observingthetoken game intheCP-net. MSCs aregraphicaldraw-

ingsshowingverticallinescorrespondingtoprocessesinthesystem(CANAPPs

intheowmetersystem). Arrowsbetweentheverticallinescorrespondtomes-

(31)

areconstructedautomaticallyfromsimulationsof theCPN model,thesimula-

tionscanbeobservedwithoutinspectingtheunderlyingCP-nets. Furthermore,

theMSCs are used to visualise executions of the CPN model leading to error

statesfoundvia state space analysis.

StateSpace Analysis. Afterthemodellingphaseoftheprojectthedesired

properties of a owmeter system were formulated to serve as a basis for the

formal analysis. Both of the communication strategies included in the CPN

model of the owmeter system were analysed to see whether they full the

properties. The analysis was performed by means of state spaces using the

Design/CPNOGtool[17]. Statespaceswerechosenastheanalysismethodfor

two reasons. Firstly, the tool support for state space generation and analysis

is well developed in the Design/CPN tool. Secondly, one of the aims of the

project was to demonstrate the use of state spaces and the Design/CPN OG

toolinindustrialsettings.

To make it possibleto analyse whether the model satises the properties,

theproperties aretranslated into dynamicpropertiesof theCPN model. This

makes itpossibleto formulate therequirementsasqueriesin theDesign/CPN

OG tool. Below an informal description of each of the properties are given

followedbyatranslationoftheproperties intopropertiesoftheCPN modelof

theowmetersystem.

Absenceof Deadlocks.

Thispropertyexpressesthatitshouldnotbepossibletobringtheowme-

ter system into a deadlock situation, i.e., a state where all the processes

(CANAPPs) areblocked.

At theleveloftheCPNmodelthispropertycan be expressedasabsence

of deadmarkings, i.e., markingswithoutenabled bindingelements. This

is a standard dynamic propertyof a CPN modeland theOG toolhas a

buildinfunctionlistdeadmarkings(),whichndthedeadmarkings(if

any) inastate space.

Absenceof AttributeCorruption.

Thispropertyexpressesthatwhena CANAPPhasinitiatedarequest its

attributes must notbe changedbeforetherequest hasbeencompleted.

At the level of the CPN model the property can be formulated using

temporal logics [22]. The Design/CPN OG tool library ASK-CTL [20]

makesitpossibletomake queriesexpressedinastateandactionoriented

variant of CTL [12] which exploits boththestate (markings)and action

(binding elements) orientednature of CP-nets. The absence ofattribute

corruption for a given CANAPP

(i;j)

can be expressed as the following

action-based CTLformula. Theformula isexplainedindetail below.

AG((Request,hcanapp=CANAPP

(i;j) i))

A((:(Indication,hcanapp=CANAPP

(i;j)

i))U(Conrm,hcanapp=CANAPP

(i;j) i)))

The formula states that whenever (denoted AG) the transition Request

occursinabindingcorrespondingtoCANAPP ,theninallfutures(de-

(32)

notedA)thetransitionIndicationcannotoccurinabindingcorresponding

to CANAPP

(i;j)

until(denotedU) thetransitionConrmhasoccurredin

abindingcorrespondingtoCANAPP

(i;j)

. Anoccurrenceofthetransition

Request in a binding corresponding to CANAPP

(i;j)

hasbeen written as

(Request,hcanapp=CANAPP

(i;j)

i). The binding of Indication and Conrm

is written in a similarway. An occurrence of the transition Request(see

Fig. 1.3) modelsthe start of a request, an occurrence of transition Indi-

cation (not shown in a gure) models the start of handling an incoming

request,and an occurrence oftransition Conrm(seeFig. 1.3)modelsthe

receptionof aresponse.

Topology Independence.

The lastpropertystates thatthe tworst propertiesmust be validinde-

pendent ofthe congurationofthe owmeter system.

At the level of the CPN model this property can be investigated by

analysing dierent congurations of the owmeter system. Investigat-

ing dierent congurations can be done by simply changing the initial

marking of the CPN model. Using state spaces topology independence

cannot be completelyveried butonly veriedfor thecongurations for

whichthestatespacehasbeenconstructed. Hence,investigatingdierent

congurationsoftheCPNmodeloftheowmetersystemwillnotresultin

a completeverication of thispropertybut solelyincreasethe reliability

oftheCPNmodel. Thisissuewillbetouchininthediscussionofrelated

work.

Usingthe Design/CPN OGtool state spaceswerecalculated and analysedfor

a numberofcongurations oftheowmetersystemusingbothcommunication

strategies. The concrete list of thecongurations analysed aswell asthe gen-

eration statistics can be found in[65] which is contained in fullin Chapter 7.

In this phase of the project the state explosion problem [90], i.e., the size of

the state spaces start to grow rapidly when system parameters increase, was

encountered. However, even in the small congurations analysed errors were

found, i.e., thedesired properties of a owmeter system were not fullled. In

all congurations analysedone of the communication strategies failed to full

the absence of deadlocks, the other communication strategy failedto fullthe

absence of attribute corruption.

Examplesofpaths 1

leadingto stateswherethepropertieswerenotfullled

wereinspectedand discussedwithintheprojectgroupinorder to identifyand

understandtheshortcomingsofthecommunicationstrategies. Forpresentation

purposesandtoimprovethereadabilityoftheexecutionpathsleadingtoerror

states foundvia state space analysisthepaths werevisualised usingtheMSCs

liketheMSCs usedto visualisesimulationsof theCPNmodel.

Analysis by means of State Spaces with Permutation Symmetries.

Onthebasisoftheanalysisresultsobtainedinthesecond phaseoftheproject

1

The Design/CPN tool has a build-in functionwhichreturns oneof the shortest paths

(33)

itwasconcludedthatanothercommunicationstrategythanthetwo communi-

cationstrategiesincluded intheCPNmodeland analysedinthesecond phase

oftheprojectwasneeded. Basedon theanalysisresultsfromthesecondphase

of the project a new communicationstrategy was designed. The CPN model

wasrevisedto capture thenewcommunicationstrategyand forsmallcongu-

rationsit wasveriedthat therevisedCPN modelfullledthetwo properties:

absence of deadlocks and absence of attribute corruption. Again the state ex-

plosion problem prevented analysis of larger congurations of the owmeter

system. Since theowmetersystemiscomposedofa numberof identicalcom-

ponents, i.e., CANAPPs, whose behaviour are identical it was decidedto use

thesymmetry method inthe analysisof the CPN modelof the owmetersys-

tem. However, for the symmetry method to apply it need to be ensured that

thesymmetrymethod preservesthepropertiesthat have to be veried.

Absenceof Deadlocks.

AstateinaSSPScorrespondstoanequivalenceclassofstatesinthestate

space. The symmetry specication used for the reduction is required to

be consistent,i.e., fullthethree requirementsinDef. 3.16in[47]. Con-

sistency of the symmetry specication ensures that symmetric states all

have symmetric enabledbindingelements aswellassymmetricsuccessor

states. Hence, a dead state in the SSPS corresponds to an equivalence

class of symmetric dead states (markings) in the state space and vice

versa. Hence,absenceofdeadlocksispreservedbythesymmetrymethod.

Absenceof AttributeCorruption.

Toreectthenew communicationstrategyanalysedtheCPN modelwas

changed. Hence, the action-based CTL formula used for the analysis in

the previous phase of the project need to be changed accordingly. The

query ischanged to take into account thatintherevisedcommunication

strategythetransitionIndicationcanoccurintwomodes(acceptorreject)

dependingonwhethertherequestisacceptedorrejectedbythereceiving

CANAPP.Thenewformulacanbeexpressedasthefollowingactionbased

CTL formula.

AG((Request,hcanapp=CANAPP

(i;j) i))

A((:(Indication,hcanapp=CANAPP

(i;j)

,mode=accepti))U

(Conrm,hcanapp=CANAPP

(i;j) i))

The action-based CTLformula above expresses absenceof attributecor-

ruption for a specic CANAPP

(i;j)

, i.e., the formula refers to an occur-

rence sequence related to a specic CANAPP

(i;j)

. Since all permuta-

tions of CANAPPs are allowed this property is not a priory preserved

by thesymmetry method. However, in[23,28] itis shown that thesym-

metry method preserves the truth value of a CTL formula if the truth

value of its atomic state propositions are invariant under the permuta-

tion symmetries. Hence,thepropertycan onlybe veriedforCANAPPs

which are not allowed to be permuted by the symmetry specication.

(34)

containing a module with a single CANAPP. Another possibility is to

strengthen the symmetry specication such that the CANAPP in ques-

tioncannotbepermuted. Theexperimentalresultspresentedin[65]isob-

tainedincongurationscontainingamodulewithasingleCANAPP.The

reasonfor thischoice wasthat strengtheningthesymmetry specication

required a re-implementation of the predicates expressing whether two

markings/bindingelementsaresymmetric;aquitecumbersometaskwhen

implementingthepredicatesbyhand. In Chapter4theconstructionof a

tool which automates the implementationof thepredicates is discussed.

Whenusingthistoolexperimentswithdierentsymmetryspecications,

e.g.,dierentkindofstrengthenedsymmetryspecications,caneasilybe

performedwithouta manual re-implementationofthepredicates.

Topology Independence.

Thispropertyisalsointhiscaseanalysedbyinvestigatingdierentcong-

urationsoftheowmetersystem. Thecongurationisdeterminedbythe

initialmarkingandineachcaseitmustbeensuredthattheinitialmark-

ing,M

0

,fullstherequirementforconsistency,i.e.,82:(M

0 )=M

0 .

The analysiswasdoneusingtheDesign/CPNOE/OStool[52] whichsupports

generation and analysis of SSPSs. However, the calculation of SSPSs are not

fully automatic; instead of assigning symmetry groups of permutations to the

atomic colour sets of the CP-net theuser of the toolis requiredto implement

twopredicatesexpressingwhentwomarkings/bindingelementsaresymmetric.

Furthermore,sincethepredicatesareusersupplied,itisalso theresponsibility

of the user to ensure that the predicates implements a consistent symmetry

specication, i.e., that thesymmetries used for thereduction is actually sym-

metries present intheCPN model.

As a part of the project an extension to the OE/OS tool was developed

which supports a semi automatic check for consistency. Consistency of the

symmetry specication ensures that symmetric markings have symmetric sets

ofenabledbindingelementsandsymmetricsetsofsuccessormarkings. Def.3.16

in [47] formally denes three requirementsthat must be fullledfor a symme-

try specicationtobeconsistent. Informallythedenitionstatesthat: 1)each

symmetry given by the symmetry specication must map the initial marking

to itself, 2) alltransitions have symmetricguards, i.e., treat symmetry colours

thesame way,and 3) all arc expressionsand symmetries given bythe symme-

try specication commutes. It is worth noticing that the three requirements

arestructural andtherefore can be checked withoutcalculating theoccurrence

sequences of theCP-net. Hence,the checkfor consistencyis invoked indepen-

dentlyofthestatespacegeneration. Sinceconsistencyensuresthatthedynamic

properties of the CP-net can be derived from the SSPSs the condensed state

space isonlycalculatedand analysedifthesymmetry specicationisfoundto

be consistent.

Thetoolextensionchecksthatthethreerequirementsarefullled. 1)canbe

checked byan iterationof allsymmetriesgiven bythesymmetryspecication.

(35)

whenthenumberofsymmetriesallowedbythesymmetryspecicationislarge.

UsingthetechniquespresentedinChapter3thecheckcanbeimplementedmore

eÆciently. 2) and 3) arechecked byconsidering eachguard and arcexpression

of the CP-net in turn. The check is based on a combination of semantic and

syntacticalchecks. Someguards/arcexpressionshavesyntacticrestrictionsthat

ensure that the consistency requirement is fullled, e.g., simple patterns like

variable names. Experimental results show that it is only the case for very

few guards/arc expressions that consistency cannot be determined using the

structuralcheck. Onlyinthatcaseasemanticcheckisperformed. Thesemantic

check is basedon evaluating the guard/arcexpression inall possiblebindings.

Asa consequencethesemanticcheckisverytimeconsumingbuttogetherwith

thesyntacticcheckitispossibletomakeafullyautomaticcheckforconsistency

fortheCPN modelof theowmetersystem.

2.3 Related Work

ThemaincontributionofthepaperistheapplicationofstatespacesandSSPSs

and the supportingtools in an industrial setting. In the following the results

fromtheDanfossproject[65]willbediscussedandcomparedtofouraspectsof

relatedwork: CP-netsandstate spacemethodsinindustrialsettings,temporal

logicsandmodelcheckinginvericationtools,thesymmetrymethodandmodel

checking, and nally,topologyindependenceand state space verication.

CP-nets and State Space Methods in Industrial Settings. CP-nets

and state spaces have been applied in a number of projects. In the following

the use of state spaces and the conclusions from the Danfoss project will be

comparedto other projects where state spaceshave beenapplied inindustrial

settings.

In [54] CP-nets is used for the modelling and analysis of a protocol for

remote object invocation in the object oriented programming language

BETA[68]. Thestructure ofthe modelledBETA systemhas similarities

to the modelledowmetersystemin[65]. In [54]theCPN model models

a number of user threads located in shells which are distributed among

a numberof ensembleswhereastheowmeter systemcontainsa number

of CANAPPs distributedamong a numberof modules. State spacesare

used for the analysis of the BETA system. Due to the state explosion

problem it was only possible to verify small congurations (up to three

user threads)ofthesystem. Netreductionsaresuggested toalleviatethe

stateexplosionproblembutdidnoleadtoanalysisoflargercongurations

of theBETA system.

[77]reportson anindustrialcooperationprojectwhereCP-netsareused

to design the software of a Dalcotech security system. State spaces are

used to investigate dynamic properties of the CPN model. Due to the

state explosion problema numberof simplicationsare donein order to

(36)

constructedforreducedscenariosand smallcongurationsof thesystem.

According to [77] the state space analysis lead to detection of approxi-

mately15non-trivial errors. Noattemptsaremade to alleviatethestate

explosion problem.

[94] reports on an industrial project where CP-nets are used for the

modellingofasoftwarearchitectureinNokiamobilephones. Thedynamic

propertiesof theCPN model areinvestigatedusingstate spaces. Dueto

the state explosion problem the state space cannot be constructed for

the full CPN model. Instead state spaces are constructed and analysed

for important sub-models. No attempts are made to alleviate the state

explosion problem. Instead it is envisioned that it will be possible to

construct the state space of thefullCPN modelon another architecture

that theCPNmodelisin theprocess of beingmoved to.

[18] reports on an industrial cooperation project where CP-nets and

state spacesare usedfor themodellingand analysis of a communication

protocol in the Bang&Olufsen BeoLink system. The CPN model is a

timedmodel[47] and,thus, hasainnitestate space. Branching options

of the Design/CPN OG tool [17] are exploited to obtain nite partial

state spaces of the initialisation phase of the communication protocol.

In order to make the CPN model suitable for state space analysis [18]

introducesboundson thebuersand considersonlysmallcongurations

of theBeoLinksystem.

What is common to the above four projects is that CP-nets and state spaces

havebeenappliedinindustrialsettings. Inallfourprojectsstatespacesareused

toverifythebasicpropertiesoftheCPNmodel;nottodoatotalvericationof

the system. All fourprojects encounter the state explosion problemand work

around the problem by making simplications of the models and considering

small congurations of the respective systems. However, all of the projects

statesthatstatespacessuccessfullyeitherdirectlydetectederrorsinthesystems

or resulted in an increased reliabilityof the systems. These observations are

consistent withtheconclusionsofthesecondphaseof theDanfossproject[65].

In the Danfoss project the state space analysis is taken a step further by

the application of SSPSs to alleviate the state explosion problem. Not many

papers report on the use of reduction techniques for state spaces of CP-nets

in industrial settings. [87] report on a project where state spaces and state

spaces withgeneral equivalences (OEgraphs) [15,47] are usedforthe analysis

ofinterworkingtraders. Tomyknowledge[65]istherstpaperreportingonthe

practicaluseofthesymmetrymethodforCP-netsinanindustrialsetting. The

useofsymmetriesyieldedsignicantreductioninthesizeofthestatespace,and

hence allowed analysis of congurations of the owmeter system which could

notbehandledwith fullstate spaces.

Temporal Logics and Model Checking in Verication Tools. In the

Danfossprojectthepropertiesareveriedfromthestatespaceusingbothproof

(37)

The proof rules are available in the Design/CPN OG tool as a set of query

functions [17] whereas verication of formulae specied in temporal logics is

supported bytheDesign/CPN OGtool libraryASK-CTL[20].

Temporallogicsiswidelyusedforthespecicationofpropertiesofsystems.

Severalvariantsexists,however, thebasicideaistobuildtemporallogicformu-

laefrom atomic propositions(relating to concepts of themodellinglanguage),

proportionaloperators,e.g.,_and ^,and temporaloperators,e.g.,2 (always)

and3(exists). Amongthetwomostwidelyusedvariantsoftemporallogicsare

Linear Temporal Logics (LTL)[92] and Computational TreeLogics (CTL) [22]

whichareusedasspecicationlanguagesinanumberofmodelcheckingtools:

LTL and CTLinPROD[76], LTLinSPIN[84], CTLinSMV [69,82], CTL in

PEP[74], and LTLand CTLintheCadence SMV Model Checker[83].

LTL and CTL can also be used for the verication of properties of CP-

nets. The Design/CPN OG tool library ASK-CTL [20], however, supports

the verication of properties specied in the language ASK-CTL [12]. ASK-

CTLis a both state and action oriented variant of CTL,thus ASK-CTLis an

extensionof CTLwhichmakesit possibleto alsoexpress properties about the

actions of the CP-net, i.e., the information labelling the edges. One of the

strengths of CP-nets compared to other modelling languages is that CP-nets

arebothstateandactionoriented. Thus,usingabothstateandactionoriented

specication language is potentially very useful when expressingproperties of

CP-nets. The absence of attribute corruption property veried in theDanfoss

project is concerned with the bindingsof three transitions in the CPN model

ofthe owmeter system. Hence,thepropertywasspeciedasan action-based

CTLformulainASK-CTL.

TheSymmetryMethodandModelChecking. Anumberofpaperscom-

binesymmetry and model checking of dierent temporal logics usingdierent

modellinglanguagesand representationsof thestate space. Belowanumberof

themostprominentapproaches arediscussed.

In [23] and [28] temporal model checking in the presence of symmetry is

investigated. The temporal logic consideredis CTL

which containsCTL and

LTLassubsetsandtheunderlyingmodelisanitestatesystem(KripkeModel).

Itisensuredthatthecondensedstate spaceobtainedpreservesthetruthvalue

oftheCTL

formulaveriedbyusingasymmetrygroupforthereductionwhich

iscontainedintheintersectionofsymmetriespresentinthemodelandthesym-

metriespresentintheformulato beveried. Thisapproachcorrespondsto the

suggested \strengthening"of thesymmetryspecicationin[65] to ensurethat

thesymmetrygroupusedforthereductionleavesthetruthvalueoftheatomic

state propositionsof theabsenceof attribute corruptionformulainvariant.

[30]and[38]presentsworkontheuseofthesymmetrymethodwhenmodel

checking under fairness assumptions. The basic idea is to restrict the model

checkingto fair executions 2

of thesystembeinganalysed.[30] considersmodel

checking of CTL

whereas [38] deals with LTL. The work in [30] and [38] is

2

Executions can be considered fair if they full some fairness requirement, e.g., strong

(38)

motivated by the fact that theapproaches presented in [23] and [28] intersect

thesymmetriesofthesystemwiththesymmetriesoftheformulatobeveried

and,hence,whenfairnessisincorporatedintheformulaoftenfailtoobtainany

reductionat all.

In[23] theuseofthesymmetrymethod insymbolicmodelcheckingiscon-

sidered. In symbolic model checking Binary Decision Diagrams (BDDs) are

used to calculate and represent thestate space. The complicationscaused by

the use of BDDs are investigated and it is shown that with some symmetry

groups(rotations andthegroup ofall permutations)thesizeof theBDD used

to represent the orbit relation, i.e., the equivalence relation expressing when

states are symmetric, grows exponentially in the minimum of the number of

components and the number of states in the component. The reason BDDs

doesnotworkwellwiththesymmetrymethodiscausedbythelackofcorrela-

tion between the size of thestate space and the sizeof the BDD representing

thestate space. Hence,areductioninthesizeof thestate space may resultin

increasedsizeof theBDD.

Topology IndependenceandStateSpaceVerication In[65]thetopol-

ogy independence property was not completely veried since it required state

spacesto beconstructed forall possible(innitelymany)congurations ofthe

owmeter system, i.e., initial markings of the CPN model constructed in the

Danfoss project. This recurrent problem of the state space method has been

studied in,e.g., [36,91].

In[36] acombinationofstate spacesandinductionisusedtodoacomplete

verication of a CPN model of an arbiter cascade. State spaces are used to

prove that a single arbiter possesses some desired properties. This is followed

by the use of mathematical induction to prove that thiswasalso the case for

arbiter cascades ofarbitrary depth.

[91] presents results where the correctness of innite parameterised fami-

liesofsystemsareestablishedusingprocess-algebraiccompositionalnitestate

vericationtechniques. Thebasicideaisto construct alabelledtransition sys-

tem that represent the behaviour of a single component of the parameterised

system. The global behaviour of the system is investigated starting from a

subsystem such that it contains a minimum number of components and in-

crementally adding more components. In each iteration the behaviour of the

composed system is compared to the behaviour of the previous system. This

procedure is continued until a x-point is reached, i.e., the behaviour of the

systemwith n+1componentsis equivalentto the behaviour ofa systemwith

n component (ifsucha xpoint exists, otherwisethe methodfails).

Referencer

RELATEREDE DOKUMENTER

(The term Coloured Petri Nets is henceforth abbreviated as CP-nets or CPN.) Our application domain is distributed systems which is partly chosen due to the case studies carried

need to declare that Machine is a formal parameter by adding the name of the parameter in the parameter specication inside the manufacturing cell module itself.. As a

In the rst assignment the students design and validate a layered communication protocol in a distributed system by means of Coloured Petri Nets (henceforth abbreviated as CP-nets

In this paper, we describe the computer tool Design/CPN supporting editing, simulation, and state space analysis of Coloured Petri Nets.. So far, approximately 40 man-years have

Nets and their symbolic reachability graph arose from pursuing more ecient methods for Petri Net based performance evaluation: The complexity of the method applied to derive

Kristensen, \Computer Aided Verication of Lamport's Fast Mutual Exclusion Algorithm Using Coloured Petri Nets and Occurrence Graphs with Symmetries,&#34; Tech. Rep., Computer

There are four basic classes of formal analysis methods: construction of occurrence graphs (representing all reachable mark- ings), calculation and interpretation of system

In [EW90] it was shown how Petri nets can naturally be made into models of Girard’s linear logic in such a way that many properties one might wish to state of nets become expressible