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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
For supporting Isabelle theories, including mechanised proofs for all laws in this paper, see http://cs.york.ac.uk/~simonf/ictac2016.
- 2.
See archive of formal proofs: https://www.isa-afp.org/entries/Circus.shtml.
- 3.
Boomerang home page: http://www.seas.upenn.edu/~harmony/.
- 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.
See our repository at github.com/isabelle-utp/utp-main/tree/shallow.2016.
References
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
Armstrong, A., Gomes, V., Struth, G.: Building program construction and verification tools from algebraic principles. Formal Aspects Comput. 28(2), 265β293 (2015)
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
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)
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
Calcagno, C., OβHearn, P., Yang, H.: Local action and abstract separation logic. In: LICS, pp. 366β378. IEEE, July 2007
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
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
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
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
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
Foster, J.: Bidirectional programming languages. Ph.D. thesis, University of Pennsylvania (2009)
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
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
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
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
Hehner, E.C.R.: A Practical Theory of Programming. Texts and Monographs in Computer Science. Springer, New York (1993)
Henkin, L., Monk, J., Tarski, A.: Cylindric Algebras, Part I. North-Holland, Amsterdam (1971)
Hoare, T.: Communicating Sequential Processes. Prentice-Hall, London (1985)
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)
Hoare, T., He, J.: Unifying Theories of Programming. Prentice-Hall, Englewood Cliffs (1998)
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
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)
Nipkow, T., Wenzel, M., Paulson, L.C. (eds.): Isabelle/HOL: A Proof Assistant for Higher-Order Logic. LNCS, vol. 2283. Springer, Heidelberg (2002)
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
Oliveira, M., Cavalcanti, A., Woodcock, J.: A UTP semantics for circus. Formal Aspects Comput. 21, 3β32 (2009)
Schirmer, N., Wenzel, M.: State spaces - the locale way. In: SSV 2009. ENTCS, vol. 254, pp. 161β179 (2009)
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
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
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
Corresponding author
Editor information
Editors and Affiliations
Rights 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)