Preview

Proceedings of the Institute for System Programming of the RAS (Proceedings of ISP RAS)

Advanced search

Automatic Code Generation from Nested Petri nets to Event-based Systems on the Telegram Platform

https://doi.org/10.15514/ISPRAS-2016-28(3)-5

Abstract

Nested Petri net formalisms is an extension of coloured Petri net formalism that uses Petri Nets as tokens. The formalism allows creating comprehensive models of multi-agent systems, simulating, verifying and analyzing them in a formal and rigorous way. Multi-agent systems are found in many different fields - from safety critical systems to everyday networks of personal computational devices; and, their presence in the real world in increasing with the increasing number of mobile computational devices. While several methods and tools were developed for modelling and analysis of NP-nets models, the synthesis part of multi-agent systems development via NP-nets is still under active development. The widely used method of automatic generation of target system code from designed and verified formal models ensures obtaining correct systems from correct models. In this paper, we demonstrate how Nested Petri net formalism can be applied to model search-and-rescue coordination systems and automatically generate implementation in the form of the executable code for event-driven systems based on the Telegram platform. We augment the NP-nets models with Action Language annotation, which enables us to link transition firings on the model level to Telegram Bot API calls on the implementation level. The suggested approach is illustrated by the example annotated model of a search and rescue coordination system.

About the Authors

D. I. Samokhvalov
National Research University Higher School of Economics
Russian Federation


L. W. Dworzanski
National Research University Higher School of Economics
Russian Federation


References

1. Telegram Bot API online documentation. [Online]. Available at: https://core.telegram.org/bots/api

2. L. Chang, X. He, J. Li, and S. M. Shatz. Applying a Nested Petri Net Modelling Paradigm to Coordination of Sensor Networks with mobile agents. In Proc. of Workshop on Petri Nets and Distributed Systems. Xian, China, 2008, pp. 132–145.

3. I. A. Lomazova, “Nested Petri Nets - a Formalism for Specification and Verification of Multi-Agent Distributed Systems,”Fundamenta Informaticae, vol. 43, no. 1, pp. 195–214, 2000.

4. Nested Petri nets: Multi-level and Recursive Systems. Fundamenta Informaticae, vol. 47, no. 3-4, pp. 283–293, Oct 2001.

5. Nested Petri Nets for Adaptive Process Modelling. In Pillars of Computer Science, ser. Lecture Notes in Computer Science, A. Avron, N. Dershowitz, and A. Rabinovich, Eds. Springer Berlin Heidelberg, 2008, vol. 4800, pp. 460–474.

6. K. Hoffmann, H. Ehrig, and T. Mossakowski. High-Level Nets with Nets and Rules as Tokens. In ICATPN, 2005, pp. 268–288.

7. D. Frumin and L. Dworzanski. NPNtool: Modelling and Analysis Toolset for Nested Petri Nets. In Proceedings of the 7th Spring/Summer Young Researchers Colloquium on Software Engineering, 2013, pp. 9–14.

8. L. Dworzanski and I. A. Lomazova. CPN Tools-Assisted Simulation and Verification of Nested Petri Nets. Automatic Control and Computer Sciences, vol. 47, no. 7, pp. 393–402, 2013.

9. L. Dworzanski and I. A. Lomazova. On Compositionality of Boundedness and Liveness for Nested Petri Nets. Fundamenta Informaticae, vol. 120, no. 3-4, pp. 275–293, 2012.

10. The Ministry of the Russian Federation for Civil Defence. Emergencies and Elimination of Consequences of Natural Disasters. Emergency Cases Registered in Russia. [Online]. Available at: http://25.mchs.gov.ru/document/2644168

11. (2013) United States Coast Guard Search and Rescue Summary Statistics. [Online]. Available at: https://www.uscg.mil/hq/cg5/cg534/SARfactsInfo/SAR%20Sum%20Stats%2064-13.pdf

12. T. Parr. The Definitive ANTLR 4 Reference. 2nd ed. Pragmatic Bookshelf, 2013.

13. L. Dworzanski and I. A. Lomazova. Automatic Construction of Distributed Component System from Nested Petri Nets. In print, Programmirovanie, vol.6, 2016 (in Russian).

14. B. Selic. The Pragmatics of Model-Driven Development. IEEE Software, vol. 20, no. 5, p. 19, 2003.

15. A. Knapp and S. Merz. Model Checking and Code Generation for UML State Machines and Collaborations. Proc. 5th Wsh. Tools for System Design and Verification, pp. 59–64, 2002.

16. D. Kundu, D. Samanta, and R. Mall. Automatic Code Generation From Unified Modelling Language Sequence Diagrams. Software, IET, vol. 7,no. 1, pp. 12–28, 2013.

17. P. Morozkin, I. Lavrovskaya, V. Olenev, and K. Nedovodeev. Integration of SDL Models into a SystemC Project for Network Simulation. In SDL 2013: Model-Driven Dependability Engineering: 16th International SDL Forum, Montreal, Canada, June 26-28, 2013. Proceedings. Springer Berlin Heidelberg, 2013, pp. 275–290.

18. L. Gomes, J. P. Barros, A. Costa, and R. Nunes. The Input-Output Place-Transition Petri Net Class and Associated Tools. In Industrial Informatics, 2007 5th IEEE International Conference on, vol. 1. IEEE, 2007, pp. 509–514.

19. R. Campos-Rebelo, F. Pereira, F. Moutinho, and L. Gomes. From IOPT Petri Nets to C: An Automatic Code Generator Tool. In Industrial Informatics (INDIN), 2011 9th IEEE International Conference on.

20. D. Zaitsev and J. Jurjens. Programming in the Sleptsov Net Language For Systems Control. Advances in Mechanical Engineering, vol. 8, no. 4, p. 1-11, 2016. DOI: 10.1177/1687814016640159.

21. K. H. Mortensen. Automatic Code Generation Method Based on Coloured Petri Net Models Applied on an Access Control System. In Application and Theory of Petri Nets 2000. Springer, 2000, pp. 367–386.

22. M. L. F. Venero and F. S. C. da Silva. Model Checking Multi-Level and Recursive Nets. Software & Systems Modeling, pp. 1–28, 2016.


Review

For citations:


Samokhvalov D.I., Dworzanski L.W. Automatic Code Generation from Nested Petri nets to Event-based Systems on the Telegram Platform. Proceedings of the Institute for System Programming of the RAS (Proceedings of ISP RAS). 2016;28(3):65-84. https://doi.org/10.15514/ISPRAS-2016-28(3)-5



Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.


ISSN 2079-8156 (Print)
ISSN 2220-6426 (Online)