Symbolic Automatic Relations and Their Applications to SMT and CHC Solving

Takumi Shimoda, Naoki Kobayashi, Ken Sakayori, Ryosuke Sato

Abstract

Despite the recent advance of automated program verification, reasoning about recursive data structures remains as a challenge for verification tools and their backends such as SMT and CHC solvers. To address the challenge, we introduce the notion of symbolic automatic relations (SARs), which combines symbolic automata and automatic relations, and inherits their good properties such as the closure under Boolean operations. We consider the satisfiability problem for SARs, and show that it is undecidable in general, but that we can construct a sound (but incomplete) and automated satisfiability checker by a reduction to CHC solving. We discuss applications to SMT and CHC solving on data structures, and show the effectiveness of our approach through experiments.

Introduction

Automated program verification relies heavily on backends like Satisfiability Modulo Theory (SMT) and Constrained Horn Clause (CHC) solvers. While these tools excel at reasoning about basic data types like integers or reals, they often struggle with recursive data structures such as lists and trees. The primary obstacle is that reasoning about lists typically requires induction, which is notoriously difficult to automate.

Existing "automatic relations" are effective for finite alphabets, but real-world programs operate over infinite domains (e.g., the set of all integers). Current SMT solvers like Z3 or CVC4 support recursive functions but frequently fail to prove even simple inductive properties without manual guidance. This work bridges this gap by providing a formal, automata-based framework to represent and solve relations over infinite-alphabet sequences.

Methodology: Symbolic Automatic Relations (SARs)

The proposed framework introduces two primary concepts to handle infinite alphabets and multi-list relations:

  1. Symbolic Synchronous Automata (ss-NFA): These are finite state machines where transitions are labeled with logical formulas (e.g., $l_0 < l_1 + 1$) rather than simple characters. The "synchronous" property allows the automaton to read multiple input lists simultaneously, element by element.
  2. Symbolic Automatic Relations (SARs): These are the relations recognized by ss-NFAs. Crucially, SARs inherit the beneficial properties of standard automatic relations, including closure under Boolean operations (AND, OR, NOT).
Examples of synchronous and symbolic automata building blocks.

By reading multiple lists at the same time, SARs can easily express relationships between lists of the same length (or padded lengths), such as "List A is element-wise less than List B." Because SARs are closed under Boolean operations, complex queries can be built by modularly combining simpler automata.

Satisfiability via Reduction to CHC

While checking the satisfiability of a general SAR is undecidable, the authors develop a sound (but incomplete) reduction to CHC solving. Instead of requiring the solver to perform induction on the list structure directly, the automaton's transition logic is translated into a set of Horn clauses over integers. A CHC solver then searches for an inductive invariant that proves the reachability (or unreachability) of the automaton's final states. This approach effectively "outsources" the induction to the CHC solver's robust invariant-finding engines.

Symbolic automata $M_1$ and $M_2(x)$ representing complex list predicates.

Experimental Evaluation

The approach was evaluated using three benchmark sets: IsaPlanner (15 instances from a proof planner for the Isabelle theorem prover), SAR_SMT (60 instances representing various list properties like prefix relations and sums), and CHC (12 instances where SARs describe models for CHCs on data structures).

The results were compared against industry-standard SMT solvers Z3 and CVC4. The proposed tool, using the Eldarica CHC solver as a backend, solved 85 out of 87 total instances. In contrast, Z3 and CVC4 solved fewer than half (38 and 40 respectively) when using recursive function definitions. Most failures for standard solvers occurred on properties requiring induction, whereas the SAR-to-CHC reduction handled these cases successfully with average execution times ranging from 0.9 to 5 seconds.

Discussion and Conclusion

The SAR framework offers a powerful, modular way to build complex queries. A major advantage is that an SAR can serve as a "certificate" of satisfiability; if a CHC solver finds a model for the reduced problem, that model describes the shape of the data structures satisfying the original formula.

However, limitations remain. The general problem is undecidable, and certain relations like append(X, Y, Z) cannot be represented as SARs due to the synchronous nature of the automata, which cannot relate words of arbitrary, non-padded lengths. Future work includes extending the framework to tree automatic relations and implementing "ICE-based learners" to automatically discover SARs from program traces, further automating the verification process.

Summary updated

Abstract

Despite the recent advance of automated program verification, reasoning about recursive data structures remains as a challenge for verification tools and their backends such as SMT and CHC solvers. To address the challenge, we introduce the notion of symbolic automatic relations (SARs), which combines symbolic automata and automatic relations, and inherits their good properties such as the closure under Boolean operations. We consider the satisfiability problem for SARs, and show that it is undecidable in general, but that we can construct a sound (but incomplete) and automated satisfiability checker by a reduction to CHC solving. We discuss applications to SMT and CHC solving on data structures, and show the effectiveness of our approach through experiments.
BibTeX
@inproceedings{shimoda2021symbolic,
  author = {Takumi Shimoda and Naoki Kobayashi and Ken Sakayori and Ryosuke Sato},
  title = {{Symbolic Automatic Relations and Their Applications to SMT and CHC Solving}},
  booktitle = {SAS},
  year = {2021},
  url = {https://openreview.net/forum?id=Mv5PQdIGRo},
}
Figure