A Decidable Logic for Tree Data-Structures with Measurements

We present \({\textsc {Dryad}}_\textit{dec}\), a decidable logic that allows reasoning about tree data-structures with measurements. This logic supports user-defined recursive measure functions based on Max or Sum, and recursive predicates based on these measure functions, such as AVL trees or red-black trees. We prove that the logic’s satisfiability is decidable. The crux of the decidability proof is a small model property which allows us to reduce the satisfiability of \({\textsc {Dryad}}_\textit{dec}\) to quantifier-free linear arithmetic theory which can be solved efficiently using SMT solvers. We also show that \({\textsc {Dryad}}_\textit{dec}\) can encode a variety of verification and synthesis problems, including natural proof verification conditions for functional correctness of recursive tree-manipulating programs, legality conditions for fusing tree traversals, synthesis conditions for conditional linear-integer arithmetic functions. We developed the decision procedure and successfully solved 220+ \({\textsc {Dryad}}_\textit{dec}\) formulae raised from these application scenarios, including verifying functional correctness of programs manipulating AVL trees, red-black trees and treaps, checking the fusibility of height-based mutually recursive tree traversals, and counterexample-guided synthesis from linear integer arithmetic specifications. To our knowledge, \({\textsc {Dryad}}_\textit{dec}\) is the first decidable logic that can solve such a wide variety of problems requiring flexible combination of measure-related, data-related and shape-related properties for trees.

[1]  Jun Sun,et al.  Satisfiability Modulo Heap-Based Programs , 2016, CAV.

[2]  Robert J. Harrison,et al.  A Domain-Specific Compiler for a Parallel Multiresolution Adaptive Numerical Simulation Environment , 2016, SC16: International Conference for High Performance Computing, Networking, Storage and Analysis.

[3]  Suresh Jagannathan,et al.  A relational framework for higher-order shape analysis , 2014, ICFP.

[4]  Frank Piessens,et al.  Software verification with VeriFast: Industrial case studies , 2014, Sci. Comput. Program..

[5]  Xiaokang Qiu,et al.  Natural proofs for data structure manipulation in C using separation logic , 2014, PLDI.

[6]  Xiaokang Qiu,et al.  Reconciling Enumerative and Symbolic Search in Syntax-Guided Synthesis , 2018, ArXiv.

[7]  Rajeev Alur,et al.  Syntax-guided synthesis , 2013, 2013 Formal Methods in Computer-Aided Design.

[8]  Peter W. O'Hearn,et al.  Local Reasoning about Programs that Alter Data Structures , 2001, CSL.

[9]  Ranjit Jhala,et al.  Type-based data structure verification , 2009, PLDI '09.

[10]  Philip Wadler,et al.  Refinement reflection: complete verification with SMT , 2017, Proc. ACM Program. Lang..

[11]  Shengchao Qin,et al.  Automated Verification of Shape, Size and Bag Properties , 2007, ICECCS.

[12]  Thomas S. Heinze,et al.  Type safety analysis for Dart , 2016, DLS.

[13]  Andrey Rybalchenko,et al.  Separation logic + superposition calculus = heap theorem prover , 2011, PLDI '11.

[14]  Xiaokang Qiu,et al.  Decidable logics combining heap structures and data , 2011, POPL '11.

[15]  Bruno Courcelle,et al.  The Monadic Second-Order Logic of Graphs. I. Recognizable Sets of Finite Graphs , 1990, Inf. Comput..

[16]  Nils Klarlund,et al.  Graph types , 1993, POPL '93.

[17]  Ranjit Jhala,et al.  Bounded refinement types , 2015, ICFP.

[18]  Margus Veanes,et al.  Fusing effectful comprehensions , 2017, PLDI.

[19]  Patrick Maxim Rondon,et al.  Liquid types , 2008, PLDI '08.

[20]  Anders Møller,et al.  The Pointer Assertion Logic Engine , 2000 .

[21]  Radu Iosif,et al.  The Tree Width of Separation Logic with Recursive Definitions , 2013, CADE.

[22]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

[23]  George C. Necula,et al.  Data Structure Specifications via Local Equality Axioms , 2005, CAV.

[24]  Joël Ouaknine,et al.  SeLoger: A Tool for Graph-Based Reasoning in Separation Logic , 2013, CAV.

