Specifying and Verifying Concurrent Algorithms with Histories and Subjectivity

  • Ilya SergeyEmail author
  • Aleksandar Nanevski
  • Anindya Banerjee
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9032)


We present a lightweight approach to Hoare-style specifications for fine-grained concurrency, based on a notion of time-stamped histories that abstractly capture atomic changes in the program state. Our key observation is that histories form a partial commutative monoid, a structure fundamental for representation of concurrent resources. This insight provides us with a unifying mechanism that allows us to treat histories just like heaps in separation logic. For example, both are subject to the same assertion logic and inference rules (e.g., the frame rule). Moreover, the notion of ownership transfer, which usually applies to heaps, has an equivalent in histories. It can be used to formally represent helping—an important design pattern for concurrent algorithms whereby one thread can execute code on behalf of another. Specifications in terms of histories naturally abstract away the internal interference, so that sophisticated fine-grained algorithms can be given the same specifications as their simplified coarse-grained counterparts, making them equally convenient for client-side reasoning. We illustrate our approach on a number of examples and validate all of them in Coq.


Auxiliary State Proof Outline Separation Logic Hoare Logic State Transition System 
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.


  1. 1.
    Bell, C.J., Appel, A.W., Walker, D.: Concurrent separation logic for pipelined parallelization. In: Cousot, R., Martel, M. (eds.) SAS 2010. LNCS, vol. 6337, pp. 151–166. Springer, Heidelberg (2010)Google Scholar
  2. 2.
    Brookes, S.: A semantics for concurrent separation logic. Th. Comp. Sci. 375(1-3) (2007)Google Scholar
  3. 3.
    Calcagno, C., O’Hearn, P.W., Yang, H.: Local action and abstract separation logic. In: LICS (2007)Google Scholar
  4. 4.
    Cerone, A., Gotsman, A., Yang, H.: Parameterised Linearisability. In: Esparza, J., Fraigniaud, P., Husfeldt, T., Koutsoupias, E. (eds.) ICALP 2014, Part II. LNCS, vol. 8573, pp. 98–109. Springer, Heidelberg (2014)Google Scholar
  5. 5.
    da Rocha Pinto, P., Dinsdale-Young, T., Gardner, P.: TaDA: A Logic for Time and Data Abstraction. In: Jones, R. (ed.) ECOOP 2014. LNCS, vol. 8586, pp. 207–231. Springer, Heidelberg (2014)Google Scholar
  6. 6.
    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)Google Scholar
  7. 7.
    Elmas, T., Qadeer, S., Sezgin, A., Subasi, O., Tasiran, S.: Simplifying linearizability proofs with reduction and abstraction. In: Esparza, J., Majumdar, R. (eds.) TACAS 2010. LNCS, vol. 6015, pp. 296–311. Springer, Heidelberg (2010)Google Scholar
  8. 8.
    Feng, X.: Local rely-guarantee reasoning. In: POPL (2009)Google Scholar
  9. 9.
    Feng, X., Ferreira, R., Shao, Z.: On the relationship between concurrent separation logic and assume-guarantee reasoning. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 173–188. Springer, Heidelberg (2007)Google Scholar
  10. 10.
    Filipovic, I., O’Hearn, P.W., Rinetzky, N., Yang, H.: Abstraction for concurrent objects. Theor. Comput. Sci. 411(51-52) (2010)Google Scholar
  11. 11.
    Fu, M., Li, Y., Feng, X., Shao, Z., Zhang, Y.: Reasoning about optimistic concurrency using a program logic for history. In: Gastin, P., Laroussinie, F. (eds.) CONCUR 2010. LNCS, vol. 6269, pp. 388–402. Springer, Heidelberg (2010)Google Scholar
  12. 12.
    Gotsman, A., Rinetzky, N., Yang, H.: Verifying concurrent memory reclamation algorithms with grace. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 249–269. Springer, Heidelberg (2013)Google Scholar
  13. 13.
    Gotsman, A., Yang, H.: Linearizability with Ownership Transfer. In: Koutny, M., Ulidowski, I. (eds.) CONCUR 2012. LNCS, vol. 7454, pp. 256–271. Springer, Heidelberg (2012)Google Scholar
  14. 14.
    Hendler, D., Incze, I., Shavit, N., Tzafrir, M.: Flat combining and the synchronization-parallelism tradeoff. In: SPAA (2010)Google Scholar
  15. 15.
    Herlihy, M., Shavit, N.: The art of multiprocessor programming. M. Kaufmann (2008)Google Scholar
  16. 16.
    Herlihy, M., Wing, J.M.: Linearizability: A correctness condition for concurrent objects. ACM Trans. Prog. Lang. Syst. 12(3) (1990)Google Scholar
  17. 17.
    Jacobs, B., Piessens, F.: Expressive modular fine-grained concurrency specification. In: POPL (2011)Google Scholar
  18. 18.
    Jones, C.B.: Specification and design of (parallel) programs. In: IFIP Congress (1983)Google Scholar
  19. 19.
    Ley-Wild, R., Nanevski, A.: Subjective auxiliary state for coarse-grained concurrency. In: POPL (2013)Google Scholar
  20. 20.
    Liang, H., Feng, X.: Modular verification of linearizability with non-fixed linearization points. In: PLDI (2013)Google Scholar
  21. 21.
    Liang, H., Feng, X., Fu, M.: A rely-guarantee-based simulation for verifying concurrent program transformations. In: POPL (2012)Google Scholar
  22. 22.
    Nanevski, A., Ley-Wild, R., Sergey, I., Delbianco, G.A.: Communicating State Transition Systems for Fine-Grained Concurrent Resources. In: Shao, Z. (ed.) ESOP 2014. LNCS, vol. 8410, pp. 290–310. Springer, Heidelberg (2014)Google Scholar
  23. 23.
    O’Hearn, P.W.: Resources, concurrency, and local reasoning. Th. Comp. Sci. 375(1-3) (2007)Google Scholar
  24. 24.
    O’Hearn, P.W., Rinetzky, N., Vechev, M.T., Yahav, E., Yorsh, G.: Verifying linearizability with hindsight. In: PODC (2010)Google Scholar
  25. 25.
    Owicki, S.S., Gries, D.: Verifying properties of parallel programs: An axiomatic approach. Commun. ACM 19(5) (1976)Google Scholar
  26. 26.
    Qadeer, S., Sezgin, A., Tasiran, S.: Back and forth: Prophecy variables for static verification of concurrent programs. Technical Report MSR-TR-2009-142 (2009)Google Scholar
  27. 27.
    Sergey, I., Nanevski, A., Banerjee, A.: Specifying and verifying concurrent algorithms with histories and subjectivity. Extended Version and Supporting Material,
  28. 28.
    Svendsen, K., Birkedal, L.: Impredicative Concurrent Abstract Predicates. In: Shao, Z. (ed.) ESOP 2014. LNCS, vol. 8410, pp. 149–168. Springer, Heidelberg (2014)Google Scholar
  29. 29.
    Svendsen, K., Birkedal, L., Parkinson, M.: Modular reasoning about separation of concurrent data structures. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 169–188. Springer, Heidelberg (2013)Google Scholar
  30. 30.
    Treiber, R.K.: Systems programming: coping with parallelism. Technical Report RJ 5118, IBM Almaden Research Center (1986)Google Scholar
  31. 31.
    Turon, A., Dreyer, D., Birkedal, L.: Unifying refinement and Hoare-style reasoning in a logic for higher-order concurrency. In: ICFP (2013)Google Scholar
  32. 32.
    Turon, A.J., Thamsborg, J., Ahmed, A., Birkedal, L., Dreyer, D.: Logical relations for fine-grained concurrency. In: POPL (2013)Google Scholar
  33. 33.
    Vafeiadis, V.: Modular fine-grained concurrency verification. PhD thesis, University of Cambridge (2007)Google Scholar
  34. 34.
    Vafeiadis, V., Parkinson, M.: A Marriage of Rely/Guarantee and Separation Logic. In: Caires, L., Vasconcelos, V.T. (eds.) CONCUR 2007. LNCS, vol. 4703, pp. 256–271. Springer, Heidelberg (2007)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2015

Authors and Affiliations

  • Ilya Sergey
    • 1
    Email author
  • Aleksandar Nanevski
    • 1
  • Anindya Banerjee
    • 1
  1. 1.IMDEA Software InstituteMadridSpain

Personalised recommendations