skip to main content
research-article

Effective interactive proofs for higher-order imperative programs

Published:31 August 2009Publication History
Skip Abstract Section

Abstract

We present a new approach for constructing and verifying higher-order, imperative programs using the Coq proof assistant. We build on the past work on the Ynot system, which is based on Hoare Type Theory. That original system was a proof of concept, where every program verification was accomplished via laborious manual proofs, with much code devoted to uninteresting low-level details. In this paper, we present a re-implementation of Ynot which makes it possible to implement fully-verified, higher-order imperative programs with reasonable proof burden. At the same time, our new system is implemented entirely in Coq source files, showcasing the versatility of that proof assistant as a platform for research on language design and verification. Both versions of the system have been evaluated with case studies in the verification of imperative data structures, such as hash tables with higher-order iterators. The verification burden in our new system is reduced by at least an order of magnitude compared to the old system, by replacing manual proof with automation. The core of the automation is a simplification procedure for implications in higher-order separation logic, with hooks that allow programmers to add domain-specific simplification rules.

We argue for the effectiveness of our infrastructure by verifying a number of data structures and a packrat parser, and we compare to similar efforts within other projects. Compared to competing approaches to data structure verification, our system includes much less code that must be trusted; namely, about a hundred lines of Coq code defining a program logic. All of our theorems and decision procedures have or build machine-checkable correctness proofs from first principles, removing opportunities for tool bugs to create faulty verifications.

Skip Supplemental Material Section

Supplemental Material

effectiveinteractiveproofsforhigher-order.mp4

References

  1. Mike Barnett, K. Rustan M. Leino, and Wolfram Schulte. The Spec# programming system: An overview. In Proc. CASSIS, 2004.Google ScholarGoogle Scholar
  2. Bruno Barras and Bruno Bernardo. The Implicit Calculus of Constructions as a programming language with dependent types. In Proc. FoSSaCS, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Josh Berdine, Cristiano Calcagno, and Peter W. O'Hearn. Smallfoot: Modular automatic assertion checking with separation logic. In Proc. FMCO, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Yves Bertot and Pierre Castéran. Interactive Theorem Proving and Program Development. Coq'Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. Springer Verlag, 2004.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Bor-Yuh Evan Chang and Xavier Rival. Relational inductive shape analysis. In Proc. POPL, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Arthur Charguéraud and François Pottier. Functional translation of a calculus of capabilities. In Proc. ICFP, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Chiyan Chen and Hongwei Xi. Combining programming with theorem proving. In Proc. ICFP, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. David Delahaye. A tactic language for the system Coq. In Proc. LPAR, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Cormac Flanagan, K. Rustan M. Leino, Mark Lillibridge, Greg Nelson, James B. Saxe, and Raymie Stata. Extended static checking for Java. In Proc. PLDI, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Bryan Ford. Parsing expression grammars: A recognition-based syntactic foundation. In Proc. POPL, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Jessica Gronski, Kenneth Knowles, Aaron Tomb, Stephen N. Freund, and Cormac Flanagan. Sage: Hybrid checking for flexible specifications. In Proc. Scheme Workshop, 2006.Google ScholarGoogle Scholar
  12. Matt Kaufmann and J. S. Moore. An industrial strength theorem prover for a logic based on Common Lisp. IEEE Trans. Softw. Eng., 23 (4), 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Xavier Leroy. Formal certification of a compiler back-end or: programming a compiler with a proof assistant. In Proc. POPL, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Barbara Liskov and Stephen N. Zilles. Specification techniques for data abstractions. IEEE Trans. Software Eng., 1 (1): 7--19, 1975.Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Conor McBride and James McKinna. The view from the left. J. Functional Programming, 14 (1): 69--111, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Aleksandar Nanevski, Greg Morrisett, and Lars Birkedal. Polymorphism and separation in Hoare Type Theory. Proc. ICFP, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Aleksandar Nanevski, Greg Morrisett, Avraham Shinnar, Paul Govereau, and Lars Birkedal. Ynot: Reasoning with the awkward squad. In Proc. ICFP, 2008.Google ScholarGoogle Scholar
  18. Ulf Norell. Towards a practical programming language based on dependent type theory. PhD thesis, Chalmers University of Technology, 2007.Google ScholarGoogle Scholar
  19. Emir Pasalic, Jeremy Siek, Walid Taha, and Seth Fogarty. Concoqtion: Indexed types now! In Proc. PEPM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Lawrence C Paulson. Isabelle: A generic theorem prover. Journal of Automated Reasoning, 5, 1994.Google ScholarGoogle Scholar
  21. Rasmus L. Petersen, Lars Birkedal, Aleksandar Nanevski, and Greg Morrisett. A realizability model for impredicative Hoare Type Theory. In Proc. ESOP, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. John C. Reynolds. Separation logic: A logic for shared mutable data structures. In Proc. LICS, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Mooly Sagiv, Thomas Reps, and Reinhard Wilhelm. Parametric shape analysis via 3-valued logic. ACM TOPLAS, 24, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Wouter Swierstra and Thorsten Altenkirch. Beauty in the beast: A functional semantics for the awkward squad. In Proc. Haskell Workshop, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Karen Zee, Viktor Kuncak, and Martin Rinard. Full functional verification of linked data structures. In Proc. PLDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Effective interactive proofs for higher-order imperative programs

                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 SIGPLAN Notices
                  ACM SIGPLAN Notices  Volume 44, Issue 9
                  ICFP '09
                  September 2009
                  343 pages
                  ISSN:0362-1340
                  EISSN:1558-1160
                  DOI:10.1145/1631687
                  Issue’s Table of Contents
                  • cover image ACM Conferences
                    ICFP '09: Proceedings of the 14th ACM SIGPLAN international conference on Functional programming
                    August 2009
                    364 pages
                    ISBN:9781605583327
                    DOI:10.1145/1596550

                  Copyright © 2009 ACM

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 31 August 2009

                  Check for updates

                  Qualifiers

                  • research-article

                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!