Advertisement

A Higher-Order Logic for Concurrent Termination-Preserving Refinement

  • Joseph TassarottiEmail author
  • Ralf JungEmail author
  • Robert HarperEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10201)

Abstract

Compiler correctness proofs for higher-order concurrent languages are difficult: they involve establishing a termination-preserving refinement between a concurrent high-level source language and an implementation that uses low-level shared memory primitives. However, existing logics for proving concurrent refinement either neglect properties such as termination, or only handle first-order state. In this paper, we address these limitations by extending Iris, a recent higher-order concurrent separation logic, with support for reasoning about termination-preserving refinements. To demonstrate the power of these extensions, we prove the correctness of an efficient implementation of a higher-order, session-typed language. To our knowledge, this is the first program logic capable of giving a compiler correctness proof for such a language. The soundness of our extensions and our compiler correctness proof have been mechanized in Coq.

Notes

Acknowledgments

The authors thank Robbert Krebbers, Jeehoon Kang, Max Willsey, Frank Pfenning, Derek Dreyer, Lars Birkedal, and Jan Hoffmann for helpful discussions and feedback. This research was conducted with U.S. Government support under and awarded by DoD, Air Force Office of Scientific Research, National Defense Science and Engineering Graduate (NDSEG) Fellowship, 32 CFR 168a; and with support by a European Research Council (ERC) Consolidator Grant for the project “RustBelt”, funded under the European Union’s Horizon 2020 Framework Programme (grant agreement no. 683289). Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of these funding agencies.

References

  1. 1.
    Website with Coq development (2016). http://www.cs.cmu.edu/~jtassaro/papers/iris-refinement
  2. 2.
    Appel, A., McAllester, D.: An indexed model of recursive types for foundational proof-carrying code. TOPLAS 23(5), 657–683 (2001)CrossRefGoogle Scholar
  3. 3.
    Benton, N.: Simple relational correctness proofs for static analyses and program transformations. In: POPL (2004)Google Scholar
  4. 4.
    Birkedal, L., Bizjak, A., Schwinghammer, J.: Step-indexed relational reasoning for countable nondeterminism. Logical Methods Comput. Sci. 9(4), 1–22 (2013)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Birkedal, L., Støvring, K., Thamsborg, J.: The category-theoretic solution of recursive metric-space equations. Theor. Comput. Sci. 411(47), 4102–4122 (2010)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Brookes, S.D.: Variables as resource for shared-memory programs: semantics and soundness. Electr. Notes Theor. Comput. Sci. 158, 123–150 (2006)CrossRefzbMATHGoogle Scholar
  7. 7.
    Caires, L., Pérez, J.A., Pfenning, F., Toninho, B.: Behavioral polymorphism and parametricity in session-based communication. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 330–349. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-37036-6_19 CrossRefGoogle Scholar
  8. 8.
    Caires, L., Pfenning, F.: Session types as intuitionistic linear propositions. In: Gastin, P., Laroussinie, F. (eds.) CONCUR 2010. LNCS, vol. 6269, pp. 222–236. Springer, Heidelberg (2010). doi: 10.1007/978-3-642-15375-4_16 CrossRefGoogle Scholar
  9. 9.
    Craig, T.S.: Building fifo and priority-queueing spin locks from atomic swap. Technical report 93-02-02, Computer Science Department, University of Washington (1993)Google Scholar
  10. 10.
    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). doi: 10.1007/978-3-662-44202-9_9 Google Scholar
  11. 11.
    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). doi: 10.1007/978-3-642-14107-2_24 CrossRefGoogle Scholar
  12. 12.
    Dinsdale-Young, T., Birkedal, L., Gardner, P., Parkinson, M.J., Yang, H.: Views: compositional reasoning for concurrent programs. In: POPL (2013)Google Scholar
  13. 13.
    Feng, X.: Local rely-guarantee reasoning. In: POPL, pp. 315–327 (2009)Google Scholar
  14. 14.
    Gay, S.J., Vasconcelos, V.T.: Linear type theory for asynchronous session types. J. Funct. Program. 20(1), 19–50 (2010)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    Hoffmann, J., Marmar, M., Shao, Z.: Quantitative reasoning for proving lock-freedom. In: LICS, pp. 124–133 (2013)Google Scholar
  16. 16.
    Honda, K.: Types for dyadic interaction. In: Best, E. (ed.) CONCUR 1993. LNCS, vol. 715, pp. 509–523. Springer, Heidelberg (1993). doi: 10.1007/3-540-57208-2_35 Google Scholar
  17. 17.
    Ishtiaq, S.S., O’Hearn, P.W.: BI as an assertion language for mutable data structures. In: POPL, pp. 14–26 (2001)Google Scholar
  18. 18.
    Jones, C.B.: Tentative steps toward a development method for interfering programs. TOPLAS 5(4), 596–619 (1983)CrossRefzbMATHGoogle Scholar
  19. 19.
    Jung, R., Krebbers, R., Birkedal, L., Dreyer, D.: Higher-order ghost state. In: ICFP, pp. 256–269 (2016, to appear)Google Scholar
  20. 20.
    Jung, R., Swasey, D., Sieczkowski, F., Svendsen, K., Turon, A., Birkedal, L., Dreyer, D.: Iris: monoids and invariants as an orthogonal basis for concurrent reasoning. In: POPL, pp. 637–650 (2015)Google Scholar
  21. 21.
    Krebbers, R., Timany, A., Birkedal, L.: Interactive proofs in higher-order concurrent separation logic. In: POPL, pp. 205–217 (2017, to appear)Google Scholar
  22. 22.
    Krogh-Jespersen, M., Svendsen, K., Birkedal, L.: A relational model of types-and-effects in higher-order concurrent separation logic. In: POPL, pp. 218–231 (2017, to appear)Google Scholar
  23. 23.
    Lehmann, D., Pnueli, A., Stavi, J.: Impartiality, justice and fairness: the ethics of concurrent termination. In: Even, S., Kariv, O. (eds.) ICALP 1981. LNCS, vol. 115, pp. 264–277. Springer, Heidelberg (1981). doi: 10.1007/3-540-10843-2_22 CrossRefGoogle Scholar
  24. 24.
    Liang, H., Feng, X.: A program logic for concurrent objects under fair scheduling. In: POPL, pp. 385–399 (2016)Google Scholar
  25. 25.
    Liang, H., Feng, X., Fu, M.: Rely-guarantee-based simulation for compositional verification of concurrent program transformations. ACM Trans. Program. Lang. Syst. 36(1), 3 (2014)CrossRefGoogle Scholar
  26. 26.
    Liang, H., Feng, X., Shao, Z.: Compositional verification of termination-preserving refinement of concurrent programs. In: CSL-LICS, pp. 65:1–65:10 (2014)Google Scholar
  27. 27.
    Magnusson, P.S., Landin, A., Hagersten, E.: Queue locks on cache coherent multiprocessors. In: International Symposium on Parallel Processing, pp. 165–171 (1994)Google Scholar
  28. 28.
    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). doi: 10.1007/978-3-642-54833-8_16 CrossRefGoogle Scholar
  29. 29.
    O’Hearn, P.: Resources, concurrency, and local reasoning. TCS 375(1), 271–307 (2007)MathSciNetCrossRefzbMATHGoogle Scholar
  30. 30.
    Pérez, J.A., Caires, L., Pfenning, F., Toninho, B.: Linear logical relations for session-based concurrency. In: Seidl, H. (ed.) ESOP 2012. LNCS, vol. 7211, pp. 539–558. Springer, Heidelberg (2012). doi: 10.1007/978-3-642-28869-2_27 CrossRefGoogle Scholar
  31. 31.
    da Rocha Pinto, P., Dinsdale-Young, T., Gardner, P., Sutherland, J.: Modular termination verification for non-blocking concurrency. In: Thiemann, P. (ed.) ESOP 2016. LNCS, vol. 9632, pp. 176–201. Springer, Heidelberg (2016). doi: 10.1007/978-3-662-49498-1_8 CrossRefGoogle Scholar
  32. 32.
    Svendsen, K., Birkedal, L.: Impredicative concurrent abstract predicates. In: Shao, Z. (ed.) ESOP 2014. LNCS, vol. 8410, pp. 149–168. Springer, Heidelberg (2014). doi: 10.1007/978-3-642-54833-8_9 CrossRefGoogle Scholar
  33. 33.
    Svendsen, K., Sieczkowski, F., Birkedal, L.: Transfinite step-indexing: decoupling concrete and logical steps. In: Thiemann, P. (ed.) ESOP 2016. LNCS, vol. 9632, pp. 727–751. Springer, Heidelberg (2016). doi: 10.1007/978-3-662-49498-1_28 CrossRefGoogle Scholar
  34. 34.
    Tassarotti, J., Jung, R., Harper, R.: A higher-order logic for concurrent termination-preserving refinement. Available as arXiv:1701.05888 [cs.PL] (2017). http://iris-project.org/pdfs/2017-esop-refinement-final.pdf. Extended version with appendices
  35. 35.
    Toninho, B., Caires, L., Pfenning, F.: Higher-order processes, functions, and sessions: a monadic integration. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 350–369. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-37036-6_20 CrossRefGoogle Scholar
  36. 36.
    Turon, A., Dreyer, D., Birkedal, L.: Unifying refinement and Hoare-style reasoning in a logic for higher-order concurrency. In: ICFP, pp. 377–390 (2013)Google Scholar
  37. 37.
    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). doi: 10.1007/978-3-540-74407-8_18 CrossRefGoogle Scholar
  38. 38.
    Wadler, P.: Propositions as sessions. J. Funct. Program. 24(2–3), 384–418 (2014)MathSciNetCrossRefzbMATHGoogle Scholar
  39. 39.
    Willsey, M., Prabhu, R., Pfenning, F.: Design and implementation of concurrent C0. In: Linearity (2016)Google Scholar
  40. 40.
    Yang, H.: Relational separation logic. TCS 375(1–3), 308–334 (2007)MathSciNetCrossRefzbMATHGoogle Scholar
  41. 41.
    Yoshida, N., Vasconcelos, V.T.: Language primitives and type discipline for structured communication-based programming revisited: Two systems for higher-order session communication. Electr. Notes Theor. Comput. Sci. 171(4), 73–93 (2007)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag GmbH Germany 2017

Authors and Affiliations

  1. 1.Carnegie Mellon UniversityPittsburghUSA
  2. 2.MPI-SWSSaarbrückenGermany

Personalised recommendations