Skip to main content

Trading Space for Simplicity in Stateless Model Checking

  • Chapter
  • First Online:
Real Time and Such

Abstract

Stateless model checking is a fully automatic verification technique for concurrent programs. which checks for safety violations by exploring all possible thread schedulings. It becomes effective when coupled with Dynamic Partial Order Reduction (DPOR), which introduces an equivalence on schedulings and reduces the amount of exploration. DPOR algorithms that are optimal are particularly effective in that they guarantee to explore exactly one execution from each equivalence class. Recently, the authors of this paper presented Parsimonious-OPtimal (POP) DPOR, an optimal DPOR algorithm for analyzing multi-threaded programs under sequential consistency, whose space consumption is polynomial in the worst case. This space consumption bound was realized due to a carefully crafted encoding of so-called sleep sets, a mechanism for preventing redundant exploration. This encoding brings some conceptual complexity to POP, which achieves good worst-case performance at the possible expense of worse average-case performance. In this paper, we present a simpler technique for managing sleep sets, which has exponential worst-case space consumption but better average-case performance. We experimentally compare these two sleep set management schemes on a range of benchmarks. The experimental results confirm that a simpler sleep set is a better choice when designing DPOR algorithms as they are faster and have similar memory consumption for average programs.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

eBook
USD 18.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Data Availability Statement

We provide an artifact with the implementations of LPOP and EPOP  and all benchmarks we have used for our evaluation in the following URL: https://doi.org/10.5281/zenodo.13225258.

Notes

  1. 1.

    https://i-cav.org/cav-award/.

  2. 2.

    Throughout this paper, we assume that threads are spawned by a main thread, and that all shared variables get initialized to 0, also by the main thread.

References

  1. Abdulla, P., Aronis, S., Jonsson, B., Sagonas, K.: Optimal dynamic partial order reduction. In: Symposium on Principles of Programming Languages, POPL 2014, pp. 373–384. ACM, New York (2014). https://doi.org/10.1145/2535838.2535845

  2. Abdulla, P.A., Aronis, S., Atig, M.F., Jonsson, B., Leonardsson, C., Sagonas, K.: Stateless model checking for TSO and PSO. In: Baier, C., Tinelli, C. (eds.) TACAS 2015. LNCS, vol. 9035, pp. 353–367. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-46681-0_28

    Chapter  Google Scholar 

  3. Abdulla, P.A., Aronis, S., Jonsson, B., Sagonas, K.: Source sets: a foundation for optimal dynamic partial order reduction. J. ACM 64(4), 25:1–25:49 (2017). https://doi.org/10.1145/3073408

  4. Abdulla, P.A., et al.: Tailoring stateless model checking for event-driven multi-threaded programs. In: André, É., Sun, J. (eds.) ATVA 2023, Part II. LNCS, vol. 14216, pp. 176–198. Springer, Cham (2023). https://doi.org/10.1007/978-3-031-45332-8_9

    Chapter  Google Scholar 

  5. Abdulla, P.A., Atig, M.F., Das, S., Jonsson, B., Sagonas, K.: Parsimonious optimal dynamic partial order reduction. CoRR abs/2405.11128 (2024). https://doi.org/10.48550/ARXIV.2405.11128

  6. Abdulla, P.A., Atig, M.F., Das, S., Jonsson, B., Sagonas, K.: Parsimonious optimal dynamic partial order reduction. In: Gurfinkel, A., Ganesh, V. (eds.) CAV 2024, Part II. LNCS, vol. 14682, pp. 19–43. Springer, Cham (2024). https://doi.org/10.1007/978-3-031-65630-9_2

    Chapter  Google Scholar 

  7. Alur, R., Dill, D.L.: A theory of timed automata. Theor. Comput. Sci. 126(2), 183–235 (1994). https://doi.org/10.1016/0304-3975(94)90010-8

    Article  MathSciNet  Google Scholar 

  8. Christakis, M., Gotovos, A., Sagonas, K.: Systematic testing for detecting concurrency errors in Erlang programs. In: Sixth IEEE International Conference on Software Testing, Verification and Validation, ICST 2013, Los Alamitos, CA, USA, pp. 154–163. IEEE (2013). https://doi.org/10.1109/ICST.2013.50

  9. Flanagan, C., Godefroid, P.: Dynamic partial-order reduction for model checking software. In: Principles of Programming Languages (POPL), pp. 110–121. ACM, New York (2005). https://doi.org/10.1145/1040305.1040315

  10. Godefroid, P.: Partial-order methods for the verification of concurrent systems: an approach to the state-explosion problem. Ph.D. thesis, University of Liège (1996). https://doi.org/10.1007/3-540-60761-7. http://www.springer.com/gp/book/9783540607618, also, volume 1032 of LNCS, Springer

  11. Godefroid, P.: Model checking for programming languages using VeriSoft. In: Principles of Programming Languages (POPL), pp. 174–186. ACM Press, New York (1997). https://doi.org/10.1145/263699.263717

  12. Godefroid, P.: Software model checking: the VeriSoft approach. Formal Methods Syst. Des. 26(2), 77–101 (2005). https://doi.org/10.1007/s10703-005-1489-x

  13. Godefroid, P., Hanmer, R.S., Jagadeesan, L.: Model checking without a model: an analysis of the heart-beat monitor of a telephone switch using VeriSoft. In: Proceedings of the ACM SIGSOFT International Symposium on Software Testing and Analysis, ISSTA, pp. 124–133. ACM, New York (1998). https://doi.org/10.1145/271771.271800

  14. Jensen, C.S., Møller, A., Raychev, V., Dimitrov, D., Vechev, M.T.: Stateless model checking of event-driven applications. In: Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015, pp. 57–73. ACM, New York (2015). https://doi.org/10.1145/2814270.2814282

  15. Jonsson, B., Lång, M., Sagonas, K.: Awaiting for Godot: stateless model checking that avoids executions where nothing happens. In: Griggio, A., Rungta, N. (eds.) 22nd Formal Methods in Computer-Aided Design, FMCAD 2022, pp. 284–293. IEEE (2022). https://doi.org/10.34727/2022/ISBN.978-3-85448-053-2_35

  16. Kastenberg, H., Rensink, A.: Dynamic partial order reduction using probe sets. In: van Breugel, F., Chechik, M. (eds.) CONCUR 2008. LNCS, vol. 5201, pp. 233–247. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-85361-9_21

    Chapter  Google Scholar 

  17. Kokologiannakis, M., Lahav, O., Sagonas, K., Vafeiadis, V.: Effective stateless model checking for C/C++ concurrency. Proc. ACM Program. Lang. 2(POPL), 17:1–17:32 (2018). https://doi.org/10.1145/3158105

  18. Kokologiannakis, M., Marmanis, I., Gladstein, V., Vafeiadis, V.: Truly stateless, optimal dynamic partial order reduction. Proc. ACM Program. Lang. 6(POPL), 1–28 (2022). https://doi.org/10.1145/3498711

  19. Kokologiannakis, M., Raad, A., Vafeiadis, V.: Model checking for weakly consistent libraries. In: Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2019, pp. 96–110. ACM, New York (2019). https://doi.org/10.1145/3314221.3314609

  20. Kokologiannakis, M., Ren, X., Vafeiadis, V.: Dynamic partial order reductions for spinloops. In: Formal Methods in Computer Aided Design, FMCAD 2021, pp. 163–172. IEEE (2021). https://doi.org/10.34727/2021/isbn.978-3-85448-046-4_25

  21. Kokologiannakis, M., Sagonas, K.: Stateless model checking of the Linux kernel’s read–copy update (RCU). Softw. Tools Technol. Transf. 21(3), 287–306 (2019). https://doi.org/10.1007/s10009-019-00514-6

  22. Kokologiannakis, M., Vafeiadis, V.: GenMC: a model checker for weak memory models. In: Silva, A., Leino, K.R.M. (eds.) CAV 2021, Part I. LNCS, vol. 12759, pp. 427–440. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-81685-8_20

    Chapter  Google Scholar 

  23. Lamport, L.: How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Comput. 28(9), 690–691 (1979). https://doi.org/10.1109/TC.1979.1675439

    Article  Google Scholar 

  24. Larsen, K.G., Larsson, F., Pettersson, P., Yi, W.: Compact data structures and statespace reduction for model-checking real-time systems. Real Time Syst. 25(2–3), 255–275 (2003). https://doi.org/10.1023/A:1025132427497

    Article  Google Scholar 

  25. Larsen, K.G., Pettersson, P., Yi, W.: UPPAAL in a nutshell. Softw. Tools Technol. Transf. 1(1–2), 134–152 (1997). https://doi.org/10.1007/S100090050010

    Article  Google Scholar 

  26. Maiya, P., Gupta, R., Kanade, A., Majumdar, R.: Partial order reduction for event-driven multi-threaded programs. In: Chechik, M., Raskin, J.-F. (eds.) TACAS 2016. LNCS, vol. 9636, pp. 680–697. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-49674-9_44

    Chapter  Google Scholar 

  27. Mazurkiewicz, A.: Trace theory. In: Brauer, W., Reisig, W., Rozenberg, G. (eds.) ACPN 1986. LNCS, vol. 255, pp. 278–324. Springer, Heidelberg (1987). https://doi.org/10.1007/3-540-17906-2_30

    Chapter  Google Scholar 

  28. Musuvathi, M., Qadeer, S., Ball, T., Basler, G., Nainar, P.A., Neamtiu, I.: Finding and reproducing heisenbugs in concurrent programs. In: Proceedings of the 8th USENIX Symposium on Operating Systems Design and Implementation, OSDI 2008, pp. 267–280. USENIX Association, Berkeley (2008). http://dl.acm.org/citation.cfm?id=1855741.1855760

  29. Palmer, R., Gopalakrishnan, G., Kirby, R.M.: Semantics driven dynamic partial-order reduction of MPI-based parallel programs. In: Ur, S., Farchi, E. (eds.) Proceedings of the 5th Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging, PADTAD 2007, pp. 43–53. ACM (2007). https://doi.org/10.1145/1273647.1273657

  30. Peled, D.: Partial order reduction: model-checking using representatives. In: Penczek, W., Szałas, A. (eds.) MFCS 1996. LNCS, vol. 1113, pp. 93–112. Springer, Heidelberg (1996). https://doi.org/10.1007/3-540-61550-4_141

    Chapter  Google Scholar 

  31. Tasharofi, S., Karmani, R.K., Lauterburg, S., Legay, A., Marinov, D., Agha, G.: TransDPOR: a novel dynamic partial-order reduction technique for testing actor programs. In: Giese, H., Rosu, G. (eds.) FMOODS/FORTE -2012. LNCS, vol. 7273, pp. 219–234. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-30793-5_14

    Chapter  Google Scholar 

  32. Valmari, A.: Stubborn set methods for process algebras. In: Peled, D.A., Pratt, V.R., Holzmann, G.J. (eds.) Partial Order Methods in Verification, Proceedings of a DIMACS Workshop. DIMACS Series in Discrete Mathematics and Theoretical Computer Science, vol. 29, pp. 213–231. DIMACS/AMS (1996). https://doi.org/10.1090/DIMACS/029/12

  33. Zhang, N., Kusano, M., Wang, C.: Dynamic partial order reduction for relaxed memory models. In: Programming Language Design and Implementation (PLDI), pp. 250–259. ACM, New York (2015). https://doi.org/10.1145/2737924.2737956

Download references

Acknowledgments

We thank the anonymous reviewers for helpful comments. This research was partially funded by research grants from the Swedish Research Council (Vetenskapsrådet) and from the Swedish Foundation for Strategic Research through project aSSIsT.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Parosh Aziz Abdulla .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2025 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Abdulla, P.A., Atig, M.F., Das, S., Jonsson, B., Sagonas, K. (2025). Trading Space for Simplicity in Stateless Model Checking. In: Graf, S., Pettersson, P., Steffen, B. (eds) Real Time and Such. Lecture Notes in Computer Science, vol 15230. Springer, Cham. https://doi.org/10.1007/978-3-031-73751-0_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-73751-0_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-73750-3

  • Online ISBN: 978-3-031-73751-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics