Skip to main content

Decomposing Data Structure Commutativity Proofs with \(m\!n\)-Differencing

  • Conference paper
  • First Online:
Verification, Model Checking, and Abstract Interpretation (VMCAI 2021)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 12597))

Abstract

Commutativity of data structure methods is of ongoing interest in contexts such as parallelizing compilers, transactional memory, speculative execution and software scalability. Despite this interest, we lack effective theories and techniques to aid commutativity verification.

In this paper, we introduce a novel decomposition to improve the task of verifying method-pair commutativity conditions from data structure implementations. The key enabling insight—called \(mn\)-differencing—defines the precision necessary for an abstraction to be fine-grained enough so that commutativity of method implementations in the abstract domain entails commutativity in the concrete domain, yet can be less precise than what is needed for full-functional correctness. We incorporate this decomposition into a proof rule, as well as an automata-theoretic reduction for commutativity verification. Finally, we discuss our simple proof-of-concept implementation and experimental results showing that \(mn\)-differencing leads to more scalable commutativity verification of some simple examples.

E. Koskinen—Supported in part by NSF award #1813745 and #2008633.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 79.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Note: as discussed in Sect. 3, we employ the technique discussed in Sect. 4 of Bansal et al. [7] to avoid the need for under-approximation or quantifier alternation.

  2. 2.

    For example, we can use prophecy variables to translate a method such as int m(a) { if (nondet()) x := a; } into one that has does not have nondeterminism in its transition system: int m(a, rho) { if (rho) x := a; }.

  3. 3.

    https://github.com/erickoskinen/cityprover.

