Abstract
We describe a general framework c2i for generating an invariant inference procedure from an invariant checking procedure. Given a checker and a language of possible invariants, c2i generates an inference procedure that iteratively invokes two phases. The search phase uses randomized search to discover candidate invariants and the validate phase uses the checker to either prove or refute that the candidate is an actual invariant. To demonstrate the applicability of c2i , we use it to generate inference procedures that prove safety properties of numerical programs, prove non-termination of numerical programs, prove functional specifications of array manipulating programs, prove safety properties of string manipulating programs, and prove functional specifications of heap manipulating programs that use linked list data structures.
Similar content being viewed by others
Notes
The conference version, [52], lacks a comparison between pure random search and MCMC search. The treatment of numerical invariants also differs.
References
Alur R, Bodík R, Juniwal G, Martin MMK, Raghothaman M, Seshia SA, Singh R, Solar-Lezama A, Torlak E, Udupa A (2013) Syntax-guided synthesis. In: FMCAD
Amato G, Parton M, Scozzari F (2012) Discovering invariants via simple component analysis. J Symb Comput 47(12):1533–1560
Andrieu C, de Freitas N, Doucet A, Jordan MI (2003) An introduction to MCMC for machine learning. Mach Learn 50(1):5–43
Beyer D Competition on Software Verification (SV-COMP) benchmarks. https://svn.sosy-lab.org/software/sv-benchmarks/tags/svcomp13/loops/
Beyer D, Henzinger TA, Jhala R, Majumdar R (2007) The software model checker blast. STTT 9(5–6):505–525
Beyer D, Henzinger TA, Majumdar R, Rybalchenko A (2007) Invariant synthesis for combined theories. In: VMCAI
Bjørner N, McMillan KL, Rybalchenko A (2013) On solving universally quantified horn clauses. In: SAS
Burckhardt S, Kothari P, Musuvathi M, Nagarakatte S (2010) A randomized scheduler with probabilistic guarantees of finding bugs. In: ASPLOS
Burnim J, Jalbert N, Stergiou C, Sen K (2009) Looper: Lightweight detection of infinite loops at runtime. In: ASE
Calcagno C, Distefano D, O’Hearn PW, Yang H (2009) Compositional shape analysis by means of bi-abduction. In: POPL
Chib S, Greenberg E (1995) Understanding the Metropolis-Hastings algorithm. Am Stat 49(4):327–335
Clarisó R, Cortadella J (2004) The octahedron abstract domain. In: SAS
Cobleigh JM, Giannakopoulou D, Pasareanu CS (2003) Learning assumptions for compositional verification. In: TACAS
Colón M, Sankaranarayanan S, Sipma H (2003) Linear invariant generation using non-linear constraint solving. In: CAV
Costantini G, Ferrara P, Cortesi A (2011) Static analysis of string values. In: ICFEM
Cousot P, Cousot R (1977) Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: POPL
Dillig I, Dillig T, Aiken A (2010) Fluid updates: beyond strong vs. weak updates. In: ESOP
Dillig I, Dillig T, Li B, McMillan KL (2013) Inductive invariant generation via abductive inference. In: OOPSLA
Ernst MD, Perkins JH, Guo PJ, McCamant S, Pacheco C, Tschantz MS, Xiao C (2007) The Daikon system for dynamic detection of likely invariants. Sci Comput Prog 69(1–3):35–45
Flanagan C, Leino KRM (2001) Houdini, an annotation assistant for ESC/Java. In: FME
Garg P, Löding C, Madhusudan P, Neider D (2013) Learning universally quantified invariants of linear data structures. In: CAV
Garg P, Löding C, Madhusudan P, Neider D (2014) ICE: a robust learning framework for synthesizing invariants. In: CAV
Grebenshchikov S, Lopes NP, Popeea C, Rybalchenko A (2012) Synthesizing software verifiers from proof rules. In: PLDI
Gulavani BS, Henzinger TA, Kannan Y, Nori AV, Rajamani SK (2006) Synergy: a new algorithm for property checking. In: FSE
Gulwani S, Jojic N (2007) Program verification as probabilistic inference. In: POPL
Gulwani S, Necula GC (2003) Discovering affine equalities using random interpretation. In: POPL
Gulwani S, Srivastava S, Venkatesan R (2008) Program analysis as constraint solving. In: PLDI
Gulwani S, Srivastava S, Venkatesan R (2009) Constraint-based invariant inference over predicate abstraction. In: VMCAI
Gupta A, Henzinger TA, Majumdar R, Rybalchenko A, Xu RG (2008) Proving non-termination. In: POPL
Gupta A, Majumdar R, Rybalchenko A (2009) From tests to proofs. In: TACAS
Harder M, Mellen J, Ernst MD (2003) Improving test suites via operational abstraction. In: ICSE
Hoder K, Bjørner N (2012) Generalized property directed reachability. In: SAT
Itzhaky S, Banerjee A, Immerman N, Nanevski A, Sagiv M (2013) Effectively-propositional reasoning about reachability in linked data structures. In: CAV
Itzhaky S, Bjørner N, Reps TW, Sagiv M, Thakur AV (2014) Property-directed shape analysis. In: CAV
Ivancic F, Sankaranarayanan S NECLA static analysis benchmarks. http://www.nec-labs.com/research/system/systems_SAV-website/small_static_bench-v1.1.tar.gz
Jhala R, McMillan KL (2006) A practical and complete approach to predicate refinement. In: TACAS. Springer, Berlin
Jung Y, Kong S, Wang BY, Yi K (2010) Deriving invariants by algorithmic learning, decision procedures, and predicate abstraction. In: VMCAI. Springer, Berlin
Kannan Y, Sen K (2008) Universal symbolic execution and its application to likely data structure invariant generation. In: Proceedings of the ISSTA
Kong S, Jung Y, David C, Wang BY, Yi K (2010) Automatically inferring quantified loop invariants by algorithmic learning from simple templates. In: APLAS
McMillan K, Rybalchenko A (2013) Combinatorial approach to some sparse-matrix problems. Technical report, Microsoft Research
Miné A (2006) The octagon abstract domain. High-order Symb Comput 19(1):31–100
de Moura LM, Bjørner N (2008) Z3: an efficient SMT solver. In: TACAS
Naik M, Yang H, Castelnuovo G, Sagiv M (2012) Abstractions from tests. In: POPL
Neuwald AF, Liu JS, Lipman DJ, Lawrence CE (1997) Extracting protein alignment models from the sequence database. Nucleic Acids Res 25:1665–1677
Nguyen T, Kapur D, Weimer W, Forrest S (2012) Using dynamic analysis to discover polynomial and array invariants. In: ICSE
Nori AV, Sharma R (2013) Termination proofs from tests. In: ESEC/SIGSOFT FSE
Qiu X, Garg P, Stefanescu A, Madhusudan P (2013) Natural proofs for structure, data, and separation. In: PLDI
Reps TW, Sagiv S, Yorsh G (2004) Symbolic implementation of the best transformer. In: VMCAI
Sagiv S, Reps TW, Wilhelm R (2002) Parametric shape analysis via 3-valued logic. ACM Trans Program Lang Syst 24(3):217–298
Sankaranarayanan S, Chang RM, Jiang G, Ivancic F (2007) State space exploration using feedback constraint generation and monte-carlo sampling. In: ESEC/SIGSOFT FSE
Schkufza E, Sharma R, Aiken A (2013) Stochastic superoptimization. In: ASPLOS
Sharma R, Aiken A (2014) From invariant checking to invariant inference using randomized search. In: CAV
Sharma R, Gupta S, Hariharan B, Aiken A, Liang P, Nori AV (2013) A data driven approach for algebraic loop invariants. In: ESOP
Sharma R, Gupta S, Hariharan B, Aiken A, Nori AV (2013) Program verification as learning geometric concepts. In: SAS
Sharma R, Nori A, Aiken A (2012) Interpolants as classifiers. In: CAV
Sharma R, Nori AV, Aiken A (2014) Bias-variance tradeoffs in program analysis. In: POPL
Solar-Lezama A (2009) The sketching approach to program synthesis. In: APLAS
Srivastava S, Gulwani S (2009) Program verification using templates over predicate abstraction. In: PLDI
Srivastava S, Gulwani S, Foster JS (2009) VS3: SMT solvers for program verification. In: CAV
Zheng Y, Zhang X, Ganesh V (2013) Z3-str: a Z3-based string solver for web application analysis. In: ESEC/SIGSOFT FSE
Acknowledgments
This work was supported by National Science Foundation grant CCF-1160904, a Microsoft fellowship, and the Air Force Research Laboratory under agreement number FA8750-12-2-0020. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Sharma, R., Aiken, A. From invariant checking to invariant inference using randomized search. Form Methods Syst Des 48, 235–256 (2016). https://doi.org/10.1007/s10703-016-0248-5
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10703-016-0248-5