skip to main content
10.1145/2908080.2908099acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Data-driven precondition inference with learned features

Published:02 June 2016Publication History

ABSTRACT

We extend the data-driven approach to inferring preconditions for code from a set of test executions. Prior work requires a fixed set of features, atomic predicates that define the search space of possible preconditions, to be specified in advance. In contrast, we introduce a technique for on-demand feature learning, which automatically expands the search space of candidate preconditions in a targeted manner as necessary. We have instantiated our approach in a tool called PIE. In addition to making precondition inference more expressive, we show how to apply our feature-learning technique to the setting of data-driven loop invariant inference. We evaluate our approach by using PIE to infer rich preconditions for black-box OCaml library functions and using our loop-invariant inference algorithm as part of an automatic program verifier for C++ programs.

References

  1. A. Albarghouthi, S. Gulwani, and Z. Kincaid. Recursive program synthesis. In Computer Aided Verification - 25th International Conference, pages 934–950, 2013.Google ScholarGoogle Scholar
  2. C. Calcagno, D. Distefano, P. W. O’Hearn, and H. Yang. Compositional shape analysis by means of bi-abduction. Journal of the ACM, 58(6), 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. Chandra, S. J. Fink, and M. Sridharan. Snugglebug: A powerful approach to weakest preconditions. In Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 363–374, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Cheung, A. Solar-Lezama, and S. Madden. Using program synthesis for social recommendations. In 21st ACM International Conference on Information and Knowledge Management, pages 1732–1736, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. E. M. Clarke, O. Grumberg, S. Jha, Y. Lu, and H. Veith. Counterexample-guided abstraction refinement. In Computer Aided Verification - 12th International Conference, pages 154–169, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Colón, S. Sankaranarayanan, and H. Sipma. Linear invariant generation using non-linear constraint solving. In Computer Aided Verification - 15th International Conference, pages 420–432, 2003.Google ScholarGoogle Scholar
  7. C. Cortes and V. Vapnik. Support-vector networks. Machine Learning, 20(3):273–297, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. P. Cousot and R. Cousot. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Fourth ACM Symposium on Principles of Programming Languages, pages 238–252, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. P. Cousot and N. Halbwachs. Automatic discovery of linear restraints among variables of a program. In Fifth Annual ACM Symposium on Principles of Programming Languages, pages 84–96, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. P. Cousot, R. Cousot, M. Fähndrich, and F. Logozzo. Automatic inference of necessary preconditions. In Verification, Model Checking, and Abstract Interpretation - 14th International Conference, pages 128–148, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. E. W. Dijkstra. A Discipline of Programming. Prentice-Hall, Englewood Cliffs, New Jersey, 1976.Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. I. Dillig and T. Dillig. Explain: A tool for performing abductive inference. In Computer Aided Verification - 25th International Conference, pages 684–689. Springer, 2013.Google ScholarGoogle Scholar
  13. I. Dillig, T. Dillig, B. Li, and K. L. McMillan. Inductive invariant generation via abductive inference. In Proceedings of the 2013 ACM SIGPLAN International Conference on Object-Oriented Programming Systems Languages & Applications, pages 443–456, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. D. Ernst, J. H. Perkins, P. J. Guo, S. McCamant, C. Pacheco, M. S. Tschantz, and C. Xiao. The daikon system for dynamic detection of likely invariants. Sci. Comput. Program., 69(1-3):35–45, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Fähndrich and F. Logozzo. Static contract checking with abstract interpretation. In Formal Verification of Object-Oriented Software - International Conference, pages 10–30, 2010.Google ScholarGoogle Scholar
  16. J. K. Feser, S. Chaudhuri, and I. Dillig. Synthesizing data structure transformations from input-output examples. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 229–239, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. G. Filé and F. Ranzato. Improving abstract interpretations by systematic lifting to the powerset. In Logic Programming, Proceedings of the 1994 International Symposium, pages 655–669, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. P. Galeotti, C. A. Furia, E. May, G. Fraser, and A. Zeller. Dynamate: Dynamically inferring loop invariants for automatic full functional verification. In Hardware and Software: Verification and Testing - 10th International Haifa Verification Conference, pages 48–53, 2014.Google ScholarGoogle Scholar
  19. P. Garg, C. Löding, P. Madhusudan, and D. Neider. ICE: A robust framework for learning invariants. In Computer Aided Verification - 26th International Conference, pages 69–87, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. Garg, D. Neider, P. Madhusudan, and D. Roth. Learning invariants using decision trees and implication counterexamples. In Proceedings of the 43rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 499–512, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. T. Gehr, D. Dimitrov, and M. T. Vechev. Learning commutativity specifications. In Computer Aided Verification - 27th International Conference, pages 307–323, 2015.Google ScholarGoogle Scholar
  22. K. Ghorbal, F. Ivancic, G. Balakrishnan, N. Maeda, and A. Gupta. Donut domains: Efficient non-convex domains for abstract interpretation. In Verification, Model Checking, and Abstract Interpretation - 13th International Conference, pages 235–250, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. R. Giacobazzi. Abductive analysis of modular logic programs. Journal of Logic and Computation, 8(4):457–483, 1998.Google ScholarGoogle ScholarCross RefCross Ref
  24. D. Gopan and T. W. Reps. Guided static analysis. In Static Analysis, 14th International Symposium, pages 349– 365, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. S. Gulwani and N. Jojic. Program verification as probabilistic inference. In Proceedings of the 34th ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, pages 277–289, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. S. Gulwani, S. Srivastava, and R. Venkatesan. Program analysis as constraint solving. In Proceedings of the ACM SIGPLAN 2008 Conference on Programming Language Design and Implementation, pages 281–292, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. A. Gupta, R. Majumdar, and A. Rybalchenko. From tests to proofs. In Tools and Algorithms for the Construction and Analysis of Systems, 15th International Conference, pages 262–276, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. D. Jackson. Software Abstractions: Logic, Language, and Analysis. MIT Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Y. Jung, S. Kong, B. Wang, and K. Yi. Deriving invariants by algorithmic learning, decision procedures, and predicate abstraction. In Verification, Model Checking, and Abstract Interpretation, 11th International Conference, pages 180–196, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. M. Kawaguchi, S. K. Lahiri, and H. Rebelo. Conditional equivalence. Technical Report MSR-TR-2010-119, Microsoft Research, October 2010.Google ScholarGoogle Scholar
  31. M. J. Kearns and U. V. Vazirani. An Introduction to Computational Learning Theory. The MIT Press, Cambridge, Massachusetts, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. S. Kong, Y. Jung, C. David, B. Wang, and K. Yi. Automatically inferring quantified loop invariants by algorithmic learning from simple templates. In Programming Languages and Systems - 8th Asian Symposium, pages 328–343, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. S. Krishna, C. Puhrsch, and T. Wies. Learning invariants using decision trees. CoRR, abs/1501.04725, 2015.Google ScholarGoogle Scholar
  34. T. Lev-Ami, M. Sagiv, T. Reps, and S. Gulwani. Backward analysis for inferring quantified preconditions. Technical Report TR-2007-12-01, Tel Aviv University, 2007.Google ScholarGoogle Scholar
  35. T. Liang, A. Reynolds, C. Tinelli, C. Barrett, and M. Deters. A DPLL(T) theory solver for a theory of strings and regular expressions. In Computer Aided Verification - 26th International Conference, pages 646–662, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. L. Mauborgne and X. Rival. Trace partitioning in abstract interpretation based static analyzers. In European Symposium on Programming, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Y. Moy. Sufficient preconditions for modular assertion checking. In Verification, Model Checking, and Abstract Interpretation, 9th International Conference, pages 188–202, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. J. W. Nimmer and M. D. Ernst. Automatic generation of program specifications. In Proceedings of the International Symposium on Software Testing and Analysis, pages 229–239, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. J. W. Nimmer and M. D. Ernst. Invariant inference for static checking:. In Proceedings of the 10th ACM SIGSOFT Symposium on Foundations of Software Engineering, pages 11–20, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. J. R. Quinlan. Induction of decision trees. Machine Learning, 1(1):81–106, 1986. Google ScholarGoogle ScholarCross RefCross Ref
  41. S. Sankaranarayanan, F. Ivancic, I. Shlyakhter, and A. Gupta. Static analysis in disjunctive numerical domains. In Static Analysis Symposium, pages 3–17, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. S. Sankaranarayanan, S. Chaudhuri, F. Ivancic, and A. Gupta. Dynamic inference of likely data preconditions over predicates by tree learning. In ACM/SIGSOFT International Symposium on Software Testing and Analysis, pages 295–306, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. T. W. Schiller, K. Donohue, F. Coward, and M. D. Ernst. Case studies and tools for contract specifications. In Proceedings of the 36th International Conference on Software Engineering, pages 596–607, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. M. N. Seghir and D. Kroening. Counterexample-guided precondition inference. In 22nd European Symposium on Programming, pages 451–471, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. M. N. Seghir and P. Schrammel. Necessary and sufficient preconditions via eager abstraction. In Programming Languages and Systems - 12th Asian Symposium, pages 236–254, 2014.Google ScholarGoogle Scholar
  46. R. Sharma and A. Aiken. From invariant checking to invariant inference using randomized search. In Computer Aided Verification - 26th International Conference, CAV 2014, Held as Part of the Vienna Summer of Logic, VSL 2014, Vienna, Austria, July 18-22, 2014. Proceedings, pages 88–105, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. R. Sharma, A. V. Nori, and A. Aiken. Interpolants as classifiers. In Computer Aided Verification - 24th International Conference, pages 71–87, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. R. Sharma, S. Gupta, B. Hariharan, A. Aiken, and A. V. Nori. Verification as learning geometric concepts. In Static Analysis - 20th International Symposium, pages 388–411, 2013.Google ScholarGoogle Scholar
  49. R. Sharma, E. Schkufza, B. R. Churchill, and A. Aiken. Conditionally correct superoptimization. In Proceedings of the 2013 ACM SIGPLAN International Conference on Object-Oriented Programming Systems Languages & Applications, pages 147–162, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. A. Solar-Lezama, L. Tancau, R. Bodik, S. Seshia, and V. Saraswat. Combinatorial sketching for finite programs. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems, pages 404–415, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. S. Srivastava, S. Gulwani, and J. S. Foster. From program verification to program synthesis. In 37th ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, pages 313–326, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Y. Zheng, X. Zhang, and V. Ganesh. Z3-str: a z3-based string solver for web application analysis. In Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, pages 114–124, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Data-driven precondition inference with learned features

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in
                • Published in

                  cover image ACM Conferences
                  PLDI '16: Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation
                  June 2016
                  726 pages
                  ISBN:9781450342612
                  DOI:10.1145/2908080
                  • General Chair:
                  • Chandra Krintz,
                  • Program Chair:
                  • Emery Berger
                  • cover image ACM SIGPLAN Notices
                    ACM SIGPLAN Notices  Volume 51, Issue 6
                    PLDI '16
                    June 2016
                    726 pages
                    ISSN:0362-1340
                    EISSN:1558-1160
                    DOI:10.1145/2980983
                    • Editor:
                    • Andy Gill
                    Issue’s Table of Contents

                  Copyright © 2016 ACM

                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 2 June 2016

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • research-article

                  Acceptance Rates

                  Overall Acceptance Rate406of2,067submissions,20%

                  Upcoming Conference

                  PLDI '24

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader