Skip to main content
Log in

Invariant diagrams with data refinement

  • Original Article
  • Published:
Formal Aspects of Computing

Abstract

Invariant based programming is an approach where we start to construct a program by first identifying the basic situations (pre- and post-conditions as well as invariants) that could arise during the execution of the algorithm. These situations are identified before any code is written. After that, we identify the transitions between the situations, which will give us the flow of control in the program. Data refinement is a technique of building correct programs working on concrete data structures as refinements of more abstract programs working on abstract data types. We study in this paper data refinement for invariant based programs and we apply it to the construction of the classical Deutsch–Schorr–Waite graph marking algorithm. Our results are formalized and mechanically proved in the Isabelle/HOL theorem prover.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Abrial J-R (2003) Event based sequential program development: application to constructing a pointer program. In: Araki K, Gnesi S, Mandrioli D (eds) FME. Lecture notes in computer science, vol 2805. Springer, Berlin, pp 51–74

    Google Scholar 

  2. Back RJ (1980) Correctness preserving program refinements: proof theory and applications. In: Mathematical centre tracts, vol 131. Mathematisch Centrum, Amsterdam

  3. Back RJ (1980) Semantic correctness of invariant based programs. In: International workshop on program construction, Chateau de Bonas, France

  4. Back RJ (1983) Invariant based programs and their correctness. In: Biermann W, Guiho G, Kodratoff Y (eds) Automatic program construction techniques. MacMillan Publishing Company, pp 223–242

  5. Back RJ (2008) Invariant based programming: basic approach and teaching experience. Formal Aspects of Computing

  6. Back RJ, Eriksson J, Myreen M (2006) Verifying invariant based programs in the SOCOS environment. In: Boca P, Bowen JP, Duce DA (eds) Teaching formal methods: practice and experience. Electronic workshops in computing (eWiC). BCS

  7. Back RJ, Eriksson J, Myreen M (2007) Testing and verifying invariant based programs in the SOCOS environment. In: The international conference on tests and proofs (TAP)

  8. Back RJ, Preoteasa V (2008) Semantics and proof rules of invariant based programs. Technical report 903, TUCS

  9. Back RJ, Preoteasa V (2011) Semantics and proof rules of invariant based programs. In: Proceedings of 26th symposium on applied computing: software verification and testing track. ACM

  10. Back RJ, von Wright J (1998) Refinement calculus A systematic introduction. Springer, Berlin

    MATH  Google Scholar 

  11. Back RJ, von Wright J (2000) Encoding, decoding and data refinement. Form Asp Comp 12: 313–349

    Article  MATH  Google Scholar 

  12. DeRoever W, Engelhardt K (1999) Data refinement: model-oriented proof methods and their comparison. Cambridge University Press, New York

    Google Scholar 

  13. Dijkstra EW (1976) A discipline of programming. Prentice-Hall Inc., Englewood Cliffs. With a foreword by C.A.R. Hoare, Prentice-Hall Series in Automatic Computation

  14. Hehner ECR (1979) Do considered od: a contribution to the programming calculus. Acta Inform 11(4): 287–304

    Article  MATH  Google Scholar 

  15. Hoare CAR (1972) Proof of correctness of data representations. Acta Inform 1(4)

  16. Knuth DE (1997) The art of computer programming: fundamental algorithms, vol 1, 3rd edn. Addison Wesley Longman Publishing Co., Inc., Redwood City

    Google Scholar 

  17. Mehta F, Nipkow T (2005) Proving pointer programs in higher-order logic. Information and Computing 199: 200–227

    Article  MATH  MathSciNet  Google Scholar 

  18. Nipkow T, Paulson LC, Wenzel M (2002) Isabelle/HOL—a proof assistant for higher-order logic. In: LNCS, vol 2283. Springer, Berlin

    Google Scholar 

  19. Preoteasa V, Back R-J (2009) Data refinement of invariant based programs. Electronic Notes in Theoretical Computer Sciences 259:143–163. Proceedings of the 14th BCS-FACS refinement workshop (REFINE 2009)

  20. Preoteasa V, Back R-J (2010) Semantics and data refinement of invariant based programs. In: Klein G, Nipkow T, Paulson L (eds) The archive of formal proofs. http://afp.sourceforge.net/entries/DataRefinementIBP.shtml. May 2010. Formal proof development

  21. Preoteasa V, Back R-J (2010) Verification of the Deutsch-Schorr-Waite graph marking algorithm using data refinement. In: Klein G, Nipkow T, Paulson L (eds) The archive of formal proofs. http://afp.sourceforge.net/entries/GraphMarkingIBP.shtml. May 2010. Formal proof development

  22. Pnueli A (2005) Verification of procedural programs. In: We will show them! Essays in Honour of Dov Gabbay, vol 2, pp 543–590

  23. Reynolds JC (1978) Programming with transition diagrams. In: Gries D (ed) Programming methodology. Springer, Berlin

  24. Schorr H, Waite WM (1967) An efficient machine-independent procedure for garbage collection in various list structures. Commun ACM 10(8): 501–506

    Article  MATH  Google Scholar 

  25. Van Emden MH (1979) Programming with verification conditions. IEEE Trans Softw Eng 5(2): 148–159

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Viorel Preoteasa.

Additional information

by Eerke Boiten, John Derrick, Dong Jin Song and Steve Reeves

Rights and permissions

Reprints and permissions

About this article

Cite this article

Preoteasa, V., Back, RJ. Invariant diagrams with data refinement. Form Asp Comp 24, 67–95 (2012). https://doi.org/10.1007/s00165-011-0195-2

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00165-011-0195-2

Keywords

Navigation