Skip to main content

Operational Annotations

A New Method for Sequential Program Verification

  • Conference paper
  • First Online:
NASA Formal Methods (NFM 2022)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13260))

Included in the following conference series:

  • 1743 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 109.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 139.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Attie, P.C.: Operational annotations: A new method for sequential program verification. CoRR abs/2102.06727 (2021). https://arxiv.org/abs/2102.06727

  2. 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

  3. 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

    Article  MathSciNet  MATH  Google Scholar 

  4. 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

  5. Dijkstra, E.W.: Guarded commands, nondeterminacy and formal derivation of programs. Commun. ACM 18(8), 453–457 (1975)

    Google Scholar 

  6. 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)

    Google Scholar 

  7. Francez, N.: Program verification. Addison-Wesley, International computer science series (1992)

    MATH  Google Scholar 

  8. Hoare, C.A.R.: Communicating Sequential Processes. Prentice-Hall (1985)

    Google Scholar 

  9. Hoare, C.A.R., et al.: Laws of programming. Commun. ACM 30(8), 672–686 (1987). https://doi.org/10.1145/27651.27653

  10. Hoare, C.: An axiomatic basis for computer programming. Commun. ACM 12(10), 576–580, 583 (1969)

    Google Scholar 

  11. 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

    Chapter  Google Scholar 

  12. 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

  13. 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

    Article  MathSciNet  MATH  Google Scholar 

  14. 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

    Google Scholar 

  15. 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

  16. Milner, R. (ed.): A Calculus of Communicating Systems. LNCS, vol. 92. Springer, Heidelberg (1980). https://doi.org/10.1007/3-540-10235-3

    Book  MATH  Google Scholar 

  17. Milner, R.: Communicating and mobile systems - the Pi-calculus. Cambridge University Press (1999)

    Google Scholar 

  18. 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

  19. Moggi, E.: Notions of computation and monads. Inf. Comput. 93(1), 55–92 (1991). https://doi.org/10.1016/0890-5401(91)90052-4

  20. Morgan, C.: Programming from specifications, 2nd edn. Prentice Hall International series in computer science, Prentice Hall (1994)

    Google Scholar 

  21. 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

    Chapter  Google Scholar 

  22. 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

    Chapter  MATH  Google Scholar 

  23. 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

  24. Plotkin, G.D.: A structural approach to operational semantics. J. Log. Algebraic Methods Program. 60–61, 17–139 (2004)

    MathSciNet  MATH  Google Scholar 

  25. 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

  26. 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)

    Google Scholar 

  27. 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

  28. 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

    Chapter  Google Scholar 

  29. Wing, J.M.: Hints to specifiers. Teaching and learning formal methods, pp. 57–78 (1995)

    Google Scholar 

  30. 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

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Paul C. Attie .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics