Abstract
This article proposes an approach to modeling imperative programs with exceptions in terms of Petri nets using template based translation of the source code into compositional model. To achieve deep automation of the model constructing algorithm for the intermediate representation of the program, an abstract semantic graph (ASG) is used. ASG terms are presented in graphical form in the article. For these terms, a minimal set of template Petri nets is presented and described. An example of a small program is presented and a complete model of the example program has been built and the resulting compositional Petri net is presented. The reachability graph of resulting model is build, analyzing which, one can find and trace back the points of exception raise. So the proposed approach allows to check where each particular exception is handled and which exceptions are handled in a particular catch block #CSOC1120.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Goodenough, J.B.: Structured exception handling. In: Proceedings of the 2nd ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, POPL 1975, pp. 204–224. ACM, New York (1975). https://doi.org/10.1145/512976.512997
Goodenough, J.B.: Exception handling: issues and a proposed notation. Commun. ACM 18(12), 683–696 (1975). https://doi.org/10.1145/361227.361230
Goldberg, A., Robson, D.: Smalltalk-80: The Language and Its Implementation. Addison-Wesley Longman Publishing Co., Inc., Boston (1983)
Stroustrup, B.: The C++ Programming Language, 4th edn. Addison-Wesley Professional, Boston (2013)
Gosling, J., Joy, B., Steele, G.L., Bracha, G., Buckley, A.: The Java Language Specification, Java SE 8 Edition, 1st edn. Addison-Wesley Professional, Boston (2014)
Rossum, G.: Python reference manual. Technical report, CWI (Centre for Mathematics and Computer Science), Amsterdam, The Netherlands (1995)
Flanagan, D., Matsumoto, Y.: The Ruby Programming Language, 1st edn. O’Reilly, Sebastopol (2008)
Mayer, W., Stumptner, M., Wotawa, F.: Debugging program exceptions. In: Ali, M., Dapoigny, R. (eds.) Fourteenth International Workshop on Principles of Diagnosis (DX-2003), pp. 119–124 (2003)
Amighi, A., de Gomes, P.C., Gurov, D., Huisman, M.: Sound control-flow graph extraction for Java programs with exceptions. In: Proceedings of the 10th International Conference on Software Engineering and Formal Methods, SEFM 2012, pp. 33–47. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-33826-7_3
Kastrinis, G., Smaragdakis, Y.: Efficient and effective handling of exceptions in Java points-to analysis. In: Proceedings of the 22nd International Conference on Compiler Construction, CC 2013, pp. 41–60. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-37051-9_3
Robillard, M.P., Murphy, G.C.: Designing robust Java programs with exceptions. SIGSOFT Softw. Eng. Notes 25(6), 2–10 (2000). https://doi.org/10.1145/357474.355046
Kharitonov, D., Tarasov, G., Golenkov, E.: Modeling of object-oriented programs with Petri Net structured objects. Comput. Inform. 36(5), 1063–1087 (2017). http://doi.org/10.4149/cai _2017 _5_ 1063
Kharitonov, D., Tarasov, G.: Modeling function calls in program control flow in terms of Petri Nets. Adv. Comput. Sci. Int. J. 3(6), 82–91 (2014). http://www.acsij.org/acsij/article/view/151
Vizovitin, N.V., Nepomniaschy, V.A., Stenenko, A.A.: Verifying UCM specifications of distributed systems using colored Petri Nets. Cybern. Syst. Anal. 51(2), 213–222 (2015). https://doi.org/10.1007/s10559-015-9714-0
Vizovitin, N., Nepomniaschy, V., Stenenko, A.: Verification of UCM models with scenario control structures using coloured Petri nets. Syst. Inform. 11–22 (2016). https://doi.org/10.31144/si.2307-6410.2016.n7.p11-22
Kurbatsky, E.: Verification of automata-based programs. In: Proceedings of the Second Spring Young Researchers Colloquium on Software Engineering, vol. 2, pp. 15–17. Institute for System Programming of the Russian Academy of Sciences (2008). https://doi.org/10.15514/syrcose-2008-2-15
Gurov, V.S., Mazin, M.A., Narvsky, A.S., Shalyto, A.A.: Tools for support of automata-based programming. Program. Comput. Softw. 33(6), 343–355 (2007). https://doi.org/10.1134/s0361768807060059
Acknowledgment
Financial support provided by the state-funded theme of the Ministry of Education and Science of the Russian Federation No. AAAA-A17-117040450019-8 is greatly appreciated.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this paper
Cite this paper
Leontev, D.V., Kharitonov, D.I., Odyakova, D.S., Parakhin, R.V. (2020). An Approach to Using Templates for Modeling Exceptions in Terms of Petri Nets. In: Silhavy, R. (eds) Intelligent Algorithms in Software Engineering. CSOC 2020. Advances in Intelligent Systems and Computing, vol 1224. Springer, Cham. https://doi.org/10.1007/978-3-030-51965-0_20
Download citation
DOI: https://doi.org/10.1007/978-3-030-51965-0_20
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-51964-3
Online ISBN: 978-3-030-51965-0
eBook Packages: Intelligent Technologies and RoboticsIntelligent Technologies and Robotics (R0)