Skip to main content

Unifying Heterogeneous State-Spaces with Lenses

  • Conference paper
  • First Online:
Theoretical Aspects of Computing – ICTAC 2016 (ICTAC 2016)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9965))

Included in the following conference series:

  • 720 Accesses

Abstract

Most verification approaches embed a model of program state into their semantic treatment. Though a variety of heterogeneous state-space models exists, they all possess common theoretical properties one would like to capture abstractly, such as the common algebraic laws of programming. In this paper, we propose lenses as a universal state-space modelling solution. Lenses provide an abstract interface for manipulating data types through spatially-separated views. We define a lens algebra that enables their composition and comparison, and apply it to formally model variables and alphabets in Hoare and He’s Unifying Theories of Programming (UTP). The combination of lenses and relational algebra gives rise to a model for UTP in which its fundamental laws can be verified. Moreover, we illustrate how lenses can be used to model more complex state notions such as memory stores and parallel states. We provide a mechanisation in Isabelle/HOL that validates our theory, and facilitates its use in program verification.

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

Similar content being viewed by others

Notes

  1. 1.

    For supporting Isabelle theories, including mechanised proofs for all laws in this paper, see http://cs.york.ac.uk/~simonf/ictac2016.

  2. 2.

    See archive of formal proofs: https://www.isa-afp.org/entries/Circus.shtml.

  3. 3.

    Boomerang home page: http://www.seas.upenn.edu/~harmony/.

  4. 4.

    Partial functions are sometimes used in the literature, e.g. [13]. We prefer total functions, as these circumvent undefinedness issues and are at the core of Isabelle/HOL.

  5. 5.

    See our repository at github.com/isabelle-utp/utp-main/tree/shallow.2016.

