Expressive program verification via structured specifications

  • Cristian Gherghina
  • Cristina David
  • Shengchao QinEmail author
  • Wei-Ngan Chin


Conventional specifications typically have a flat structure that is based primarily on the underlying logic. Such specifications lack structures that could provide better guidance to the verification process. In this work, we propose to add three new structures to a specification framework for separation logic to achieve a more precise and better guided verification for pointer-based programs. The newly introduced structures empower users with more control over the verification process in the following ways: (1) case analysis can be invoked to take advantage of disjointedness conditions in the logic, (2) early, as opposed to late, instantiation can minimise the use of existential quantification and (3) novel formulae structuring can provide better reuse of the verification process. Initial experiments have shown that structured specifications can lead to more precise verification without incurring any performance overhead. To support our proposal, we shall illustrate the usage of structured specifications in the context of proving termination and we will briefly outline the impact of our proposal on a recent development focussed on verifying the FreeRTOS scheduler Ferreira et al. (Int. J. Softw. Tools Technol. Trans. 2014).


Structured specifications Separation logic Case analysis 


  1. 1.
    The FreeRTOS\(^{{\rm TM}}\) project website. (2013). URL:
  2. 2.
    Barnett, M., Leino, K.R.M., Schulte, W.: The Spec# programming system: an overview. In: CASSIS, vol. 3362, pp. 49–69. Springer-Verlag, LNCS, New York (2004)Google Scholar
  3. 3.
    Berdine, J., Calcagno, C., O’Hearn, P.W.: Smallfoot: modular automatic assertion checking with separation logic. In: FMCO, Springer LNCS 4111, pp. 115–137 (2006)Google Scholar
  4. 4.
    Brock, B., Kaufmann, M., Moore, J.S.: ACL2 theorems about commercial microprocessors. In: FMCAD, pp. 275–293 (1996)Google Scholar
  5. 5.
    Bryant, R.E.: Graph-based algorithms for boolean function manipulation. IEEE Trans. Comput. 35, 677–691 (1986)CrossRefzbMATHGoogle Scholar
  6. 6.
    Burdy, L., Cheon, Y., Cok, D.R., Ernst, M.D., Kiniry, J.R., Leavens, G.T., Leino, K.R.M., Poll, E.: An overview of JML tools and applications. Int. J. Softw. Tools Technol. Trans. 7(3), 212–232 (2005)Google Scholar
  7. 7.
    Chang, B.Y.E., Rival, X.: Relational inductive shape analysis. In: POPL, pp. 247–260 (2008)Google Scholar
  8. 8.
    Chin, W.N., David, C., Nguyen, H.H., Qin, S.: Multiple pre/post specifications for heap-manipulating methods. In: HASE, pp. 357–364 (2007)Google Scholar
  9. 9.
    Chin, W.N., David, C., Nguyen, H.H., Qin, S.: Automated verification of shape, size and bag properties via user-defined predicates in separation logic. Sci. Comput. Program. 77(9), 1006–1036 (2012)CrossRefzbMATHGoogle Scholar
  10. 10.
    Distefano, D., Parkinson, M.J.: jStar: towards practical verification for Java. In: OOPSLA (2008)Google Scholar
  11. 11.
    Ferreira, J.F., Gherghina, C., He, G., Qin, S., Chin, W.-N.: Automated verification of the FreeRTOS scheduler in HIP/SLEEK. Int. J. Softw. Tools Technol. Trans (2014). doi: 10.1007/s10009-014-307-4
  12. 12.
    Gherghina, C., David, C., Qin, S., Chin, W.N.: Structured specifications for better verification of heap-manipulating programs. In: FM (2011)Google Scholar
  13. 13.
    Ishtiaq, S., O’Hearn, P.: BI as an assertion language for mutable data structures. In: POPL, pp. 14–26. London (2001)Google Scholar
  14. 14.
    Jacobs, B., Smans, J., Piessens, F.: A quick tour of the veriFast program verifier. In: APLAS, pp. 304–311 (2010)Google Scholar
  15. 15.
    Jonkers, H.B.M.: Upgrading the pre- and postcondition technique. In: VDM, pp. 428–456. Springer-Verlag, London (1991)Google Scholar
  16. 16.
    Klarlund, N., Moller, A.: MONA Version 1.4-User Manual. BRICS Notes Series (2001). URL:
  17. 17.
    Le, T.C., Gherghina, C., Hobor, A., Chin, W.N.: A Specification Logic for Termination and Non-Termination Reasoning Tech. rep. National University of Singapore, Singapore (2012)Google Scholar
  18. 18.
    Leavens, G.T., Baker, A.L.: Enhancing the pre- and postcondition technique for more expressive specifications. In: FM (1999)Google Scholar
  19. 19.
    Leino, K.R.M.: Dafny: An automatic program verifier for functional correctness. In: LPAR (Dakar), pp. 348–370 (2010)Google Scholar
  20. 20.
    Parkinson, M.J., Bierman, G.M.: Separation logic and abstraction. In: POPL, pp. 247–258 (2005)Google Scholar
  21. 21.
    Nguyen, H., David, C., Qin, S., Chin, W.: Automated verification of shape and size properties via separation logic. In: VMCAI. Nice, France (2007)Google Scholar
  22. 22.
    O’Hearn, P., Yang, H., Reynolds, J.: Separation and information hiding. In: POPL, Venice, Italy (2004)Google Scholar
  23. 23.
    Pientka, B.: A heuristic for case analysis. Undergraduate thesis, Technical Paper 37, Department of Artificial Intelligence, University of Edinburgh (1995)Google Scholar
  24. 24.
    Pugh, W.: The Omega Test: A fast practical integer programming algorithm for dependence analysis. Commun. ACM 8, 102–114 (1992) Google Scholar
  25. 25.
    Reynolds, J.: Separation logic: a logic for shared mutable data structures. In: LICS, pp. 55–74. Copenhagen, Denmark (2002)Google Scholar
  26. 26.
    Seino, T., Ogato, K., Futatsugi, K.: Mechanically supporting case analysis for verification of distributed systems. IJPCC (2005)Google Scholar
  27. 27.
    Woodcock, J.: Grand challenge in software verification. In: SBMF (2008)Google Scholar
  28. 28.
    Zee, K., Kuncak, V., Rinard, M.C.: An integrated proof language for imperative programs. In: PLDI, pp. 338–351. ACM, New York (2009)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2014

Authors and Affiliations

  • Cristian Gherghina
    • 1
  • Cristina David
    • 2
  • Shengchao Qin
    • 3
    • 4
    Email author
  • Wei-Ngan Chin
    • 5
  1. 1.Singapore University of Technology and DesignSingaporeSingapore
  2. 2.University of OxfordOxfordUK
  3. 3.Shenzhen UniversityShenzhenChina
  4. 4.Teesside UniversityMiddlesbroughUK
  5. 5.National University of SingaporeSingaporeSingapore

Personalised recommendations