Verifying Tree-Manipulating Programs via CHCs

📅 2025-05-20
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
Automated and generalizable verification of programs operating on tree-shaped data structures remains challenging. To address this, we propose a unified semantic modeling approach based on “knitted-tree” encoding: program executions—including inputs, outputs, and intermediate states—are structured as fused trees and systematically reduced to the satisfiability problem of constrained Horn clauses (CHCs). This encoding enables the first structural characterization and modular verification of tree-program semantics. By leveraging off-the-shelf CHC solvers (e.g., Z3/Spacer), our method automatically synthesizes concise, compositional invariants for safety properties such as memory safety. We demonstrate fully automated verification on multiple classical tree algorithms, generating provably correct, modular invariants. Our approach significantly improves scalability, reusability, and automation in tree-program verification.

Technology Category

Constraint Satisfaction and Optimization: Satisfiability Modulo TheoriesKnowledge Representation and Reasoning: Automated Reasoning and Theorem ProvingNatural Language Processing: Code Generation / Program Synthesis from Natural Language

Application Category

Semantics and Knowledge: Methods, algorithms and applications for the development of semantic models, knowledge graphs and other forms of structured data models with machine-interpretable semanticsGraph Algorithms and Modeling for the Web: Efficient manipulation of static and dynamic Web-related graphsSecurity and Privacy: Data transparency and provenance
📝 Abstract
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 (CHCs), reducing verification to CHC satisfiability task. To illustrate our approach, we focus on memory safety and show how it naturally leads to simple, modular invariants.
Problem

Research questions and friction points this paper is trying to address.

Verifying tree-manipulating programs via CHCs
Modeling program execution as knitted-tree structures
Reducing verification to CHC satisfiability tasks
Innovation

Methods, ideas, or system contributions that make the work stand out.

Uses knitted-tree encoding for program execution
Encodes tree structures as constrained Horn clauses
Reduces verification to CHC satisfiability task
🔎 Similar Papers
No similar papers found.