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

Coarser Equivalences for Causal Concurrency

Published: 05 January 2024 Publication History

Abstract

Trace theory (formulated by Mazurkiewicz in 1987) is a principled framework for defining equivalence relations for concurrent program runs based on a commutativity relation over the set of atomic steps taken by individual program threads. Its simplicity, elegance, and algorithmic efficiency makes it useful in many different contexts including program verification and testing. It is well-understood that the larger the equivalence classes are, the more benefits they would bring to the algorithms and applications that use them. In this paper, we study relaxations of trace equivalence with the goal of maintaining its algorithmic advantages.
We first prove that the largest appropriate relaxation of trace equivalence, an equivalence relation that preserves the order of steps taken by each thread and what write operation each read operation observes, does not yield efficient algorithms. Specifically, we prove a linear space lower bound for the problem of checking, in a streaming setting, if two arbitrary steps of a concurrent program run are causally concurrent (i.e. they can be reordered in an equivalent run) or causally ordered (i.e. they always appear in the same order in all equivalent runs). The same problem can be decided in constant space for trace equivalence. Next, we propose a new commutativity-based notion of equivalence called grain equivalence that is strictly more relaxed than trace equivalence, and yet yields a constant space algorithm for the same problem. This notion of equivalence uses commutativity of grains, which are sequences of atomic steps, in addition to the standard commutativity from trace theory. We study the two distinct cases when the grains are contiguous subwords of the input program run and when they are not, formulate the precise definition of causal concurrency in each case, and show that they can be decided in constant space, despite being strict relaxations of the notion of causal concurrency based on trace equivalence.

References

[1]
Parosh Aziz Abdulla, Mohamed Faouzi Atig, Bengt Jonsson, Magnus Lång, Tuan Phong Ngo, and Konstantinos Sagonas. 2019. Optimal Stateless Model Checking for Reads-from Equivalence under Sequential Consistency. Proc. ACM Program. Lang., 3, OOPSLA (2019), Article 150, oct, 29 pages. https://doi.org/10.1145/3360576
[2]
Pratyush Agarwal, Krishnendu Chatterjee, Shreya Pathak, Andreas Pavlogiannis, and Viktor Toman. 2021. Stateless Model Checking Under a Reads-Value-From Equivalence. In Computer Aided Verification: 33rd International Conference, CAV 2021, Virtual Event, July 20–23, 2021, Proceedings, Part I. Springer-Verlag, Berlin, Heidelberg. 341–366. isbn:978-3-030-81684-1 https://doi.org/10.1007/978-3-030-81685-8_16
[3]
Zhendong Ang and Umang Mathur. 2024. Predictive Monitoring against Pattern Regular Languages. Proc. ACM Program. Lang., 8, POPL (2024), Article 73, jan, https://doi.org/10.1145/3632915
[4]
Serge Bauget and Paul Gastin. 1995. On congruences and partial orders. In Mathematical Foundations of Computer Science 1995, Jiří Wiedermann and Petr Hájek (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 434–443. isbn:978-3-540-44768-9
[5]
Marek Chalupa, Krishnendu Chatterjee, Andreas Pavlogiannis, Nishant Sinha, and Kapil Vaidya. 2017. Data-Centric Dynamic Partial Order Reduction. Proc. ACM Program. Lang., 2, POPL (2017), Article 31, dec, 30 pages. https://doi.org/10.1145/3158119
[6]
Krishnendu Chatterjee, Andreas Pavlogiannis, and Viktor Toman. 2019. Value-centric Dynamic Partial Order Reduction. Proc. ACM Program. Lang., 3, OOPSLA (2019), 124:1–124:29. https://doi.org/10.1145/3360550
[7]
Ankush Desai, Pranav Garg, and P. Madhusudan. 2014. Natural proofs for asynchronous programs using almost-synchronous reductions. In Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications, OOPSLA 2014, part of SPLASH 2014, Portland, OR, USA, October 20-24, 2014. 709–725.
[8]
1995. The Book of Traces, Volker Diekert and Grzegorz Rozenberg (Eds.). World Scientific. isbn:978-981-02-2058-7
[9]
Cezara Drăgoi, Thomas A. Henzinger, and Damien Zufferey. 2016. PSync: A Partially Synchronous Language for Fault-Tolerant Distributed Algorithms. In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’16). Association for Computing Machinery, New York, NY, USA. 400–415. isbn:9781450335492 https://doi.org/10.1145/2837614.2837650
[10]
Tayfun Elmas, Shaz Qadeer, and Serdar Tasiran. 2007. Goldilocks: A Race and Transaction-aware Java Runtime. In Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’07). ACM, New York, NY, USA. 245–255. isbn:978-1-59593-633-2 https://doi.org/10.1145/1250734.1250762
[11]
Azadeh Farzan. 2023. Commutativity in Automated Verification. In LICS. 1–7. https://doi.org/10.1109/LICS56636.2023.10175734
[12]
Azadeh Farzan, Dominik Klumpp, and Andreas Podelski. 2022. Sound sequentialization for concurrent program verification. In PLDI ’22: 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation, San Diego, CA, USA, June 13 - 17, 2022, Ranjit Jhala and Isil Dillig (Eds.). ACM, 506–521. https://doi.org/10.1145/3519939.3523727
[13]
Azadeh Farzan and P. Madhusudan. 2006. Causal Atomicity. In Computer Aided Verification, Thomas Ball and Robert B. Jones (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 315–328. isbn:978-3-540-37411-4
[14]
Azadeh Farzan and P. Madhusudan. 2008. Monitoring Atomicity in Concurrent Programs. In Computer Aided Verification, Aarti Gupta and Sharad Malik (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 52–65. isbn:978-3-540-70545-1
[15]
Azadeh Farzan, P. Madhusudan, Niloofar Razavi, and Francesco Sorrentino. 2012. Predicting Null-pointer Dereferences in Concurrent Programs. In Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering (FSE ’12). ACM, New York, NY, USA. Article 47, 11 pages. isbn:978-1-4503-1614-9 https://doi.org/10.1145/2393596.2393651
[16]
Azadeh Farzan, P. Madhusudan, and Francesco Sorrentino. 2009. Meta-analysis for Atomicity Violations Under Nested Locking. In Proceedings of the 21st International Conference on Computer Aided Verification (CAV ’09). Springer-Verlag, Berlin, Heidelberg. 248–262. isbn:978-3-642-02657-7 https://doi.org/10.1007/978-3-642-02658-4_21
[17]
Azadeh Farzan and Umang Mathur. 2023. Coarser Equivalences for Causal Concurrency. CoRR, abs/2208.12117 (2023), https://doi.org/10.48550/ARXIV.2208.12117 arXiv:2208.12117.
[18]
Azadeh Farzan and Anthony Vandikas. 2019. Automated Hypersafety Verification. In Computer Aided Verification - 31st International Conference, CAV 2019, New York City, NY, USA, July 15-18, 2019, Proceedings, Part I, Isil Dillig and Serdar Tasiran (Eds.) (Lecture Notes in Computer Science, Vol. 11561). Springer, 200–218. https://doi.org/10.1007/978-3-030-25540-4_11
[19]
Azadeh Farzan and Anthony Vandikas. 2020. Reductions for safety proofs. Proc. ACM Program. Lang., 4, POPL (2020), 13:1–13:28. https://doi.org/10.1145/3371081
[20]
Cormac Flanagan and Stephen N. Freund. 2009. FastTrack: Efficient and Precise Dynamic Race Detection. In Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’09). ACM, New York, NY, USA. 121–133. isbn:978-1-60558-392-1 https://doi.org/10.1145/1542476.1542490
[21]
Cormac Flanagan, Stephen N. Freund, and Jaeheon Yi. 2008. Velodrome: A Sound and Complete Dynamic Atomicity Checker for Multithreaded Programs. In Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’08). ACM, New York, NY, USA. 293–303. isbn:978-1-59593-860-2 https://doi.org/10.1145/1375581.1375618
[22]
Cormac Flanagan and Patrice Godefroid. 2005. Dynamic Partial-Order Reduction for Model Checking Software. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’05). Association for Computing Machinery, New York, NY, USA. 110–121. isbn:158113830X https://doi.org/10.1145/1040305.1040315
[23]
Blaise Genest, Dietrich Kuske, and Anca Muscholl. 2007. On Communicating Automata with Bounded Channels. Fundam. Inform., 80, 1-3 (2007), 147–167.
[24]
Phillip B. Gibbons and Ephraim Korach. 1994. On Testing Cache-Coherent Shared Memories. In Proceedings of the Sixth Annual ACM Symposium on Parallel Algorithms and Architectures (SPAA ’94). Association for Computing Machinery, New York, NY, USA. 177–188. isbn:0897916719 https://doi.org/10.1145/181014.181328
[25]
Phillip B. Gibbons and Ephraim Korach. 1997. Testing Shared Memories. SIAM J. Comput., 26, 4 (1997), 1208–1244. https://doi.org/10.1137/S0097539794279614 arxiv:https://doi.org/10.1137/S0097539794279614.
[26]
Patrice Godefroid. 1997. Model Checking for Programming Languages Using VeriSoft. In Proceedings of the 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’97). Association for Computing Machinery, New York, NY, USA. 174–186. isbn:0897918533 https://doi.org/10.1145/263699.263717
[27]
Patrice Godefroid and Didier Pirottin. 1993. Refining Dependencies Improves Partial-Order Verification Methods (Extended Abstract). In Computer Aided Verification, 5th International Conference, CAV ’93, Elounda, Greece, June 28 - July 1, 1993, Proceedings. 438–449.
[28]
Michel Hack. 1976. Petri net language. Massachusetts Institute of Technology.
[29]
Charles Antony Richard Hoare. 1978. Communicating sequential processes. Commun. ACM, 21, 8 (1978), 666–677.
[30]
Jeff Huang. 2018. UFO: Predictive Concurrency Use-after-Free Detection. In Proceedings of the 40th International Conference on Software Engineering (ICSE ’18). Association for Computing Machinery, New York, NY, USA. 609–619. isbn:9781450356381 https://doi.org/10.1145/3180155.3180225
[31]
Jeff Huang, Qingzhou Luo, and Grigore Rosu. 2015. GPredict: Generic Predictive Concurrency Analysis. In Proceedings of the 37th International Conference on Software Engineering - Volume 1 (ICSE ’15). IEEE Press, 847–857. isbn:9781479919345
[32]
Jeff Huang, Patrick O’Neil Meredith, and Grigore Rosu. 2014. Maximal Sound Predictive Race Detection with Control Flow Abstraction. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’14). ACM, New York, NY, USA. 337–348. isbn:978-1-4503-2784-8 https://doi.org/10.1145/2594291.2594315
[33]
Russell Impagliazzo and Ramamohan Paturi. 2001. On the complexity of k-SAT. J. Comput. System Sci., 62, 2 (2001), 367–375.
[34]
Ayal Itzkovitz, Assaf Schuster, and Oren Zeev-Ben-Mordehai. 1999. Toward Integration of Data Race Detection in DSM Systems. J. Parallel Distrib. Comput., 59, 2 (1999), Nov., 180–203. issn:0743-7315 https://doi.org/10.1006/jpdc.1999.1574
[35]
Christian Gram Kalhauge and Jens Palsberg. 2018. Sound Deadlock Prediction. Proc. ACM Program. Lang., 2, OOPSLA (2018), Article 146, Oct., 29 pages. https://doi.org/10.1145/3276516
[36]
Shmuel Katz and Doron A. Peled. 1992. Defining Conditional Independence Using Collapses. Theor. Comput. Sci., 101, 2 (1992), 337–359.
[37]
Dileep Kini, Umang Mathur, and Mahesh Viswanathan. 2017. Dynamic Race Prediction in Linear Time. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2017). ACM, New York, NY, USA. 157–170. isbn:978-1-4503-4988-8 https://doi.org/10.1145/3062341.3062374
[38]
Dileep Kini, Umang Mathur, and Mahesh Viswanathan. 2018. Data Race Detection on Compressed Traces. In Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE 2018). Association for Computing Machinery, New York, NY, USA. 26–37. isbn:9781450355735 https://doi.org/10.1145/3236024.3236025
[39]
H.C.M. Kleijn, R. Morin, and B. Rozoy. 1998. Event Structures for Local Traces. Electronic Notes in Theoretical Computer Science, 16, 2 (1998), 98–113. issn:1571-0661 https://doi.org/10.1016/S1571-0661(04)00120-3 EXPRESS ’98, Fifth International Workshop on Expressiveness in Concurrency (Satellite Workshop of CONCUR ’98)
[40]
Michalis Kokologiannakis, Iason Marmanis, Vladimir Gladstein, and Viktor Vafeiadis. 2022. Truly Stateless, Optimal Dynamic Partial Order Reduction. Proc. ACM Program. Lang., 6, POPL (2022), Article 49, jan, 28 pages. https://doi.org/10.1145/3498711
[41]
Michalis Kokologiannakis, Azalea Raad, and Viktor Vafeiadis. 2019. Model Checking for Weakly Consistent Libraries. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2019). Association for Computing Machinery, New York, NY, USA. 96–110. isbn:9781450367127 https://doi.org/10.1145/3314221.3314609
[42]
Rucha Kulkarni, Umang Mathur, and Andreas Pavlogiannis. 2021. Dynamic Data-Race Detection Through the Fine-Grained Lens. In 32nd International Conference on Concurrency Theory (CONCUR 2021), Serge Haddad and Daniele Varacca (Eds.) (Leibniz International Proceedings in Informatics (LIPIcs), Vol. 203). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl, Germany. 16:1–16:23. isbn:978-3-95977-203-7 issn:1868-8969 https://doi.org/10.4230/LIPIcs.CONCUR.2021.16
[43]
Hendrik Maarand and Tarmo Uustalu. 2019. Certified Normalization of Generalized Traces. Innov. Syst. Softw. Eng., 15, 3–4 (2019), sep, 253–265. issn:1614-5046 https://doi.org/10.1007/s11334-019-00347-1
[44]
Umang Mathur, Dileep Kini, and Mahesh Viswanathan. 2018. What Happens-after the First Race? Enhancing the Predictive Power of Happens-before Based Dynamic Race Detection. Proc. ACM Program. Lang., 2, OOPSLA (2018), Article 145, Oct., 29 pages. issn:2475-1421 https://doi.org/10.1145/3276515
[45]
Umang Mathur, Andreas Pavlogiannis, and Mahesh Viswanathan. 2021. Optimal Prediction of Synchronization-Preserving Races. Proc. ACM Program. Lang., 5, POPL (2021), Article 36, Jan., 29 pages. https://doi.org/10.1145/3434317
[46]
Umang Mathur and Mahesh Viswanathan. 2020. Atomicity Checking in Linear Time Using Vector Clocks. In Proceedings of the Twenty-Fifth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS ’20). Association for Computing Machinery, New York, NY, USA. 183–199. isbn:9781450371025 https://doi.org/10.1145/3373376.3378475
[47]
A Mazurkiewicz. 1987. Trace Theory. In Advances in Petri Nets 1986, Part II on Petri Nets: Applications and Relationships to Other Models of Concurrency. Springer-Verlag New York, Inc., 279–324.
[48]
Robin Milner. 1980. A calculus of communicating systems. Springer.
[49]
Andreas Pavlogiannis. 2019. Fast, Sound, and Effectively Complete Dynamic Race Prediction. Proc. ACM Program. Lang., 4, POPL (2019), Article 17, Dec., 29 pages. https://doi.org/10.1145/3371085
[50]
Jake Roemer, Kaan Genç, and Michael D. Bond. 2018. High-coverage, Unbounded Sound Predictive Race Detection. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2018). ACM, New York, NY, USA. 374–389. isbn:978-1-4503-5698-5 https://doi.org/10.1145/3192366.3192385
[51]
Grigore Roşu and Mahesh Viswanathan. 2003. Testing Extended Regular Language Membership Incrementally by Rewriting. In Rewriting Techniques and Applications, Robert Nieuwenhuis (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 499–514. isbn:978-3-540-44881-5
[52]
Mahmoud Said, Chao Wang, Zijiang Yang, and Karem Sakallah. 2011. Generating Data Race Witnesses by an SMT-based Analysis. In Proceedings of the Third International Conference on NASA Formal Methods (NFM’11). Springer-Verlag, Berlin, Heidelberg. 313–327. isbn:978-3-642-20397-8 http://dl.acm.org/citation.cfm?id=1986308.1986334
[53]
Malavika Samak and Murali Krishna Ramanathan. 2014. Trace Driven Dynamic Deadlock Detection and Reproduction. In Proceedings of the 19th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP ’14). Association for Computing Machinery, New York, NY, USA. 29–42. isbn:9781450326568 https://doi.org/10.1145/2555243.2555262
[54]
Vladimiro Sassone, Mogens Nielsen, and Glynn Winskel. 1993. Deterministic behavioural models for concurrency. In Mathematical Foundations of Computer Science 1993, Andrzej M. Borzyszkowski and Stefan Sokoł owski (Eds.).
[55]
Koushik Sen, Grigore Roşu, and Gul Agha. 2005. Detecting Errors in Multithreaded Programs by Generalized Predictive Analysis of Executions. In Formal Methods for Open Object-Based Distributed Systems, Martin Steffen and Gianluigi Zavattaro (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 211–226. isbn:978-3-540-31556-8
[56]
Yannis Smaragdakis, Jacob Evans, Caitlin Sadowski, Jaeheon Yi, and Cormac Flanagan. 2012. Sound Predictive Race Detection in Polynomial Time. In Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’12). ACM, New York, NY, USA. 387–400. isbn:978-1-4503-1083-3 https://doi.org/10.1145/2103656.2103702
[57]
Francesco Sorrentino, Azadeh Farzan, and P. Madhusudan. 2010. PENELOPE: Weaving Threads to Expose Atomicity Violations. In Proceedings of the Eighteenth ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE ’10). ACM, New York, NY, USA. 37–46. isbn:978-1-60558-791-2 https://doi.org/10.1145/1882291.1882300
[58]
Martin Sulzmann and Kai Stadtmüller. 2020. Efficient, near Complete, and Often Sound Hybrid Dynamic Data Race Prediction. In Proceedings of the 17th International Conference on Managed Programming Languages and Runtimes (MPLR 2020). Association for Computing Machinery, New York, NY, USA. 30–51. isbn:9781450388535 https://doi.org/10.1145/3426182.3426185
[59]
Hünkar Can Tunç, Umang Mathur, Andreas Pavlogiannis, and Mahesh Viswanathan. 2023. Sound Dynamic Deadlock Prediction in Linear Time. Proc. ACM Program. Lang., 7, PLDI (2023), 1733–1758. https://doi.org/10.1145/3591291
[60]
Hünkar Can Tunç, Umang Mathur, Andreas Pavlogiannis, and Mahesh Viswanathan. 2023. Sound Dynamic Deadlock Prediction in Linear Time. Proc. ACM Program. Lang., 7, PLDI (2023), Article 177, jun, 26 pages. https://doi.org/10.1145/3591291
[61]
Chao Wang, Sudipta Kundu, Malay Ganai, and Aarti Gupta. 2009. Symbolic Predictive Analysis for Concurrent Programs. In Proceedings of the 2Nd World Congress on Formal Methods (FM ’09). Springer-Verlag, Berlin, Heidelberg. 256–272. isbn:978-3-642-05088-6 https://doi.org/10.1007/978-3-642-05089-3_17
[62]
Ryan Williams. 2005. A new algorithm for optimal 2-constraint satisfaction and its implications. Theoretical Computer Science, 348, 2-3 (2005), 357–365.
[63]
Glynn Winskel. 1987. Event structures. In Petri Nets: Applications and Relationships to Other Models of Concurrency, W. Brauer, W. Reisig, and G. Rozenberg (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 325–392. isbn:978-3-540-47926-0

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 8, Issue POPL
January 2024
2820 pages
EISSN:2475-1421
DOI:10.1145/3554315
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 05 January 2024
Published in PACMPL Volume 8, Issue POPL

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. concurrency
  2. equivalence
  3. predictive analysis
  4. reads-from
  5. reduction

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)172
  • Downloads (Last 6 weeks)26
Reflects downloads up to 04 Oct 2024

Other Metrics

Citations

Cited By

View all

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