Skip to main content

A Mechanized Theory of Program Refinement

  • Conference paper
  • First Online:
Formal Methods and Software Engineering (ICFEM 2019)

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

Included in the following conference series:

  • 923 Accesses

Abstract

We present a mechanized theory of program refinement that allows for the stepwise development of imperative programs in the Coq proof assistant. We formalize a design language with support for gradual refinement and a calculus which enforces correctness-by-construction. A notion of program design captures the hierarchy of refinement steps resulting from a development. The underlying theory follows the predicative programming paradigm where programs and specifications are both easily expressed as predicates, which fit naturally in the dependent type theory of the 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.

    Calculus of weakest preconditions.

  2. 2.

    https://github.com/bsall/AMToPR-ICFEM-2019.

  3. 3.

    https://github.com/bsall/AMToPR-ICFEM-2019/tree/master/src/examples/.

References

  1. Alpuim, J., Swierstra, W.: Embedding the refinement calculus in Coq. Sci. Comput. Program. 164, 37–48 (2018)

    Article  Google Scholar 

  2. Back, R.J., Wright, J.: Refinement Calculus: A Systematic Introduction. Springer, New York (2012). https://doi.org/10.1007/978-1-4612-1674-2

    Book  MATH  Google Scholar 

  3. Backhouse, R., Van Der Woude, J.: Demonic operators and monotype factors. Math. Struct. Comput. Sci. 3(4), 417–433 (1993)

    Article  MathSciNet  Google Scholar 

  4. Berghammer, R., Zierer, H.: Relational algebraic semantics of deterministic and nondeterministic programs. TCS. 43, 123–147 (1986)

    Article  MathSciNet  Google Scholar 

  5. Boulmé, S.: Intuitionistic refinement calculus. In: Della Rocca, S.R. (ed.) TLCA 2007. LNCS, vol. 4583, pp. 54–69. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-73228-0_6

    Chapter  Google Scholar 

  6. Butler, M., Långbacka, T.: Program derivation using the refinement calculator. In: Goos, G., Hartmanis, J., van Leeuwen, J., von Wright, J., Grundy, J., Harrison, J. (eds.) TPHOLs 1996. LNCS, vol. 1125, pp. 93–108. Springer, Heidelberg (1996). https://doi.org/10.1007/BFb0105399

    Chapter  Google Scholar 

  7. Desharnais, J., Jaoua, A., Mili, F., Boudriga, N., Mili, A.: A relational division operator: the conjugate kernel. TCS 114(2), 247–272 (1993)

    Article  MathSciNet  Google Scholar 

  8. Dijkstra, E.: Notes on structured programming. In: Dahl, O.J., Dijkstra, E.W., Hoare, C.A.R. (eds.) Structured Programming. Academic Press, London (1972)

    MATH  Google Scholar 

  9. Frappier, M., Mili, A., Desharnais, J.: A relational calculus for program construction by parts. Sci. Comput. Program. 26(1–3), 237–254 (1996)

    Article  MathSciNet  Google Scholar 

  10. Hehner, E.C.: Predicative programming Part I. Commun. ACM 27(2), 134–143 (1984)

    Article  MathSciNet  Google Scholar 

  11. Hehner, E.C.: Specified blocks. In: Meyer, B., Woodcock, J. (eds.) VSTTE 2005. LNCS, vol. 4171, pp. 384–391. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-69149-5_41

    Chapter  Google Scholar 

  12. Hehner, E.C.: A Practical Theory of Programming. Springer, New York (2012). https://doi.org/10.1007/978-1-4419-8596-5

    Book  MATH  Google Scholar 

  13. Hoare, C.A.R.: Proof of correctness of data representations. In: Gries, D. (ed.) Programming Methodology, pp. 269–281. Springer, New York (1978). https://doi.org/10.1007/978-1-4612-6315-9_20

    Chapter  Google Scholar 

  14. Hoare, C.A.R., He, J.: The weakest prespecification. Inf. Process. Lett. 24(2), 127–132 (1987)

    Article  MathSciNet  Google Scholar 

  15. Hoare, C.A.R., Jifeng, H.: Unifying Theories of Programming, vol. 14. Prentice Hall, Englewood Cliffs (1998)

    MATH  Google Scholar 

  16. Josephs, M.B.: An introduction to the theory of specification and refinement. In: IBM research Report RC 12993. IBM Thomas J. Watson Research Division (1987)

    Google Scholar 

  17. Knuth, D.E.: Literate programming. Comput. J. 27(2), 97–111 (1984)

    Article  Google Scholar 

  18. Kourie, D.G., Watson, B.W.: The Correctness-by-Construction Approach to Programming. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-27919-5

    Book  MATH  Google Scholar 

  19. Mili, A.: A relational approach to the design of deterministic programs. Acta Informatica 20(4), 315–328 (1983)

    Article  MathSciNet  Google Scholar 

  20. Morgan, C.: The refinement calculus, and literate development. In: Möller, B., Partsch, H., Schuman, S. (eds.) Formal Program Development. LNCS, vol. 755, pp. 161–182. Springer, Heidelberg (1993). https://doi.org/10.1007/3-540-57499-9_20

    Chapter  Google Scholar 

  21. Morgan, C., Robinson, K., Gardiner, P.: On the Refinement Calculus (Formal Approaches to Computing and Information Technology (FACIT)). Springer, London (1994)

    Google Scholar 

  22. Sekerinski, E.: A calculus for predicative programming. In: Bird, R.S., Morgan, C.C., Woodcock, J.C.P. (eds.) MPC 1992. LNCS, vol. 669, pp. 302–322. Springer, Heidelberg (1993). https://doi.org/10.1007/3-540-56625-2_20

    Chapter  Google Scholar 

  23. Sozeau, M.: Subset coercions in Coq. In: Altenkirch, T., McBride, C. (eds.) TYPES 2006. LNCS, vol. 4502, pp. 237–252. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-74464-1_16

    Chapter  Google Scholar 

  24. The Coq Development Team: The Coq proof assistant, version 8.8.0, April 2018

    Google Scholar 

  25. Wirth, N.: Program development by stepwise refinement. Commun. ACM 14(4), 221–227 (1971)

    Article  Google Scholar 

  26. Woodcock, J., Davies, J.: Using Z. Prentice Hall International (1996)

    Google Scholar 

Download references

Acknowledgment

We are very grateful to Sylvain Boulmé and Pierre-Évariste Dagand for all the insightful discussions we had about this work. We also thank the anonymous referees for their useful suggestions.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Boubacar Demba Sall .

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

Sall, B.D., Peschanski, F., Chailloux, E. (2019). A Mechanized Theory of Program Refinement. In: Ait-Ameur, Y., Qin, S. (eds) Formal Methods and Software Engineering. ICFEM 2019. Lecture Notes in Computer Science(), vol 11852. Springer, Cham. https://doi.org/10.1007/978-3-030-32409-4_19

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-32409-4_19

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-32408-7

  • Online ISBN: 978-3-030-32409-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics