Abstract
This paper presents an approach to show how to implement three complex statements: continue, break, return of Python to XD-M language. To this end, three algorithms for implementing three complex statements are given in detail. Further, three complex statements are implemented in XD-M. Finally, a program example is presented to illustrate how to use the proposed approach to build an XD-M program equivalent to the original Python program.
The research is supported by the National Key Research and Development Program of China (2018AAA0103202); National Natural Science Foundation of China (62172322, 61751207, 61732013); Shannxi Key Science and Technology Innovation Team Project (2019TD-001); Natural Science Basic Research Program of Shaanxi Province (2022JM-367).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
P2M: A Python to XD-M translator. https://github.com/FairyJiar/P2M
Python AST Document. https://docs.python.org/3/library/ast.html
Python Homepage. https://www.python.org/
Allen, F.E.: Control flow analysis. ACM SIGPLAN Notices 5(7), 1–19 (1970)
Baker, B.S., Kosaraju, S.R.: A comparison of multilevel break and next statements. J. ACM (JACM) 26(3), 555–566 (1979)
Bowman, H., Thompson, S.: A decision procedure and complete axiomatization of finite interval temporal logic with projection. J. Logic Comput. 13(2), 195–239 (2003)
Chen, W.: Loop invariance with break and continue. Sci. Comput. Program. 209, 102679 (2021)
Duan, Z.: Temporal Logic and Temporal Logic Programming. Science Press, Beijing (2005)
Duan, Z., Tian, C.: A practical decision procedure for propositional projection temporal logic with infinite models. Theoret. Comput. Sci. 554, 169–190 (2014)
Duan, Z., Tian, C., Zhang, N.: A canonical form based decision procedure and model checking approach for propositional projection temporal logic. Theoret. Comput. Sci. 609, 544–560 (2016)
Duan, Z., Yang, X., Koutny, M.: Framed temporal logic programming. Sci. Comput. Program. 70(1), 31–61 (2008)
Hammond, M., Robinson, A.: Python Programming on Win32: Help for Windows Programmers. O’Reilly Media, Inc., Sebastapol (2000)
Lomet, D.B.: Control structures and the RETURN statement. In: Watson T.J., (ed.) IBM Research Division (1973)
Rosner, R., Pnueli, A.: A choppy logic. Weizmann Institute of Science, Department of Applied Mathematics (1986)
Sorva, J., Vihavainen, A.: Break statement considered. ACM Inroads 7(3), 36–41 (2016)
Taft, S.T.: Implementing the extended return statement for ADA 2005. In: Proceedings of the 2008 ACM Annual International Conference on SIGAda Annual International Conference, pp. 97–104 (2008)
Tian, C., Duan, Z., Duan, Z.: Making CEGAR more efficient in software model checking. IEEE Trans. Softw. Eng. 40(12), 1206–1223 (2014)
Wang, X., Tian, C., Duan, Z., Zhao, L.: MSVL: a typed language for temporal logic programming. Front. Comput. Sci. 11(5), 762–785 (2017)
Zhang, N., Duan, Z., Tian, C.: A mechanism of function calls in MSVL. Theoret. Comput. Sci. 654, 11–25 (2016)
Zhang, N., Duan, Z., Tian, C.: Model checking concurrent systems with MSVL. Sci. China Inf. Sci. 59(11), 1–3 (2016)
Author information
Authors and Affiliations
Corresponding authors
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Wang, J., Zhang, N., Duan, Z. (2022). Three Algorithms for Converting Control Flow Statements from Python to XD-M. In: Ni, Q., Wu, W. (eds) Algorithmic Aspects in Information and Management. AAIM 2022. Lecture Notes in Computer Science, vol 13513. Springer, Cham. https://doi.org/10.1007/978-3-031-16081-3_40
Download citation
DOI: https://doi.org/10.1007/978-3-031-16081-3_40
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-16080-6
Online ISBN: 978-3-031-16081-3
eBook Packages: Computer ScienceComputer Science (R0)