Abstract
I present a new method for specifying and verifying the partial correctness of sequential programs. The key observation is that, in Hoare logic, assertions are used as selectors of states, that is, an assertion specifies the set of program states that satisfy the assertion. Hence, the usual meaning of the partial correctness Hoare triple \(\{f\}\,P \,\{g\}\): if execution is started in any of the states that satisfy assertion f, then, upon termination, the resulting state will be some state that satisfies assertion g. There are of course other ways to specify a set of states. Given a program \(\alpha \), the post-states of \(\alpha \) are the states that \(\alpha \) may terminate in, given that \(\alpha \) starts executing in an arbitrary initial state. I introduce the operational triple \([\alpha ]\,P \,[\beta ]\) to mean: if execution of \(P \) is started in any post-state of \(\alpha \), then upon termination, the resulting state will be some post-state of \(\beta \). Here, \(\alpha \) is the pre-program, and plays the role of a pre-condition, and \(\beta \) is the post-program, and plays the role of a post-condition.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Attie, P.C.: Operational annotations: A new method for sequential program verification. CoRR abs/2102.06727 (2021). https://arxiv.org/abs/2102.06727
Back, R., von Wright, J.: Refinement Calculus - A Systematic Introduction. Graduate Texts in Computer Science. Springer (1998). https://doi.org/10.1007/978-1-4612-1674-2
Ciobâcă, Ş, Lucanu, D., Rusu, V., Roşu, G.: A language-independent proof system for full program equivalence. Formal Aspects Comput. 28(3), 469–497 (2016). https://doi.org/10.1007/s00165-016-0361-7
Crole, R.L., Gordon, A.D.: Relating operational and denotational semantics for input/output effects. Math. Struct. Comput. Sci. 9(2), 125–158 (1999). http://journals.cambridge.org/action/displayAbstract?aid=44797
Dijkstra, E.W.: Guarded commands, nondeterminacy and formal derivation of programs. Commun. ACM 18(8), 453–457 (1975)
Floyd, R.: Assigning meanings to programs. In: Mathematical Aspects of Computer Science. Proceedings of Symposium on Applied Mathematics, pp. 19–32. American Mathematical Society (1967)
Francez, N.: Program verification. Addison-Wesley, International computer science series (1992)
Hoare, C.A.R.: Communicating Sequential Processes. Prentice-Hall (1985)
Hoare, C.A.R., et al.: Laws of programming. Commun. ACM 30(8), 672–686 (1987). https://doi.org/10.1145/27651.27653
Hoare, C.: An axiomatic basis for computer programming. Commun. ACM 12(10), 576–580, 583 (1969)
Hoare, T.: Laws of programming: the algebraic unification of theories of concurrency. In: Baldan, P., Gorla, D. (eds.) CONCUR 2014. LNCS, vol. 8704, pp. 1–6. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-44584-6_1
Jacobs, B.: Dijkstra and Hoare monads in monadic computation. Theor. Comput. Sci. 604, 30–45 (2015). https://doi.org/10.1016/j.tcs.2015.03.020
Lucanu, D., Rusu, V.: Program equivalence by circular reasoning. Formal Aspects Comput. 27(4), 701–726 (2014). https://doi.org/10.1007/s00165-014-0319-6
Lynch, N.A., Tuttle, M.R.: An introduction to input/output automata. CWI-Quarterly 2(3), 219–246 (1989), centrum voor Wiskunde en Informatica, Amsterdam, The Netherlands. Technical Memo MIT/LCS/TM-373, Laboratory for Computer Science, Massachusetts Institute of Technology, Cambridge, MA 02139, November 1988
Lynch, N.A., Vaandrager, F.W.: Forward and backward simulations: I. Untimed systems. Inf. Comput. 121(2), 214–233 (1995). https://doi.org/10.1006/inco.1995.1134
Milner, R. (ed.): A Calculus of Communicating Systems. LNCS, vol. 92. Springer, Heidelberg (1980). https://doi.org/10.1007/3-540-10235-3
Milner, R.: Communicating and mobile systems - the Pi-calculus. Cambridge University Press (1999)
Moggi, E.: Computational lambda-calculus and monads. In: Proceedings of the Fourth Annual Symposium on Logic in Computer Science (LICS ’89), Pacific Grove, California, USA, 5–8 June, 1989, pp. 14–23. IEEE Computer Society (1989). https://doi.org/10.1109/LICS.1989.39155
Moggi, E.: Notions of computation and monads. Inf. Comput. 93(1), 55–92 (1991). https://doi.org/10.1016/0890-5401(91)90052-4
Morgan, C.: Programming from specifications, 2nd edn. Prentice Hall International series in computer science, Prentice Hall (1994)
Park, D.: Concurrency and automata on infinite sequences. In: Deussen, P. (ed.) GI-TCS 1981. LNCS, vol. 104, pp. 167–183. Springer, Heidelberg (1981). https://doi.org/10.1007/BFb0017309
Pitts, A.M.: Operational semantics and program equivalence. In: Barthe, G., Dybjer, P., Pinto, L., Saraiva, J. (eds.) APPSEM 2000. LNCS, vol. 2395, pp. 378–412. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45699-6_8
Pitts, A.M., Stark, I.D.B.: Observable properties of higher order functions that dynamically create local names, or: What’s new? In: Borzyszkowski, A.M., Sokolowski, S. (eds.) MFCS 1993. LNCS, vol. 711, pp. 122–141. Springer, Heidelberg (1993). https://doi.org/10.1007/3-540-57182-5_8
Plotkin, G.D.: A structural approach to operational semantics. J. Log. Algebraic Methods Program. 60–61, 17–139 (2004)
Reynolds, J.C.: Separation logic: a logic for shared mutable data structures. In: Proceedings of the 17th Annual IEEE Symposium on Logic in Computer Science, LICS 2002, pp. 55–74. IEEE Computer Society, Washington, DC (2002). http://dl.acm.org/citation.cfm?id=645683.664578
Schmidt, D.A.: Programming language semantics. In: Gonzalez, T.F., Diaz-Herrera, J., Tucker, A. (eds.) Computing Handbook, Third Edition: Computer Science and Software Engineering, pp. 69: 1–19. CRC Press (2014)
Swamy, N., Hritcu, C., Keller, C., Rastogi, A., Delignat-Lavaud, A., Forest, S., Bhargavan, K., Fournet, C., Strub, P., Kohlweiss, M., Zinzindohoue, J.K., Béguelin, S.Z.: Dependent types and multi-monadic effects in F. In: Bodik, R., Majumdar, R. (eds.) Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2016, St. Petersburg, FL, USA, January 20–22, 2016, pp. 256–270. ACM (2016). https://doi.org/10.1145/2837614.2837655
Swierstra, W.: A hoare logic for the state monad. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 440–451. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-03359-9_30
Wing, J.M.: Hints to specifiers. Teaching and learning formal methods, pp. 57–78 (1995)
Wirsing, M.: Algebraic specification. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, Volume B: Formal Models and Semantics, pp. 675–788. Elsevier and MIT Press (1990). https://doi.org/10.1016/b978-0-444-88074-1.50018-4
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 Springer Nature Switzerland AG
About this paper
Cite this paper
Attie, P.C. (2022). Operational Annotations. In: Deshmukh, J.V., Havelund, K., Perez, I. (eds) NASA Formal Methods. NFM 2022. Lecture Notes in Computer Science, vol 13260. Springer, Cham. https://doi.org/10.1007/978-3-031-06773-0_32
Download citation
DOI: https://doi.org/10.1007/978-3-031-06773-0_32
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-06772-3
Online ISBN: 978-3-031-06773-0
eBook Packages: Computer ScienceComputer Science (R0)