[25]  Andreas Maletti,et al.  Compositions of extended top-down tree transducers , 2008, Inf. Comput..

[26]  Constantin Enea,et al.  A Logic-Based Framework for Reasoning about Composite Data Structures , 2009, CONCUR.

[27]  John C. Reynolds,et al.  Separation logic: a logic for shared mutable data structures , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[28]  Tomás Vojnar,et al.  Automata-based verification of programs with tree updates , 2009, Acta Informatica.

[29]  Ruzica Piskac,et al.  Automating Separation Logic Using SMT , 2013, CAV.

[30]  Xiaokang Qiu,et al.  Natural proofs for structure, data, and separation , 2013, PLDI.

[31]  Viktor Kuncak,et al.  Satisfiability Modulo Recursive Programs , 2011, SAS.

[32]  Michael Goldfarb,et al.  General transformations for GPU execution of tree traversals , 2013, 2013 SC - International Conference for High Performance Computing, Networking, Storage and Analysis (SC).

[33]  Xiaokang Qiu,et al.  Recursive proofs for inductive tree data-structures , 2012, POPL '12.

[34]  Joël Ouaknine,et al.  Tractable Reasoning in a Fragment of Separation Logic , 2011, CONCUR.

[35]  Milind Kulkarni,et al.  Automatically enhancing locality for tree traversals with traversal splicing , 2012, OOPSLA '12.

[36]  Henny B. Sipma,et al.  Verifying Balanced Trees , 2007, LFCS.

[37]  Milind Kulkarni,et al.  Enhancing locality for recursive traversals of recursive structures , 2011, OOPSLA '11.

[38]  David Walker,et al.  Types and full abstraction for polyadic pi-calculus , 2005, Inf. Comput..

[39]  Ruzica Piskac,et al.  Automating Separation Logic with Trees and Data , 2014, CAV.

[40]  Ranjit Jhala,et al.  Abstract Refinement Types , 2013, ESOP.

[41]  Frank Piessens,et al.  VeriFast: A Powerful, Sound, Predictable, Fast Verifier for C and Java , 2011, NASA Formal Methods.

[42]  Viktor Kuncak,et al.  Decision procedures for algebraic data types with abstractions , 2010, POPL '10.

[43]  Shuvendu K. Lahiri,et al.  Back to the future: revisiting precise program verification using SMT solvers , 2008, POPL '08.

[44]  Joost Engelfriet,et al.  Output String Languages of Compositions of Deterministic Macro Tree Transducers , 2002, J. Comput. Syst. Sci..

[45]  Leo A. Meyerovich,et al.  Fast and parallel webpage layout , 2010, WWW '10.

[46]  Milind Kulkarni,et al.  TreeFuser: a framework for analyzing and fusing general recursive tree traversals , 2017, Proc. ACM Program. Lang..

[47]  Adam Chlipala,et al.  Mostly-automated verification of low-level programs in computational separation logic , 2011, PLDI '11.

[48]  Antoine Meyer,et al.  A logic of reachable patterns in linked data-structures , 2006, J. Log. Algebraic Methods Program..

[49]  Robert J. Harrison,et al.  On fusing recursive traversals of K-d trees , 2016, CC.

[50]  Leo A. Meyerovich,et al.  Parallel schedule synthesis for attribute grammars , 2013, PPoPP '13.

[51]  Henny B. Sipma,et al.  Decision procedures for term algebras with integer constraints , 2006, Inf. Comput..

[52]  Martin Odersky,et al.  Miniphases: compilation using modular and efficient tree transformations , 2017, PLDI.

[53]  Neil Immerman,et al.  Effectively-Propositional Reasoning about Reachability in Linked Data Structures , 2013, CAV.

[54]  Xiaokang Qiu,et al.  Efficient Decision Procedures for Heaps Using STRAND , 2011, SAS.

[55]  Ranjit Jhala,et al.  LiquidHaskell: experience with refinement types in the real world , 2014, Haskell.

[56]  Ranjit Jhala,et al.  Refinement types for Haskell , 2014, ICFP.

[57]  Michael W. Whalen,et al.  Reasoning About Algebraic Data Types with Abstractions , 2016, Journal of Automated Reasoning.