Automated Termination and Complexity Analysis of Imperative Programs
Final Report Abstract
Our goal was to analyze termination and complexity of imperative programs, which is crucial for software verification. We used the following methodology: In the front-end, a finite symbolic execution graph is generated from the program, which represents all possible program executions. Then, a program in a simple language, e.g., a term rewrite system (TRS) or an integer transition system (ITS) is synthesized from the graph. Finally, termination or complexity of this simple program is analyzed in the back-end of our approach. We obtained the following contributions: (A) Termination Analysis: Based on our previous work on termination of Java, we developed an approach for automatic termination analysis of C programs, which can analyze programs with low-level memory operations and features like dynamic data structures, recursion, or bitvector integers. While termination is undecidable in general, we also developed results on classes of programs where questions of termination or complexity are decidable. So for sub-programs from such a class, one can apply complete techniques. To improve the power of the back-end, we obtained several new results on termination of TRSs. We developed novel frameworks for relative termination and for almost-sure termination of probabilistic TRSs, and results on using termination analysis of TRSs to minimize description logic proofs. (B) Complexity Analysis (Upper Bounds): We adapted techniques for proving termination to infer upper bounds on the runtime of programs. This concerns both the front-ends for Java and C, and the back-ends for TRSs and ITSs. In particular, we developed a modular approach for complexity analysis of ITSs which alternates between computing runtime and size bounds (on the values of program variables) for program parts. To increase its power, we also integrated complete techniques (as in (A)) for sub-programs where runtime or size bounds are computable. Moreover, we adapted the approach in order to compute upper bounds on the expected runtimes of probabilistic ITSs. (C) Complexity Analysis (Lower Bounds): To detect bugs, we also developed techniques to compute lower runtime bounds for back-end programs. For ITSs, these techniques rely on accelerating loops into non-deterministic straight-line code. We developed new calculi to combine loop acceleration with the search for counterexamples in order to use loop acceleration not just for lower bounds, but also to prove non-termination of ITSs or (un)satisfiability of Constraint Horn Clauses (which are used to analyze program safety). Since loop acceleration often generates exponential expressions, to check reachability in accelerated programs, we also extended SMT solvers to exponential integer arithmetic. (D) Implementation: We implemented all our contributions in the tools AProVE (for the overall approach), KoAT and LoAT (for upper and lower bounds of ITSs), and SwInE (for SMT modulo exponential arithmetic). Their power was evaluated in extensive experiments and annual competitions.
Link to the final report
https://doi.org/10.34657/17569
Publications
-
Termination of Polynomial Loops. Lecture Notes in Computer Science, 89-112.
Frohn, Florian; Hark, Marcel & Giesl, Jürgen
-
Inferring Expected Runtimes of Probabilistic Integer Programs Using Expected Sizes. Lecture Notes in Computer Science, 250-269.
Meyer, Fabian; Hark, Marcel & Giesl, Jürgen
-
A calculus for modular loop acceleration and non-termination proofs. International Journal on Software Tools for Technology Transfer, 24(5), 691-715.
Frohn, Florian & Fuhs, Carsten
-
AProVE: Non-Termination Witnesses for C Programs. Lecture Notes in Computer Science, 403-407.
Hensel, Jera; Mensendiek, Constantin & Giesl, Jürgen
-
Automatic Complexity Analysis of Integer Programs via Triangular Weakly Non-Linear Loops. Lecture Notes in Computer Science, 734-754.
Lommen, Nils; Meyer, Fabian & Giesl, Jürgen
-
Improving Automatic Complexity Analysis of Integer Programs. Lecture Notes in Computer Science, 193-228.
Giesl, Jürgen; Lommen, Nils; Hark, Marcel & Meyer, Fabian
-
Proving Non-Termination and Lower Runtime Bounds with LoAT (System Description). Lecture Notes in Computer Science, 712-722.
Frohn, Florian & Giesl, Jürgen
-
ADCL: Acceleration Driven Clause Learning for Constrained Horn Clauses. Lecture Notes in Computer Science, 259-285.
Frohn, Florian & Giesl, Jürgen
-
Proving Almost-Sure Innermost Termination of Probabilistic Term Rewriting Using Dependency Pairs. Lecture Notes in Computer Science, 344-364.
Kassing, Jan-Christoph & Giesl, Jürgen
-
Proving Non-Termination by Acceleration Driven Clause Learning (Short Paper). Lecture Notes in Computer Science, 220-233.
Frohn, Florian & Giesl, Jürgen
-
Proving Termination of C Programs with Lists. Lecture Notes in Computer Science, 266-285.
Hensel, Jera & Giesl, Jürgen
-
Targeting Completeness: Using Closed Forms for Size Bounds of Integer Programs. Lecture Notes in Computer Science, 3-22.
Lommen, Nils & Giesl, Jürgen
-
A Complete Dependency Pair Framework for Almost-Sure Innermost Termination of Probabilistic Term Rewriting. Lecture Notes in Computer Science, 62-80.
Kassing, Jan-Christoph; Dollase, Stefan & Giesl, Jürgen
-
A Dependency Pair Framework for Relative Termination of Term Rewriting. Lecture Notes in Computer Science, 360-380.
Kassing, Jan-Christoph; Vartanyan, Grigory & Giesl, Jürgen
-
Control-Flow Refinement for Complexity Analysis of Probabilistic Programs in KoAT (Short Paper). Lecture Notes in Computer Science, 233-243.
Lommen, Nils; Meyer, Éléanore & Giesl, Jürgen
-
F. Baader and J. Giesl. On the complexity of the small term reachability problem for terminating term rewriting systems. In Proc. FSCD ’24, LIPIcs, 2024
F. Baader & J. Giesl
-
From Innermost to Full Almost-Sure Termination of Probabilistic Term Rewriting. Lecture Notes in Computer Science, 206-228.
Kassing, Jan-Christoph; Frohn, Florian & Giesl, Jürgen
-
Integrating Loop Acceleration Into Bounded Model Checking. Lecture Notes in Computer Science, 73-91.
Frohn, Florian & Giesl, Jürgen
-
Satisfiability Modulo Exponential Integer Arithmetic. Lecture Notes in Computer Science, 344-365.
Frohn, Florian & Giesl, Jürgen
