skip to main content
10.1145/2908080.2908125acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article
Public Access

Automatically learning shape specifications

Published:02 June 2016Publication History

ABSTRACT

This paper presents a novel automated procedure for discovering expressive shape specifications for sophisticated functional data structures. Our approach extracts potential shape predicates based on the definition of constructors of arbitrary user-defined inductive data types, and combines these predicates within an expressive first-order specification language using a lightweight data-driven learning procedure. Notably, this technique requires no programmer annotations, and is equipped with a type-based decision procedure to verify the correctness of discovered specifications. Experimental results indicate that our implementation is both efficient and effective, capable of automatically synthesizing sophisticated shape specifications over a range of complex data types, going well beyond the scope of existing solutions.

References

  1. A. Albarghouthi and K. L. McMillan. Beautiful Interpolants. In CAV, 2013. doi: 10.1007/978-3-642-39799-8_ 22.Google ScholarGoogle Scholar
  2. R. Alur, R. Bod´ık, E. Dallal, D. Fisman, P. Garg, G. Juniwal, H. Kress-Gazit, P. Madhusudan, M. M. K. Martin, M. Raghothaman, S. Saha, S. A. Seshia, R. Singh, A. Solar-Lezama, E. Torlak, and A. Udupa. Syntax-Guided Synthesis. In Dependable Software Systems Engineering, pages 1– 25, 2015. doi: 10.3233/978-1-61499-495-4-1.Google ScholarGoogle Scholar
  3. J. Berdine, B. Cook, and S. Ishtiaq. SLAYER: Memory Safety for Systems-level Code. In CAV, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. doi: 10.1007/ 978-3-642-22110-1_15.Google ScholarGoogle Scholar
  5. M. Bofill, M. Palah´ı, J. Suy, and M. Villaret. Solving constraint satisfaction problems with SAT modulo theories. Constraints, 17(3):273–303, 2012. doi: 10.1007/ s10601-012-9123-1. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. C. Calcagno, D. Distefano, P. O’Hearn, and H. Yang. Compositional Shape Analysis by Means of Bi-abduction. In POPL, 2009. doi: 10.1145/1480881.1480917. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. B.-Y. E. Chang and X. Rival. Relational Inductive Shape Analysis. In POPL, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. doi: 10.1145/1328438.Google ScholarGoogle Scholar
  9. 1328469.Google ScholarGoogle Scholar
  10. A. Chlipala. Mostly-automated Verification of Low-level Programs in Computational Separation Logic. In PLDI, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. doi: 10.1145/1993498.1993526.Google ScholarGoogle Scholar
  12. K. Claessen and J. Hughes. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In ICFP, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. doi: 10.1145/351240.351266.Google ScholarGoogle Scholar
  14. E. Cohen, M. Dahlweid, M. Hillebrand, D. Leinenbach, M. Moskal, T. Santen, W. Schulte, and S. Tobies. VCC: A Practical System for Verifying Concurrent C. In TPHOLs, 2009. doi: 10.1007/978-3-642-03359-9_2. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. L. De Moura and N. Bjørner. Z3: An Efficient SMT Solver. In TACAS, 2008. doi: 10.1007/978-3-540-78800-3_ 24. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. I. Dillig, T. Dillig, A. Aiken, and M. Sagiv. Precise and Compact Modular Procedure Summaries for Heap Manipulating Programs. In PLDI, 2011. doi: 10.1145/1993498. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 1993565.Google ScholarGoogle Scholar
  18. 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. doi: 10.1016/j.scico. 2007.01.015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. Flanagan and K. R. M. Leino. Houdini, an Annotation Assistant for ESC/Java. In FME, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. doi: 10.1007/ 3-540-45251-6_29.Google ScholarGoogle Scholar
  21. P. Garg, C. Löding, P. Madhusudan, and D. Neider. Learning Universally Quantified Invariants of Linear Data Structures. In CAV, 2013. doi: 10.1007/978-3-642-39799-8_ 57.Google ScholarGoogle Scholar
  22. P. Garg, C. Löding, P. Madhusudan, and D. Neider. ICE: A Robust Learning Framework for learning Invariants. In CAV, 2014. doi: 10.1007/978-3-319-08867-9_5. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. P. Garg, P. Madhusudan, D. Neider, and D. Roth. Learning Invariants Using Decision Trees and Implication Counterexamples. In POPL, 2016. doi: 10.1145/2837614.2837664. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. T. Gehr, D. Dimitrov, and M. Vechev. Learning Commutativity Specifications. In CAV, 2015.Google ScholarGoogle Scholar
  25. doi: 10.1007/ 978-3-319-21690-4_18.Google ScholarGoogle Scholar
  26. P. Godefroid and A. Taly. Automated Synthesis of Symbolic Instruction Encodings from I/O Samples. In PLDI, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. doi: 10.1145/2254064.2254116.Google ScholarGoogle Scholar
  28. S. Graf and H. Sa¨ıdi. Construction of Abstract State Graphs with PVS. In CAV, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. doi: 10.1007/ 3-540-63166-6_10.Google ScholarGoogle Scholar
  30. B. Guo, N. Vachharajani, and D. I. August. Shape Analysis with Inductive Recursion Synthesis. In PLDI, 2007. doi: 10. 1145/1250734.1250764. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. A. Gupta, R. Majumdar, and A. Rybalchenko. From Tests to Proofs. In TACAS, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. doi: 10.1007/ 978-3-642-00768-2_24.Google ScholarGoogle Scholar
  33. T. A. Henzinger, R. Jhala, R. Majumdar, and K. L. McMillan. Abstractions from Proofs. In POPL, 2004. doi: 10.1145/ 964001.964021. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. C. Ihlemann, S. Jacobs, and V. Sofronie-Stokkermans. On Local Reasoning in Verification. In TACAS, 2008. doi: 10. 1007/978-3-540-78800-3_19. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. S. Itzhaky, A. Banerjee, N. Immerman, A. Nanevski, and M. Sagiv. Effectively-Propositional Reasoning About Reachability in Linked Data Structures. In CAV, 2013. doi: 10. 1007/978-3-642-39799-8_53.Google ScholarGoogle Scholar
  36. S. Itzhaky, A. Banerjee, N. Immerman, O. Lahav, A. Nanevski, and M. Sagiv. Modular Reasoning About Heap Paths via Effectively Propositional Formulas. In POPL, 2014. doi: 10.1145/2535838.2535854. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. S. Itzhaky, N. Bjørner, T. W. Reps, M. Sagiv, and A. V. Thakur. Property-Directed Shape Analysis. In CAV, 2014. doi: 10. 1007/978-3-319-08867-9_3. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. B. Jeannet, A. Loginov, T. Reps, and M. Sagiv. A Relational Approach to Interprocedural Shape Analysis. ACM Trans. Program. Lang. Syst., 32:5:1–5:52, 2010. doi: 10.1145/ 1667048.1667050. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. G. Kaki and S. Jagannathan. A Relational Framework for Higher-order Shape Analysis. In ICFP, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. doi: 10. 1145/2628136.2628159.Google ScholarGoogle Scholar
  41. A. Karbyshev, N. Bjorner, S. Itzhaky, N. Rinetzky, and S. Shoham. Property-Directed Inference of Universal Invariants or Proving Their Absence. In CAV, 2015. doi: 10. 1007/978-3-319-21690-4_40.Google ScholarGoogle Scholar
  42. M. Kawaguchi, P. Rondon, and R. Jhala. Type-based Data Structure Verification. In PLDI, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. doi: 10.1145/ 1542476.1542510.Google ScholarGoogle Scholar
  44. S. Lahiri and S. Qadeer. Back to the Future: Revisiting Precise Program Verification Using SMT Solvers. In POPL, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. doi: 10.1145/1328438.1328461.Google ScholarGoogle Scholar
  46. Q. L. Le, C. Gherghina, S. Qin, and W.-N. Chin. Shape Analysis via Second-Order Bi-Abduction. In CAV, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. doi: 10.1007/978-3-319-08867-9_4.Google ScholarGoogle Scholar
  48. K. R. M. Leino. Dafny: An Automatic Program Verifier for Functional Correctness. In LPAR, 2010. doi: 10.1007/ 978-3-642-17511-4_20. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. T. Lev-Ami and S. Sagiv. TVLA: A System for Implementing Static Analyses. In SAS, 2000. doi: 10.1007/ 978-3-540-45099-3_15. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. T. Lev-Ami, N. Immerman, T. Reps, M. Sagiv, S. Srivastava, and G. Yorsh. Simulating Reachability Using First-order Logic with Applications to Verification of Linked Data Structures. In CADE, 2005. doi: 10.1007/11532231_8. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. A. Loginov, T. Reps, and M. Sagiv. Abstraction Refinement via Inductive Learning. In CAV, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. doi: 10.1007/ 11513988_50.Google ScholarGoogle Scholar
  53. P. Madhusudan, X. Qiu, and A. Stefanescu. Recursive Proofs for Inductive Tree Data-structures. In POPL, 2012. doi: 10. 1145/2103656.2103673. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. R. Manevich, E. Yahav, G. Ramalingam, and M. Sagiv. Predicate Abstraction and Canonical Abstraction for Singly-linked Lists. In VMCAI, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. doi: 10.1007/ 978-3-540-30579-8_13.Google ScholarGoogle Scholar
  56. E. J. McCluskey. Minimization of Boolean Functions. Bell system technical Journal, 35(6):1417–1444, 1956.Google ScholarGoogle Scholar
  57. H. H. Nguyen, C. David, S. Qin, and W.-N. Chin. Automated Verification of Shape and Size Properties via Separation Logic. In VMCAI, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. doi: 10.1007/ 978-3-540-69738-1_18.Google ScholarGoogle Scholar
  59. P. C. Nguyen and D. V. Horn. Relatively Complete Counterexamples for Higher-Order Programs. In PLDI, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. doi: 10.1145/2737924.2737971.Google ScholarGoogle Scholar
  61. T. Nguyen, D. Kapur, W. Weimer, and S. Forrest. Using Dynamic Analysis to Generate Disjunctive Invariants. In ICSE, 2014. doi: 10.1145/2568225.2568275. Google ScholarGoogle ScholarDigital LibraryDigital Library
  62. E. Pek, X. Qiu, and P. Madhusudan. Natural Proofs for Data Structure Manipulation in C Using Separation Logic. In PLDI, 2014. doi: 10.1145/2594291.2594325. Google ScholarGoogle ScholarDigital LibraryDigital Library
  63. P. Philippaerts, J. T. Mühlberg, W. Penninckx, J. Smans, B. Jacobs, and F. Piessens. Software Verification with VeriFast: Industrial Case Studies. Sci. Comput. Program., 82:77–97, 2014. doi: 10.1016/j.scico.2013.01.006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  64. R. Piskac, L. Moura, and N. Bjørner. Deciding Effectively Propositional Logic Using DPLL and Substitution Sets. J. Autom. Reason., 44:401–424, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  65. doi: 10.1007/ s10817-009-9161-6.Google ScholarGoogle Scholar
  66. R. Piskac, T. Wies, and D. Zufferey. GRASShopper - Complete Heap Verification with Mixed Specifications. In TACAS, 2014. doi: 10.1007/978-3-642-54862-8_9.Google ScholarGoogle Scholar
  67. R. Piskac, T. Wies, and D. Zufferey. Automating Separation Logic with Trees and Data. In CAV, 2014. doi: 10.1007/ 978-3-319-08867-9_47. Google ScholarGoogle ScholarDigital LibraryDigital Library
  68. X. Qiu, P. Garg, A. S¸tefănescu, and P. Madhusudan. Natural Proofs for Structure, Data, and Separation. In PLDI, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  69. doi: 10.1145/2462156.2462169.Google ScholarGoogle Scholar
  70. T. Reps, M. Sagiv, and G. Yorsh. Symbolic Implementation of the Best Transformer. In VMCAI, 2004. doi: 10.1007/ 978-3-540-24622-0_21.Google ScholarGoogle ScholarCross RefCross Ref
  71. P. M. Rondon, M. Kawaguci, and R. Jhala. Liquid Types. In PLDI, 2008. doi: 10.1145/1375581.1375602. Google ScholarGoogle ScholarDigital LibraryDigital Library
  72. R. Sharma and A. Aiken. From Invariant Checking to Invariant Inference Using Randomized Search. In CAV, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  73. doi: 10.1007/978-3-319-08867-9_6.Google ScholarGoogle Scholar
  74. R. Sharma, A. V. Nori, and A. Aiken. Interpolants As Classifiers. In CAV, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  75. doi: 10.1007/ 978-3-642-31424-7_11.Google ScholarGoogle Scholar
  76. R. Sharma, S. Gupta, B. Hariharan, A. Aiken, P. Liang, and A. V. Nori. A Data Driven Approach for Algebraic Loop Invariants. In ESOP, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  77. doi: 10.1007/ 978-3-642-37036-6_31.Google ScholarGoogle Scholar
  78. R. Sharma, S. Gupta, B. Hariharan, A. Aiken, and A. Nori. Verification as Learning Geometric Concepts. In SAS, 2013.Google ScholarGoogle ScholarCross RefCross Ref
  79. doi: 10.1007/978-3-642-38856-9_21.Google ScholarGoogle Scholar
  80. A. Solar-Lezama. Program Synthesis by Sketching. PhD thesis, University of California at Berkeley, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  81. S. Srivastava and S. Gulwani. Program Verification Using Templates over Predicate Abstraction. In PLDI, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  82. doi: 10.1145/1542476.1542501.Google ScholarGoogle Scholar
  83. M. Stojadinovi´c and F. Mari´c. meSAT: multiple encodings of CSP to SAT. Constraints, 19(4):380–403, 2014. doi: 10. 1007/s10601-014-9165-7. Google ScholarGoogle ScholarDigital LibraryDigital Library
  84. P. Suter, M. Dotta, and V. Kuncak. Decision Procedures for Algebraic Data Types with Abstractions. In POPL, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  85. doi: 10.1145/1706299.1706325.Google ScholarGoogle Scholar
  86. P. Suter, A. S. Köksal, and V. Kuncak. Satisfiability Modulo Recursive Programs. In SAS, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  87. doi: 10.1007/ 978-3-642-23702-7_23.Google ScholarGoogle Scholar
  88. A. Thakur, A. Lal, J. Lim, and T. Reps. PostHat and All That: Automating Abstract Interpretation. Electron. Notes Theor. Comput. Sci., 311:15–32, 2015. doi: 10.1016/j.entcs. 2015.02.003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  89. N. Vazou, E. L. Seidel, R. Jhala, D. Vytiniotis, and S. Peyton-Jones. Refinement Types for Haskell. In ICFP, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  90. doi: 10.1145/2628136.2628161.Google ScholarGoogle Scholar
  91. N. Vazou, A. Bakst, and R. Jhala. Bounded Refinement Types. In ICFP, 2015. doi: 10.1145/2784731.2784745. Google ScholarGoogle ScholarDigital LibraryDigital Library
  92. H. Xi and F. Pfenning. Dependent Types in Practical Programming. In POPL, 1999. doi: 10.1145/292540.292560. Google ScholarGoogle ScholarDigital LibraryDigital Library
  93. H. Yang, O. Lee, J. Berdine, C. Calcagno, B. Cook, D. Distefano, and P. O’Hearn. Scalable Shape Analysis for Systems Code. In CAV, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  94. doi: 10.1007/ 978-3-540-70545-1_36.Google ScholarGoogle Scholar
  95. G. Yorsh, T. Reps, and M. Sagiv. Symbolically Computing Most-precise Abstract Operations for Shape Analysis. In TACAS, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  96. doi: 10.1007/978-3-540-24730-2_ 39.Google ScholarGoogle Scholar
  97. G. Yorsh, T. Ball, and M. Sagiv. Testing, Abstraction, Theorem Proving: Better Together! In ISSTA, 2006. doi: 10. 1145/1146238.1146255. Google ScholarGoogle ScholarDigital LibraryDigital Library
  98. G. Yorsh, A. Rabinovich, M. Sagiv, A. Meyer, and A. Bouajjani. A Logic of Reachable Patterns in Linked Data-structures. In FOSSACS, 2006. doi: 10.1007/11690634_7. Google ScholarGoogle ScholarDigital LibraryDigital Library
  99. K. Zee, V. Kuncak, and M. Rinard. Full Functional Verification of Linked Data Structures. In PLDI, 2008. doi: 10. 1145/1375581.1375624. Google ScholarGoogle ScholarDigital LibraryDigital Library
  100. H. Zhu, A. Nori, and S. Jagannathan. Learning Refinement Types. In ICFP, 2015. doi: 10.1145/2784731. Google ScholarGoogle ScholarDigital LibraryDigital Library
  101. 2784766.Google ScholarGoogle Scholar
  102. H. Zhu, A. Nori, and S. Jagannathan. Dependent Array Type Inference from Tests. In VMCAI, 2015. doi: 10.1007/ 978-3-662-46081-8_23.Google ScholarGoogle ScholarDigital LibraryDigital Library
  103. H. Zhu, G. Petri, and S. Jagannathan. Automatically Learning Shape Specifications. Technical report, Purdue Univsersity, 2016.Google ScholarGoogle Scholar

Index Terms

  1. Automatically learning shape specifications

              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 ACM 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