Skip to main content

Verified Self-Explaining Computation

  • Conference paper
  • First Online:
Mathematics of Program Construction (MPC 2019)

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

Included in the following conference series:

Abstract

Common programming tools, like compilers, debuggers, and IDEs, crucially rely on the ability to analyse program code to reason about its behaviour and properties. There has been a great deal of work on verifying compilers and static analyses, but far less on verifying dynamic analyses such as program slicing. Recently, a new mathematical framework for slicing was introduced in which forward and backward slicing are dual in the sense that they constitute a Galois connection. This paper formalises forward and backward dynamic slicing algorithms for a simple imperative programming language, and formally verifies their duality using the Coq proof assistant.

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 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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

Notes

  1. 1.

    In the literature Imp is also referred to as WHILE.

  2. 2.

    We overload the \(\Rightarrow \) notation to mean one of three evaluation relations. It is always clear from the arguments which relation we are referring to.

  3. 3.

    We again overload \(\nearrow \) and \(\searrow \) arrows in the notation to denote one of three forward/backward slicing relations. This is important in the rules for boolean slicing, whose premises refer to the slicing relation for arithmetic expressions, and command slicing, whose premises refer to slicing relation for boolean expressions.

  4. 4.

    When some partial value v is used as a slicing criterion we say that we “slice w.r.t. v”.

  5. 5.

    This example is adapted from [9].

  6. 6.

    Name comes from a term “prefix set” introduced in [17] to refer to a set of all partial values smaller than a given value. So a prefix set of a top element of a lattice denotes a set of all elements in that (complete) lattice.

  7. 7.

    In order to make the code snippets in the paper easier to read we omit the ordering relation when indexing prefix.

  8. 8.

    Authors of [9] use the name WHILE, but the language is the same.

References

  1. Backhouse, R.: Galois connections and fixed point calculus. In: Backhouse, R., Crole, R., Gibbons, J. (eds.) Algebraic and Coalgebraic Methods in the Mathematics of Program Construction. LNCS, vol. 2297, pp. 89–150. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-47797-7_4

    Chapter  Google Scholar 

  2. Binkley, D., Danicic, S., Gyimóthy, T., Harman, M., Kiss, A., Korel, B.: A formalisation of the relationship between forms of program slicing. Sci. Comput. Program. 62(3), 228–252 (2006). Special issue on Source code analysis and manipulation (SCAM 2005)

    Article  MathSciNet  Google Scholar 

  3. Blazy, S., Maroneze, A., Pichardie, D.: Verified validation of program slicing. In: Proceedings of the 2015 Conference on Certified Programs and Proofs, CPP 2015, pp. 109–117. ACM, New York (2015)

    Google Scholar 

  4. Cheney, J., Acar, U.A., Perera, R.: Toward a theory of self-explaining computation. In: Tannen, V., Wong, L., Libkin, L., Fan, W., Tan, W.-C., Fourman, M. (eds.) In Search of Elegance in the Theory and Practice of Computation. LNCS, vol. 8000, pp. 193–216. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-41660-6_9

    Chapter  MATH  Google Scholar 

  5. Chiang, Y., Mu, S.: Formal derivation of greedy algorithms from relational specifications: a tutorial. J. Log. Algebr. Meth. Program. 85(5), 879–905 (2016). https://doi.org/10.1016/j.jlamp.2015.12.003

    Article  MathSciNet  MATH  Google Scholar 

  6. Davey, B.A., Priestley, H.A.: Introduction to Lattices and Order. Cambridge University Press, Cambridge (2002)

    Book  Google Scholar 

  7. Gibbons, J.: Fission for program comprehension. In: Proceedings of Mathematics of Program Construction, 8th International Conference, MPC 2006, Kuressaare, Estonia, 3–5 July 2006, pp. 162–179 (2006). https://doi.org/10.1007/11783596_12

    Google Scholar 

  8. Korel, B., Laski, J.: Dynamic program slicing. Inf. Process. Lett. 29(3), 155–163 (1988)

    Article  Google Scholar 

  9. Léchenet, J., Kosmatov, N., Gall, P.L.: Cut branches before looking for bugs: certifiably sound verification on relaxed slices. Formal Aspects Comput. 30(1), 107–131 (2018)

    Article  MathSciNet  Google Scholar 

  10. Leroy, X., Blazy, S., Kästner, D., Schommer, B., Pister, M., Ferdinand, C.: Compcert - a formally verified optimizing compiler. In: ERTS 2016: Embedded Real Time Software and Systems. SEE (2016)

    Google Scholar 

  11. Mu, S., Ko, H., Jansson, P.: Algebra of programming in Agda: dependent types for relational program derivation. J. Funct. Program. 19(5), 545–579 (2009). https://doi.org/10.1017/S0956796809007345

    Article  MathSciNet  MATH  Google Scholar 

  12. Mu, S., Oliveira, J.N.: Programming from Galois connections. J. Log. Algebr. Program. 81(6), 680–704 (2012). https://doi.org/10.1016/j.jlap.2012.05.003

    Article  MathSciNet  MATH  Google Scholar 

  13. Nielson, F., Nielson, H.R., Hankin, C.: Principles of Program Analysis. Springer, Heidelberg (1999). https://doi.org/10.1007/978-3-662-03811-6

    Book  MATH  Google Scholar 

  14. Perera, R., Garg, D., Cheney, J.: Causally consistent dynamic slicing. In: CONCUR, pp. 18:1–18:15 (2016)

    Google Scholar 

  15. Perera, R., Acar, U.A., Cheney, J., Levy, P.B.: Functional programs that explain their work. In: ICFP, pp. 365–376. ACM (2012)

    Google Scholar 

  16. Pierce, B.C., et al.: Software Foundations. Electronic textbook (2017), version 5.0. http://www.cis.upenn.edu/~bcpierce/sf

  17. Ricciotti, W., Stolarek, J., Perera, R., Cheney, J.: Imperative functional programs that explain their work. In: Proceedings of the ACM on Programming Languages (PACMPL) 1(ICFP), September 2017

    Article  Google Scholar 

  18. Silva, J.: An analysis of the current program slicing and algorithmic debugging based techniques. Technical University of Valencia, Tech. rep. (2008)

    Google Scholar 

  19. Stolarek, J.: Verified self-explaining computation, May 2019. https://bitbucket.org/jstolarek/gc_imp_slicing/src/mpc_2019_submission/

  20. The Coq Development Team: The Coq proof assistant, version 8.7.0, October 2017. https://doi.org/10.5281/zenodo.1028037

  21. Weiser, M.: Program slicing. In: ICSE, pp. 439–449. IEEE Press, Piscataway (1981)

    Google Scholar 

  22. Winskel, G.: The Formal Semantics of Programming Languages: An Introduction. MIT Press, Cambridge (1993)

    Book  Google Scholar 

Download references

Acknowledgements

We gratefully acknowledge help received from Wilmer Ricciotti during our work on the Coq formalisation, and Jeremy Gibbons for comments on a draft. This work was supported by ERC Consolidator Grant Skye (grant number 682315).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jan Stolarek .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Stolarek, J., Cheney, J. (2019). Verified Self-Explaining Computation. In: Hutton, G. (eds) Mathematics of Program Construction. MPC 2019. Lecture Notes in Computer Science(), vol 11825. Springer, Cham. https://doi.org/10.1007/978-3-030-33636-3_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-33636-3_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-33635-6

  • Online ISBN: 978-3-030-33636-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics