skip to main content
10.1145/1190216.1190234acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article

Types, bytes, and separation logic

Authors Info & Claims
Published:17 January 2007Publication History

ABSTRACT

We present a formal model of memory that both captures the low-level features of C's pointers and memory, and that forms the basis for an expressive implementation of separation logic. At the low level, we do not commit common oversimplifications, but correctly deal with C's model of programming language values and the heap. At the level of separation logic, we are still able to reason abstractly and efficiently. We implement this framework in the theorem prover Isabelle/HOL and demonstrate it on two case studies. We show that the divide between detailed and abstract does not impose undue verification overhead, and that simple programs remain easy to verify. We also show that the framework is applicable to real, security- and safety-critical code by formally verifying the memory allocator of the L4 microkernel.

References

  1. Beyond reachability: Shape abstraction in the presence of pointer arithmetic. In 13th International Symposium on Static Analysis (SAS 2006), volume 4134 of Lecture Notes in Computer Science, pages 182--203. Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. T. Ball and S. K. Rajamani. Automatically validating temporal safety properties of interfaces. In SPIN'01, Workshop on Model Checking of Software, volume 2057 of Lecture Notes in Computer Science, pages 103--122, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. J. Berdine, C. Calcagno, and P. O'Hearn. A decidable fragment of separation logic. In FSTTCS 2004: Foundations of Software Technology and Theoretical Computer Science, 24th International Conference, Chennai, India, December 16--18, 2004, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. W. R. Bevier. Kit: A study in operating system verification. IEEE Transactions on Software Engineering, 15(11):1382--1396, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Beyer, T. A. Henzinger, R. Jhala, and R. Majumdar. Checking memory safety with Blast. In Proceedings of the International Conference on Fundamental Approaches to Software Engineering (FASE), volume 3442 ofLecture Notes in Computer Science, pages 2--18. Springer, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. Bloch. Nearly all binary searches and mergesorts are broken. newblock http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html, June 2006.Google ScholarGoogle Scholar
  7. M. Blume. No-longer-foreign: Teaching an ML compiler to speak C "natively". Electronic Notes in Theoretical Computer Science, 59(1), 2001.Google ScholarGoogle Scholar
  8. R. Bornat. Proving pointer programs in Hoare Logic. In R. Backhouse and J. Oliveira, editors,Mathematics of Program Construction (MPC 2000), volume 1837 of LNCS, pages 102--126. Springer, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. R. Burstall. Some techniques for proving correctness of programs which alter data structures. In B. Meltzer and D. Michie, editors, Machine Intelligence 7, pages 23--50. Edinburgh University Press, 1972.Google ScholarGoogle Scholar
  10. B. Cook, D. Kroening, and N. Sharygina. Cogent: Accurate theorem proving for program verification. In K. Etessami and S. K. Rajamani, editors, Proceedings of CAV 2005, volume 3576 ofLecture Notes in Computer Science, pages 296--300. Springer Verlag, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. Daum, S. Maus, N. Schirmer, and M. N. Seghir. Integration of a software model checker into Isabelle. In G. Sutcliffe and A. Voronkov, editors, Logic for Programming, Artificial Intelligence, and Reasoning: 12th International Conference, LPAR 2005, volume 3835 ofLecture Notes in Artificial Intelligence, pages 381--395, Montego Bay, Jamaica, October 2005. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J.-C. Filliâtre and C. Marché. Multi-prover verification of C programs. InFormal Methods and Software Engineering, 6th International Conference on Formal Engineering Methods, ICFEM 2004, Seattle, USA, volume 3308 ofLNCS, pages 15--29. Springer, 2004.Google ScholarGoogle Scholar
  13. M. Gargano, M. Hillebrand, D. Leinenbach, and W. Paul. On the correctness of operating system kernels. In Proc. 18th International Conference on Theorem Proving in Higher Order Logics (TPHOLs'05), pages 1--16, Oxford, UK, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. T. A. Henzinger, R. Jhala, R. Majumdar, and G. Sutre. Software verification with Blast. In SPIN'03, Workshop on Model Checking Software, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Hohmuth, H. Tews, and S. G. Stephens. Applying source-code verification to a microkernel --- the VFiasco project. Technical Report TUD-FI02-03-M"arz, TU Dresden, 2002.Google ScholarGoogle Scholar
  16. S. S. Ishtiaq and P. W. O'Hearn. BI as an assertion language for mutable data structures. In POPL '01: Proceedings of the 28th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 14--26, New York, NY, USA, 2001. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. L4Ka Team. L4 emphfootnotesize eXemphfootnotesize perimental Kernel Reference Manual Version X.2. University of Karlsruhe, Oct. 2001. http://l4ka.org/projects/version4/l4-x2.pdf.Google ScholarGoogle Scholar
  18. N. Marti, R. Affeldt, and A. Yonezawa. Verification of the heap manager of an operating system using separation logic. In Third workshop on Semantics, Program Analysis, and Computing Environments For Memory Management (SPACE 2006), pages 61--72, Jan. 2006.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. F. Mehta and T. Nipkow. Proving pointer programs in higher-order logic. Information and Computation, 2005. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. Moller and M. I. Schwartzbach. The pointer assertion logic engine. In Proc. ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '01, June 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. G. Necula, J. Condit, M. Harren, S. McPeak, and W. Weimer. CCured: type-safe retrofitting of legacy software. ACM Trans. Prog. Lang. Syst., 27(3):477--526, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. P. G. Neumann, R. S. Boyer, R. J. Feiertag, K. N. Levitt, and L. Robinson. A provably secure operating system: The system, its applications, and proofs. Technical Report CSL-116, SRI International, 1980.Google ScholarGoogle Scholar
  23. T. Nipkow, L. Paulson, and M. Wenzel. Isabelle/HOL --- A Proof Assistant for Higher-Order Logic, volume 2283 of LNCS. Springer, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. Norrish. C formalised in HOL. PhD thesis, Computer Laboratory, University of Cambridge, 1998.Google ScholarGoogle Scholar
  25. J. C. Reynolds. Separation logic: A logic for shared mutable data structures. In Proc. 17th IEEE Symposium on Logic in Computer Science, pages 55--74, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. M. Sagiv, T. Reps, and R. Wilhelm. Parametric shape analysis via 3-valued logic. In POPL '99: Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 105--118. ACM Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. N. Schirmer. Verification of Sequential Imperative Programs in Isabelle/HOL. PhD thesis, Technische Universit"at München, 2006.Google ScholarGoogle Scholar
  28. H. Tuch and G. Klein. A unified memory model for pointers. In G. Sutcliffe and A. Voronkov, editors, 12th International Conference on Logic for Programming Artificial Intelligence and Reasoning (LPAR-12), volume 3835 ofLNCS, pages 474--488, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. H. Tuch, G. Klein, and M. Norrish. Verification of the L4 kernel memory allocator. Formal proof document. http://www.ertos.nicta.com.au/research/l4.verified/kmalloc.pml, July 2006.Google ScholarGoogle Scholar
  30. B. Walker, R. Kemmerer, and G. Popek. Specification and verification of the UCLA Unix security kernel. CACM, 23(2):118--131, 1980. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. T. Weber. Towards mechanized program verification with separation logic. In J. Marcinkowski and A. Tarlecki, editors,Computer Science Logic -- 18th International Workshop, CSL 2004, volume 3210 ofLecture Notes in Computer Science, pages 250--264. Springer, 2004.Google ScholarGoogle Scholar
  32. M. Wenzel. Type classes and overloading in higher-order logic. In E. L. Gunter and A. Felty, editors,Theorem Proving in Higher Order Logics'97, volume 1275 ofLNCS, pages 307--322. Springer, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. M. Wildmoser and T. Nipkow. Certifying machine code safety: Shallow versus deep embedding. In K. Slind, A. Bunker, and G. Gopalakrishnan, editors,Theorem Proving in Higher Order Logics 2004, volume 3223 ofLNCS, pages 305--320. Springer, 2004.Google ScholarGoogle Scholar
  34. H. Yang and P. W. O'Hearn. A semantic basis for local reasoning. In Foundations of Software Science and Computation Structure, pages 402--416, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. K. Zee, P. Lam, V. Kuncak, and M. Rinard. Combining theorem proving with static analysis for data structure consistency. In Int. Workshop on Software Verification and Validation, 2004.Google ScholarGoogle Scholar

Index Terms

  1. Types, bytes, and separation logic

    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
      POPL '07: Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
      January 2007
      400 pages
      ISBN:1595935754
      DOI:10.1145/1190216
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 42, Issue 1
        Proceedings of the 2007 POPL Conference
        January 2007
        379 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1190215
        Issue’s Table of Contents

      Copyright © 2007 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: 17 January 2007

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

      Acceptance Rates

      Overall Acceptance Rate824of4,130submissions,20%

      Upcoming Conference

      POPL '25

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader