skip to main content
research-article

SPARK by Example: an introduction to formal verification through the standard C++ library

Published:06 December 2019Publication History
Skip Abstract Section

Abstract

This paper presents SPARK by Example [10], a guide for people wanting to get involved in formal verification of SPARK programs. SPARK by Example is inspired by ACSL by Example, a similar effort for C/ACSL programs, and provides detailed specification, implementation and proof of classic algorithms (array manipulation, sorting, heap etc). A comparison between ACSL and SPARK is done in the light of proof performance and ease of use.

References

  1. AdaCore. 2018. Advanced SPARK -- online course. https://learn.adacore.com/ courses/advanced-spark/index.htmlGoogle ScholarGoogle Scholar
  2. AdaCore. 2018. Introduction to SPARK -- online course. https://learn.adacore.com/ courses/intro-to-spark/index.htmlGoogle ScholarGoogle Scholar
  3. AdaCore and Altran UK Ltd. 2018. SPARK 2014's User Guide. http://docs.adacore. com/spark2014-docs/html/ug/index.htmlGoogle ScholarGoogle Scholar
  4. AdaCore and Thales. 2017. Implementation guidance for the adoption of SPARK. https://www.adacore.com/books/implementation-guidance-sparkGoogle ScholarGoogle Scholar
  5. Patrick Baudin, Pascal Cuoq, Jean-Christophe Filliâtre, Claude Marché, Benjamin Monate, Yannick Moy, and Virgile Prevosto. 2018. ACSL: ANSI/ISO C specification language. https://frama-c.com/download/ acsl-implementation-Chlorine-20180501.pdfGoogle ScholarGoogle Scholar
  6. Stefan Berghofer. 2017. Development of Security-Critical Software with SPARK/Ada at secunet. (Presented at) Frama-C & SPARK days: Formal Analysis and Proof for Programs in C and Ada. https://frama-c.com/download/ framaCDay/FCSD17/talk/09_Berghofer.pdfGoogle ScholarGoogle Scholar
  7. François Bobot, Jean-Christophe Filliâtre, Claude Marché, and Andrei Paskevich. 2011. Why3: Shepherd Your Herd of Provers. In Boogie 2011: First International Workshop on Intermediate Verification Languages. Wroc?aw, Poland, 53--64. https: //hal.inria.fr/hal-00790310.Google ScholarGoogle Scholar
  8. Jochen Burghardt and Jens Gerlach. 2018. ACSL by Example. https://github. com/fraunhoferfokus/acsl-by-exampleGoogle ScholarGoogle Scholar
  9. CEA List. 2018. Frama-C. https://frama-c.comGoogle ScholarGoogle Scholar
  10. Léo Creuse, Christohe Garion, Jérôme Hugues, and Joffrey Huguet. 2018. SPARK by Example. https://github.com/tofgarion/spark-by-exampleGoogle ScholarGoogle Scholar
  11. Mickaël Delahaye, Nikolai Kosmatov, and Julien Signoles. 2013. Common specification language for static and dynamic analysis of C programs. In Proceedings of the 28th Annual ACM Symposium on Applied Computing, SAC '13, Coimbra, Portugal, March 18--22, 2013, Sung Y. Shin and José Carlos Maldonado (Eds.). ACM, 1230--1235. https://doi.org/10.1145/2480362.2480593Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. EdgerW. Dijkstra. 1975. Guarded commands, nondeterminacy and formal derivation of program. 18, 8 (1975), 453--457.Google ScholarGoogle Scholar
  13. Claire Dross and Yannick Moy. 2017. Auto-Active Proof of Red-Black Trees in SPARK. In NASA Formal Methods, Clark Barrett, Misty Davies, and Temesghen Kahsai (Eds.). Springer International Publishing, Cham, 68--83.Google ScholarGoogle Scholar
  14. Jean-Christophe Filliâtre and Andrei Paskevich. 2013. Why3 - Where Programs Meet Provers. In Proceedings of the 22nd European Symposium on Programming (Lecture Notes in Computer Science), Matthias Felleisen and Philippa Gardner (Eds.), Vol. 7792. Springer, 125--128.Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. RobertW. Floyd. 1967. Assigning meanings to programs. In Mathematical aspects of computer science, J. T. Schwartz (Ed.). American Mathematical Society, 19--32.Google ScholarGoogle Scholar
  16. International Organization for Standardization. 2011. ISO/IEC 14882:2011.Google ScholarGoogle Scholar
  17. David Hauzar, Claude Marché, and Yannick Moy. 2016. Counterexamples from Proof Failures in SPARK. In Software Engineering and Formal Methods (Software Engineering and Formal Methods). Springer, Vienna, Austria. https://hal.inria.fr/ hal-01314885Google ScholarGoogle Scholar
  18. C. A. R. Hoare. 1969. An axiomatic basis for computer programming. 12, 10 (1969), 576--580.Google ScholarGoogle Scholar
  19. John W. McCormick and Peter C. Chapin. 2015. Building High Integrity Applications with SPARK. Cambridge University Press.Google ScholarGoogle Scholar
  20. Florent Kirchner, Nikolai Kosmatov, Virgile Prevosto, Julien Signoles, and Boris Yakobowski. 2015. Frama-C: A software analysis perspective. Formal Asp. Comput. 27, 3 (2015), 573--609. https://doi.org/10.1007/s00165-014-0326--7Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Memcached community. 2018. Memcached. https://memcached.org/Google ScholarGoogle Scholar
  22. Bertrand Meyer. 1992. Applying "Design by Contract". IEEE Computer 25, 10 (1992), 40--51. https://doi.org/10.1109/2.161279Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Guillaume Petiot, Nikolai Kosmatov, Bernard Botella, Alain Giorgetti, and Jacques Julliand. 2016. Your Proof Fails? Testing Helps to Find the Reason. In Tests and Proofs - 10th International Conference, TAP 2016, Held as Part of STAF 2016, Vienna, Austria, July 5--7, 2016, Proceedings (Lecture Notes in Computer Science), Bernhard K. Aichernig and Carlo A. Furia (Eds.), Vol. 9762. Springer, 130--150. https://doi.org/10.1007/978--3--319--41135--4_8Google ScholarGoogle Scholar
  24. P.J. Plauger, Meng Lee, David Musser, and Alexander A. Stepanov. 2000. C++ Standard Template Library. Prentice Hall PTR.Google ScholarGoogle Scholar
  25. Alexander Senier. 2018. SPARK Cryptographic Library. https://git.codelabs.ch/ ?p=spark-crypto.gitGoogle ScholarGoogle Scholar
  26. Julien Signoles. 2018. E-ACSL: Executable ANSI/ISO C Specification Laguage. http://frama-c.com/download/e-acsl/e-acsl.pdfGoogle ScholarGoogle Scholar
  27. The Toccata team. 2018. Why3. http://why3.lri.fr/Google ScholarGoogle Scholar
  28. Jeffrey Voas and Kim Schaffer. 2016. Insights on Formal Methods in Cybersecurity. 49, 5 (2016), 102--105. https://doi.org/10.1109/MC.2016.131Google ScholarGoogle Scholar
  29. Zhi Zhang, Robby, John Hatcliff, Yannick Moy, and Pierre Courtieu. 2017. Focused Certification of an Industrial Compilation and Static Verification Toolchain. In Software Engineering and Formal Methods, Alessandro Cimatti and Marjan Sirjani (Eds.). Springer International Publishing, Cham, 17--34.Google ScholarGoogle Scholar

Index Terms

(auto-classified)
  1. SPARK by Example: an introduction to formal verification through the standard C++ library

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGAda Ada Letters
        ACM SIGAda Ada Letters  Volume 38, Issue 2
        December 2018
        106 pages
        ISSN:1094-3641
        DOI:10.1145/3375408
        • Editor:
        • Alok Srivastava
        Issue’s Table of Contents

        Copyright © 2019 Copyright is held by the owner/author(s)

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 6 December 2019

        Check for updates

        Qualifiers

        • research-article
      • Article Metrics

        • Downloads (Last 12 months)13
        • Downloads (Last 6 weeks)1

        Other Metrics

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!