Verifying Tree-Manipulating Programs via CHCs
摘要
Programs that manipulate tree-shaped data structures often require complex, specialized proofs that are difficult to generalize and automate. This paper introduces a unified, foundational approach to verifying such programs. Central to our approach is the knitted-tree encoding, modeling each program execution as a tree structure capturing input, output, and intermediate states. Leveraging the compositional nature of knitted-trees, we encode these structures as constrained Horn clauses (CHC s), reducing verification to CHC satisfiability. To illustrate our approach, we focus on memory safety and show how it naturally leads to simple, modular invariants.