Skip to main content

Reverse Hoare Logic

  • Conference paper
Software Engineering and Formal Methods (SEFM 2011)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7041))

Included in the following conference series:

Abstract

We present a novel Hoare-style logic, called Reverse Hoare Logic, which can be used to reason about state reachability of imperative programs. This enables us to give natural specifications to randomized (deterministic or nondeterministic) algorithms. We give a proof system for the logic and use this to give simple formal proofs for a number of illustrative examples. We define a weakest postcondition calculus and use this to show that the proof system is sound and complete.

This research was supported by SFI project SFI 06 IN.1 1898.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Apt, K.R.: Ten years of Hoare’s logic: A survey—part I. ACM Trans. Program. Lang. Syst. 3, 431–483 (1981)

    Article  MATH  Google Scholar 

  2. Apt, K.R.: Ten years of Hoare’s logic: A survey—part II: Nondeterminism. Theoretical Computer Science 28(1-2), 83–109 (1983)

    Article  MATH  Google Scholar 

  3. Bacchus, F., Yang, Q.: Downward refinement and the efficiency of hierarchical problem solving. Artificial Intelligence 71(1), 43–100 (1994)

    Article  MATH  Google Scholar 

  4. Barnett, M., DeLine, R., Fähndrich, M., Jacobs, B., Leino, K.R.M., Schulte, W., Venter, H.S.: The spec# programming system: Challenges and directions. In: Meyer, B., Woodcock, J. (eds.) VSTTE 2005. LNCS, vol. 4171, pp. 144–152. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  5. Chadha, R., Cruz-Filipe, L., Mateus, P., Sernadas, A.: Reasoning about probabilistic sequential programs. Theor. Comput. Sci. 379, 142–165 (2007)

    Article  MATH  Google Scholar 

  6. Chen, W., Udding, J.T.: Program inversion: more than fun! Sci. Comput. Program. 15, 1–13 (1990)

    Article  MATH  Google Scholar 

  7. Cok, D., Kiniry, J.: ESC/Java2: Uniting ESC/Java and JML. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 108–128. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  8. Goldblatt, R.: Logics of time and computation. Center for the Study of Language and Information, Stanford, CA, USA (1987)

    Google Scholar 

  9. Harel, D.: Logics of programs: Axiomatics and descriptive power. Tech. rep., Massachusetts Institute of Technology, Cambridge, MA, USA (1978)

    Google Scholar 

  10. den Hartog, J.: Verifying probabilistic programs using a Hoare like logic. In: Thiagarajan, P., Yap, R. (eds.) ASIAN 1999. LNCS, vol. 1742, pp. 790–790. Springer, Heidelberg (1999)

    Google Scholar 

  11. Heyer, T.: Semantic Inspection of Software Artifacts From Theory to Practice. Ph.D. thesis, Linköping University (2001)

    Google Scholar 

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

    Article  MATH  Google Scholar 

  13. Hoare, C.A.R., Wirth, N.: An axiomatic definition of the programming language PASCAL. Acta Informatica 2, 335–355 (1973)

    Article  MATH  Google Scholar 

  14. Hofmann, M., Pavlova, M.: Elimination of ghost variables in program logics. In: Barthe, G., Fournet, C. (eds.) TGC 2007. LNCS, vol. 4912, pp. 1–20. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  15. Honda, K., Yoshida, N., Berger, M.: An observationally complete program logic for imperative higher-order functions. In: LICS, pp. 270–279. IEEE, Los Alamitos (2005)

    Google Scholar 

  16. Kanig, J., Filliâtre, J.C.: Who: a verifier for effectful higher-order programs. In: ACM SIGPLAN Workshop on ML, pp. 39–48. ACM, New York (2009)

    Google Scholar 

  17. Kleymann, T.: Hoare logic and auxiliary variables. Formal Aspects of Computing 11, 541–566 (1999), http://dx.doi.org/10.1007/s001650050057 , doi:10.1007/s001650050057

    Article  MATH  Google Scholar 

  18. Kozen, D.: A probabilistic PDL. J. Comp. and Sys. Sc. 30(2), 162–178 (1985)

    Article  MATH  Google Scholar 

  19. Kumar, A., Srivastava, B., Mittal, S.: Information modeling for end to end composition of semantic web services. In: Gil, Y., Motta, E., Benjamins, V.R., Musen, M.A. (eds.) ISWC 2005. LNCS, vol. 3729, pp. 476–490. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  20. Meyer, B.: Object-oriented software construction, 2nd edn. Prentice-Hall, Inc., Upper Saddle River (1997)

    MATH  Google Scholar 

  21. Morgan, C., McIver, A., Seidel, K.: Probabilistic predicate transformers. ACM Trans. Program. Lang. Syst., 325–353 (1996)

    Google Scholar 

  22. Nanevski, A., Morrisett, G., Birkedal, L.: Polymorphism and separation in Hoare Type Theory. SIGPLAN Not. 41, 62–73 (2006)

    Article  MATH  Google Scholar 

  23. Ramshaw, L.H.: Formalizing the analysis of algorithms. Ph.D. thesis, Stanford University (1979)

    Google Scholar 

  24. Reussner, R., Poernomo, I., Schmidt, H.: Reasoning about software architectures with contractually specified components. In: Cechich, A., Piattini, M., Vallecillo, A. (eds.) CBSQ 2003. LNCS, vol. 2693, pp. 287–325. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  25. Reynolds, J.C.: Separation logic: A logic for shared mutable data structures. In: LICS, pp. 55–74. IEEE Computer Society, Washington, DC, USA (2002)

    Google Scholar 

  26. ten Teije, A., van Harmelen, F.: Characterising approximate problem solving: by partially fulfilled pre- and postconditions. In: ECAI 1998. CEUR-WS, vol. 16, pp. 78–82 (1998)

    Google Scholar 

  27. Woodcock, J., Cavalcanti, A.: A Tutorial Introduction to Designs in Unifying Theories of Programming. In: Boiten, E.A., Derrick, J., Smith, G.P. (eds.) IFM 2004. LNCS, vol. 2999, pp. 40–66. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  28. von Wright, J.: Program inversion in the refinement calculus. Information Processing Letters 37(2), 95–100 (1991)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

de Vries, E., Koutavas, V. (2011). Reverse Hoare Logic. In: Barthe, G., Pardo, A., Schneider, G. (eds) Software Engineering and Formal Methods. SEFM 2011. Lecture Notes in Computer Science, vol 7041. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-24690-6_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-24690-6_12

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-24689-0

  • Online ISBN: 978-3-642-24690-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics