Abstract
Code commutativity has increasingly many applications including proof methodologies for concurrency, reductions, automated parallelization, distributed systems and blockchain smart contracts. While there has been some work on automatically generating commutativity conditions through abstraction refinement, the performance of such refinement algorithms critically depends on (i) the universe of predicates and (ii) the choice of the next predicate during search, and thus far this has not been examined in detail.
In this paper, we improve commutativity synthesis by addressing these under-explored requirements. We prune the universe of predicates through a combination of better predicate generation, new a priori syntactic filtering, and through dynamic reduction of the search space. We also present new predicate selection heuristics: one based on look-ahead, and one that utilizes model counting to greedily cover the search space.
Our work is embodied in the new commutativity synthesis tool Servois2, a generational improvement over the state-of-the-art tool Servois. Servois2 is implemented in a faster language and has support for CVC5 and Z3. We contribute new, non-trivial commutativity benchmarks. All of the new features in Servois2 are shown to either increase performance (geomean \(3.58 \times \) speedup) or simplify the conditions generated, when compared against Servois. We also show that our look-ahead heuristic leads to better scaling with respect to the number of predicates.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 2.
To satisfy closure, we include negations of all predicates. This comes at no performance loss, as such additions can be skipped over by Choose. This is valid because Refine recurses upon the negation of the chosen predicate.
- 3.
- 4.
- 5.
mVarA and mVarB are short for multiVarA and multiVarB.
- 6.
References
Farzan, A., Vandikas, A.: Reductions for safety proofs. In: Proceedings of the ACM on Programming Languages, vol. 4, no. POPL, pp. 1–28 (2019)
Kragl, B., Qadeer, S.: The civl verifier. In: 2021 Formal Methods in Computer Aided Design (FMCAD), pp. 143–152. IEEE (2021)
Flanagan, C., Freund, S.N.: The anchor verifier for blocking and non-blocking concurrent software. In: Proceedings of the ACM on Programming Languages, vol. 4, no. OOPSLA, pp. 1–29 (2020)
Rinard, M.C., Diniz, P.C.: Commutativity analysis: a new analysis technique for parallelizing compilers. ACM Trans. Program. Lang. Syst. (TOPLAS) 19(6), 942–991 (1997). https://citeseer.ist.psu.edu/rinard97commutativity.html
Spiegelman, A., Golan-Gueta, G., Keidar, I.: Transactional data structure libraries. ACM SIGPLAN Not. 51(6), 682–696 (2016)
Chen, A., Fathololumi, P., Koskinen, E., Pincus, J.: Veracity: declarative multicore programming with commutativity). In: Proceedings of the ACM Programming Language, vol. 6, no. OOPSLA2, pp. 186:1–186:31 (2022). https://doi.org/10.1145/3563349
Prabhu, P., Ghosh, S., Zhang, Y., Johnson, N.P., August, D.I.: Commutative set: a language extension for implicit parallel programming. In: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 1–11 (2011)
Clements, A.T., Kaashoek, M.F., Zeldovich, N., Morris, R.T., Kohler, E.: The scalable commutativity rule: designing scalable software for multicore processors. ACM Trans. Comput. Syst. (TOCS) 32(4), 1–47 (2015)
Shapiro, M., Preguiça, N., Baquero, C., Zawirski, M.: A comprehensive study of convergent and commutative replicated data types. Ph.D. dissertation, Inria-Centre Paris-Rocquencourt; INRIA (2011)
Dickerson, T., Gazzillo, P., Herlihy, M., Koskinen, E.: Adding concurrency to smart contracts. In: Proceedings of the ACM Symposium on Principles of Distributed Computing, Series PODC 2017, pp. 303–312. ACM, New York (2017). https://doi.acm.org/10.1145/3087801.3087835
Pîrlea, G., Kumar, A., Sergey, I.: Practical smart contract sharding with ownership and commutativity analysis. In: Freund, S.N., Yahav, E. (eds.) PLDI 2021: 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation, Virtual Event, Canada, 20–25 June 2021, pp. 1327–1341. ACM (2021). https://doi.org/10.1145/3453483.3454112
Gehr, T., Dimitrov, D., Vechev, M.: Learning commutativity specifications. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015, Part I. LNCS, vol. 9206, pp. 307–323. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21690-4_18
Aleen, F., Clark, N.: Commutativity analysis for software parallelization: letting program transformations see the big picture. In: Soffa, M.L., Irwin, M.J. (eds.) Proceedings of the 14th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS-XII), pp. 241–252. ACM (2009)
Bansal, K., Koskinen, E., Tripp, O.: Automatic generation of precise and useful commutativity conditions. In: Beyer, D., Huisman, M. (eds.) TACAS 2018. LNCS, vol. 10805, pp. 115–132. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-89960-2_7
Bansal, K., Koskinen, E., Tripp, O.: Synthesizing precise and useful commutativity conditions. J. Autom. Reason. 64(7), 1333–1359 (2020)
Gomes, C.P., Sabharwal, A., Selman, B.: Model counting. In: Handbook of Satisfiability, pp. 993–1014. IOS Press (2021)
De Loera, J.A., Hemmecke, R., Tauzer, J., Yoshida, R.: Effective lattice point counting in rational convex polytopes. J. Symb. Comput. 38(4), 1273–1302 (2004)
Aydin, A., Bang, L., Bultan, T.: Automata-based model counting for string constraints. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9206, pp. 255–272. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21690-4_15
Molavi, A., Schneider, T., Downing, M., Bang, L.: MCBAT: model counting for constraints over bounded integer arrays. In: Christakis, M., Polikarpova, N., Duggirala, P.S., Schrammel, P. (eds.) NSV/VSTTE -2020. LNCS, vol. 12549, pp. 124–143. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-63618-0_8
Barrett, C., et al.: CVC4. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 171–177. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-22110-1_14
Barbosa, H., et al.: cvc5: a versatile and industrial-strength SMT solver. In: Fisman, D., Rosu, G. (eds.) TACAS 2022, Part I. LNCS, vol. 13243, pp. 415–442. Springer, Cham (2022). https://doi.org/10.1007/978-3-030-99524-9_24
de Moura, L., Bjørner, N.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-78800-3_24
Aydin, A., Bang, L., Bultan, T.: Automata-based model counting for string constraints. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9206, pp. 255–272. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21690-4_15
Chakraborty, S., Meel, K.S., Vardi, M.Y.: Approximate model counting. In: Handbook of Satisfiability, pp. 1015–1045. IOS Press (2021)
Jia, X., Ghezzi, C., Ying, S.: Enhancing reuse of constraint solutions to improve symbolic execution. In: Proceedings of the 2015 International Symposium on Software Testing and Analysis, ISSTA 2015, pp. 177–187. Association for Computing Machinery, New York (2015). https://doi.org/10.1145/2771783.2771806
Acknowledgements
This work is supported in part by NSF Award #2008633 and #2107169.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Chen, A., Fathololumi, P., Nicola, M., Pincus, J., Brennan, T., Koskinen, E. (2023). Better Predicates and Heuristics for Improved Commutativity Synthesis. In: André, É., Sun, J. (eds) Automated Technology for Verification and Analysis. ATVA 2023. Lecture Notes in Computer Science, vol 14216. Springer, Cham. https://doi.org/10.1007/978-3-031-45332-8_5
Download citation
DOI: https://doi.org/10.1007/978-3-031-45332-8_5
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-45331-1
Online ISBN: 978-3-031-45332-8
eBook Packages: Computer ScienceComputer Science (R0)