Abstract
The metatheory of axiomatic weak memory models covers questions like the correctness of compilation mappings from one model to another and the correctness of local program transformations according to a given model---topics usually requiring lengthy human investigation. We show that these questions can be solved by answering a more basic question: "Given two memory models, is one weaker than the other?" Moreover, for a wide class of axiomatic memory models, we show that this basic question can be reduced to a language inclusion problem between regular languages, which is decidable.
Similarly, implementing an efficient check for whether an execution graph is consistent according to a given memory model has required non-trivial manual effort. Again, we show that such efficient checks can be derived automatically for a wide class of axiomatic memory models, and that incremental consistency checks can be incorporated in GenMC, a state-of-the-art model checker for concurrent programs. As a result, we get the first time- and space-efficient bounded verifier taking the axiomatic memory model as an input parameter.
- Parosh Aziz Abdulla, Stavros Aronis, Mohamed Faouzi Atig, Bengt Jonsson, Carl Leonardsson, and Konstantinos Sagonas ( 2015 ). “Stateless model checking for TSO and PSO.” In: TACAS 2015. Vol. 9035. LNCS. Berlin, Heidelberg: Springer, pp. 353-367. doi: https://doi.org/10.1007/978-3-662-46681-0_28.
Google Scholar
Digital Library
- Jade Alglave, Luc Maranget, Paul E. McKenney, Andrea Parri, and Alan Stern ( 2018 ). “Frightening small children and disconcerting grown-ups: Concurrency in the Linux kernel.” In: ASPLOS 2018. Williamsburg, VA, USA: ACM, pp. 405-418. doi: https://doi.org/10.1145/3173162.3177156.
Google Scholar
Digital Library
- Jade Alglave, Luc Maranget, and Michael Tautschnig ( July 2014 ). “Herding cats: Modelling, simulation, testing, and data mining for weak memory.” In: ACM Trans. Program. Lang. Syst. 36.2, 7 : 1-7 : 74. doi: https://doi.org/10.1145/2627752.
Google Scholar
Digital Library
- Mark Batty, Kayvan Memarian, Scott Owens, Susmit Sarkar, and Peter Sewell ( 2012 ). “Clarifying and compiling C/C++ concurrency: From C+ +11 to POWER.” In: POPL 2012. Philadelphia, PA, USA: ACM, pp. 509-520. doi: https://doi.org/10. 1145/2103656.2103717.
Google Scholar
Digital Library
- Mark Batty, Scott Owens, Susmit Sarkar, Peter Sewell, and Tjark Weber ( 2011 ). “ Mathematizing C ++ concurrency.” In: POPL 2011. Austin, Texas, USA: ACM, pp. 55-66. doi: https://doi.org/10.1145/1926385.1926394.
Google Scholar
Digital Library
- Filippo Bonchi and Damien Pous ( 2013 ). “Checking NFA equivalence with bisimulations up to congruence.” In: POPL 2013. Ed. by Roberto Giacobazzi and Radhia Cousot. ACM, pp. 457-468. doi: https://doi.org/10.1145/2429069.2429124.
Google Scholar
Digital Library
- James Bornholt and Emina Torlak ( 2017 ). “Synthesizing memory models from framework sketches and Litmus tests.” In: PLDI 2017. Ed. by Albert Cohen and Martin T. Vechev. ACM, pp. 467-481. doi: https://doi.org/10.1145/3062341.3062353.
Google Scholar
Digital Library
- Stephen Dolan, KC Sivaramakrishnan, and Anil Madhavapeddy ( 2018 ). “Bounding Data Races in Space and Time.” In: PLDI 2018. Philadelphia, PA, USA: ACM, pp. 242-255. doi: https://doi.org/10.1145/3192366.3192421.
Google Scholar
Digital Library
- Shaked Flur, Kathryn E. Gray, Christopher Pulte, Susmit Sarkar, Ali Sezgin, Luc Maranget, Will Deacon, and Peter Sewell ( 2016 ). “Modelling the ARMv8 architecture, operationally: Concurrency and ISA.” In: POPL 2016. St. Petersburg, FL, USA: ACM, pp. 608-621. doi: https://doi.org/10.1145/2837614.2837615.
Google Scholar
Digital Library
- Shaked Flur, Susmit Sarkar, Christopher Pulte, Kyndylan Nienhuis, Luc Maranget, Kathryn E. Gray, Ali Sezgin, Mark Batty, and Peter Sewell ( 2017 ). “Mixed-size concurrency: ARM, POWER, C/C++ 11, and SC.” In: POPL 2017. Paris, France: ACM, pp. 429-442. doi: https://doi.org/10.1145/3009837.3009839.
Google Scholar
Digital Library
- Natalia Gavrilenko, Hernán Ponce-de-León, Florian Furbach, Keijo Heljanko, and Roland Meyer ( 2019 ). “BMC for weak memory models: Relation analysis for compact SMT encodings.” In: CAV 2019. Ed. by Isil Dillig and Serdar Tasiran. Cham: Springer International Publishing, pp. 355-365. doi: https://doi.org/10.1007/978-3-030-25540-4_19.
Google Scholar
Cross Ref
- Fei He, Zhihang Sun, and Hongyu Fan ( 2021 ). “Satisfiability modulo Ordering Consistency Theory for Multi-Threaded Program Verification.” In: PLDI 2021. Virtual, Canada: ACM, pp. 1264-1279. doi: https://doi.org/10.1145/3453483.3454108.
Google Scholar
Digital Library
- Tsunehiko Kameda and Peter Weiner ( 1970 ). “ On the State Minimization of Nondeterministic Finite Automata.” In: IEEE Trans. Computers 19.7, pp. 617-627. doi: https://doi.org/10.1109/T-C. 1970. 222994.
Google Scholar
Cross Ref
- Michalis Kokologiannakis, Ori Lahav, Konstantinos Sagonas, and Viktor Vafeiadis (Dec. 2017 ). “Efective stateless model checking for C/C++ concurrency.” In: Proc. ACM Program. Lang. 2.POPL, 17 : 1-17 : 32. doi: https://doi.org/10.1145/3158105.
Google Scholar
Digital Library
- Michalis Kokologiannakis, Iason Marmanis, Vladimir Gladstein, and Viktor Vafeiadis (Jan. 2022 ). “Truly stateless, optimal dynamic partial order reduction.” In: Proc. ACM Program. Lang. 6.POPL. doi: https://doi.org/10.1145/3498711.
Google Scholar
Digital Library
- Michalis Kokologiannakis, Azalea Raad, and Viktor Vafeiadis ( 2019 ). “Model checking for weakly consistent libraries.” In: PLDI 2019. New York, NY, USA: ACM. doi: https://doi.org/10.1145/3314221.3314609.
Google Scholar
Digital Library
- Michalis Kokologiannakis and Viktor Vafeiadis ( 2020 ). “HMC: Model checking for hardware memory models.” In: ASPLOS 2020. ASPLOS '20. Lausanne, Switzerland: ACM, pp. 1157-1171. doi: https://doi.org/10.1145/3373376.3378480.
Google Scholar
Digital Library
- Michalis Kokologiannakis and Viktor Vafeiadis ( 2021 ). “GenMC: A model checker for weak memory models.” In: CAV 2021. Ed. by Alexandra Silva and K. Rustan M. Leino. Vol. 12759. LNCS. Springer, pp. 427-440. doi: https://doi.org/10.1007/978-3-030-81685-8_20.
Google Scholar
Digital Library
- Dexter Kozen ( 1997 ). “Kleene Algebra with Tests.” In: ACM Trans. Program. Lang. Syst. 19.3. doi: https://doi.org/10.1145/ 256167.256195.
Google Scholar
Digital Library
- Dexter Kozen and Frederick Smith ( 1996 ). “Kleene Algebra with Tests: Completeness and Decidability.” In: CSL 1996. Ed. by Dirk van Dalen and Marc Bezem. Vol. 1258. LNCS. Springer, pp. 244-259. doi: https://doi.org/10.1007/3-540-63172-0\_43.
Google Scholar
Cross Ref
- Ori Lahav, Nick Giannarakis, and Viktor Vafeiadis ( 2016a ). “ Taming Release-acquire Consistency.” In: POPL 2016. St. Petersburg, FL, USA: ACM, pp. 649-662. doi: https://doi.org/10.1145/2837614.2837643.
Google Scholar
Digital Library
- Ori Lahav and Viktor Vafeiadis ( 2016b ). “Explaining Relaxed Memory Models with Program Transformations.” In: FM 2016. Springer, pp. 479-495. doi: https://doi.org/10.1007/978-3-319-48989-6_29.
Google Scholar
Cross Ref
- Ori Lahav, Viktor Vafeiadis, Jeehoon Kang, Chung-Kil Hur, and Derek Dreyer ( 2017 ). “Repairing sequential consistency in C/C++ 11.” In: PLDI 2017. Barcelona, Spain: ACM, pp. 618-632. doi: https://doi.org/10.1145/3062341.3062352.
Google Scholar
Digital Library
- Leslie Lamport (Sept. 1979 ). “How to Make a Multiprocessor Computer that Correctly Executes Multiprocess Programs.” In: IEEE Trans. Computers 28.9, pp. 690-691. doi: https://doi.org/10.1109/TC. 1979. 1675439.
Google Scholar
Cross Ref
- Sela Mador-Haim, Rajeev Alur, and Milo M. K. Martin ( 2010 ). “Generating Litmus Tests for Contrasting Memory Consistency Models.” In: CAV 2010. Ed. by Tayssir Touili, Byron Cook, and Paul B. Jackson. Springer. doi: https://doi.org/10.1007/978-3-642-14295-6\_26.
Google Scholar
Cross Ref
- Sela Mador-Haim, Rajeev Alur, and Milo M. K. Martin ( 2011 ). “Litmus tests for comparing memory consistency models: how long do they need to be?” In: DAC 2011. Ed. by Leon Stok, Nikil D. Dutt, and Soha Hassoun. ACM. doi: https: //doi.org/10.1145/2024724.2024842.
Google Scholar
Digital Library
- Brian Norris and Brian Demsky ( 2013 ). “CDSChecker: Checking concurrent data structures written with C/C++ atomics.” In: OOPSLA 2013. ACM, pp. 131-150. doi: https://doi.org/10.1145/2509136.2509514.
Google Scholar
Digital Library
- Scott Owens, Susmit Sarkar, and Peter Sewell ( 2009 ). “A better x86 memory model: x86-TSO.” In: TPHOLs 2009. Munich, Germany: Springer, pp. 391-407. doi: https://doi.org/10.1007/978-3-642-03359-9_27.
Google Scholar
Digital Library
- Anton Podkopaev, Ori Lahav, and Viktor Vafeiadis (Jan. 2019 ). “Bridging the gap between programming languages and hardware weak memory models.” In: Proc. ACM Program. Lang. 3.POPL, 69 : 1-69 : 31. doi: https://doi.org/10.1145/3290382.
Google Scholar
Digital Library
- Yuval Filmus (https://cs.stackexchange.com/users/683/yuval-filmus) ( 2022 ). Is the power of a regular language regular? Is the root of a regular language regular? Computer Science Stack Exchange. URL:https://cs.stackexchange.com/q/99371 (version: 2018-10-31). eprint: https://cs.stackexchange.com/q/99371. url: https://cs.stackexchange.com/q/99371 (visited on Oct. 20, 2022 ).
Google Scholar
- Christopher Pulte, Shaked Flur, Will Deacon, Jon French, Susmit Sarkar, and Peter Sewell ( 2018 ). “Simplifying ARM concurrency: Multicopy-atomic axiomatic and operational models for ARMv8.” In: Proc. ACM Program. Lang. 2.POPL, 19 : 1-19 : 29. doi: https://doi.org/10.1145/3158107.
Google Scholar
Digital Library
- Christopher Pulte, Jean Pichon-Pharabod, Jeehoon Kang, Sung-Hwan Lee, and Chung-Kil Hur ( 2019 ). “Promising-ARM/RISCV: A simpler and faster operational concurrency model.” In: PLDI 2019. Phoenix, AZ, USA: ACM, pp. 1-15. doi: https: //doi.org/10.1145/3314221.3314624.
Google Scholar
Digital Library
- Susmit Sarkar, Kayvan Memarian, Scott Owens, Mark Batty, Peter Sewell, Luc Maranget, Jade Alglave, and Derek Williams ( 2012 ). “Synchronising C/C++ and POWER.” In: PLDI 2012. ACM, pp. 311-322. doi: https://doi.org/10.1145/2254064. 2254102.
Google Scholar
Digital Library
- Susmit Sarkar, Peter Sewell, Jade Alglave, Luc Maranget, and Derek Williams ( 2011 ). “Understanding POWER multiprocessors.” In: PLDI 2011. ACM, pp. 175-186. doi: https://doi.org/10.1145/1993498.1993520.
Google Scholar
Digital Library
- SPARC International Inc. ( 1992 ). The SPARC Architecture Manual: Version 8. Prentice-Hall, Inc.
Google Scholar
- SPARC International Inc. ( 1994 ). The SPARC architecture manual (version 9). Prentice-Hall.
Google Scholar
- Emina Torlak, Mandana Vaziri, and Julian Dolby ( 2010 ). “MemSAT: checking axiomatic specifications of memory models.” In: PLDI 2010. Ed. by Benjamin G. Zorn and Alexander Aiken. ACM, pp. 341-350. doi: https://doi.org/10.1145/1806596.1806635.
Google Scholar
Digital Library
- Viktor Vafeiadis, Thibaut Balabonski, Soham Chakraborty, Robin Morisset, and Francesco Zappa Nardelli ( 2015 ). “Common compiler optimisations are invalid in the C11 memory model and what we can do about it.” In: POPL 2015. Mumbai, India: ACM, pp. 209-220. doi: https://doi.org/10.1145/2676726.2676995.
Google Scholar
Digital Library
- John Wickerson, Mark Batty, Tyler Sorensen, and George A. Constantinides ( 2017 ). “Automatically Comparing Memory Consistency Models.” In: POPL 2017. ACM, pp. 190-204. doi: https://doi.org/10.1145/3009837.3009838.
Google Scholar
Digital Library
Index Terms
Kater: Automating Weak Memory Model Metatheory and Consistency Checking
Recommendations
Unifying Operational Weak Memory Verification: An Axiomatic Approach
In this article, we propose an approach to program verification using an abstract characterisation of weak memory models. Our approach is based on a hierarchical axiom scheme that captures the observational properties of a memory model. In particular, we ...
Model checking for weakly consistent libraries
PLDI 2019: Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and ImplementationWe present GenMC, a model checking algorithm for concurrent programs that is parametric in the choice of memory model and can be used for verifying clients of concurrent libraries. Subject to a few basic conditions about the memory model, our algorithm ...
Model checking for a multi-execution memory model
Multi-execution memory models, such as Promising and Weakestmo, are an advanced class of weak memory consistency models that justify certain outcomes of a concurrent program by considering multiple candidate executions collectively. While this key ...






Comments