skip to main content
research-article
Open Access

Implicit dynamic frames

Published:04 May 2012Publication History
Skip Abstract Section

Abstract

An important, challenging problem in the verification of imperative programs with shared, mutable state is the frame problem in the presence of data abstraction. That is, one must be able to specify and verify upper bounds on the set of memory locations a method can read and write without exposing that method's implementation.

Separation logic is now widely considered the most promising solution to this problem. However, unlike conventional verification approaches, separation logic assertions cannot mention heap-dependent expressions from the host programming language, such as method calls familiar to many developers. Moreover, separation logic-based verifiers are often based on symbolic execution. These symbolic execution-based verifiers typically do not support non-separating conjunction, and some of them rely on the developer to explicitly fold and unfold predicate definitions. Furthermore, several researchers have wondered whether it is possible to use verification condition generation and standard first-order provers instead of symbolic execution to automatically verify conformance with a separation logic specification.

In this article, we propose a variant of separation logic called implicit dynamic frames that supports heap-dependent expressions inside assertions. Conformance with an implicit dynamic frames specification can be checked by proving the validity of a number of first-order verification conditions. To show that these verification conditions can be discharged automatically by standard first-order provers, we have implemented our approach in a verifier prototype and have used this prototype to verify several challenging examples from related work. Our prototype automatically folds and unfolds predicate definitions, as required, during the proof and can reason about non-separating conjunction which is used in the specifications of some of these examples. Finally, we prove the soundness of the approach.

