Lower-Bound Synthesis Using Loop Specialization and Max-SMT

This paper presents a new framework to synthesize lower-bounds on the worst-case cost for non-deterministic integer loops. As in previous approaches, the analysis searches for a metering function that under-approximates the number of loop iterations. The key novelty of our framework is the specialization of loops, which is achieved by restricting their enabled transitions to a subset of the inputs combined with the narrowing of their transition scopes. Specialization allows us to find metering functions for complex loops that could not be handled before or be more precise than previous approaches. Technically, it is performed (1) by using quasi-invariants while searching for the metering function, (2) by strengthening the loop guards, and (3) by narrowing the space of non-deterministic choices. We also propose a Max-SMT encoding that takes advantage of the use of soft constraints to force the solver look for more accurate solutions. We show our accuracy gains on benchmarks extracted from the 2020 Termination and Complexity Competition by comparing our results to those obtained by the "Image missing" system.

[1]  Henny B. Sipma,et al.  Linear Invariant Generation Using Non-linear Constraint Solving , 2003, CAV.

[2]  Elvira Albert,et al.  Cost Analysis of Java Bytecode , 2007, ESOP.

[3]  Zhong Shao,et al.  Automatic Static Cost Analysis for Parallel Programs , 2015, ESOP.

[4]  Yu Chen,et al.  A New Algorithm for Identifying Loops in Decompilation , 2007, SAS.

[5]  Ben Wegbreit,et al.  Mechanical program analysis , 1975, CACM.

[6]  Albert Oliveras,et al.  The Barcelogic SMT Solver , 2008, CAV.

[7]  Elvira Albert,et al.  Automatic Inference of Upper Bounds for Recurrence Relations in Cost Analysis , 2008, SAS.

[8]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

[9]  Nir Piterman,et al.  On Automation of CTL* Verification for Infinite-State Systems , 2015, CAV.

[10]  Antonio Flores-Montoya,et al.  Upper and Lower Amortized Cost Bounds of Programs Expressed as Cost Relations , 2016, FM.

[11]  Elvira Albert,et al.  On the Inference of Resource Usage Upper and Lower Bounds , 2013, TOCL.

[12]  Helmut Veith,et al.  Complexity and Resource Bound Analysis of Imperative Programs Using Difference Constraints , 2017, Journal of Automated Reasoning.

[13]  Daniel Larraz,et al.  Proving Non-termination Using Max-SMT , 2014, CAV.

[14]  Helmut Veith,et al.  A simple and scalable static analysis for bound analysis and amortized complexity analysis , 2014, Software Engineering.

[15]  Jürgen Giesl,et al.  Analyzing Runtime and Size Complexity of Integer Programs , 2016, ACM Trans. Program. Lang. Syst..

[16]  Jürgen Giesl,et al.  Lower Runtime Bounds for Integer Programs , 2016, IJCAR.