Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

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

Published: 01 March 2014 Publication History

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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[9]
Stephen D. Brookes. 1996. Full abstraction for a shared-variable parallel language. Inf. Comput. 127, 2, 145--163.
[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.
[11]
Coq Development Team. 2010. The Coq proof assistant reference manual. The Coq release v8.3. http://coq.inria.fr/V8.3/refman/
[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.
[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.
[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.
[15]
Ivana Filipović, Peter O’Hearn, Noam Rinetzky, and Hongseok Yang. 2010. Abstraction for concurrent objects. Theor. Comput. Sci. 411, 51--52, 4379--4398.
[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.
[17]
Maurice Herlihy and Nir Shavit. 2008. The Art of Multiprocessor Programming. Morgan Kaufmann, San Fransisco.
[18]
Charles A. R. Hoare. 1972. Proof of correctness of data representations. Acta Inf. 1, 4, 271--281.
[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.
[20]
Cliff B. Jones. 1983. Tentative steps toward a development method for interfering programs. ACM Trans. Program. Lang. Syst. 5, 4, 596--619.
[21]
Kalpesh Kapoor, Kamal Lodaya, and Uday Reddy. 2011. Fine-grained concurrency with separation logic. J. Philos. Logic 40, 5, 583--632.
[22]
Xavier Leroy. 2009. A formally verified compiler back-end. J. Autom. Reason. 43, 4, 363--446.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[30]
R. Kent Treiber. 1986. System programming: Coping with parallelism. Tech. rep. RJ 5118, IBM Almaden Research Center.
[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.
[32]
Viktor Vafeiadis. 2008. Modular fine-grained concurrency verification. Tech. rep. UCAM-CL-TR-726, University of Cambridge, Computer Laboratory.
[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.
[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.
[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.
[36]
Hongseok Yang. 2007. Relational separation logic. Theor. Comput. Sci. 375, 1--3, 308--334.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

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
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: 01 March 2014
Accepted: 01 November 2013
Revised: 01 September 2013
Received: 01 January 2013
Published in TOPLAS Volume 36, Issue 1

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Concurrency
  2. program transformation
  3. rely-guarantee reasoning
  4. simulation

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)46
  • Downloads (Last 6 weeks)15
Reflects downloads up to 09 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Compositional Semantics for Shared-Variable ConcurrencyProceedings of the ACM on Programming Languages10.1145/36563998:PLDI(543-566)Online publication date: 20-Jun-2024
  • (2024)A Compositional Theory of LinearizabilityJournal of the ACM10.1145/364366871:2(1-107)Online publication date: 27-Jan-2024
  • (2024)A Denotational Approach to Release/Acquire ConcurrencyProgramming Languages and Systems10.1007/978-3-031-57267-8_5(121-149)Online publication date: 6-Apr-2024
  • (2023)Survey of the Formal Verification of Operating Systems in Power Monitoring SystemProceedings of the 2023 5th International Conference on Pattern Recognition and Intelligent Systems10.1145/3609703.3609714(65-70)Online publication date: 28-Jul-2023
  • (2023)Specifying and Reasoning About Shared-Variable ConcurrencyTheories of Programming and Formal Methods10.1007/978-3-031-40436-8_5(110-135)Online publication date: 8-Sep-2023
  • (2022)Sequential reasoning for optimizing compilers under weak memory concurrencyProceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3519939.3523718(213-228)Online publication date: 9-Jun-2022
  • (2022)Abstraction for Crash-Resilient ObjectsProgramming Languages and Systems10.1007/978-3-030-99336-8_10(262-289)Online publication date: 5-Apr-2022
  • (2021)CSimACM Transactions on Programming Languages and Systems10.1145/343680843:1(1-46)Online publication date: 9-Feb-2021
  • (2020)Rely-Guarantee Reasoning about Messaging System for Autonomous Vehicles2020 International Symposium on Theoretical Aspects of Software Engineering (TASE)10.1109/TASE49443.2020.00021(89-96)Online publication date: Dec-2020
  • (2019)Decoupling lock-free data structures from memory reclamation for static analysisProceedings of the ACM on Programming Languages10.1145/32903713:POPL(1-31)Online publication date: 2-Jan-2019
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media