skip to main content
research-article
Open access

Stuttering for Free

Published: 16 October 2023 Publication History

Abstract

One of the most common tools for proving behavioral refinements between transition systems is the method of simulation proofs, which has been explored extensively over the past several decades. Stuttering simulations are an extension of traditional simulations—used, for example, in CompCert—in which either the source or target of the simulation is permitted to “stutter” (stay in place) while the other side steps forward. In the interest of ensuring soundness, however, existing stuttering simulations restrict proofs to only perform a finite number of stuttering steps before making synchronous progress—a step of reasoning in which both sides of the simulation progress forward together. This restriction guarantees that a terminating program cannot be proven to simulate a non-terminating one.
In this paper, we observe that the requirement to eventually achieve synchronous progress is burdensome and, what’s more, unnecessary: it is possible to ensure soundness of stuttering simulations while only requiring asynchronous progress (progress on both sides of the simulation that may be achieved with only stuttering steps). Building on this observation, we develop a new simulation technique we call FreeSim (short for “freely-stuttering simulations”), mechanized in Coq, and we demonstrate its effectiveness on a range of interesting case studies. These include a simplification of the meta-theory of CompCert, as well as the DTrees library, which enriches the ITrees (Interaction Trees) library with dual non-determinism.

References

[1]
Ralph-Johan Back and Joakim Wright. 2012. Refinement calculus: a systematic introduction. Springer Science & Business Media. https://dl.acm.org/doi/10.5555/551462
[2]
Dariusz Biernacki, Sergueï Lenglet, and Piotr Polesiuk. 2019. Bisimulations for delimited-control operators. Logical methods in computer science, 15 (2019).
[3]
Dariusz Biernacki, Sergueï Lenglet, and Piotr Polesiuk. 2019. Diacritical companions. Electronic Notes in Theoretical Computer Science, 347 (2019), 25–43.
[4]
Dariusz Biernacki, Sergueï Lenglet, and Piotr Polesiuk. 2019. Proving soundness of extensional normal-form bisimilarities. Logical Methods in Computer Science, 15 (2019).
[5]
Nicolas Chappe, Paul He, Ludovic Henrio, Yannick Zakowski, and Steve Zdancewic. 2023. Choice Trees: Representing Nondeterministic, Recursive, and Impure Programs in Coq. Proc. ACM Program. Lang., 7, POPL (2023), Article 61, jan, 31 pages. https://doi.org/10.1145/3571254
[6]
Minki Cho, Youngju Song, Dongjae Lee, Lennard Gäher, and Derek Dreyer. 2023. Stuttering for Free (OOPSLA 2023 Artifact). https://doi.org/10.5281/zenodo.8331740
[7]
Dan Frumin, Robbert Krebbers, and Lars Birkedal. 2018. ReLoC: A mechanised relational logic for fine-grained concurrency. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science. 442–451.
[8]
Lennard Gäher, Michael Sammler, Simon Spies, Ralf Jung, Hoang-Hai Dang, Robbert Krebbers, Jeehoon Kang, and Derek Dreyer. 2022. Simuliris: a separation logic framework for verifying concurrent program optimizations. Proceedings of the ACM on Programming Languages, 6, POPL (2022), 1–31.
[9]
Ronghui Gu, Jérémie Koenig, Tahina Ramananandro, Zhong Shao, Xiongnan (Newman) Wu, Shu-Chun Weng, Haozhong Zhang, and Yu Guo. 2015. Deep Specifications and Certified Abstraction Layers. In Proceedings of the 42nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2015).
[10]
Chung-Kil Hur, Georg Neis, Derek Dreyer, and Viktor Vafeiadis. 2013. The Power of Parameterization in Coinductive Proof. In Proceedings of the 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’13). Association for Computing Machinery, New York, NY, USA. 193–206. isbn:9781450318327 https://doi.org/10.1145/2429069.2429093
[11]
Jérémie Koenig and Zhong Shao. 2020. Refinement-Based Game Semantics for Certified Abstraction Layers. In Proceedings of the 35th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS ’20). Association for Computing Machinery, New York, NY, USA. 633–647. isbn:9781450371049 https://doi.org/10.1145/3373718.3394799
[12]
Dongjae Lee, Minki Cho, Jinwoo Kim, Soonwon Moon, Youngju Song, and Chung-Kil Hur. 2023. Fair Operational Semantics. Proc. ACM Program. Lang., 7, PLDI (2023), Article 139, jun, 24 pages. https://doi.org/10.1145/3591253
[13]
Xavier Leroy. 2006. Formal Certification of a Compiler Back-end or: Programming a Compiler with a Proof Assistant. In Proceedings of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2006).
[14]
Xavier Leroy. 2023. Implication proof from forward simulation to backward simulation. https://github.com/AbsInt/CompCert/blob/35feefd229792e6b560ccf156465a6e309bc1d98/common/Smallstep.v##L1612
[15]
Jacob R Lorch, Yixuan Chen, Manos Kapritsos, Bryan Parno, Shaz Qadeer, Upamanyu Sharma, James R Wilcox, and Xueyuan Zhao. 2020. Armada: low-effort verification of high-performance concurrent programs. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation. 197–210. https://doi.org/10.1145/3385412.3385971
[16]
Robin Milner. 1971. An Algebraic Definition of Simulation Between Programs. In International Joint Conference on Artificial Intelligence. https://dl.acm.org/doi/abs/10.5555/1622876.1622926
[17]
Robin Milner. 1989. Communication and concurrency. 84, Prentice hall Englewood Cliffs.
[18]
Kedar S. Namjoshi. 1997. A Simple Characterization of Stuttering Bisimulation. In Foundations of Software Technology and Theoretical Computer Science, 17th Conference, Kharagpur, India, December 18-20, 1997, Proceedings, S. Ramesh and G. Sivakumar (Eds.) (Lecture Notes in Computer Science, Vol. 1346). Springer, 284–296. https://doi.org/10.1007/BFb0058037
[19]
Damien Pous. 2016. Coinduction all the way up. In Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science. 307–316. https://doi.org/10.1145/2933575.2934564
[20]
Damien Pous and Davide Sangiorgi. 2011. Enhancements of the bisimulation proof method. Cambridge University Press, 233289. https://doi.org/10.1017/CBO9780511792588.007
[21]
Michael Sammler, Deepak Garg, Derek Dreyer, and Tadeusz Litak. 2019. The high-level benefits of low-level sandboxing. Proceedings of the ACM on Programming Languages, 4, POPL (2019), 1–32. https://doi.org/10.1145/3371100
[22]
Michael Sammler, Simon Spies, Youngju Song, Emanuele D’Osualdo, Robbert Krebbers, Deepak Garg, and Derek Dreyer. 2023. DimSum: A Decentralized Approach to Multi-Language Semantics and Verification. Proc. ACM Program. Lang., 7, POPL (2023), Article 27, jan, 31 pages. https://doi.org/10.1145/3571220
[23]
Davide Sangiorgi. 1998. On the bisimulation proof method. Mathematical Structures in Computer Science, 8, 5 (1998), 447–479.
[24]
Youngju Song, Minki Cho, Dongjoo Kim, Yonghyun Kim, Jeehoon Kang, and Chung-Kil Hur. 2019. CompCertM: CompCert with C-Assembly Linking and Lightweight Modular Verification. Proc. ACM Program. Lang., 4, POPL (2019), Article 23, Dec., 31 pages. https://doi.org/10.1145/3371091
[25]
Youngju Song, Minki Cho, Dongjae Lee, Chung-Kil Hur, Michael Sammler, and Derek Dreyer. 2023. Conditional Contextual Refinement. Proc. ACM Program. Lang., 7, POPL (2023), Article 39, jan, 31 pages. https://doi.org/10.1145/3571232
[26]
The Coq Development Team. 2021. The Coq Proof Assistant 8.13.2 Reference Manual. https://coq.github.io/doc/V8.13.2/refman/
[27]
Aaron Turon, Derek Dreyer, and Lars Birkedal. 2013. Unifying refinement and Hoare-style reasoning in a logic for higher-order concurrency. In Proceedings of the 18th ACM SIGPLAN international conference on Functional programming. 377–390. https://doi.org/10.1145/2500365.2500600
[28]
Li-yao Xia, Yannick Zakowski, Paul He, Chung-Kil Hur, Gregory Malecha, Benjamin C. Pierce, and Steve Zdancewic. 2019. Interaction Trees: Representing Recursive and Impure Programs in Coq. Proc. ACM Program. Lang., 4, POPL (2019), Article 51, Dec., 32 pages. https://doi.org/10.1145/3371119
[29]
Yannick Zakowski, Paul He, Chung-Kil Hur, and Steve Zdancewic. 2020. An Equational Theory for Weak Bisimulation via Generalized Parameterized Coinduction. CoRR, abs/2001.02659 (2020), arXiv:2001.02659. arxiv:2001.02659
[30]
Jianzhou Zhao, Santosh Nagarakatte, Milo M.K. Martin, and Steve Zdancewic. 2012. Formalizing the LLVM Intermediate Representation for Verified Program Transformations. In Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’12). Association for Computing Machinery, New York, NY, USA. 427–440. isbn:9781450310833 https://doi.org/10.1145/2103656.2103709

Cited By

View all
  • (2024)Refinement Composition LogicProceedings of the ACM on Programming Languages10.1145/36746458:ICFP(573-601)Online publication date: 15-Aug-2024

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 7, Issue OOPSLA2
October 2023
2250 pages
EISSN:2475-1421
DOI:10.1145/3554312
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution 4.0 International License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 16 October 2023
Published in PACMPL Volume 7, Issue OOPSLA2

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Coq
  2. stuttering simulation
  3. verification

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

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

Other Metrics

Citations

Cited By

View all
  • (2024)Refinement Composition LogicProceedings of the ACM on Programming Languages10.1145/36746458:ICFP(573-601)Online publication date: 15-Aug-2024

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