Skip to main content
Erschienen in:

Open Access 2025 | OriginalPaper | Buchkapitel

AISE v2.0: Combining Loop Transformations

(Competition Contribution)

verfasst von : Yao Lin, Zhenbang Chen, Ji Wang

Erschienen in: Tools and Algorithms for the Construction and Analysis of Systems

Verlag: Springer Nature Switzerland

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
download
DOWNLOAD
print
DRUCKEN
insite
SUCHEN
loading …

Abstract

Dieses Kapitel untersucht die Synergie zwischen abstrakter Interpretation und symbolischer Ausführung und präsentiert einen neuartigen Verifikationsansatz für Programme mit Schleifen. Die wichtigste Innovation liegt in der Einführung einer Schleifenabstraktionsmethode, die Schleifen auf der Grundlage von Invarianten, die durch Wiederholungsanalyse erzeugt werden, übernähert. Diese Methode, zusammen mit anderen vorgeschlagenen Schleifentransformationstechniken, befasst sich mit dem Problem der Pfadexplosion, insbesondere in Programmen, die nichtlineare Arithmetik beinhalten. Das Kapitel bietet einen umfassenden Workflow von AISE v2.0, der veranschaulicht, wie verschiedene Schleifentransformationen (NL, A, ANs, E) sequenziell angewendet werden, um die Programmeigenschaften zu überprüfen. Es werden auch die Implementierungsdetails diskutiert, einschließlich der Verwendung von LLVM zur Vorverarbeitung und der Integration fortgeschrittener Solver wie Z3 und CVC5. Die Effektivität von AISE v2.0 wird durch seine Wettbewerbsfähigkeit in der Kategorie ReachSafety-Loops unter Beweis gestellt, was seine Fähigkeit unterstreicht, komplexe Schleifenstrukturen zu handhaben und die Verifikationsgenauigkeit zu verbessern. Das Kapitel schließt mit einer Diskussion über die Beschränkungen und potenziellen zukünftigen Verbesserungen des Ansatzes und bietet eine zukunftsgerichtete Perspektive auf die Weiterentwicklung der Verifikationstechniken von Programmen.
Hinweise
Z. Chen—Jury member.

1 Verification Approach

The key idea of AISE [19] is to synergize abstract interpretation [12] and symbolic execution [7, 15]. This synergy1 enables AISE to handle the program with loops effectively. However, when the program involves nonlinear arithmetic, AISE still suffers from the path explosion problem. To address this, we introduce a loop abstraction method, which over-approximates the loop in the program based on the invariant generated by the recurrence analysis [17, 18]. Additionally, we propose several other loop transformation methods to address different scenarios.
Figure 1 illustrates the workflow of AISE v2.0. Given a C program \(\mathcal {P}\), we first compile it into LLVM IR format and then preprocess it using LLVM’s passes. Next, AISE will be used to verify \(\mathcal {P}\). If AISE cannot finish within 60 seconds, the loops in \(\mathcal {P}\) will be transformed, generating four variants, i.e., NL, A, ANs, and E. AISE then sequentially verify NL, A, and ANs to determine whether the properties in \(\mathcal {P}\) hold. If an unknown or violation occurs during this process, we will revert to verifying \(\mathcal {P}\) or E until timeout. Below, we introduce each loop transformation and its role in verification.
Fig. 1.
The workflow of AISE v2.0 (\(\mathcal {P}\): the original program, NL: not entering the loop, A: loop abstraction, ANs: loop abstractions with one negated property in each, E: the program with inv instrumented, https://static-content.springer.com/image/chp%3A10.1007%2F978-3-031-90660-2_12/MediaObjects/652620_1_En_12_Figc_HTML.gif : True, https://static-content.springer.com/image/chp%3A10.1007%2F978-3-031-90660-2_12/MediaObjects/652620_1_En_12_Figd_HTML.gif :False, https://static-content.springer.com/image/chp%3A10.1007%2F978-3-031-90660-2_12/MediaObjects/652620_1_En_12_Fige_HTML.gif :Unknown)
Fig. 2.
Illustration of the loop transformation scheme
Not entering the loop (NL). Figure 2b illustrates a scenario where the loop in \(\mathcal {P}\) is not entered. Since symbolic execution often "gets stuck" in loops, prioritizing the analysis of this scenario may help reduce unnecessary overhead.
Loop abstraction (A). Inspired by the loop abstraction method [13], we use an invariant-based loop abstraction here to tackle the challenge brought by loops. Figure 2c shows the abstracted program A. Intuitively, A represents the set of all possible behaviors that could occur during any iteration of the loop in \(\mathcal {P}\). In Figure 2c, Line 2 represents the non-deterministic assignments to the variables modified in the Loop body (denoted as changed_vars), which describes all possible states of all variables in the Loop body at the beginning of the loop’s any iteration. Line 3 and Line 9 ensure the correct semantics of entering and exiting the loop, respectively. To improve the precision of abstraction, we use recurrence analysis [17, 18], which captures the numerical relationships of variables using real arithmetic, to generate the loop invariant (inv) and add it in Line 4. However, when the loop involves integer division, rounding issues may cause the inv to fail to satisfy the inductiveness. Therefore, additional checks2 (Line 7) are needed to verify the inductiveness of inv. If inv is violated, we will remove it from the transformed program and generate another invariant (which is included in each analysis step in Figure 1). Notably, recurrence analysis [17, 18] only plays the role of generating inv, and inv can also be produced by other loop invariant generation techniques. Due to Line 1, the symbolic execution of A also covers the case not entering the loop (i.e., NL).3 For nested loops, we abstract the innermost loop first and then progressively abstract each outer loop before verification. By verifying that p1 and p2 hold in A, we can conclude that these properties also hold in \(\mathcal {P}\). However, when verification fails, whether the property in \(\mathcal {P}\) is violated cannot be determined, as it may be a false positive due to the over-approximation of the loop abstraction in A.
Loop abstraction with one negated property (AN). AN is generated from A with only one property negated. If a violation occurs when verifying A, we will first confirm it by verifying ANs. AN1 (Figure 2d) and AN2 (Figure 2e) are the ANs generated from A (Figure 2c). If we ignore assertions, we can also say that ANs are the over-approximation of \(\mathcal {P}\). If the assertions in AN1 and AN2 are all reachable in \(\mathcal {P}\) and the verification result of either is true, we can conclude that one property in \(\mathcal {P}\) will be violated while the remaining properties will hold. For example, if the assertions in AN1 are all reachable in \(\mathcal {P}\) and we can prove that !p1 and p2 hold in AN1, then we can conclude that !p1 and p2 also hold in \(\mathcal {P}\), that is to say, the assert(p1) in \(\mathcal {P}\) will be violated. During preprocessing, we use LLVM’s passes to remove the unreachable basic blocks in \(\mathcal {P}\), ensuring that all assertions in ANs are reachable in \(\mathcal {P}\). If unreachable assertions still remain in ANs after transformation, this approach may result in false positives.
Loop with invariant (E). This variant in Figure 2f is the last step of confirming the violation, i.e., employing AISE to check the violation. However, different from \(\mathcal {P}\), we add the invariant inv in Line 3, which improves the efficiency of symbolic execution by leveraging the invariant to accelerate constraint solving process.

2 Implementation

The Loop Transformer of AISE v2.0 is based on LLVM [1]. AISE’s abstract interpretation module is CLAM [2, 14], configured as in [19]. AISE’s symbolic execution module is based on BUBAAK-LEE [3] (a fork of KLEE [10] used in the BUBAAK [11]) with some improvements. We improve the solver part by supporting floating-point programs and employing the theory of integer as an additional option (KLEE uses bit-vector theory by default) for solving path conditions. The symbolic execution module of AISE first uses Z3 [16] to check formulas’ satisfiability, and switches to CVC5 [8] if Z3 times out. The Invariant Generator is based on c_convertor [4], which summarizes loops by computing closed-form solutions for each variable in the loop body [17] or for the polynomial expressions extracted from the loop body [18]. Besides fixing some bugs, we have optimized the Invariant Generator by considering branch conditions and the initial assignments of variables.

3 Result and Discussion

Table 1.
The contribution of each method
 
total
AISE+P
AISE+NL
AISE+A
AISE+ANs
AISE+E
total correct
603
528
0
66
8
1
correct true
428
362
0
66
0
0
correct false
175
166
0
0
8
1
total correct-unconfirmed
73
49
0
23
0
1
total incorrect
0
0
0
0
0
0
score
1031
890
0
132
8
1
This year, by combining (1) the synergy between abstract interpretation and symbolic execution and (2) a recurrence analysis based loop transformation scheme, AISE v2.0 scored 1031 points and won first place in the ReachSafety-Loops category, demonstrating its capability in verifying the programs with loops. Table 1 presents the contribution of each method. As shown by the table, the synergy in AISE is effective for most programs, and when it fails within 60 seconds, loop transformations can further enhance AISE’s ability. Due to lack of invariant in correctness witnesses, we still have 73 unconfirmed results. AISE v2.0 could not produce any results in the AISE+NL phase due to the program’s small size, and it may perform better on larger programs. When handling programs with arrays or loops containing multiple branches, both CLAM and Invariant Generator may not work, causing AISE v2.0 to still suffer from the path explosion problem. Additionally, the SMT solvers encounter difficulties when solving nonlinear constraints, further limiting the verification capabilities of AISE v2.0. Since we only consider whether the program is correct when it terminates, AISE’s verify method currently cannot handle programs with non-terminating loops.

4 Software Project, Tool setup and Contributors

AISE v2.0 can run on the Ubuntu 22.04/24.04 LTS and is licensed under GPL 3.0. This year, AISE v2.0 participates in the ReachSafety-Loops category of SV-COMP 2025 [9]. The execution command of AISE v2.0 is as follow:
Where <data_model> is the program’s data model (32-bit or 64-bit) and <program> is the input program. The contributors of AISE v2.0 are all from the National University of Defense Technology. A complete list of contributors is available at [5].
Data-Availability Statement The artifact for AISE v2.0 has been archived and is available on Zenodo [6].

Acknowledgement

This research was supported by National Key R&D Program of China (No. 2022YFB4501903) and the NSFC Programs (No. 62172429 and 62032024).
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://​creativecommons.​org/​licenses/​by/​4.​0/​), 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 license and indicate if changes were made.
The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license 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.
Fußnoten
1
Due to space limitations, further technical details can be found in [19].
 
2
inv_assert here functions like assert, but with a different name for distinction.
 
3
Because of development time limitations, the scenarios described by NL and A overlap, which will be optimized in the future.
 
Literatur
8.
Zurück zum Zitat Barbosa, H., Barrett, C., Brain, M., Kremer, G., Lachnitt, H., Mann, M., Mohamed, A., Mohamed, M., Niemetz, A., Nötzli, A., et al.: cvc5: A versatile and industrial-strength smt solver. In: International Conference on Tools and Algorithms for the Construction and Analysis of Systems. pp. 415–442. Springer (2022) Barbosa, H., Barrett, C., Brain, M., Kremer, G., Lachnitt, H., Mann, M., Mohamed, A., Mohamed, M., Niemetz, A., Nötzli, A., et al.: cvc5: A versatile and industrial-strength smt solver. In: International Conference on Tools and Algorithms for the Construction and Analysis of Systems. pp. 415–442. Springer (2022)
9.
Zurück zum Zitat Beyer, D., Strejček, J.: Improvements in software verification and witness validation: SV-COMP 2025. In: Proc. TACAS. LNCS, Springer (2025) Beyer, D., Strejček, J.: Improvements in software verification and witness validation: SV-COMP 2025. In: Proc. TACAS. LNCS, Springer (2025)
10.
Zurück zum Zitat Cadar, C., Dunbar, D., Engler, D.R.: KLEE: Unassisted and automatic generation of high-coverage tests for complex systems programs. In: Draves, R., van Renesse, R. (eds.) 8th USENIX Symposium on Operating Systems Design and Implementation, OSDI 2008, December 8-10, 2008, San Diego, California, USA, Proceedings. pp. 209–224. USENIX Association Cadar, C., Dunbar, D., Engler, D.R.: KLEE: Unassisted and automatic generation of high-coverage tests for complex systems programs. In: Draves, R., van Renesse, R. (eds.) 8th USENIX Symposium on Operating Systems Design and Implementation, OSDI 2008, December 8-10, 2008, San Diego, California, USA, Proceedings. pp. 209–224. USENIX Association
13.
Zurück zum Zitat Darke, P., Chimdyalwar, B., Venkatesh, R., Shrotri, U., Metta, R.: Over-approximating loops to prove properties using bounded model checking. In: 2015 Design, Automation & Test in Europe Conference & Exhibition (DATE). pp. 1407–1412 (2015). https://doi.org/10.7873/DATE.2015.0245 Darke, P., Chimdyalwar, B., Venkatesh, R., Shrotri, U., Metta, R.: Over-approximating loops to prove properties using bounded model checking. In: 2015 Design, Automation & Test in Europe Conference & Exhibition (DATE). pp. 1407–1412 (2015). https://​doi.​org/​10.​7873/​DATE.​2015.​0245
16.
Zurück zum Zitat de Moura, L.M., Bjørner, N.S.: Z3: An efficient smt solver. In: International Conference on Tools and Algorithms for Construction and Analysis of Systems (2008) de Moura, L.M., Bjørner, N.S.: Z3: An efficient smt solver. In: International Conference on Tools and Algorithms for Construction and Analysis of Systems (2008)
18.
Zurück zum Zitat Wang, C., Lin, F.: On polynomial expressions with c-finite recurrences in loops with nested nondeterministic branches. In: Computer Aided Verification: 36th International Conference, CAV 2024, Montreal, QC, Canada, July 24-27, 2024, Proceedings, Part I. p. 409-430. Springer-Verlag, Berlin, Heidelberg (2024). https://doi.org/10.1007/978-3-031-65627-9_20 Wang, C., Lin, F.: On polynomial expressions with c-finite recurrences in loops with nested nondeterministic branches. In: Computer Aided Verification: 36th International Conference, CAV 2024, Montreal, QC, Canada, July 24-27, 2024, Proceedings, Part I. p. 409-430. Springer-Verlag, Berlin, Heidelberg (2024). https://​doi.​org/​10.​1007/​978-3-031-65627-9_​20
Metadaten
Titel
AISE v2.0: Combining Loop Transformations
verfasst von
Yao Lin
Zhenbang Chen
Ji Wang
Copyright-Jahr
2025
DOI
https://doi.org/10.1007/978-3-031-90660-2_12