References

  1. Infer static analyzer. https://fbinfer.com/

  2. Verifast. https://github.com/verifast/verifast

  3. Abadi, M., Lamport, L.: The existence of refinement mappings. Theor. Comput. Sci. 82, 253–284 (1991)

    Article  MathSciNet  Google Scholar 

  4. Aleen, F., Clark, N.: Commutativity analysis for software parallelization: letting program transformations see the big picture. In: Proceedings of the 14th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS-XII) (2009), ACM, pp. 241–252 (2009)

    Google Scholar 

  5. Antonopoulos, T., Gazzillo, P., Hicks, M., Koskinen, E., Terauchi, T., Wei, S.: Decomposition instead of self-composition for proving the absence of timing channels. In: Cohen, A., Vechev, M.T. (eds.) Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017, Barcelona, Spain, 18–23 June 2017, pp. 362–375. ACM (2017)

    Google Scholar 

  6. Banerjee, A., Naumann, D. A., and Nikouei, M. Relational logic with framing and hypotheses. In: 36th IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2016). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2016)

    Google Scholar 

  7. Bansal, K., Koskinen, E., Tripp, O.: Automatic generation of precise and useful commutativity conditions. In: Beyer, D., Huisman, M. (eds.) TACAS 2018. LNCS, vol. 10805, pp. 115–132. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-89960-2_7

    Chapter  MATH  Google Scholar 

  8. Barthe, G., Crespo, J.M., Kunz, C.: Relational verification using product programs. In: Butler, M., Schulte, W. (eds.) FM 2011. LNCS, vol. 6664, pp. 200–214. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-21437-0_17

    Chapter  Google Scholar 

  9. Barthe, G., D’Argenio, P.R., Rezk, T.: Secure information flow by self-composition. In: CSFW (2004)

    Google Scholar 

  10. Beyer, D., Keremoglu, M.E.: CPAchecker: a tool for configurable software verification. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 184–190. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-22110-1_16

    Chapter  Google Scholar 

  11. Bolognesi, T., Smolka, S.A.: Fundamental results for the verification of observational equivalence: a survey. In: PSTV, pp. 165–179 (1987)

    Google Scholar 

  12. Bouajjani, A., Emmi, M., Enea, C., Hamza, J. On reducing linearizability to state reachability. In Automata, Languages, and Programming - 42nd International Colloquium, ICALP 2015, Kyoto, Japan, 6–10 July 2015, Proceedings, Part II, pp. 95–107 (2015)

    Google Scholar 

  13. Chechik, M., Stavropoulou, I., Disenfeld, C., Rubin, J.: FPH: efficient non-commutativity analysis of feature-based systems. In: Russo, A., Schürr, A. (eds.) FASE 2018. LNCS, vol. 10802, pp. 319–336. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-89363-1_18

    Chapter  Google Scholar 

  14. Clarkson, M.R., Schneider, F.B.: Hyperproperties. J. Comput. Secur. 18(6), 1157–1210 (2010)

    Article  Google Scholar 

  15. Clements, A.T., Kaashoek, M.F., Zeldovich, N., Morris, R.T., Kohler, E.: The scalable commutativity rule: designing scalable software for multicore processors. ACM Trans. Comput. Syst. 32(4), 10 (2015)

    Article  Google Scholar 

  16. Dickerson, T.D., Koskinen, E., Gazzillo, P., Herlihy, M.: Conflict abstractions and shadow speculation for optimistic transactional objects. In: Programming Languages and Systems - 17th Asian Symposium, APLAS 2019, Nusa Dua, Bali, Indonesia, 1–4 December 2019, Proceedings, pp. 313–331 (2019)

    Google Scholar 

  17. Dimitrov, D., Raychev, V., Vechev, M., Koskinen, E.: Commutativity race detection. In: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2014) (2014)

    Google Scholar 

  18. Eilers, M., Müller, P., Hitz, S.: Modular product programs. ACM Trans. Programm. Lang. Syst. (TOPLAS) 42(1), 1–37 (2019)

    MATH  Google Scholar 

  19. Farzan, A., Vandikas, A.: Automated hypersafety verification. In: Dillig, I., Tasiran, S. (eds.) CAV 2019. LNCS, vol. 11561, pp. 200–218. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-25540-4_11

    Chapter  Google Scholar 

  20. Frumin, D., Krebbers, R., Birkedal, L.: Reloc: a mechanised relational logic for fine-grained concurrency. In: Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, pp. 442–451 (2018)

    Google Scholar 

  21. Gehr, T., Dimitrov, D., Vechev, M. T. Learning commutativity specifications. In: Computer Aided Verification - 27th International Conference, CAV 2015, San Francisco, CA, USA, 18–24 July 2015, Proceedings, Part I, 307–323 (2015)

    Google Scholar 

  22. Heizmann, M., et al.: Ultimate automizer with SMTInterpol. In: Piterman, N., Smolka, S.A. (eds.) TACAS 2013. LNCS, vol. 7795, pp. 641–643. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-36742-7_53

    Chapter  Google Scholar 

  23. Henzinger, T.A., Jhala, R., Majumdar, R., Necula, G.C., Sutre, G., Weimer, W.: Temporal-safety proofs for systems code. In: Computer Aided Verification, 14th International Conference, CAV 2002, Copenhagen, Denmark, 27–31 July 2002, Proceedings, pp. 526–538 (2002)

    Google Scholar 

  24. Herlihy, M., Koskinen, E.: Transactional boosting: a methodology for highly concurrent transactional objects. In: Proceedings of the 13th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP 2008) (2008)

    Google Scholar 

  25. Houshmand, F., Lesani, M.H.: replication coordination analysis and synthesis. Proc. ACM Program. Lang. 3(POPL), 74:1–74:32 (2019)

    Google Scholar 

  26. Juhasz, U., Kassios, I.T., MĂĽller, P., Novacek, M., Schwerhoff, M., Summers, A.J.: Viper: a verification infrastructure for permission-based reasoning. Technical report, ETH Zurich (2014)

    Google Scholar 

  27. Kim, D., Rinard, M.C. :Verification of semantic commutativity conditions and inverse operations on linked data structures. In: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2011, ACM, pp. 528–541 (2011)

    Google Scholar 

  28. Koskinen, E., Bansal, K.: Reducing commutativity verification to reachability with differencing abstractions. CoRR abs/2004.08450 (2020)

    Google Scholar 

  29. Koskinen, E., Parkinson, M.J.: The push/pull model of transactions. In: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, Portland, OR, USA, June 15–17, 2015, pp. 186–195 (2015)

    Google Scholar 

  30. Koskinen, E., Parkinson, M.J., Herlihy, M.: Coarse-grained transactions. In: Proceedings of the 37th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, ACM, pp. 19–30 (2010)

    Google Scholar 

  31. Kragl, B., Qadeer, S.: Layered concurrent programs. In: Chockler, H., Weissenbacher, G. (eds.) CAV 2018. LNCS, vol. 10981, pp. 79–102. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-96145-3_5

    Chapter  Google Scholar 

  32. Kulkarni, M., Nguyen, D., Prountzos, D., Sui, X., Pingali, K.: Exploiting the commutativity lattice. In: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2011, pp. 542–555. ACM (2011)

    Google Scholar 

  33. Kulkarni, M., Pingali, K., Walter, B., Ramanarayanan, G., Bala, K., Chew, L.P.: Optimistic parallelism requires abstractions. In: Ferrante, J., McKinley, K.S. (eds.) Proceedings of the ACM SIGPLAN 2007 Conference on Programming Language Design and Implementation (PLDI 2007), pp. 211–222. ACM (2007)

    Google Scholar 

  34. Lipton, R.J.: Reduction: a method of proving properties of parallel programs. Commun. ACM 18(12), 717–721 (1975)

    Article  MathSciNet  Google Scholar 

  35. Najafzadeh, M., Gotsman, A., Yang, H., Ferreira, C., Shapiro, M.: The CISE tool: proving weakly-consistent applications correct. In: Proceedings of the 2nd Workshop on the Principles and Practice of Consistency for Distributed Data, PaPoC@EuroSys 2016, London, United Kingdom, 18 April 2016, pp. 2:1–2:3 (2016)

    Google Scholar 

  36. Ni, Y., et al.: Open nesting in software transactional memory. In: Proceedings of the 12th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPOPP 2007, pp. 68–78. ACM (2007)

    Google Scholar 

  37. O’Hearn, P., Reynolds, J., Yang, H.: Local reasoning about programs that alter data structures. In: Fribourg, L. (ed.) CSL 2001. LNCS, vol. 2142, pp. 1–19. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-44802-0_1

    Chapter  Google Scholar 

  38. Reynolds, J.C.: Separation logic: a logic for shared mutable data structures. In: Proceedings 17th Annual IEEE Symposium on Logic in Computer Science, pp. 55–74. IEEE (2002)

    Google Scholar 

  39. Rinard, M.C., Diniz, P.C.: Commutativity analysis: a new analysis technique for parallelizing compilers. ACM Trans. Program. Lang. Syst. (TOPLAS) 19(6), 942–991 (1997)

    Article  Google Scholar 

  40. Sousa, M., Dillig, I.: Cartesian hoare logic for verifying k-safety properties. In: Krintz, C., Berger, E. (eds.) Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2016, Santa Barbara, CA, USA, 13–17 June 2016, pp. 57–69. ACM (2016)

    Google Scholar 

  41. Terauchi, T., Aiken, A.: Secure information flow as a safety problem. In: SAS (2005)

    Google Scholar 

  42. Tripp, O., Manevich, R., Field, J., Sagiv, M.: JANUS: exploiting parallelism via hindsight. In: ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2012, pp. 145–156 (2012)

    Google Scholar 

  43. Vafeiadis, V.: Automatically proving linearizability. In: Touili, T., Cook, B., Jackson, P. (eds.) CAV 2010. LNCS, vol. 6174, pp. 450–464. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-14295-6_40

    Chapter  Google Scholar 

  44. Yang, H.: Relational separation logic. Theor. Comput. Sci. 375(1–3), 308–334 (2007)

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgments

We would like to thank Marco Gaboardi, Maurice Herlihy, Michael Hicks, David Naumann and the anonymous reviewers for their helpful feedback on earlier drafts of this work. This work was supported in part by NSF award #1813745 and #2008633.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Eric Koskinen .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Koskinen, E., Bansal, K. (2021). Decomposing Data Structure Commutativity Proofs with \(m\!n\)-Differencing. In: Henglein, F., Shoham, S., Vizel, Y. (eds) Verification, Model Checking, and Abstract Interpretation. VMCAI 2021. Lecture Notes in Computer Science(), vol 12597. Springer, Cham. https://doi.org/10.1007/978-3-030-67067-2_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-67067-2_5

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-67066-5

  • Online ISBN: 978-3-030-67067-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics