Counterexample- and Simulation-Guided Floating-Point Loop Invariant Synthesis

We present an automated procedure for synthesizing sound inductive invariants for floating-point numerical loops. Our procedure generates invariants of the form of a convex polynomial inequality that tightly bounds the values of loop variables. Such invariants are a prerequisite for reasoning about the safety and roundoff errors of floating-point programs. Unlike previous approaches that rely on policy iteration, linear algebra or semi-definite programming, we propose a heuristic procedure based on simulation and counterexample-guided refinement. We observe that this combination is remarkably effective and general and can handle both linear and nonlinear loop bodies, nondeterministic values as well as conditional statements. Our evaluation shows that our approach can efficiently synthesize loop invariants for existing benchmarks from literature, but that it is also able to find invariants for nonlinear loops that today’s tools cannot handle.

[1]  Alexander Aiken,et al.  A Data Driven Approach for Algebraic Loop Invariants , 2013, ESOP.

[2]  Suresh Jagannathan,et al.  A data-driven CHC solver , 2018, PLDI.

[3]  Henny B. Sipma,et al.  Non-linear loop invariant generation using Gröbner bases , 2004, POPL.

[4]  Isil Dillig,et al.  Inductive invariant generation via abductive inference , 2013, OOPSLA.

[5]  Antoine Miné,et al.  An Algorithm Inspired by Constraint Solvers to Infer Inductive Invariants in Numeric Programs , 2016, ESOP.

[6]  Eric Goubault,et al.  Coupling policy iteration with semi-definite relaxation to compute accurate numerical invariants in static analysis , 2010, Log. Methods Comput. Sci..

[7]  Heiko Becker,et al.  Daisy - Framework for Analysis and Optimization of Numerical Programs (Tool Paper) , 2018, TACAS.

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

[9]  Rastislav Bodík,et al.  Sampling invariants from frequency distributions , 2017, 2017 Formal Methods in Computer Aided Design (FMCAD).

[10]  Ganesh Gopalakrishnan,et al.  Rigorous Estimation of Floating-Point Round-off Errors with Symbolic Taylor Expansions , 2015, FM.

[11]  Andrew Ruef,et al.  Counterexample-guided approach to finding numerical invariants , 2017, ESEC/SIGSOFT FSE.

[12]  Virgile Prevosto,et al.  Synthesizing Invariants by Solving Solvable Loops , 2016, ATVA.

[13]  Arnaud Venet,et al.  Abstract Interpretation with Higher-Dimensional Ellipsoids and Conic Extrapolation , 2015, CAV.

[14]  Eric Goubault,et al.  A Fast Method to Compute Disjunctive Quadratic Invariants of Numerical Programs , 2017, ACM Trans. Embed. Comput. Syst..

[15]  Christof Löding,et al.  ICE: A Robust Framework for Learning Invariants , 2014, CAV.

[16]  Enric Rodríguez-Carbonell,et al.  Generation of Basic Semi-algebraic Invariants Using Convex Polyhedra , 2005, SAS.

[17]  Antoine Miné,et al.  The octagon abstract domain , 2001, Proceedings Eighth Working Conference on Reverse Engineering.

[18]  A. Magnani,et al.  Tractable fitting with convex polynomials via sum-of-squares , 2005, Proceedings of the 44th IEEE Conference on Decision and Control.

[19]  Ashutosh Gupta,et al.  InvGen: An Efficient Invariant Generator , 2009, CAV.

[20]  Patrick Cousot,et al.  Static determination of dynamic properties of programs , 1976 .

[21]  Martin Brain,et al.  Building Better Bit-Blasting for Floating-Point Problems , 2019, TACAS.

[22]  Rastislav Bodík,et al.  Accelerating Syntax-Guided Invariant Synthesis , 2018, TACAS.

[23]  Markus Püschel,et al.  A practical construction for decomposing numerical abstract domains , 2017, Proc. ACM Program. Lang..

[24]  Bertrand Jeannet,et al.  Apron: A Library of Numerical Abstract Domains for Static Analysis , 2009, CAV.

[25]  Roberto Bagnara,et al.  The Parma Polyhedra Library: Toward a complete set of numerical abstractions for the analysis and verification of hardware and software systems , 2006, Sci. Comput. Program..

[26]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[27]  Helmut Seidl,et al.  Numerical invariants through convex relaxation and max-strategy iteration , 2014, Formal Methods Syst. Des..

[28]  Alexander Aiken,et al.  Verification as Learning Geometric Concepts , 2013, SAS.

[29]  Leonardo Mendonça de Moura,et al.  Solving non-linear arithmetic , 2012, ACCA.

[30]  Zachary Kincaid,et al.  Non-linear reasoning for invariant synthesis , 2017, Proc. ACM Program. Lang..

[31]  Alexander Aiken,et al.  From invariant checking to invariant inference using randomized search , 2014, Formal Methods Syst. Des..

[32]  Laura Kovács,et al.  Reasoning Algebraically About P-Solvable Loops , 2008, TACAS.

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

[34]  Richard M. Murray,et al.  Feedback Systems An Introduction for Scientists and Engineers , 2007 .

[35]  James Demmel,et al.  IEEE Standard for Floating-Point Arithmetic , 2008 .

[36]  Viktor Kuncak,et al.  Towards a Compiler for Reals , 2014, ACM Trans. Program. Lang. Syst..

[37]  Pierre Roux,et al.  Integrating Policy Iterations in Abstract Interpreters , 2013, ATVA.

[38]  Jérôme Feret,et al.  Static Analysis of Digital Filters , 2004, ESOP.

[39]  Aaron R. Bradley,et al.  SAT-Based Model Checking without Unrolling , 2011, VMCAI.