skip to main content
10.1145/2384616.2384655acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Higher-order symbolic execution via contracts

Published:19 October 2012Publication History

ABSTRACT

We present a new approach to automated reasoning about higher-order programs by extending symbolic execution to use behavioral contracts as symbolic values, thus enabling symbolic approximation of higher-order behavior.

Our approach is based on the idea of an abstract reduction semantics that gives an operational semantics to programs with both concrete and symbolic components. Symbolic components are approximated by their contract and our semantics gives an operational interpretation of contracts-as-values. The result is an executable semantics that soundly predicts program behavior, including contract failures, for all possible instantiations of symbolic components. We show that our approach scales to an expressive language of contracts including arbitrary programs embedded as predicates, dependent function contracts, and recursive contracts. Supporting this rich language of specifications leads to powerful symbolic reasoning using existing program constructs.

We then apply our approach to produce a verifier for contract correctness of components, including a sound and computable approximation to our semantics that facilitates fully automated contract verification. Our implementation is capable of verifying contracts expressed in existing programs, and of justifying contract-elimination optimizations.

Skip Supplemental Material Section

Supplemental Material

References

  1. J. Michael Ashley and R. Kent Dybvig. A practical and flexible flow analysis for higher-order languages. ACM Trans. on Program. Lang. Syst., 20 (4): 845--868, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Thomas Ball, Rupak Majumdar, Todd Millstein, and Sriram K. Rajamani. Automatic predicate abstraction of C programs. In Proceedings of the Conference on Programming Language Design and Implementation, pages 203--213, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Thomas Ball, Vladimir Levin, and Sriram K. Rajamani. A decade of software model checking with SLAM. Commun. ACM, 54 (7): 68--76, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Anindya Banerjee. A modular, polyvariant and type-based closure analysis. In Proceedings of the International Conference on Functional Programming, pages 1--10, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Anindya Banerjee and Thomas Jensen. Modular control-flow analysis with rank 2 intersection types. Mathematical. Structures in Comp. Sci., 13 (1): 87--124, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Barnett, M. Fähndrich, K. R. M. Leino, P. Müller, W. Schulte, and H. Venter. Specification and verification: The Spec# experience. Commun. ACM, 54 (6): 81--91, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Matthias Blume and David McAllester. Sound and complete models of contracts. J. Funct. Program., 16 (4--5): 375--414, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Cristian Cadar, Vijay Ganesh, Peter M. Pawlowski, David L. Dill, and Dawson R. Engler. EXE: automatically generating inputs of death. In Proceedings of the Conference on Computer and Communications Security, pages 322--335, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Cristian Cadar, Daniel Dunbar, and Dawson Engler. KLEE: unassisted and automatic generation of high-coverage tests for complex systems programs. In Proceedings of the Conference on Operating Systems Design and Implementation, pages 209--224, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Patrick Cousot and Radhia Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proceedings of the Symposium on Principles of Programming Languages, pages 238--252, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. P. L. Curien. An abstract framework for environment machines. Theoretical Computer Science, 82 (2): 389--402, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Christos Dimoulas and Matthias Felleisen. On contract satisfaction in a higher-order world. ACM Trans. on Program. Lang. Syst., 33, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Christos Dimoulas, Robert B. Findler, Cormac Flanagan, and Matthias Felleisen. Correct blame for contracts: no more scapegoating. In Proceedings of the Symposium on Principles of Programming Languages, pages 215--226, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Manuel Fähndrich and Francesco Logozzo. Static contract checking with abstract interpretation. In Proceedings of the 2010 International Conference on Formal Verification of Object-Oriented Software, pages 10--30, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Manuel Fähndrich, Michael Barnett, and Francesco Logozzo. Embedded contract languages. In Proceedings of the Symposium on Applied Computing, pages 2103--2110, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Matthias Felleisen, Robert B. Findler, Matthew Flatt, and Shriram Krishnamurthi. How to design programs: an introduction to programming and computing. MIT Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Robert B. Findler and Matthias Felleisen. Contracts for higher-order functions. In ICFP '02: Proceedings of the seventh ACM SIGPLAN International Conference on Functional Programming, pages 48--59, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Cormac Flanagan. Effective Static Debugging via Componential Set-Based Analysis. PhD thesis, Rice University, 1997.Google ScholarGoogle Scholar
  19. Matthew Flatt and PLT. Reference: Racket. Technical Report PLT-TR-2010--1, PLT Inc., 2010.Google ScholarGoogle Scholar
  20. Patrice Godefroid, Nils Klarlund, and Koushik Sen. DART: directed automated random testing. In Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 213--223. ACM, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. M. Greenberg. personal communication.Google ScholarGoogle Scholar
  22. Ralf Hinze, Johan Jeuring, and Andres Löh. Typed contracts for functional programming. In Functional and Logic Programming, volume 3945 of LNCS, chapter 15, pages 208--225. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Ralph Johan, Abo Akademi, and J. Von Wright. Refinement Calculus: A Systematic Introduction. Springer-Verlag New York, Inc., 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. James C. King. Symbolic execution and program testing. Commun. ACM, 19 (7): 385--394, 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Naoki Kobayashi. Types and higher-order recursion schemes for verification of higher-order programs. In Proceedings of the Symposium on Principles of Programming Languages, pages 416--428, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Naoki Kobayashi, Ryosuke Sato, and Hiroshi Unno. Predicate abstraction and CEGAR for higher-order model checking. In Proceedings of the Conference on Programming Language Design and Implementation, pages 222--233, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. George Kuan, David MacQueen, and Robert B. Findler. A rewriting semantics for type inference. In Proceedings of the European Symposium on Programming, volume 4421, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Oukseh Lee, Kwangkeun Yi, and Yunheung Paek. A proof method for the correctness of modularized 0CFA. Info. Proc. Letters, 81: 179--185, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Philippe Meunier. Modular Set-Based Analysis from Contracts. PhD thesis, Northeastern University, 2006.Google ScholarGoogle Scholar
  30. Philippe Meunier, Robert B. Findler, and Matthias Felleisen. Modular set-based analysis from contracts. In POPL '06: Conference record of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 218--231, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Bertrand Meyer. Eiffel : The Language. Prentice Hall, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Matthew Might and Olin Shivers. Improving flow analyses via(Γ)CFA: Abstract garbage collection and counting. In Proceedings of the International Conference on Functional Programming, pages 13--25, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. G. Plotkin. LCF considered as a programming language. Theoretical Computer Science, 5 (3): 223--255, 1977.Google ScholarGoogle ScholarCross RefCross Ref
  34. John Reppy. Type-sensitive control-flow analysis. In ML '06: Proceedings of the 2006 Workshop on ML, pages 74--83, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Patrick M. Rondon, Ming Kawaguci, and Ranjit Jhala. Liquid types. In Programming Languages Design and Implementation, PLDI '08, pages 159--169. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Koushik Sen, Darko Marinov, and Gul Agha. CUTE: a concolic unit testing engine for C. SIGSOFT Softw. Eng. Notes, 30 (5): 263--272, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Manuel Serrano. Control flow analysis: a functional languages compilation paradigm. In Proceedings of the Symposium on Applied Computing, pages 118--122, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Olin Shivers. Control-flow analysis of higher-order languages. PhD thesis, Carnegie Mellon University, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. T. Stephen Strickland, Sam Tobin-Hochstadt, Robert Bruce Findler, and Matthew Flatt. Chaperones and impersonators: Runtime support for reasonable interposition. In OOPSLA '12: Object-Oriented Programming, Systems, Languages, and Applications, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Peter Thiemann. Higher-Order redundancy elimination. In Proceedings of the Workshop on Partial Evaluation and Program Manipulation, pages 73--84, 1994.Google ScholarGoogle Scholar
  41. Sam Tobin-Hochstadt and Matthias Felleisen. Logical types for untyped languages. In Proceedings of the International Conference on Functional Programming, pages 117--128, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. David Van Horn and Matthew Might. Abstracting abstract machines. In Proceedings of the International Conference on Functional Programming, pages 51--62, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Dana N. Xu. Hybrid contract checking via symbolic simplification. In Proceedings of the Workshop on Partial Evaluation and Program Manipulation, pages 107--116, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Dana N. Xu, Simon Peyton Jones, and Simon Claessen. Static contract checking for Haskell. In POPL '09: Proceedings of the 36th annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 41--52, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Higher-order symbolic execution via contracts

                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
                • Published in

                  cover image ACM Conferences
                  OOPSLA '12: Proceedings of the ACM international conference on Object oriented programming systems languages and applications
                  October 2012
                  1052 pages
                  ISBN:9781450315616
                  DOI:10.1145/2384616
                  • cover image ACM SIGPLAN Notices
                    ACM SIGPLAN Notices  Volume 47, Issue 10
                    OOPSLA '12
                    October 2012
                    1011 pages
                    ISSN:0362-1340
                    EISSN:1558-1160
                    DOI:10.1145/2398857
                    Issue’s Table of Contents

                  Copyright © 2012 ACM

                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 19 October 2012

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • research-article

                  Acceptance Rates

                  Overall Acceptance Rate268of1,244submissions,22%

                  Upcoming Conference

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader