ebook img

Code Generation from Pragmatics Annotated Coloured Petri Nets PDF

297 Pages·2017·10.25 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Code Generation from Pragmatics Annotated Coloured Petri Nets

Downloaded from orbit.dtu.dk on: Jan 07, 2023 Code Generation from Pragmatics Annotated Coloured Petri Nets Simonsen, Kent Inge Publication date: 2015 Document Version Publisher's PDF, also known as Version of record Link back to DTU Orbit Citation (APA): Simonsen, K. I. (2015). Code Generation from Pragmatics Annotated Coloured Petri Nets. Technical University of Denmark. DTU Compute PHD-2014 No. 345 General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights.  Users may download and print one copy of any publication from the public portal for the purpose of private study or research.  You may not further distribute the material or use it for any profit-making activity or commercial gain  You may freely distribute the URL identifying the publication in the public portal If you believe that this document breaches copyright please contact us providing details, and we will remove access to the work immediately and investigate your claim. Code Generation from Pragmatics Annotated Coloured Petri Nets by Kent Inge Fagerland Simonsen Kongens Lyngby 2014 PHD-2014-345 Technical University of Denmark Department of Applied Mathematics and Computer Science Matematiktorvet, building 303B, 2800 Kongens Lyngby, Denmark Phone +45 4525 3351 [email protected] www.compute.dtu.dk PHD-2014-345 Summary (English) All electronic communication relies on communication protocols. It is therefore veryimportantthatprotocolsarecorrectandthatprotocolimplementationsare reliable. Coloured Petri Nets (CPNs) have been widely used to model, analyse and verify communication protocols. However, relatively limited work has been doneontransformingCPNmodeltoprotocolimplementations. Thegoalofthe thesis is to be able to automatically generate high-quality implementations of communication protocols based on CPN models. In this thesis, we develop a methodology for generating implementations of protocols using a sub-class of CPNs, called Pragmatics Annotated CPNs (PA- CPNs). PA-CPNs give structure to the protocol models and allows the models to be annotated with code generation pragmatics. These pragmatics are used by our code generation approach to identify and execute the appropriate code generation templates. The templates hold the information needed to transform the model to a fully working protocol implementation for a target platform. The code generation approach coupled with PA-CPNs provide a flexible way to perform code generation for communication protocols. The code generation approach has been implemented in a prototype tool called PetriCode. We defined several criteria for our code generation approach, the approach should be scalable so that is can be used to generate code for industrial sized protocols. The models should be verifiable and it should be possible to perform efficient verification on the models. The approach and the models that are em- ployed for code generation should be platform independent in the sense that it should be possible to generate code for a wide range of platforms based on the same model. The generated code should be integrable meaning that it should ii beabletousedifferentthirdpartylibrariesandthecodeshouldbeeasilyusable by third party code. Finally, the code should be readable by developers with expertise on the considered platforms. Inthisthesis,weshowthatourcodegenerationapproachisabletogeneratecode forawiderangeofplatformswithoutalteringthePA-CPNmodelthatdescribe the protocol design. The generated code is also shown to be readable and we demonstrate that a generated implementation can be easily integrated with third party software. We also show that our approach scales to industrial sized protocolsbyapplyingourapproachtogeneratecodefortheWebSocketprotocol. The WebSocket protocol creates a message-based two-way channel that can be used by web applications. This allows web applications to communicate with the server much more efficiently than using the traditional request-response pattern for certain application types such as games and rich web applications. Finally, we conclude the evaluation of the criteria of our approach by using the WebSocket PA-CPN model to show that we are able to verify fairly large protocols. Summary (Danish) Alt elektronisk kommunikation bygger på kommunikasjonsprotokoller. Det er derforviktigtatprotokollererkorrekteogatimplementationerafprotokollerer pålidelige. Farvede Petri Nets (CPNs) har været bredt anvendt til modellering, analyseogverifikationafkommunikationsprotokoller,mendereksistererrelativt begrænsede forskningsresultater for at transformere CPN modeller til protokol implementationer.Måletmeddenneafhandlingeratgøredetmuligtautomatisk atgenererehøj-kvalitetsimlementationerafkommunikationsprotokollerbaseret på CPN modeller. I denne afhandling utvikles en metode for at generere implementationer af pro- tokollerbaseretpåenunderklasseavCPNmodellerkaldetPragmatic-Annoterede CPN (PA-CPN) modeller. PA-CPN modeller giver struktur til protokolmodel- ler og tillader modellerne at blive annoteret med kodegenereringspragmatikker. Pragmatikkernebliverbrukttilatidentificereogutførekodegenereringsskabelo- ner. Skabelonerne inndeholder den information som skal til for at transformere en model til en komplet kørende implementation for en given platform. Tilgan- gen til kode generering koblet med PA-CPN modeller udgør en fleksibel måde at generere kode for kommunikationsprotokoller. Kodegenereringsmetoden er implementeret i en prototype værktøj kaldet PetriCode. Vi opstiller flere kriterier for tilgangen til kodegenerering. Den skal være ska- lerbar for at den kan brukes til at generere kode for protokoller af industriel størrelse. Modellerne skal være verificerbare og det skal være muligt at utføre verifikationen på modellerne effektivt. Tilgangen og de modeller som anvendes til kodegenerering skal være platform uafhængige hvilket betyder at det skal være muligt at gererere kode for et bred spektrum af platforme baseret på den iv Summary (Danish) samme model. Den genererede kode skal være integrerbar så den kan bruges af trejdeparts biblioteker og koden skal let kunne brukes af tredjeparts kode. Endelig skal den genererede kode være læsbar af utviklere med ekspertise på de platforme som der genereres kode til. I afhandlingen viser vi hvordan vores tilgang til kode generering kan generere kode for et bredt spektrum af platforme uden at ændre i den PA-CPN mo- del som beskriver protokol designet. Vi viser at den genererede kode er læsbar og at den let kan integreres i trejdeparts software. Vi viser også at vores til- gang skalerer til protokoller af industriel størrelse ved at anvende den til at generere kode for WebSocket protokollen. WebSocket protokollen giver en be- skedorienteret tovejskanal som kan bruges av web-applikationer. Dette tillader web-applikationeratkommunikeremedenservermereeffektivtendvedatbru- ge det traditionelle request-respons mønster for applikationer som eksempelvis spil og klient-tunge web applikationer. Vi afslutter evalueringen af kriterier for metoden ved at bruge PA-CPN modellen af WebSocket protokollen til at de- monstrere at vi kan verificere komplekse protokoller. Preface This thesis was prepared at the department of Applied Mathematics and Com- puter Science at the Technical University of Denmark in fulfilment of the re- quirementsforacquiringaPh.D.inInformatics. Theauthorhasbeenemployed as a Ph.D. research fellow at the Department of Computing, Mathematics, and Physics at Bergen University College supported by the strategic research pro- gram on Software Technologies for Distributed Systems (DISTECH). The thesis deals with automatically generating implementations of communica- tionprotocols. ThisfillsagapintheecosystemaroundtheColouredPetriNets modelling language that is supported by the CPN Tools modelling tool. The thesis consists of a collection of several papers and an overview article. All but one of the papers have been published at peer reviewed conferences and workshops. The overview article gives an overview of the results contained in the papers and puts it into a coherent context via a discussion of related work found in the literature. Bergen, 30-August-2014 Kent Inge Fagerland Simonsen vi Acknowledgements Iwouldnothavebeenabletowritethisthesiswithoutthehelpandsupportfrom many people and institutions. First of all, I would like to thank my supervisors Lars Michael Kristensen and Ekkart Kindler for their invaluable support and guidance throughout this project. I am grateful for all the time and effort they havedevotedtothisproject. Theinputandadvicetheyhavegivenmethrough moreorlessregularmeetingsandlessregularconferencecallshavebeencrucial to completing this thesis. Also, the seemingly endless stream of comments and corrections on the text of this theses and the attached papers have elevated the quality of the work significantly. IwouldalsoliketothanktheBergenUniversityCollege(BUC)andthedepart- mentofcomputing,mathematicsandphysicsforallowingmetoembarkonthis project and paying my bills. Also, I want to thank the Technical University of Denmark (DTU) and the section for software engineering at DTU Compute for allowing me, as a non-employee of DTU, to enter its Ph.D. program. The staff at BUC and DTU is also to be thanked for making me feel welcome at both institutions. And a special thanks should be extended to Sven-Olai Høyland for all the help with teaching Android and Java programming. A special thanks also goes out to Adrian Rutle, who encouraged me to apply for the PhD research fellow position at BUC, even though I applied for the wrong position. IalsothankmyfellowPh.D.studentsandothercollegesatBUCandDTUwho I have shared many a laugh with. Especially I want to that Florian Mantz and Piotr Henryk Kazmierczak whom I have also shared office with from the very

Description:
Publisher's PDF, also known as Version of record. Link back to DTU Code Generation from Pragmatics Annotated Coloured. Petri Nets. Kgs. Lyngby: Technical University of Denmark (DTU). (DTU Compute PHD-2014; No. 345). Technical Report IMM-Technical Reports-2013-01, Technical Univer-.
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.