Abstract
The weakly relational domain of Octagons offers a decent compromise between precision and efficiency for numerical properties. Here, we are concerned with the construction of non-numerical relational domains. We provide a general construction of weakly relational domains, which we exemplify with an extension of constant propagation by disjunctions. Since for the resulting domain of 2-disjunctive formulas satisfiability is NP-complete, we provide a general construction for a further, more abstract, weakly relational domain where the abstract operations of restriction and least upper bound can be efficiently implemented. In the second step, we consider a relational domain that tracks conjunctions of inequalities between variables, and between variables and constants for arbitrary partial orders of values. Examples are sub(multi)sets, as well as prefix, substring or scattered substring orderings on strings. When the partial order is a lattice, we provide precise polynomial algorithms for satisfiability, restriction, and the best abstraction of disjunction. Complementary to the constructions for lattices, we find that, in general, satisfiability of conjunctions is NP-complete. We therefore again provide polynomial abstract versions of restriction, conjunction, and join. By using our generic constructions, these domains are extended to weakly relational domains that additionally track disjunctions. For all our domains, we indicate how abstract transformers for assignments and guards can be constructed.
Article PDF
Similar content being viewed by others
Avoid common mistakes on your manuscript.
References
Abdulla, P.A., Atig, M.F., Diep, B.P., Holík, L., Janku, P.: Chain-free string constraints. In: Chen, Y., Cheng, C., Esparza, J. (eds.) Automated Technology for Verification and Analysis – 17th International Symposium, ATVA 2019, Proceedings, Taipei, Taiwan, October 28-31, 2019. LNCS, vol. 11781, pp. 277–293. Springer, Berlin (2019). https://doi.org/10.1007/978-3-030-31784-3_16
Albert, E., Arenas, P., Genaim, S., Puebla, G., Román-Díez, G.: Conditional termination of loops over heap-allocated data. Sci. Comput. Program. 92, 2–24 (2014). https://doi.org/10.1016/j.scico.2013.04.006
Arceri, V., Olliaro, M., Cortesi, A., Ferrara, P.: Relational string abstract domains. In: Finkbeiner, B., Wies, T. (eds.) Verification, Model Checking, and Abstract Interpretation – 23rd International Conference, VMCAI 2022, Proceedings, Philadelphia, PA, USA, January 16–18, 2022, LNCS, vol. 13182, pp. 20–42. Springer, Berlin (2022). https://doi.org/10.1007/978-3-030-94583-1_2
Bagnara, R., Hill, P.M., Zaffanella, E.: An improved tight closure algorithm for integer octagonal constraints. In: Logozzo, F., Peled, D.A., Zuck, L.D. (eds.) Verification, Model Checking, and Abstract Interpretation, pp. 8–21. Springer, Berlin (2008)
Bagnara, R., Hill, P.M., Zaffanella, E.: Weakly-relational shapes for numeric abstractions: improved algorithms and proofs of correctness. Form. Methods Syst. Des. 35(3), 279–323 (2009). https://doi.org/10.1007/s10703-009-0073-1
Beckert, B., Hähnle, R., Manyà, F.: The 2-sat problem of regular signed CNF formulas. In: 30th IEEE International Symposium on Multiple-Valued Logic, ISMVL 2000, Portland, Oregon, USA, May 23–25, 2000. Proceedings, pp. 331–336. IEEE Comput. Soc., Los Alamitos (2000). https://doi.org/10.1109/ISMVL.2000.848640
Chawdhary, A., Robbins, E., King, A.: Incrementally closing octagons. Form. Methods Syst. Des. 54(2), 232–277 (2019). https://doi.org/10.1007/s10703-017-0314-7
Chen, T., Chen, Y., Hague, M., Lin, A.W., Wu, Z.: What is decidable about string constraints with the ReplaceAll function. Proc. ACM Program. Lang. 2(POPL), 3:1–3:29 (2018). https://doi.org/10.1145/3158091
Cousot, P.: Principles of Abstract Interpretation. MIT Press, Cambridge (2021)
Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: Graham, R.M., Harrison, M.A., Sethi, R. (eds.) Conference Record of the Fourth ACM Symposium on Principles of Programming Languages, Los Angeles, California, USA, January 1977, pp. 238–252. ACM, New York (1977). https://doi.org/10.1145/512950.512973.
Cousot, P., Cousot, R.: Abstract interpretation frameworks. J. Log. Comput. 2(4), 511–547 (1992). https://doi.org/10.1093/LOGCOM/2.4.511
Cousot, P., Halbwachs, N.: Automatic discovery of linear restraints among variables of a program. In: Aho, A.V., Zilles, S.N., Szymanski, T.G. (eds.) Conference Record of the Fifth Annual ACM Symposium on Principles of Programming Languages, Tucson, Arizona, USA, January 1978, pp. 84–96. ACM, New York (1978). https://doi.org/10.1145/512760.512770
Day, J.D., Ganesh, V., Grewal, N., Manea, F.: On the expressive power of string constraints. Proc. ACM Program. Lang. 7(POPL), 278–308 (2023). https://doi.org/10.1145/3571203
Dor, N., Rodeh, M., Sagiv, S.: Cleanness checking of string manipulations in C programs via integer analysis. In: Cousot, P. (ed.) Static Analysis, 8th International Symposium, SAS 2001, Proceedings. Paris, France, July 16–18, 2001, LNCS, vol. 2126, pp. 194–212. Springer, Berlin (2001). https://doi.org/10.1007/3-540-47764-0_12
Ganesh, V., Minnes, M., Solar-Lezama, A., Rinard, M.: What is decidable about strings? (2011)
Karr, M.: Affine relationships among variables of a program. Acta Inform. 6, 133–151 (1976). https://doi.org/10.1007/BF00268497
Miné, A.: The octagon abstract domain. In: WCRE’ 01, p. 310. IEEE Comput. Soc., Los Alamitos (2001). https://doi.org/10.1109/WCRE.2001.957836
Miné, A.: Weakly relational numerical abstract domains. (Domaines numériques abstraits faiblement relationnels). PhD thesis, École Polytechnique, Palaiseau, France (2004). https://tel.archives-ouvertes.fr/tel-00136630
Miné, A.: The octagon abstract domain. High.-Order Symb. Comput. 19(1), 31–100 (2006). https://doi.org/10.1007/s10990-006-8609-1
Müller-Olm, M., Seidl, H.: Precise interprocedural analysis through linear algebra. In: Jones, N.D., Leroy, X. (eds.) Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2004, Venice, Italy, January 14–16, 2004, pp. 330–341. ACM, New York (2004). https://doi.org/10.1145/964001.964029
Müller-Olm, M., Seidl, H.: Analysis of modular arithmetic. ACM Trans. Program. Lang. Syst. 29(5), 29 (2007). https://doi.org/10.1145/1275497.1275504
Sankaranarayanan, S., Sipma, H.B., Manna, Z.: Scalable analysis of linear systems using mathematical programming. In: Cousot, R. (ed.) Verification, Model Checking, and Abstract Interpretation. LNCS, vol. 3385, pp. 25–41. Springer, Berlin (2005)
Schwarz, M., Seidl, H.: Octagons revisited - elegant proofs and simplified algorithms. In: Hermenegildo, M.V., Morales, J.F. (eds.) Static Analysis – 30th International Symposium, SAS 2023, Proceedings, Cascais, Portugal, October 22–24, 2023. LNCS, vol. 14284, pp. 485–507. Springer, Berlin (2023). https://doi.org/10.1007/978-3-031-44245-2_21
Schwarz, M., Saan, S., Seidl, H., Erhard, J., Vojdani, V.: Clustered relational thread-modular abstract interpretation with local traces. In: Wies, T. (ed.) Programming Languages and Systems – 32nd European Symposium on Programming, ESOP 2023, ETAPS 2023, Proceedings, Paris, France, April 22–27, 2023, LNCS, vol. 13990, pp. 28–58. Springer, Berlin (2023). https://doi.org/10.1007/978-3-031-30044-8_2
Simon, A., King, A., Howe, J.M.: Two variables per linear inequality as an abstract domain. In: Leuschel, M. (ed.) Logic Based Program Synthesis and Transformation, 12th International Workshop, LOPSTR 2002, Revised Selected Papers, Madrid, Spain, September 17-20, 2002. LNCS, vol. 2664, pp. 71–89. Springer, Berlin (2002). https://doi.org/10.1007/3-540-45013-0_7
Yu, F., Bultan, T., Hardekopf, B.: String abstractions for string verification. In: Groce, A., Musuvathi, M. (eds.) Model Checking Software – 18th International SPIN Workshop, Proceedings, Snowbird, UT, USA, July 14–15, 2011. LNCS, vol. 6823, pp. 20–37. Springer, Berlin (2011). https://doi.org/10.1007/978-3-642-22306-8_3
Acknowledgements
We thank the referees for their careful reading and detailed feedback. This work was supported by Shota Rustaveli National Science Foundation of Georgia, project FR-21-7973, and Deutsche Forschungsgemeinschaft (DFG), 378803395/2428 ConVeY.
Funding
Open Access funding enabled and organized by Projekt DEAL.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Seidl, H., Erhard, J., Tilscher, S. et al. Non-numerical weakly relational domains. Int J Softw Tools Technol Transfer 26, 479–494 (2024). https://doi.org/10.1007/s10009-024-00755-0
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10009-024-00755-0