Synthesis of ranking functions using extremal counterexamples

We present a complete method for synthesizing lexicographic linear ranking functions (and thus proving termination), supported by inductive invariants, in the case where the transition relation of the program includes disjunctions and existentials (large block encoding of control flow). Previous work would either synthesize a ranking function at every basic block head, not just loop headers, which reduces the scope of programs that may be proved to be terminating, or expand large block transitions including tests into (exponentially many) elementary transitions, prior to computing the ranking function, resulting in a very large global constraint system. In contrast, our algorithm incrementally refines a global linear constraint system according to extremal counterexamples: only constraints that exclude spurious solutions are included. Experiments with our tool Termite show marked performance and scalability improvements compared to other systems.

[1]  Andreas Podelski,et al.  A Complete Method for the Synthesis of Linear Ranking Functions , 2004, VMCAI.

[2]  Laure Gonnord,et al.  Abstract acceleration in linear relation analysis , 2014, Sci. Comput. Program..

[3]  Henny B. Sipma,et al.  Linear Ranking with Reachability , 2005, CAV.

[4]  Xavier Leroy,et al.  Verified validation of lazy code motion , 2009, PLDI '09.

[5]  Patrice Quinton,et al.  Linear programming models for scheduling systems of affine recurrence equations—a comparative study , 1998, SPAA '98.

[6]  Alexander Schrijver,et al.  Theory of linear and integer programming , 1986, Wiley-Interscience series in discrete mathematics and optimization.

[7]  Corinne Ancourt,et al.  A Modular Static Analysis Approach to Affine Loop Invariants Detection , 2010, Electron. Notes Theor. Comput. Sci..

[8]  Paul Feautrier,et al.  Rank: A Tool to Check Program Termination and Computational Complexity , 2013, 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation Workshops.

[9]  Samir Genaim,et al.  Proving Termination One Loop at a Time , 2003, WLPE.

[10]  David Monniaux,et al.  PAGAI: A Path Sensitive Static Analyser , 2012, Electron. Notes Theor. Comput. Sci..

[11]  Adi Shamir,et al.  A Linear Time Algorithm for Finding Minimum Cutsets in Reducible Graphs , 1979, SIAM J. Comput..

[12]  Fernando Magno Quintão Pereira,et al.  Real-World Loops are Easy to Predict: A Case Study , 2014 .

[13]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[14]  Viktor Kuncak,et al.  A Verification Toolkit for Numerical Transition Systems - Tool Paper , 2012, FM.

[15]  Paul Feautrier,et al.  Accelerated Invariant Generation for C Programs with Aspic and C2fsm , 2010, Electron. Notes Theor. Comput. Sci..

[16]  Paul Feautrier,et al.  Multi-dimensional Rankings, Program Termination, and Complexity Bounds of Flowchart Programs , 2010, SAS.

[17]  Daniel Larraz Hurtado,et al.  Proving termination of imperative programs using Max-SMT , 2013, FMCAD 2013.

[18]  Aart Middeldorp,et al.  Increasing interpretations , 2009, Annals of Mathematics and Artificial Intelligence.

[19]  Caterina Urban,et al.  The Abstract Domain of Segmented Ranking Functions , 2013, SAS.

[20]  Raphael Ernani Rodrigues,et al.  Real-World Loops Are Easy to Predict , 2014, SBLP.

[21]  Daniel Kroening,et al.  Decision Procedures , 2016, Texts in Theoretical Computer Science. An EATCS Series.

[22]  Bernd Grtner,et al.  Approximation Algorithms and Semidefinite Programming , 2012 .

[23]  Nicolas Halbwachs,et al.  Combining Widening and Acceleration in Linear Relation Analysis , 2006, SAS.

[24]  Florian Zuleger,et al.  Ramsey vs. Lexicographic Termination Proving , 2013, TACAS.

[25]  Albert Oliveras,et al.  On SAT Modulo Theories and Optimization Problems , 2006, SAT.

[26]  Henny B. Sipma,et al.  The Polyranking Principle , 2005, ICALP.

[27]  Laure Gonnord,et al.  Using Bounded Model Checking to Focus Fixpoint Iterations , 2011, SAS.

[28]  Paul Feautrier,et al.  Some efficient solutions to the affine scheduling problem. I. One-dimensional time , 1992, International Journal of Parallel Programming.

[29]  Jürgen Giesl,et al.  Proving Termination of Programs Automatically with AProVE , 2014, IJCAR.

[30]  Sumit Gulwani,et al.  Bound Analysis of Imperative Programs with the Size-Change Abstraction , 2011, SAS.

[31]  Antoine Miné,et al.  An Abstract Domain to Infer Ordinal-Valued Ranking Functions , 2014, ESOP.

[32]  Daniel Larraz,et al.  Proving termination of imperative programs using Max-SMT , 2013, 2013 Formal Methods in Computer-Aided Design.

[33]  David Monniaux,et al.  Succinct Representations for Abstract Interpretation - Combined Analysis Algorithms and Experimental Evaluation , 2012, SAS.

[34]  Amir M. Ben-Amram,et al.  Ranking Functions for Linear-Constraint Loops , 2012, JACM.

[35]  A. M. Turing,et al.  Checking a large routine , 1989 .

[36]  Paul Feautrier,et al.  Some efficient solutions to the affine scheduling problem. Part II. Multidimensional time , 1992, International Journal of Parallel Programming.

[37]  Sumit Gulwani,et al.  The reachability-bound problem , 2010, PLDI '10.

[38]  Nicolas Halbwachs,et al.  Automatic discovery of linear restraints among variables of a program , 1978, POPL.

[39]  Andreas Podelski,et al.  Proving program termination , 2011, Commun. ACM.

[40]  Roberto Sebastiani,et al.  Optimization in SMT with LA(Q) Cost Functions , 2012 .