Abstract
Arrays are commonly used in a variety of software to store and process data in loops. Automatically proving safety properties of such programs that manipulate arrays is challenging. We present a novel verification technique, called full-program induction, for proving (a sub-class of) quantified as well as quantifier-free properties of programs manipulating arrays of parametric size N. Instead of inducting over individual loops, our technique inducts over the entire program (possibly containing multiple loops) directly via the program parameter N. The technique performs non-trivial transformations of the given program and pre-conditions during the inductive step. The transformations assist in effectively reducing the assertion checking problem by transforming a program with multiple loops to a program which has fewer and simpler loops or is loop free. Significantly, full-program induction does not require generation or use of loop-specific invariants. To assess the efficacy of our technique, we have developed a prototype tool called Vajra. We demonstrate the performance of Vajra vis-a-vis several state-of-the-art tools on a large set of array manipulating benchmarks from the international software verification competition (SV-COMP) and on several programs inspired by algebraic functions that perform polynomial computations.
Similar content being viewed by others
Notes
By indirect dependence, we mean the dependence via another value computed in a peeled or non-peeled statements in the program.
References
Sheeran, M., Singh, S., Stålmarck, G.: Checking safety properties using induction and a SAT-solver. In: Proceedings of FMCAD, pp. 127–144 (2000)
Komuravelli, A., Bjorner, N., Gurfinkel, A., McMillan, K.L.: Compositional verification of procedural programs using Horn clauses over integers and arrays. In: Proceedings of FMCAD, pp. 89–96 (2015)
Gurfinkel, A., Shoham, S., Vizel, Y.: Quantifiers on demand. In: Proceedings of ATVA, pp. 248–266 (2018)
Fedyukovich, G., Prabhu, S., Madhukar, K., Gupta, A.: Quantified invariants via syntax-guided-synthesis. In: Proceedings of CAV, pp. 259–277 (2019)
Rajkhowa, P., Lin, F.: Extending VIAP to handle array programs. In: Proceedings of VSTTE, pp. 38–49 (2018)
Henzinger, T.A., Hottelier, T., Kovács, L., Rybalchenko, A.: Aligators for arrays (tool paper). In: Proceedings of LPAR, pp. 348–356 (2010)
Afzal, M., Chakraborty, S., Chauhan, A., Chimdyalwar, B., Darke, P., Gupta, A., Kumar, S., Babu M, C., Unadkat, D., Venkatesh, R.: Veriabs: verification by abstraction and test generation (competition contribution). In: Proceedings of TACAS, pp. 383–387 (2020)
Chakraborty, S., Gupta, A., Unadkat, D.: Verifying Array Manipulating Programs by Tiling. In: Proceedings of SAS, pp. 428–449 (2017)
Monniaux, D., Gonnord, L.: Cell morphing: from array programs to array-free horn clauses. In: Proceedings of SAS, pp. 361–382 (2016)
Alberti, F., Ghilardi, S., Sharygina, N.: Booster: an acceleration-based verification framework for array programs. In: Proceedings of ATVA, pp. 18–23 (2014)
Clarke, E., Biere, A., Raimi, R., Zhu, Y.: Bounded model checking using satisfiability solving. FMSD 19(1), 7–34 (2001)
de Moura, L.M., Bjørner, N.: Z3: an efficient SMT solver. In: Proceedings of TACAS, pp. 337–340 (2008)
Gopan, D., Reps, T.W., Sagiv, S.: A framework for numeric analysis of array operations. In: Proceedings of POPL, pp. 338–350 (2005)
Halbwachs, N., Péron, M.: Discovering properties about arrays in simple programs. In: Proceedings of PLDI, pp. 339–348 (2008)
Liu, J., Rival, X.: Abstraction of arrays based on non contiguous partitions. In: Proceedings of VMCAI, pp. 282–299 (2015)
Cousot, P., Cousot, R., Logozzo, F.: A parametric segmentation functor for fully automatic and scalable array content analysis. In: Proceedings of POPL, pp. 105–118 (2011)
Gulwani, S., McCloskey, B., Tiwari, A.: Lifting abstract interpreters to quantified logical domains. In: Proceedings of POPL, pp. 235–246 (2008)
Srivastava, S., Gulwani, S.: Program verification using templates over predicate abstraction. ACM Sigplan Notices 44(6), 223–234 (2009)
Beyer, D., Henzinger, T.A., Majumdar, R., Rybalchenko, A.: Invariant synthesis for combined theories. In: Proceedings of VMCAI, pp. 378–394 (2007)
Jhala, R., McMillan, K.L.: Array abstractions from proofs. In: Proceedings of CAV, pp. 193–206 (2007)
Flanagan, C., Leino, K.R.M.: Houdini, an annotation assistant for ESC/Java. In: Proceedings of FME, pp. 500–517 (2001)
Ernst, M.D., Perkins, J.H., Guo, P.J., McCamant, S., Pacheco, C., Tschantz, M.S., Xiao, C.: The Daikon system for dynamic detection of likely invariants. Sci. Comput. Program. 69(1–3), 35–45 (2007)
Lattner, C., Adve, V.: Llvm: a compilation framework for lifelong program analysis and transformation. In: Proceedings of CGO, pp. 75–86 (2004)
Chakraborty, S., Gupta, A., Unadkat, D.: Verifying array manipulating programs with full-program induction. In: Proceedings of TACAS, pp. 22–39 (2020)
Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Global value numbers and redundant computations. In: Proceedings of POPL, pp. 12–27 (1988)
Knobe, K., Sarkar, V.: Array SSA form and its use in parallelization. In: Proceedings of POPL, pp. 107–120 (1998)
Unadkat, D.P.: Techniques for Precise and Scalable Verification of Array Programs. Ph.D. Thesis, Indian Institute of Technology Bombay (2022)
Towle, R.A.: Control and Data Dependence for Program Transformations. Ph.D. Dissertation, University of Illinois at Urbana-Champaign, USA (1976)
Kuck, D.L.: Structure of Computers and Computations. Wiley, Hoboken (1978)
Ferrante, J., Ottenstein, K.J., Warren, J.D.: The program dependence graph and its use in optimization. TOPLAS 9(3), 319–349 (1987)
Horwitz, S., Reps, T.: The use of program dependence graphs in software engineering. In: ICSE, pp. 392–411 (1992)
Kennedy, K., Allen, J.R.: Optimizing Compilers for Modern Architectures: A Dependence-Based Approach (2001)
Dams, D., Gerth, R., Grumberg, O.: A heuristic for the automatic generation of ranking functions. In: Workshop on Advances in Verification, pp. 1–8 (2000)
Colón, M.A., Sipma, H.B.: Synthesis of linear ranking functions. In: Proceedings of TACAS, pp. 67–81 (2001)
Colón, M.A., Sipma, H.B.: Practical methods for proving program termination. In: Proceedings of CAV, pp. 442–454 (2002)
Podelski, A., Rybalchenko, A.: A complete method for the synthesis of linear ranking functions. In: Proceedings of VMCAI, pp. 239–251 (2004)
Dershowitz, N.: Orderings for term-rewriting systems. Theoret. Comput. Sci. 17(3), 279–301 (1982)
Lescanne, P.: Some properties of decomposition ordering, a simplification ordering to prove termination of rewriting systems. RAIRO. Informatique théorique 16(4), 331–347 (1982)
Chakraborty, S., Gupta, A., Unadkat, D.: Diffy: inductive reasoning of array programs using difference invariants. In: Proceedings of CAV, pp. 911–935 (2021)
Chakraborty, S., Gupta, A., Unadkat, D.: Verifying array manipulating programs with full-program induction—artifacts TACAS 2020. Figshare (2020). https://doi.org/10.6084/m9.figshare.11875428.v1
Georgiou, P., Gleiss, B., Kovács, L.: Trace logic for inductive loop reasoning. In: Proceedings of FMCAD, pp. 255–263 (2020)
Bozga, M., Iosif, R., Konecný, F.: Fast acceleration of ultimately periodic relations. In: Proceedings of CAV, pp. 227–242 (2010)
Jeannet, B., Schrammel, P., Sankaranarayanan, S.: Abstract acceleration of general linear loops. In: Proceedings of POPL, pp. 529–540 (2014)
Alberti, F., Bruttomesso, R., Ghilardi, S., Ranise, S., Sharygina, N.: Lazy abstraction with interpolants for arrays. In: Proceedings of LPAR, pp. 46–61 (2012)
Monniaux, D., Alberti, F.: A simple abstraction of arrays and maps by program translation. In: Proceedings of SAS, pp. 217–234 (2015)
Lin, F.: A formalization of programs in first-order logic with a discrete linear order. Artif. Intell. 235, 1–25 (2016)
Déharbe, D., Moreira, A.M.: Using induction and BDDs to model check invariants. In: Advances in Hardware Design and Verification, pp. 203–213 (1997)
Bjesse, P., Claessen, K.: Sat-based verification without state space traversal. In: FMCAD, pp. 409–426 (2000)
Eén, N., Sörensson, N.: Temporal induction by incremental sat solving. Electron. Notes Theor. Comput. Sci. 89(4), 543–560 (2003)
Große, D., Le, H.M., Drechsler, R.: Induction-based formal verification of SystemC TLM designs. In: Workshop on Microprocessor Test and Verification, pp. 101–106 (2009)
Claessen, K., Johansson, M., Rosén, D., Smallbone, N.: Automating inductive proofs using theory exploration. In: CADE, pp. 392–406 (2013)
Reynolds, A., Kuncak, V.: Induction for SMT solvers. In: VMCAI, pp. 80–98 (2015)
Unno, H., Torii, S., Sakamoto, H.: Automating induction for solving horn clauses. In: CAV, pp. 571–591 (2017)
De Moura, L., Rueß, H., Sorea, M.: Bounded model checking and induction: from refutation to verification. In: CAV, pp. 14–26 (2003)
Hagen, G., Tinelli, C.: Scaling up the formal verification of Lustre programs with SMT-based techniques. In: FMCAD, pp. 1–9 (2008)
Donaldson, A.F., Kroening, D., Rümmer, P.: Automatic analysis of scratch-pad memory code for heterogeneous multicore processors. In: Proceedings of TACAS, pp. 280–295 (2010)
Kahsai, T., Tinelli, C.: Pkind: A parallel k-induction based model checker. In: PDMC, pp. 55–62 (2011)
Donaldson, A.F., Haller, L., Kroening, D., Rümmer, P.: Software verification using k-induction. In: Proceedings of SAS, pp. 351–368 (2011)
Beyer, D., Dangl, M., Wendler, P.: Boosting k-induction with continuously-refined invariants. In: Proceedings of CAV, pp. 622–640 (2015)
Brain, M., Joshi, S., Kroening, D., Schrammel, P.: Safety verification and refutation by k-invariants and k-induction. In: Proceedings of SAS, pp. 145–161 (2015)
Gadelha, M.Y., Ismail, H.I., Cordeiro, L.C.: Handling loops in bounded model checking of c programs via k-induction. STTT 19(1), 97–114 (2017)
Krishnan, H.G.V., Vizel, Y., Ganesh, V., Gurfinkel, A.: Interpolating strong induction. In: International Conference on Computer Aided Verification, pp. 367–385 (2019)
Alhawi, O.M., Rocha, H., Gadelha, M.R., Cordeiro, L.C., Batista, E.: Verification and refutation of c programs based on k-induction and invariant inference. STTT 23(2), 115–135 (2021)
Yu, E., Biere, A., Heljanko, K.: Progress in certifying hardware model checking results. In: Proceedings of CAV, pp. 363–386 (2021)
Seghir, M.N., Brain, M.: Simplifying the verification of quantified array assertions via code transformation. In: Proceedings of LOPSTR, pp. 194–212 (2012)
Ish-Shalom, O., Itzhaky, S., Rinetzky, N., Shoham, S.: Putting the squeeze on array programs: Loop verification via inductive rank reduction. In: Proceedings of VMCAI, pp. 112–135 (2020)
Chakraborty, S., Gupta, A., Unadkat, D.: Diffy: inductive reasoning of array programs using difference invariants. Figshare (2021). https://doi.org/10.6084/m9.figshare.14509467
Mann, M., Irfan, A., Griggio, A., Padon, O., Barrett, C.: Counterexample-guided prophecy for model checking modulo the theory of arrays. In: Proceedings of TACAS (2021)
Dillig, I., Dillig, T., Aiken, A.: Fluid updates: beyond strong vs. weak updates. In: Proceedings of ESOP, pp. 246–266 (2010)
Jacobs, B., Smans, J., Philippaerts, P., Vogels, F., Penninckx, W., Piessens, F.: VeriFast: A powerful, sound, predictable, fast verifier for C and Java. In: Proceedings of NFM, pp. 41–55 (2011)
Paige, R., Koenig, S.: Finite differencing of computable expressions. TOPLAS 4(3), 402–454 (1982)
Horwitz, S., Prins, J., Reps, T.: Integrating noninterfering versions of programs. TOPLAS 11(3), 345–387 (1989)
Lahiri, S.K., Vaswani, K., Hoare, C.A.: Differential static analysis: opportunities, applications, and challenges. In: Workshop on Future of Software Engineering Research, pp. 201–204 (2010)
Liu, Y.A., Stoller, S.D., Teitelbaum, T.: Static caching for incremental computation. TOPLAS 20(3), 546–585 (1998)
Liu, Y.A., Stoller, S.D., Li, N., Rothamel, T.: Optimizing aggregate array computations in loops. TOPLAS 27(1), 91–125 (2005)
Binkley, D.W.: Using semantic differencing to reduce the cost of regression testing. In: Proceedings of ICSM, pp. 41–50 (1992)
Shankar, A., Bodik, R.: DITTO: automatic incrementalization of data structure invariant checks (in Java). ACM SIGPLAN Notices 42(6), 310–319 (2007)
Lahiri, S.K., Hawblitzel, C., Kawaguchi, M., Rebêlo, H.: Symdiff: a language-agnostic semantic diff tool for imperative programs. In: Proceedings of CAV, pp. 712–717 (2012)
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Springer Nature or its licensor holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Chakraborty, S., Gupta, A. & Unadkat, D. Full-program induction: verifying array programs sans loop invariants. Int J Softw Tools Technol Transfer 24, 843–888 (2022). https://doi.org/10.1007/s10009-022-00676-w
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10009-022-00676-w