Skip to main content
Log in

Full-program induction: verifying array programs sans loop invariants

  • General
  • Special Issue: TACAS 2020
  • Published:
International Journal on Software Tools for Technology Transfer Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21
Fig. 22
Fig. 23
Fig. 24
Fig. 25
Fig. 26
Fig. 27
Fig. 28

Similar content being viewed by others

Notes

  1. By indirect dependence, we mean the dependence via another value computed in a peeled or non-peeled statements in the program.

References

  1. Sheeran, M., Singh, S., Stålmarck, G.: Checking safety properties using induction and a SAT-solver. In: Proceedings of FMCAD, pp. 127–144 (2000)

  2. 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)

  3. Gurfinkel, A., Shoham, S., Vizel, Y.: Quantifiers on demand. In: Proceedings of ATVA, pp. 248–266 (2018)

  4. Fedyukovich, G., Prabhu, S., Madhukar, K., Gupta, A.: Quantified invariants via syntax-guided-synthesis. In: Proceedings of CAV, pp. 259–277 (2019)

  5. Rajkhowa, P., Lin, F.: Extending VIAP to handle array programs. In: Proceedings of VSTTE, pp. 38–49 (2018)

  6. Henzinger, T.A., Hottelier, T., Kovács, L., Rybalchenko, A.: Aligators for arrays (tool paper). In: Proceedings of LPAR, pp. 348–356 (2010)

  7. 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)

  8. Chakraborty, S., Gupta, A., Unadkat, D.: Verifying Array Manipulating Programs by Tiling. In: Proceedings of SAS, pp. 428–449 (2017)

  9. Monniaux, D., Gonnord, L.: Cell morphing: from array programs to array-free horn clauses. In: Proceedings of SAS, pp. 361–382 (2016)

  10. Alberti, F., Ghilardi, S., Sharygina, N.: Booster: an acceleration-based verification framework for array programs. In: Proceedings of ATVA, pp. 18–23 (2014)

  11. Clarke, E., Biere, A., Raimi, R., Zhu, Y.: Bounded model checking using satisfiability solving. FMSD 19(1), 7–34 (2001)

    MATH  Google Scholar 

  12. de Moura, L.M., Bjørner, N.: Z3: an efficient SMT solver. In: Proceedings of TACAS, pp. 337–340 (2008)

  13. Gopan, D., Reps, T.W., Sagiv, S.: A framework for numeric analysis of array operations. In: Proceedings of POPL, pp. 338–350 (2005)

  14. Halbwachs, N., Péron, M.: Discovering properties about arrays in simple programs. In: Proceedings of PLDI, pp. 339–348 (2008)

  15. Liu, J., Rival, X.: Abstraction of arrays based on non contiguous partitions. In: Proceedings of VMCAI, pp. 282–299 (2015)

  16. 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)

  17. Gulwani, S., McCloskey, B., Tiwari, A.: Lifting abstract interpreters to quantified logical domains. In: Proceedings of POPL, pp. 235–246 (2008)

  18. Srivastava, S., Gulwani, S.: Program verification using templates over predicate abstraction. ACM Sigplan Notices 44(6), 223–234 (2009)

    Article  Google Scholar 

  19. Beyer, D., Henzinger, T.A., Majumdar, R., Rybalchenko, A.: Invariant synthesis for combined theories. In: Proceedings of VMCAI, pp. 378–394 (2007)

  20. Jhala, R., McMillan, K.L.: Array abstractions from proofs. In: Proceedings of CAV, pp. 193–206 (2007)

  21. Flanagan, C., Leino, K.R.M.: Houdini, an annotation assistant for ESC/Java. In: Proceedings of FME, pp. 500–517 (2001)

  22. 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)

    Article  MathSciNet  MATH  Google Scholar 

  23. Lattner, C., Adve, V.: Llvm: a compilation framework for lifelong program analysis and transformation. In: Proceedings of CGO, pp. 75–86 (2004)

  24. Chakraborty, S., Gupta, A., Unadkat, D.: Verifying array manipulating programs with full-program induction. In: Proceedings of TACAS, pp. 22–39 (2020)

  25. Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Global value numbers and redundant computations. In: Proceedings of POPL, pp. 12–27 (1988)

  26. Knobe, K., Sarkar, V.: Array SSA form and its use in parallelization. In: Proceedings of POPL, pp. 107–120 (1998)

  27. Unadkat, D.P.: Techniques for Precise and Scalable Verification of Array Programs. Ph.D. Thesis, Indian Institute of Technology Bombay (2022)

  28. Towle, R.A.: Control and Data Dependence for Program Transformations. Ph.D. Dissertation, University of Illinois at Urbana-Champaign, USA (1976)

  29. Kuck, D.L.: Structure of Computers and Computations. Wiley, Hoboken (1978)

    Google Scholar 

  30. Ferrante, J., Ottenstein, K.J., Warren, J.D.: The program dependence graph and its use in optimization. TOPLAS 9(3), 319–349 (1987)

    Article  MATH  Google Scholar 

  31. Horwitz, S., Reps, T.: The use of program dependence graphs in software engineering. In: ICSE, pp. 392–411 (1992)

  32. Kennedy, K., Allen, J.R.: Optimizing Compilers for Modern Architectures: A Dependence-Based Approach (2001)

  33. 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)

  34. Colón, M.A., Sipma, H.B.: Synthesis of linear ranking functions. In: Proceedings of TACAS, pp. 67–81 (2001)

  35. Colón, M.A., Sipma, H.B.: Practical methods for proving program termination. In: Proceedings of CAV, pp. 442–454 (2002)

  36. Podelski, A., Rybalchenko, A.: A complete method for the synthesis of linear ranking functions. In: Proceedings of VMCAI, pp. 239–251 (2004)

  37. Dershowitz, N.: Orderings for term-rewriting systems. Theoret. Comput. Sci. 17(3), 279–301 (1982)

    Article  MathSciNet  MATH  Google Scholar 

  38. 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)

    Article  MathSciNet  MATH  Google Scholar 

  39. Chakraborty, S., Gupta, A., Unadkat, D.: Diffy: inductive reasoning of array programs using difference invariants. In: Proceedings of CAV, pp. 911–935 (2021)

  40. 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

  41. Georgiou, P., Gleiss, B., Kovács, L.: Trace logic for inductive loop reasoning. In: Proceedings of FMCAD, pp. 255–263 (2020)

  42. Bozga, M., Iosif, R., Konecný, F.: Fast acceleration of ultimately periodic relations. In: Proceedings of CAV, pp. 227–242 (2010)

  43. Jeannet, B., Schrammel, P., Sankaranarayanan, S.: Abstract acceleration of general linear loops. In: Proceedings of POPL, pp. 529–540 (2014)

  44. Alberti, F., Bruttomesso, R., Ghilardi, S., Ranise, S., Sharygina, N.: Lazy abstraction with interpolants for arrays. In: Proceedings of LPAR, pp. 46–61 (2012)

  45. Monniaux, D., Alberti, F.: A simple abstraction of arrays and maps by program translation. In: Proceedings of SAS, pp. 217–234 (2015)

  46. Lin, F.: A formalization of programs in first-order logic with a discrete linear order. Artif. Intell. 235, 1–25 (2016)

    Article  MathSciNet  MATH  Google Scholar 

  47. 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)

  48. Bjesse, P., Claessen, K.: Sat-based verification without state space traversal. In: FMCAD, pp. 409–426 (2000)

  49. Eén, N., Sörensson, N.: Temporal induction by incremental sat solving. Electron. Notes Theor. Comput. Sci. 89(4), 543–560 (2003)

    Article  MATH  Google Scholar 

  50. 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)

  51. Claessen, K., Johansson, M., Rosén, D., Smallbone, N.: Automating inductive proofs using theory exploration. In: CADE, pp. 392–406 (2013)

  52. Reynolds, A., Kuncak, V.: Induction for SMT solvers. In: VMCAI, pp. 80–98 (2015)

  53. Unno, H., Torii, S., Sakamoto, H.: Automating induction for solving horn clauses. In: CAV, pp. 571–591 (2017)

  54. De Moura, L., Rueß, H., Sorea, M.: Bounded model checking and induction: from refutation to verification. In: CAV, pp. 14–26 (2003)

  55. Hagen, G., Tinelli, C.: Scaling up the formal verification of Lustre programs with SMT-based techniques. In: FMCAD, pp. 1–9 (2008)

  56. 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)

  57. Kahsai, T., Tinelli, C.: Pkind: A parallel k-induction based model checker. In: PDMC, pp. 55–62 (2011)

  58. Donaldson, A.F., Haller, L., Kroening, D., Rümmer, P.: Software verification using k-induction. In: Proceedings of SAS, pp. 351–368 (2011)

  59. Beyer, D., Dangl, M., Wendler, P.: Boosting k-induction with continuously-refined invariants. In: Proceedings of CAV, pp. 622–640 (2015)

  60. 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)

  61. 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)

    Article  Google Scholar 

  62. Krishnan, H.G.V., Vizel, Y., Ganesh, V., Gurfinkel, A.: Interpolating strong induction. In: International Conference on Computer Aided Verification, pp. 367–385 (2019)

  63. 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)

    Article  Google Scholar 

  64. Yu, E., Biere, A., Heljanko, K.: Progress in certifying hardware model checking results. In: Proceedings of CAV, pp. 363–386 (2021)

  65. Seghir, M.N., Brain, M.: Simplifying the verification of quantified array assertions via code transformation. In: Proceedings of LOPSTR, pp. 194–212 (2012)

  66. 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)

  67. 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

  68. 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)

  69. Dillig, I., Dillig, T., Aiken, A.: Fluid updates: beyond strong vs. weak updates. In: Proceedings of ESOP, pp. 246–266 (2010)

  70. 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)

  71. Paige, R., Koenig, S.: Finite differencing of computable expressions. TOPLAS 4(3), 402–454 (1982)

    Article  MATH  Google Scholar 

  72. Horwitz, S., Prins, J., Reps, T.: Integrating noninterfering versions of programs. TOPLAS 11(3), 345–387 (1989)

    Article  Google Scholar 

  73. 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)

  74. Liu, Y.A., Stoller, S.D., Teitelbaum, T.: Static caching for incremental computation. TOPLAS 20(3), 546–585 (1998)

    Article  Google Scholar 

  75. Liu, Y.A., Stoller, S.D., Li, N., Rothamel, T.: Optimizing aggregate array computations in loops. TOPLAS 27(1), 91–125 (2005)

    Article  Google Scholar 

  76. Binkley, D.W.: Using semantic differencing to reduce the cost of regression testing. In: Proceedings of ICSM, pp. 41–50 (1992)

  77. Shankar, A., Bodik, R.: DITTO: automatic incrementalization of data structure invariant checks (in Java). ACM SIGPLAN Notices 42(6), 310–319 (2007)

  78. 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)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Divyesh Unadkat.

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.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10009-022-00676-w

Keywords

Navigation