Sound reasoning about integral data types with a reusable SMT solver interface

We extend the Leon verification system for Scala with support for bit-vector reasoning, thus addressing one of its fundamental soundness limitation with respect to the treatment of integers primitives. We leverage significant progresses recently achieved in SMT solving by developing a solver-independent interface to easily configure the back-end of Leon. Our interface is based on the emerging SMT-LIB standard for SMT solvers, and we release a Scala library offering full support for the latest version of the standard. We use the standard BigInt Scala library to represent mathematical integers, whereas we correctly model Int as 32-bit integers. We ensure safety of arithmetic by checking for division by zero and correctly modeling division and modulo. We conclude with a performance comparison between the sound representation of Ints and the cleaner abstract representation using mathematical integers, and discuss the trade-off involved.

[1]  Sanjit A. Seshia,et al.  Beaver: Engineering an Efficient SMT Solver for Bit-Vector Arithmetic , 2009, CAV.

[2]  Lawrence Charles Paulson,et al.  Isabelle: A Generic Theorem Prover , 1994 .

[3]  Viktor Kuncak,et al.  An overview of the Leon verification system: verification by translation to recursive functions , 2013, SCALA@ECOOP.

[4]  Jean-Christophe Filliâtre,et al.  Why3 - Where Programs Meet Provers , 2013, ESOP.

[5]  Viktor Kuncak,et al.  Satisfiability Modulo Recursive Programs , 2011, SAS.

[6]  Viktor Kuncak,et al.  Counter-example complete verification for higher-order functions , 2015, Scala@PLDI.

[7]  Armin Biere,et al.  Boolector: An Efficient SMT Solver for Bit-Vectors and Arrays , 2009, TACAS.

[8]  Cesare Tinelli,et al.  DPLL( T): Fast Decision Procedures , 2004, CAV.

[9]  Christoph Walther,et al.  About VeriFun , 2003, CADE.

[10]  Henry S. Warren,et al.  Hacker's Delight , 2002 .

[11]  Eva Darulova,et al.  Programming with Numerical Uncertainties , 2014 .

[12]  Viktor Kuncak,et al.  Deductive Program Repair , 2015, CAV.

[13]  K. Rustan M. Leino,et al.  Dafny: An Automatic Program Verifier for Functional Correctness , 2010, LPAR.

[14]  Viktor Kuncak,et al.  Sound compilation of reals , 2013, POPL.

[15]  Ganesh Gopalakrishnan,et al.  Proceedings of the 23rd international conference on Computer aided verification , 2011 .

[16]  Viktor Kuncak,et al.  Decision procedures for algebraic data types with abstractions , 2010, POPL '10.

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

[18]  Raymond T. Boute,et al.  The Euclidean definition of the functions div and mod , 1992, TOPL.

[19]  Viktor Kuncak,et al.  Executing Specifications Using Synthesis and Constraint Solving , 2013, RV.

[20]  Viktor Kuncak,et al.  Synthesis modulo recursive functions , 2013, OOPSLA.

[21]  Panagiotis Manolios,et al.  Computer-Aided Reasoning: An Approach , 2011 .