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.
Similar content being viewed by others
References
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
Back RJ (1980) Correctness preserving program refinements: proof theory and applications. In: Mathematical centre tracts, vol 131. Mathematisch Centrum, Amsterdam
Back RJ (1980) Semantic correctness of invariant based programs. In: International workshop on program construction, Chateau de Bonas, France
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
Back RJ (2008) Invariant based programming: basic approach and teaching experience. Formal Aspects of Computing
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
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)
Back RJ, Preoteasa V (2008) Semantics and proof rules of invariant based programs. Technical report 903, TUCS
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
Back RJ, von Wright J (1998) Refinement calculus A systematic introduction. Springer, Berlin
Back RJ, von Wright J (2000) Encoding, decoding and data refinement. Form Asp Comp 12: 313–349
DeRoever W, Engelhardt K (1999) Data refinement: model-oriented proof methods and their comparison. Cambridge University Press, New York
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
Hehner ECR (1979) Do considered od: a contribution to the programming calculus. Acta Inform 11(4): 287–304
Hoare CAR (1972) Proof of correctness of data representations. Acta Inform 1(4)
Knuth DE (1997) The art of computer programming: fundamental algorithms, vol 1, 3rd edn. Addison Wesley Longman Publishing Co., Inc., Redwood City
Mehta F, Nipkow T (2005) Proving pointer programs in higher-order logic. Information and Computing 199: 200–227
Nipkow T, Paulson LC, Wenzel M (2002) Isabelle/HOL—a proof assistant for higher-order logic. In: LNCS, vol 2283. Springer, Berlin
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)
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
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
Pnueli A (2005) Verification of procedural programs. In: We will show them! Essays in Honour of Dov Gabbay, vol 2, pp 543–590
Reynolds JC (1978) Programming with transition diagrams. In: Gries D (ed) Programming methodology. Springer, Berlin
Schorr H, Waite WM (1967) An efficient machine-independent procedure for garbage collection in various list structures. Commun ACM 10(8): 501–506
Van Emden MH (1979) Programming with verification conditions. IEEE Trans Softw Eng 5(2): 148–159
Author information
Authors and Affiliations
Corresponding author
Additional information
by Eerke Boiten, John Derrick, Dong Jin Song and Steve Reeves
Rights 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
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00165-011-0195-2