References

  1. Banerjee, A., Naumann, D., and Rosenberg, S. 2008. Regional logic for local reasoning about global invariants. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP). Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Barnett, M., DeLine, R., Fähndrich, M., Leino, K. R. M., and Schulte, W. 2003. Verification of object-oriented programs with invariants. J. Obj. Technol. 3, 6.Google ScholarGoogle Scholar
  3. Barnett, M., Fahndrich, M., and Logozzo, F. 2010. Embedded contract languages. In Proceedings of the ACM Symposium on Applied Computing (SAC). Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Barnett, M., Leino, K. R. M., and Schulte, W. 2004. The Spec# programming system: An overview. In Proceedings of the Workshop on Construction and Analysis of Safe, Secure, and Interoperable Smart devices (CASSIS). Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Barnett, M. and Naumann, D. A. 2004. Friends need a bit more: Maintaining invariants over shared state. In Proceedings of the International Conference on Mathematics of Program Construction (MPC).Google ScholarGoogle Scholar
  6. Beckert, B., Hähnle, R., and Schmitt, P. H. 2007. Verification of Object-Oriented Software: The KeY Approach. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Berdine, J., Calcagno, C., and O'Hearn, P. 2005. Symbolic execution with separation logic. In Proceedings of the Asian Symposium on Programming Languages and Systems (APLAS). Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Bornat, R. 2000. Proving pointer programs in hoare logic. In Proceedings of the International Conference on Mathematics of Program Construction (MPC). Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Boyland, J. 2003. Checking interference with fractional permissions. In Proceedings of the International Symposium on Static Analysis. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Burdy, L., Cheon, Y., Cok, D., Ernst, M., Kiniry, J., Leavens, G. T., Leino, K. R. M., and Poll, E. 2005. An overview of JML tools and applications. Int. J. Softw. Tools Technol. Transfer 7, 3. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Calcagno, C., Distefano, D., OHearn, P., and Yang, H. 2009. Compositional shape analysis by means of BI-abduction. In Proceedings of the Symposium on Principles of Programming Languages (POPL). Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Dahlweid, M., Moskal, M., Santen, T., Tobies, S., and Schulte, W. 2009. VCC: Contract-based modular verification of concurrent C. In Proceedings of the International Conference on Software Engineering (ICSE).Google ScholarGoogle Scholar
  13. Darvas, á. and Leino, K. R. M. 2007. Practical reasoning about invocations and implementations of pure methods. In Proceedings of the International Conference on Fundamental Approaches to Software Engineering (FASE). Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. de Moura, L. and Bjørner, N. 2008. Z3: An efficient SMT solver. In Proceedings of the International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS). Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Detlefs, D., Nelson, G., and Saxe, J. B. 2005. Simplify: A theorem prover for program checking. J. ACM 52, 3. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Dijkstra, E. W. 1975. Guarded commands, nondeterminacy and formal derivation of programs. Comm. ACM 18, 8. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Dinsdale-Young, T., Dodds, M., Gardner, P., Parkinson, M., and Vafeiadis, V. 2010. Concurrent abstract predicates. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP). Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Distefano, D. and Parkinson, M. 2008. jStar: Towards practical verification for Java. In Proceedings of the Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA). Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. EIFFEL 2006. Eiffel: Analysis, design and programming language. Standard ECMA-367, ECMA International.Google ScholarGoogle Scholar
  20. Flanagan, C., Leino, K. R. M., Lillibridge, M., Nelson, G., Saxe, J. B., and Stata, R. 2002. Extended static checking for Java. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI). Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Gamma, E., Helm, R., Johnson, R., and Vlissides, J. 1994. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Haack, C. and Hurlin, C. 2009. Resource usage protocols for iterators. J. Obj. Technol. 8, 4.Google ScholarGoogle Scholar
  23. Hobor, A., Appel, A. W., and Nardelli, F. Z. 2008. Oracle semantics for concurrent separation logic. In Proceedings of the European Symposium on Programming (ESOP). Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Jacobs, B. and Piessens, F. 2007. Inspector methods for state abstraction. J. Obj. Technol. 6, 5.Google ScholarGoogle Scholar
  25. Jacobs, B. and Piessens, F. 2011. Expressive modular fine-grained concurrency specification. In Proceedings of the Symposium on Principles of Programming Languages (POPL). Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Jacobs, B., Piessens, F., Smans, J., and Leino, K. R. M. 2008. A programming model for concurrent object-oriented programs. ACM Trans. Program. Lang. Syst. 31, 1. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Jacobs, B., Smans, J., and Piessens, F. 2008. Verifying the composite pattern using separation logic. In Proceedings of the Specification and Verification of Component-Based Systems—Challenge Track (SAVCBS).Google ScholarGoogle Scholar
  28. Jacobs, B., Smans, J., and Piessens, F. 2010. A quick tour of the VeriFast program verifier. In Proceedings of the Asian Symposium on Programming Languages and Systems (APLAS). Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Kassios, Y. 2006. Dynamic frames: Support for framing, dependencies and sharing without restrictions. In Proceedings of the International Symposium on Formal Methods (FM). Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Krishnaswami, N. R. 2006. Reasoning about iterators with separation logic. In Proceedings of the Specification and Verification of Component-Based Systems (SAVCBS). Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Leavens, G. T. 2006. JMLŠs rich, inherited specifications for behavioral subtypes. In Proceedings of the International Conference on Formal Engineering Methods (ICFEM). Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Leavens, G. T., Leino, K. R. M., and Müller, P. 2007. Specification and verification challenges for sequential object-oriented programs. Formal Aspects Comput. 19, 2. Google ScholarGoogle ScholarCross RefCross Ref
  33. Leino, K. R. M. 2010. Dafny: An automatic program verifier for functional correctness. In Proceedings of the International Conference on Logic for Programming Artificial Intelligence and Reasoning (LPAR). Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Leino, K. R. M. and Middelkoop, R. 2009. Proving consistency of pure methods and model fields. In Proceedings of the International Conference on Fundamental Approaches to Software Engineering (FASE). Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Leino, K. R. M. and Monahan, R. 2009. Reasoning about comprehensions with first-order smt solvers. In Proceedings of the ACM Symposium on Applied Computing (SAC). Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Leino, K. R. M. and Müller, P. 2004. Object invariants in dynamic contexts. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP).Google ScholarGoogle Scholar
  37. Leino, K. R. M. and Müller, P. 2009. A basis for verifying multithreaded programs. In Proceedings of the European Symposium on Programming (ESOP). Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Leino, K. R. M., Müller, P., and Smans, J. 2010. A basis for verifying multithreaded programs. In Proceedings of the European Symposium on Programming (ESOP). Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Leino, K. R. M. and Nelson, G. 2002. Data abstraction and information hiding. ACM Trans. Program. Lang. Sys. 24, 5. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Leino, K. R. M., Poetzsch-Heffter, A., and Zhou, Y. 2002. Using data groups to specify and check side effects. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI). Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Leino, K. R. M. and Schulte, W. 2007. Using history invariants to verify observers. In Proceedings of the European Symposium on Programming (ESOP). Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Malecha, G. and Morrisett, G. 2010. Mechanized verification with sharing. In Proceedings of the International Colloquium on Theoretical Aspects of Computing (ICTAC). Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Middelkoop, R., Huizing, C., Kuiper, R., and Luit, E. J. 2008. nvariants for non-hierarchical object structures. In Proceedings of the Brazilian Symposium on Formal Methods (SBMF). Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Müller, P. 2001. Modular specification and verification of object-oriented programs. Ph.D. dissertation, FernUniversität Hagen.Google ScholarGoogle Scholar
  45. Müller, P. and Ruskiewicz, J. N. 2011. Using debuggers to understand failed verification attempts. In Proceedings of the International Symposium on Formal Methods (FM). Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Nanevski, A., Morrisett, G., Shinnar, A., Govereau, P., and Birkedal, L. 2008. Ynot: Reasoning with the awkward squad. In Proceedings of the International Conference on Functional Programming (ICFP).Google ScholarGoogle Scholar
  47. Nanevski, A., Vafeiadis, V., and Berdine, J. 2010. Structuring the verification of heap-manipulating programs. In Proceedings of the Symposium on Principles of Programming Languages (POPL). Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Nguyen, H. H., David, C., Qin, S., and Chin, W.-N. 2007. Automated verification of shape and size properties via separation logic. In Proceedings of the Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI). Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Nguyen, H. H., Kuncak, V., and Chin, W.-N. 2008. Runtime checking for separation logic. In Proceedings of the Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI). Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. O'Hearn, P., Reynolds, J., and Yang, H. 2001. Local reasoning about programs that alter data structures. In Proceedings of the International Workshop on Computer Science Logic (CSL). Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Owicki, S. and Gries, D. 1976. Verifying properties of parallel programs: an axiomatic approach. Comm. ACM 19, 5. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Pariente, D. and Ledinot, E. 2010. Formal verification of industrial C code using Frama-C: A case study. In Proceedings of the International Conference on Formal Verification of Object-Oriented Software (FoVeOOS).Google ScholarGoogle Scholar
  53. Parkinson, M. 2005. Local reasoning for Java. Ph.D. thesis, University of Cambridge.Google ScholarGoogle Scholar
  54. Parkinson, M. 2007. Class invariants: The end of the road? In Proceedings of the International Workshop on Aliasing, Confinement and Ownership in Object-Oriented Programming (IWACO).Google ScholarGoogle Scholar
  55. Parkinson, M. and Bierman, G. 2005. Separation logic and abstraction. In Proceedings of the Symposium on Principles of Programming Languages (POPL). Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. Parkinson, M. and Bierman, G. 2008. Separation logic, abstraction and inheritance. In Proceedings of the Symposium on Principles of Programming Languages (POPL). Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. Parkinson, M. and Summers, A. 2011. The relationship between separation logic and implicit dynamic frames. In Proceedings of the European Symposium on Programming (ESOP). Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. Reynolds, J. 2002. Separation logic: A logic for shared mutable data structures. In Proceedings of the Symposium on Logic in Computer Science (LICS). Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. Rival, X. and Chang, B.-Y. E. 2011. Calling context abstraction with shapes. In Proceedings of the Symposium on Principles of Programming Languages (POPL). Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. Rosenberg, S., Banerjee, A., and Naumann, D. A. 2010. Local reasoning and dynamic framing for the composite pattern and its clients. In Proceedings of the International Conference on Verified Software: Theories, Tools and Experiments. Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. Rudich, A., Darvas, á., and Müller, P. 2008. Checking well-formedness of pure-method specifications. In Proceedings of the International Symposium on Formal Methods (FM). Google ScholarGoogle ScholarDigital LibraryDigital Library
  62. Schoeller, B. 2007. Making classes provable through contracts. Ph.D. ETH Zurich.Google ScholarGoogle Scholar
  63. Smans, J., Jacobs, B., and Piessens, F. 2009. Implicit dynamic frames: Combining dynamic frames and separation logic. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP). Google ScholarGoogle ScholarDigital LibraryDigital Library
  64. Smans, J., Jacobs, B., and Piessens, F. 2010. Heap-dependent expressions in separation logic. In Proceedings of the International Conference on Formal Techniques for Distributed Systems (FMOODS/FORTE). Google ScholarGoogle ScholarDigital LibraryDigital Library
  65. Smans, J., Jacobs, B., Piessens, F., and Schulte, W. 2008. An automatic verifier for Java-like programs based on dynamic frames. In Proceedings of the International Conference on Fundamental Approaches to Software Engineering (FASE). Google ScholarGoogle ScholarDigital LibraryDigital Library
  66. Summers, A. J. and Drossopoulou, S. 2010. Considerate reasoning and the composite design pattern. In Proceedings of the Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI). Google ScholarGoogle ScholarDigital LibraryDigital Library
  67. Tuch, H., Klein, G., and Norrish, M. 2007. Types, bytes, and separation logic. In Proceedings of the Symposium on Principles of Programming Languages (POPL). Google ScholarGoogle ScholarDigital LibraryDigital Library
  68. Tuerk, T. 2009. A formalization of Smallfoot in HOL. In Proceedings of the International Conference on Theorem Proving in Higher-Order Logics (TPHOLs). Google ScholarGoogle ScholarDigital LibraryDigital Library
  69. Tuerk, T. 2010. Local reasoning about while-loops. In Proceedings of the International Conference on Verified Software: Theories, Tools and Experiments—Theory Workshop (VS-Theory).Google ScholarGoogle Scholar
  70. van Staden, S., Calcagno, C., and Meyer, B. 2010. Verifying executable object-oriented specifications with separation logic. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP). Google ScholarGoogle ScholarDigital LibraryDigital Library
  71. Villard, J., Lozes, é., and Calcagno, C. 2009. Proving copyless message passing. In Proceedings of the Asian Symposium on Programming Languages and Systems (APLAS). Google ScholarGoogle ScholarDigital LibraryDigital Library
  72. Zee, K., Kuncak, V., and Rinard, M. C. 2008. Full functional verification of linked data structures. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI). Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Implicit dynamic frames

      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 Transactions on Programming Languages and Systems
        ACM Transactions on Programming Languages and Systems  Volume 34, Issue 1
        April 2012
        225 pages
        ISSN:0164-0925
        EISSN:1558-4593
        DOI:10.1145/2160910
        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: 4 May 2012
        • Accepted: 1 January 2012
        • Received: 1 July 2011
        Published in toplas Volume 34, Issue 1

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader