skip to main content
research-article
Open Access

Rely-Guarantee-Based Simulation for Compositional Verification of Concurrent Program Transformations

Published:01 March 2014Publication History
Skip Abstract Section

Abstract

Verifying program transformations usually requires proving that the resulting program (the target) refines or is equivalent to the original one (the source). However, the refinement relation between individual sequential threads cannot be preserved in general with the presence of parallel compositions, due to instruction reordering and the different granularities of atomic operations at the source and the target. On the other hand, the refinement relation defined based on fully abstract semantics of concurrent programs assumes arbitrary parallel environments, which is too strong and cannot be satisfied by many well-known transformations.

In this article, we propose a Rely-Guarantee-based Simulation (RGSim) to verify concurrent program transformations. The relation is parametrized with constraints of the environments that the source and the target programs may compose with. It considers the interference between threads and their environments, thus is less permissive than relations over sequential programs. It is compositional with respect to parallel compositions as long as the constraints are satisfied. Also, RGSim does not require semantics preservation under all environments, and can incorporate the assumptions about environments made by specific program transformations in the form of rely/guarantee conditions. We use RGSim to reason about optimizations and prove atomicity of concurrent objects. We also propose a general garbage collector verification framework based on RGSim, and verify the Boehm et al. concurrent mark-sweep GC.

References

  1. Martín Abadi and Leslie Lamport. 1991. The existence of refinement mappings. Theor. Comput. Sci. 82, 2, 253--284. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Martín Abadi and Gordon Plotkin. 2009. A model of cooperative threads. In Proceedings of the 36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’09). ACM Press, New York, 29--40. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Katherine Barabash, Ori Ben-Yitzhak, Irit Goft, Elliot K. Kolodner, Victor Leikehman, Yoav Ossia, Avi Owshanko, and Erez Petrank. 2005. A parallel, incremental, mostly concurrent garbage collector for servers. ACM Trans. Program. Lang. Syst. 27, 6, 1097--1146. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Nick Benton. 2004. Simple relational correctness proofs for static analyses and program transformations. In Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’04). ACM Press, New York, 14--25. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Nick Benton and Chung-Kil Hur. 2009. Biorthogonality, step-indexing and compiler correctness. In Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming (ICFP’09). ACM Press, New York, 97--108. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Hans-Juergen Boehm. 2005. Threads cannot be implemented as a library. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’05). ACM Press, New York, 261--268. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Hans-Juergen Boehm and Sarita V. Adve. 2008. Foundations of the C++ concurrency memory model. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’08). ACM Press, New York, 68--78. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Hans-Juergen Boehm, Alan J. Demers, and Scott Shenker. 1991. Mostly parallel garbage collection. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’91). ACM Press, New York, 157--164. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Stephen D. Brookes. 1996. Full abstraction for a shared-variable parallel language. Inf. Comput. 127, 2, 145--163.Google ScholarGoogle ScholarCross RefCross Ref
  10. Sebastian Burckhardt, Madanlal Musuvathi, and Vasu Singh. 2010. Verifying local transformations on relaxed memory models. In Proceedings of the 19th Joint European Conference on Theory and Practice of Software and the International Conference on Compiler Construction (CC’10/ETAPS’10). Springer, 104--123. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Coq Development Team. 2010. The Coq proof assistant reference manual. The Coq release v8.3. http://coq.inria.fr/V8.3/refman/Google ScholarGoogle Scholar
  12. David Dice, Ori Shalev, and Nir Shavit. 2006. Transactional locking ii. In Proceedings of the 20th International Conference on Distributed Computing (DISC’06). Springer, 194--208. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Tayfun Elmas, Shaz Qadeer, Ali Sezgin, Omer Subasi, and Serdar Tasiran. 2010. Simplifying linearizability proofs with reduction and abstraction. In Proceedings of the 16th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS’10). Springer, 296--311. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Xinyu Feng. 2009. Local rely-guarantee reasoning. In Proceedings of the 36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’09). ACM Press, New York, 315--327. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Ivana Filipović, Peter O’Hearn, Noam Rinetzky, and Hongseok Yang. 2010. Abstraction for concurrent objects. Theor. Comput. Sci. 411, 51--52, 4379--4398. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. David S. Gladstein and Mitchell Wand. 1996. Compiler correctness for concurrent languages. In Proceedings of the 1st International Conference on Coordination Languages and Models (COORDINATION’96). Lecture Notes in Computer Science, vol. 1061, Springer, 231--248. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Maurice Herlihy and Nir Shavit. 2008. The Art of Multiprocessor Programming. Morgan Kaufmann, San Fransisco. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Charles A. R. Hoare. 1972. Proof of correctness of data representations. Acta Inf. 1, 4, 271--281. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Chung-Kil Hur and Derek Dreyer. 2011. A Kripke logical relation between ML and assembly. In Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’11). ACM Press, New York, 133--146. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Cliff B. Jones. 1983. Tentative steps toward a development method for interfering programs. ACM Trans. Program. Lang. Syst. 5, 4, 596--619. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Kalpesh Kapoor, Kamal Lodaya, and Uday Reddy. 2011. Fine-grained concurrency with separation logic. J. Philos. Logic 40, 5, 583--632.Google ScholarGoogle ScholarCross RefCross Ref
  22. Xavier Leroy. 2009. A formally verified compiler back-end. J. Autom. Reason. 43, 4, 363--446. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Hongjin Liang, Xinyu Feng, and Ming Fu. 2012. A rely-guarantee-based simulation for verifying concurrent program transformations. In Proceedings of the 39th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’12). ACM Press, New York, 455--468. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Andreas Lochbihler. 2010. Verifying a compiler for java threads. In Proceedings of the 19th European Conference on Programming Languages and Systems (ESOP’10). Springer, 427--447. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Andrew McCreight, Zhong Shao, Chunxiao Lin, and Long Li. 2007. A general framework for certifying garbage collectors and their mutators. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’07). ACM Press, New York, 468--479. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Matthew Parkinson, Richard Bornat, and Cristiano Calcagno. 2006. Variables as resource in hoare logics. In Proceedings of the 21st Annual IEEE Symposium on Logic in Computer Science (LICS’06). IEEE Computer Society, 137--146. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Dusko Pavlovic, Peter Pepper, and Douglas R. Smith. 2010. Formal derivation of concurrent garbage collectors. In Proceedings of the 10th International Conference on Mathematics of Program Construction (MPC’10). 353--376. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. John C. Reynolds. 2002. Separation logic: A logic for shared mutable data structures. In Proceedings of the 17th Annual IEEE Symposium on Logic in Computer Science (LICS’02). IEEE Computer Society, 55--74. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Jaroslav Ševčík, Viktor Vafeiadis, Francesco Zappa Nardelli, Suresh Jagannathan, and Peter Sewell. 2011. Relaxed-memory concurrency and verified compilation. In Proceedings of the 38th ACM SIGPLANSIGACT Symposium on Principles of Programming Languages (POPL’11). ACM Press, New York, 43--54. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. R. Kent Treiber. 1986. System programming: Coping with parallelism. Tech. rep. RJ 5118, IBM Almaden Research Center.Google ScholarGoogle Scholar
  31. Aaron Turon and Mitchell Wand. 2011. A separation logic for refining concurrent objects. In Proceedings of the 38th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’11). ACM Press, New York, 247--258. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Viktor Vafeiadis. 2008. Modular fine-grained concurrency verification. Tech. rep. UCAM-CL-TR-726, University of Cambridge, Computer Laboratory.Google ScholarGoogle Scholar
  33. Viktor Vafeiadis and Matthew J. Parkinson. 2007. A marriage of rely/guarantee and separation logic. In Proceedings of the 18th International Conference on Concurrency Theory (CONCUR’07). Springer, 256--271. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Martin T. Vechev, Eran Yahav, and David F. Bacon. 2006. Correctness-preserving derivation of concurrent garbage collection algorithms. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’06). ACM Press, New York, 341--353. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Mitchell Wand. 1995. Compiler correctness for parallel languages. In Proceedings of the 7th International Conference on Functional Programming Languages and Computer Architecture (FPCA’95). ACM Press, New York, 120--134. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Hongseok Yang. 2007. Relational separation logic. Theor. Comput. Sci. 375, 1--3, 308--334. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Rely-Guarantee-Based Simulation for Compositional Verification of Concurrent Program Transformations

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in

            Full Access

            • Published in

              cover image ACM Transactions on Programming Languages and Systems
              ACM Transactions on Programming Languages and Systems  Volume 36, Issue 1
              March 2014
              186 pages
              ISSN:0164-0925
              EISSN:1558-4593
              DOI:10.1145/2597180
              Issue’s Table of Contents

              Copyright © 2014 ACM

              Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 1 March 2014
              • Accepted: 1 November 2013
              • Revised: 1 September 2013
              • Received: 1 January 2013
              Published in toplas Volume 36, Issue 1

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • research-article
              • Research
              • Refereed

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader