Skip to main content

Pointer Program Derivation Using Coq: Graphs and Schorr-Waite Algorithm

  • Conference paper
Formal Methods and Software Engineering (ICFEM 2014)

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

Included in the following conference series:

  • 934 Accesses

Abstract

We present a specification, a derivation and total correctness proofs of operations for bi-functional graphs implemented with pointers, including the Schorr-Waite algorithm. This one marks such a graph with an economical depth-first strategy. Our approach is purely algebraic and functional, from a simple graph specification to the simulation of a tail-recursive imperative program, then to a true C pointer program by elementary classical transformations. We stay in the unique higher-order formalism of the Calculus of Inductive Constructions for specifications, programs and proofs. All the development is supported by Coq.

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 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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abrial, J.-R.: Event Based Sequential Program Development: Application to Constructing a Pointer Program. In: Araki, K., Gnesi, S., Mandrioli, D. (eds.) FME 2003. LNCS, vol. 2805, pp. 51–74. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  2. Bertot, Y., Casteran, P.: Interactive Theorem Proving and Program Development - Coq’Art: The Calculus of Inductive Constructions. Springer-Verlag (2004)

    Google Scholar 

  3. Bornat, R.: Proving Pointer Programs in Hoare Logic. In: Backhouse, R., Oliveira, J.N. (eds.) MPC 2000. LNCS, vol. 1837, pp. 102–126. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  4. Broy, M., Pepper, P.: Combining Algebraic and Algorithmic Reasoning: An Approach to the Schorr-Waite Algorithm. ACM-TOPLAS 4(3), 362–381 (1982)

    Article  MATH  Google Scholar 

  5. Bubel, R.: The schorr-waite-algorithm. In: Beckert, B., Hähnle, R., Schmitt, P.H. (eds.) Verification of Object-Oriented Software. LNCS (LNAI), vol. 4334, pp. 569–587. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  6. Burstall, R.M.: Some techniques for proving correctness of programs which alters data structures. Machine Intelligence 7, 23–50 (1972)

    MATH  Google Scholar 

  7. Chlipala, A.: Mostly-automated verification of low-level programs in computational separation logic. In: PLDI, pp. 234–245 (2011)

    Google Scholar 

  8. de Roever, W.-P.: On Backtracking and Greatest Fixpoints. In: Salomaa, A., Steinby, M. (eds.) ICALP 1977. LNCS, vol. 52, pp. 412–429. Springer, Heidelberg (1977)

    Chapter  Google Scholar 

  9. Dershowitz, N.: The Schorr-Waite Marking Algorithm Revisited. Inf. Proc. Lett. 11(3), 141–143 (1980)

    Article  MathSciNet  MATH  Google Scholar 

  10. Dufourd, J.-F.: Polyhedra genus theorem and Euler formula: A hypermap-formalized intuitionistic proof. Theor. Comp. Sci. 403(2-3), 133–159 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  11. Dufourd, J.-F.: Dérivation de l’algorithme de Schorr-Waite en Coq par une méthode algébrique. In: JFLA 2012, INRIA (2012), http://hal.inria.fr/hal-00665909

  12. Dufourd, J.-F.: Schorr-Waite Coq Development On-line Documentation (2013), http://dpt-info.u-strasbg.fr/~jfd/SW-LIB-PUBLI.tar.gz

  13. Dufourd, J.-F.: Formal Study of Functional Orbits in Finite Domains, 35 pages (2013) (submitted)

    Google Scholar 

  14. Dufourd, J.-F.: Hypermap specification and certified linked implementation using orbits. In: Klein, G., Gamboa, R. (eds.) ITP 2014. LNCS, vol. 8558, pp. 242–257. Springer, Heidelberg (2014)

    Chapter  Google Scholar 

  15. Giorgino, M., Strecker, M., Matthes, R., Pantel, M.: Verification of the schorr-waite algorithm – from trees to graphs. In: Alpuente, M. (ed.) LOPSTR 2010. LNCS, vol. 6564, pp. 67–83. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  16. Filliâtre, J.-C.: Verifying two lines of C with why3: An exercise in program verification. In: Joshi, R., Müller, P., Podelski, A. (eds.) VSTTE 2012. LNCS, vol. 7152, pp. 83–97. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  17. Gerhardt, S.L.: A derivation-oriented proof of the Schorr-Waite algorithm. In: Gerhart, S.L., et al. (eds.) Program Construction. LNCS, vol. 69, pp. 472–492. Springer, Heidelberg (1979)

    Chapter  Google Scholar 

  18. Gonthier, G.: Formal Proof - The Four-Color Theorem. Notices of the AMS 55(11), 1382–1393 (2008)

    MathSciNet  MATH  Google Scholar 

  19. Gries, D.: The Schorr-Waite Graph Marking Algorithm. Acta Informatica 11, 223–232 (1979)

    Article  MATH  Google Scholar 

  20. Griffiths, M.: Development of the Schorr-Waite algorithm. In: Gerhart, S.L., Pair, C., Pepper, P.A., Wössner, H., Dijkstra, E.W., Guttag, J.V., Owicki, S.S., Partsch, H., Bauer, F.L., Gries, D., Griffiths, M., Horning, J.J., Wirsing, M. (eds.) Program Construction. LNCS, vol. 69, pp. 464–471. Springer, Heidelberg (1979)

    Chapter  Google Scholar 

  21. Hackett, B., Rugina, R.: Region-Based Shape Analysis with Tracked Locations. In: 32nd ACM POPL 2005, pp. 310–323 (2005)

    Google Scholar 

  22. Hubert, T., Marché, C.: A case study of C source code verification; the Schorr-Waite algorithm. In: 3rd IEEE SEFM 2005, pp. 190–199 (2005)

    Google Scholar 

  23. Knuth, D.E.: The Art of Computer Programming: Fundamental Algorithms, vol. I. Add. -Wesley (1968)

    Google Scholar 

  24. Leino, K.R.M.: Dafny: An automatic program verifier for functional correctness. In: Clarke, E.M., Voronkov, A. (eds.) LPAR-16 2010. LNCS, vol. 6355, pp. 348–370. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  25. Leroy, X., Blazy, S.: Formal Verification of a C-like Memory Model and Its Uses for Verifying Program Transformations. JAR 41(1), 1–31 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  26. Loginov, A., Reps, T., Sagiv, M.: Automated verification of the deutsch-schorr-waite tree-traversal algorithm. In: Yi, K. (ed.) SAS 2006. LNCS, vol. 4134, pp. 261–279. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  27. Mehta, F., Nipkow, T.: Proving pointer programs in higher-order logic. Info. and Comp. 199(1-2), 200–227 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  28. Morris, J.M.: A Proof of the Schorr-Waite Algorithm. In: TFPM, vol. 91, pp. 43–51. NATO, D. Reidel (1982)

    Google Scholar 

  29. Preoteasa, V., Back, R.-J.: Invariant diagrams with data refinement. FAC 24(1), 67–95 (2012)

    MathSciNet  MATH  Google Scholar 

  30. Reynolds, J.C.: Separation Logic: A Logic for Shared Mutable Data Structures. In: LICS 2002, pp. 55–74 (2002)

    Google Scholar 

  31. Schorr, H., Waite, W.R.: An Efficient Machine-Independent Procedure for Garbage Collection in Various List Structures. CACM 10(8), 501–506 (1967)

    Article  MATH  Google Scholar 

  32. Suzuki, N.: Automatic Verification of Programs with Complex Data Structures. PhD Th., Dept. of CS, Stanford (1976)

    Google Scholar 

  33. Topor, R.W.: The Correctness of the Schorr-Waite List Marking Algorithm. Acta Inf. 11, 211–221 (1979)

    Article  MathSciNet  MATH  Google Scholar 

  34. Ward, M.: Derivation of Data Intensive Algorithms by Formal Transformation. IEEE-TOSE 22(9), 665–686 (1996)

    Google Scholar 

  35. Yang, H.: Relational separation logic. TCS 375(1-3), 308–334 (2007)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Dufourd, JF. (2014). Pointer Program Derivation Using Coq: Graphs and Schorr-Waite Algorithm. In: Merz, S., Pang, J. (eds) Formal Methods and Software Engineering. ICFEM 2014. Lecture Notes in Computer Science, vol 8829. Springer, Cham. https://doi.org/10.1007/978-3-319-11737-9_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-11737-9_10

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-11736-2

  • Online ISBN: 978-3-319-11737-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics