Article information
2019 , Volume 24, ¹ 6, p.60-68
Leontev D.D., Odyakova D.S., Parakhin R.V., Kharitonov D.I.
Exceptions modelling in imperative programs in terms of Petri Nets
The purpose of the article is to propose an approach to the automatic generation of models of imperative programs with exceptions from the source code. Methodology. The approach defines consecutive transformations of the program beginning from the source code to the parsing tree of the program, then to an abstract semantic graph and finally to a compositional model in terms of Petri nets. Transformations are based on a set of formal principles and relations and can be performed without human intervention purely algorithmically. To build a model from the program abstract semantic graph, templates and composition rules are used. Templates describe in terms of Petri net the basic constructions of imperative programming languages: expressions, branching, loops, choice and function call. Findings. A set of templates for modelling the exception handling mechanism is described. This set includes templates for the try and catch blocks describing the processing of the exception in local places of the program, the throw operator to signal the exception, and the operator of the function call with exceptions. Îriginality/value. The article demonstrates that the proposed set of templates allows building a complete model of the program with exceptions, consisting of several functions. The resulting program model makes it possible to analyze the program behavior by standard for Petri nets formal methods. In particular, a possibility of an abnormal termination due to an exceptional situation can be validated and where each particular exception is handled as well as what exceptions are handled in a particular catch block.
[full text] [link to elibrary.ru]
Keywords: programming languages, automatic construction of program models, verification of programs, Petri nets
doi: 10.25743/ICT.2019.24.6.008.
Author(s): Leontev Denis Denis Vasilevich Position: Research Scientist Office: Institute of Automation and Control Processes Far Eastern Branch of the Russian Academy of Sciences Address: 690041, Russia, Vladivostok, 5, Radio st
Phone Office: (423)232-0702 E-mail: devozh@dvo.ru SPIN-code: 4726-6260Odyakova Daria Sergeevna Position: engineer Office: Institute of Automation and Control Processes, FEB RAS Address: 690041, Russia, Vladivostok, 5, Radio St.
Phone Office: (423) 232 07 02 E-mail: darlene@dvo.ru Parakhin Roman Valeryevich Position: engineer Office: Institute of Automation and Control Processes, FEB RAS Address: 690041, Russia, Vladivostok, 5, Radio St.
Phone Office: (423) 232 07 02 E-mail: fadak@dvo.ru SPIN-code: 3769-9789Kharitonov Dmitriy Ivanovich PhD. Position: Senior Research Scientist Office: Institute of Automation and Control Processes, FEB RAS Address: 690041, Russia, Vladivostok, 5, Radio st.
Phone Office: (423) 232-0702 E-mail: demiurg@dvo.ru
References:
[1] Goodenough, J.B. Exception Handling: Issues and a Proposed Notation. Commun. ACM. 1975; 18(12):683–696.
[2] Goldberg, A., Robson, D. Smalltalk-80: The Language and Its Implementation. Boston: Addison-Wesley Longman Publishing Co.; 1983: 714.
[3] Stroustrup, B. The C++ Programming Language, 4th edition. Boston: Addison-Wesley Professional; 2013: 1376.
[4] J. Gosling, B. Joy, G. L. Steele, G. Bracha, A. Buckley The Java Language Specification, Java SE. 8 Edition. Boston: Addison-Wesley Professional; 2014: 685.
[5] The Python Language Reference. Available at: https://docs.python.org/3/reference/ (accessed 01.10.2019).
[6] Flanagan, D., Matsumoto, Y. The Ruby Programming Language. Sebastopol: O’Reilly; 2008: 448.
[7] Mayer W., Stumptner M., Wotawa F. Debugging program exceptions. Fourteenth International Workshop on Principles of Diagnosis (DX-03). Washington: Institute of Software Technology; 2003:119–124.
[8] Amighi, A., de C. Gomes, P., Gurov, D., Huisman M. Sound control-flow graph extraction for java programs with exceptions. Proceedings of the 10th International Conference on Software Engineering and Formal Methods. Berlin: Springer-Verlag; 2012:33– 47.
[9] Kastrinis, G., Smaragdakis, Y. Efficient and Effective Handling of Exceptions in Java Points-to Analysis. Proceedings of the 22Nd International Conference on Compiler Construction. Berlin: Springer-Verlag; 2013:41–60.
[10] Robillard, M.P., Murphy, G.C. Designing robust JAVA programs with exceptions. Proceedings of the 8th ACM SIGSOFT International Symposium on Foundations of Software Engineering. New York: ACM Press; 2000; 25(6):2–10.
[11] Tarasov, G.V., Kharitonov, D.I., Golenkov, E.A. On a function representation in an imperative program model specified by Petri Nets. Modeling and Analysis of Information Systems. 2011; 18(2):18–38. (In Russ.)
[12] Kharitonov, D., Tarasov, G. Modeling function calls in program control flow in terms of Petri Nets. Advances in Computer Science: an International Journal. 2014; 3(6):82–91.
Bibliography link: Leontev D.D., Odyakova D.S., Parakhin R.V., Kharitonov D.I. Exceptions modelling in imperative programs in terms of Petri Nets // Computational technologies. 2019. V. 24. ¹ 6. P. 60-68
|