Specifying Compatible Sharing in Data Structures

  • Asankhaya SharmaEmail author
  • Aquinas Hobor
  • Wei-Ngan Chin
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9407)


Automated verification of programs that utilize data structures with intrinsic sharing is a challenging problem. We develop an extension to separation logic that can reason about aliasing in heaps using a notion of compatible sharing. Compatible sharing can model a variety of fine grained sharing and aliasing scenarios with concise specifications. Given these specifications, our entailment procedure enables fully automated verification of a number of challenging programs manipulating data structures with non-trivial sharing. We benchmarked our prototype with examples derived from practical algorithms found in systems code, such as those using threaded trees and overlaid data structures.


Field Annotation Memory Specification Data Node Separation Logic Memory Region 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.



This work is supported by MoE 2013-T2-2-146 and Yale-NUS College R-607-265-045-121.


  1. 1.
    Banerjee, A., Naumann, D.A., Rosenberg, S.: Regional logic for local reasoning about global invariants. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 387–411. Springer, Heidelberg (2008) CrossRefGoogle Scholar
  2. 2.
    Berdine, J., Calcagno, C., O’Hearn, P.W.: Smallfoot: modular automatic assertion checking with separation logic. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2005. LNCS, vol. 4111, pp. 115–137. Springer, Heidelberg (2006) CrossRefGoogle Scholar
  3. 3.
    Boyland, J.T.: Semantics of fractional permissions with nesting. ACM Trans. Program. Lang. Syst. 32(6), 22:1–22:33 (2010)CrossRefGoogle Scholar
  4. 4.
    Cherini, R., Rearte, L., Blanco, J.: A shape analysis for non-linear data structures. In: Cousot, R., Martel, M. (eds.) SAS 2010. LNCS, vol. 6337, pp. 201–217. Springer, Heidelberg (2010) CrossRefGoogle Scholar
  5. 5.
    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
  6. 6.
    David, C., Chin, W.-N.: Immutable specifications for more concise and precise verification. In: OOPSLA, pp. 359–374 (2011)Google Scholar
  7. 7.
    Dinsdale-Young, T., Dodds, M., Gardner, P., Parkinson, M.J., Vafeiadis, V.: Concurrent abstract predicates. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 504–528. Springer, Heidelberg (2010) CrossRefGoogle Scholar
  8. 8.
    Drăgoi, C., Enea, C., Sighireanu, M.: Local shape analysis for overlaid data structures. In: Logozzo, F., Fähndrich, M. (eds.) Static Analysis. LNCS, vol. 7935, pp. 150–171. Springer, Heidelberg (2013) CrossRefGoogle Scholar
  9. 9.
    Enea, C., Saveluc, V., Sighireanu, M.: Compositional invariant checking for overlaid and nested linked lists. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 129–148. Springer, Heidelberg (2013) CrossRefGoogle Scholar
  10. 10.
    Gast, H.: Reasoning about memory layouts. In: FM, pp. 628–643 (2009)Google Scholar
  11. 11.
    Gotsman, A., Berdine, J., Cook, B.: Interprocedural shape analysis with separated heap abstractions. In: Yi, K. (ed.) SAS 2006. LNCS, vol. 4134, pp. 240–260. Springer, Heidelberg (2006) CrossRefGoogle Scholar
  12. 12.
    Hobor, A., Villard, J.: The Ramifications of sharing in data structures. In: POPL (2013)Google Scholar
  13. 13.
    Ishtiaq, S., O’Hearn, P.W.: BI as an assertion language for mutable data structures. In: ACM POPL, pp. 14–26. London, January 2001Google Scholar
  14. 14.
    Kelly, P., Maslov, V., Pugh, W., et al.: The Omega Library Version 1.1.0 Interface Guide, November 1996Google Scholar
  15. 15.
    Klarlund, N., Moller, A.: MONA Version 1.4 - User Manual. BRICS Notes Series, January 2001Google Scholar
  16. 16.
    Le, X.B., Gherghina, C., Hobor, A.: Decision procedures over sophisticated fractional permissions. In: Jhala, R., Igarashi, A. (eds.) APLAS 2012. LNCS, vol. 7705, pp. 368–385. Springer, Heidelberg (2012) CrossRefGoogle Scholar
  17. 17.
    Lee, O., Yang, H., Petersen, R.: Program analysis for overlaid data structures. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 592–608. Springer, Heidelberg (2011) CrossRefGoogle Scholar
  18. 18.
    Reynolds, J.: Separation aogic: a logic for shared mutable data structures. In: IEEE LICS, pp. 55–74 (2002)Google Scholar
  19. 19.
    Trinh, M.-T., Le, Q.L., David, C., Chin, W.-N.: Bi-abduction with pure properties for specification inference. In: Shan, C. (ed.) APLAS 2013. LNCS, vol. 8301, pp. 107–123. Springer, Heidelberg (2013) CrossRefGoogle Scholar
  20. 20.
    Turon, A.J., Wand, M.: A separation logic for refining concurrent objects. In: POPL, pp. 247–258 (2011)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  • Asankhaya Sharma
    • 1
    Email author
  • Aquinas Hobor
    • 1
    • 2
  • Wei-Ngan Chin
    • 1
  1. 1.School of ComputingNational University of SingaporeSingaporeSingapore
  2. 2.Yale-NUS CollegeNational University of SingaporeSingaporeSingapore

Personalised recommendations