References

  1. Alkassar, E., Hillebrand, M.A., Leinenbach, D., Schirmer, N.W., Starostin, A.: The Verisoft approach to systems verification. In: Shankar, N., Woodcock, J. (eds.) VSTTE 2008. LNCS, vol. 5295, pp. 209–224. Springer, Heidelberg (2008). doi:10.1007/978-3-540-87873-5_18

    Chapter  Google Scholar 

  2. Armstrong, A., Gomes, V., Struth, G.: Building program construction and verification tools from algebraic principles. Formal Aspects Comput. 28(2), 265–293 (2015)

    Article  MathSciNet  MATH  Google Scholar 

  3. Armstrong, A., Struth, G., Weber, T.: Program analysis and verification based on Kleene algebra in Isabelle/HOL. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 197–212. Springer, Heidelberg (2013). doi:10.1007/978-3-642-39634-2_16

    Chapter  Google Scholar 

  4. Back, R.-J., Preoteasa, V.: Reasoning about recursive procedures with parameters. In: Proceedings of the Workshop on Mechanized Reasoning About Languages with Variable Binding, MERLIN 2003, pp. 1–7. ACM (2003)

    Google Scholar 

  5. Blanchette, J.C., Bulwahn, L., Nipkow, T.: Automatic proof and disproof in Isabelle/HOL. In: Tinelli, C., Sofronie-Stokkermans, V. (eds.) FroCoS 2011. LNCS (LNAI), vol. 6989, pp. 12–27. Springer, Heidelberg (2011). doi:10.1007/978-3-642-24364-6_2

    Chapter  Google Scholar 

  6. Calcagno, C., O’Hearn, P., Yang, H.: Local action and abstract separation logic. In: LICS, pp. 366–378. IEEE, July 2007

    Google Scholar 

  7. Cavalcanti, A., Woodcock, J.: A tutorial introduction to CSP in Unifying Theories of Programming. In: Cavalcanti, A., Sampaio, A., Woodcock, J. (eds.) PSSE 2004. LNCS, vol. 3167, pp. 220–268. Springer, Heidelberg (2006). doi:10.1007/11889229_6

    Chapter  Google Scholar 

  8. Dongol, B., Gomes, V.B.F., Struth, G.: A program construction and verification tool for separation logic. In: Hinze, R., VoigtlΓ€nder, J. (eds.) MPC 2015. LNCS, vol. 9129, pp. 137–158. Springer, Heidelberg (2015). doi:10.1007/978-3-319-19797-5_7

    Chapter  Google Scholar 

  9. Feliachi, A., Gaudel, M.-C., Wolff, B.: Unifying theories in Isabelle/HOL. In: Qin, S. (ed.) UTP 2010. LNCS, vol. 6445, pp. 188–206. Springer, Heidelberg (2010). doi:10.1007/978-3-642-16690-7_9

    Chapter  Google Scholar 

  10. Feliachi, A., Gaudel, M.-C., Wolff, B.: Isabelle/Circus: a process specification and verification environment. In: Joshi, R., MΓΌller, P., Podelski, A. (eds.) VSTTE 2012. LNCS, vol. 7152, pp. 243–260. Springer, Heidelberg (2012). doi:10.1007/978-3-642-27705-4_20

    Chapter  Google Scholar 

  11. Fischer, S., Hu, Z., Pacheco, H.: A clear picture of lens laws. In: Hinze, R., VoigtlΓ€nder, J. (eds.) MPC 2015. LNCS, vol. 9129, pp. 215–223. Springer, Heidelberg (2015). doi:10.1007/978-3-319-19797-5_10

    Chapter  Google Scholar 

  12. Foster, J.: Bidirectional programming languages. Ph.D. thesis, University of Pennsylvania (2009)

    Google Scholar 

  13. Foster, J., Greenwald, M., Moore, J., Pierce, B., Schmitt, A.: Combinators for bidirectional tree transformations: a linguistic approach to the view-update problem. ACM Trans. Program. Lang. Syst. 29(3), 17 (2007). doi:10.1145/1232420.1232424

    Article  Google Scholar 

  14. Foster, S., Struth, G., Weber, T.: Automated engineering of relational and algebraic methods in Isabelle/HOL. In: Swart, H. (ed.) RAMICS 2011. LNCS, vol. 6663, pp. 52–67. Springer, Heidelberg (2011). doi:10.1007/978-3-642-21070-9_5

    Chapter  Google Scholar 

  15. Foster, S., Thiele, B., Cavalcanti, A., Woodcock, J.: Towards a UTP semantics for Modelica. In Proceedings of the 6th International Symposium on Unifying Theories of Programming, June 2016. To appear

    Google Scholar 

  16. Foster, S., Zeyda, F., Woodcock, J.: Isabelle/UTP: a mechanised theory engineering framework. In: Naumann, D. (ed.) UTP 2014. LNCS, vol. 8963, pp. 21–41. Springer, Heidelberg (2015). doi:10.1007/978-3-319-14806-9_2

    Google Scholar 

  17. Hehner, E.C.R.: A Practical Theory of Programming. Texts and Monographs in Computer Science. Springer, New York (1993)

    Book  MATH  Google Scholar 

  18. Henkin, L., Monk, J., Tarski, A.: Cylindric Algebras, Part I. North-Holland, Amsterdam (1971)

    MATH  Google Scholar 

  19. Hoare, T.: Communicating Sequential Processes. Prentice-Hall, London (1985)

    MATH  Google Scholar 

  20. Hoare, T., Hayes, I., He, J., Morgan, C., Roscoe, A., Sanders, J., SΓΈrensen, I., Spivey, J., Sufrin, B.: The laws of programming. Commun. ACM 30(8), 672–687 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  21. Hoare, T., He, J.: Unifying Theories of Programming. Prentice-Hall, Englewood Cliffs (1998)

    MATH  Google Scholar 

  22. Huffman, B., Kunčar, O.: Lifting and transfer: a modular design for quotients in Isabelle/HOL. In: Gonthier, G., Norrish, M. (eds.) CPP 2013. LNCS, vol. 8307, pp. 131–146. Springer, Heidelberg (2013). doi:10.1007/978-3-319-03545-1_9

    Chapter  Google Scholar 

  23. Klein, G., et al.: seL4: Formal verification of an OS kernel. In: Proceedings of the 22nd Symposium on Operating Systems Principles (SOSP), pp. 207–220. ACM (2009)

    Google Scholar 

  24. Nipkow, T., Wenzel, M., Paulson, L.C. (eds.): Isabelle/HOL: A Proof Assistant for Higher-Order Logic. LNCS, vol. 2283. Springer, Heidelberg (2002)

    MATH  Google Scholar 

  25. Oliveira, M., Cavalcanti, A., Woodcock, J.: Unifying theories in ProofPower-Z. In: Dunne, S., Stoddart, B. (eds.) UTP 2006. LNCS, vol. 4010, pp. 123–140. Springer, Heidelberg (2006). doi:10.1007/11768173_8

    Chapter  Google Scholar 

  26. Oliveira, M., Cavalcanti, A., Woodcock, J.: A UTP semantics for circus. Formal Aspects Comput. 21, 3–32 (2009)

    Article  MATH  Google Scholar 

  27. Schirmer, N., Wenzel, M.: State spaces - the locale way. In: SSV 2009. ENTCS, vol. 254, pp. 161–179 (2009)

    Google Scholar 

  28. Woodcock, J., Foster, S., Butterfield, A.: Heterogeneous semantics and unifying theories. In: 7th International Symposium on Leveraging Applications of Formal Methods, Verification, and Validation (ISoLA) (2016). To appear

    Google Scholar 

  29. Zeyda, F., Foster, S., Freitas, L.: An axiomatic value model for Isabelle/UTP. In: Proceedings of the 6th International Symposium on Unifying Theories of Programming (2016). To appear

    Google Scholar 

Download references

Acknowledgements

This work is partly supported by EU H2020 project INTO-CPS, grant agreement 644047. http://into-cps.au.dk/. We also thank Prof. Burkhart Wolff for his generous and helpful comments on our work.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Simon Foster .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

Β© 2016 Springer International Publishing AG

About this paper

Cite this paper

Foster, S., Zeyda, F., Woodcock, J. (2016). Unifying Heterogeneous State-Spaces with Lenses. In: Sampaio, A., Wang, F. (eds) Theoretical Aspects of Computing – ICTAC 2016. ICTAC 2016. Lecture Notes in Computer Science(), vol 9965. Springer, Cham. https://doi.org/10.1007/978-3-319-46750-4_17

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-46750-4_17

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-46749-8

  • Online ISBN: 978-3-319-46750-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics