Initial Limit Datalog: a New Extensible Class of Decidable Constrained Horn Clauses

Toby Cathcart Burn, Luke Ong, Steven J. Ramsay, Dominik Wagner · DOI

Introduction

Constrained Horn Clauses (CHCs) serve as the fundamental "assembly language" for modern formal verification. By modeling program logic through these clauses, researchers can verify safety properties across a variety of systems. However, a persistent tension exists in the field: the desire for high expressivity to model complex programs often conflicts with the requirement for decidability—the guarantee that a verification tool will eventually provide a definitive "yes" or "no" answer.

While standard CHCs over infinite domains, such as linear integer arithmetic (LIA), are frequently undecidable, previous research introduced limit Datalog$_Z$ to bridge this gap. This approach achieved decidability by restricting predicates to be monotonic. However, limit Datalog$_Z$ was confined to first-order logic and specific integer theories. This paper introduces initial limit Datalog, a framework that extends these concepts to higher-order logic and a broader range of background theories while maintaining decidability.

The Challenge of Higher-Order Logic

Higher-order logic allows predicates to take other predicates as arguments, providing immense modeling power. However, this power is dangerous; without restrictions, higher-order logic can easily encode undecidable problems, such as Diophantine equations. The authors identify that unrestricted higher-order limit Datalog is undecidable because it can be used to define multiplication.

To navigate this, the paper introduces two primary innovations:

1. Initial Type Restriction

The authors propose a syntactic restriction on types termed "initial." This restriction carefully manages the "order" of arguments to prevent the specific types of nesting that lead to undecidability. By enforcing this structure, the logic remains expressive enough to handle useful recursion—such as the Iter combinator—while remaining within a "Goldilocks" zone of logical safety.

2. Entwined Structures

In higher-order logic, the space of possible models is typically uncountable, making an exhaustive search impossible. The paper’s core theoretical contribution is the definition of entwined structures. These are a specific class of models that are recursively enumerable. This property allows the development of a practical decision procedure.

The Decision Procedure: A Dual-Track Approach

To determine the satisfiability of a set of clauses, the authors propose a "race" between two concurrent procedures:

  1. Refutation Search: A procedure that uses resolution to find a proof that no model exists.
  2. Model Enumeration: A procedure that enumerates entwined structures to find a model that satisfies the clauses.

Because of the mathematical properties of initial limit Datalog, the authors prove that one of these two procedures is guaranteed to succeed, ensuring the problem is decidable.

Beyond Integers: Extensibility via Well-Quasi-Orders

A significant advantage of this new framework is its extensibility. By shifting the focus to Well-Quasi-Orders (WQOs), the framework moves beyond simple integer arithmetic. It can reason about diverse domains, including:

  • Vectors of Naturals: Useful for Petri nets and multi-counter systems.
  • Strings and Words: Reasoning about subword orders in language theory.
  • Process Algebras: Modeling the behavior of concurrent systems.

Key Results and Expressivity

The paper establishes several landmark results:

  • Decidability Theorem: Satisfiability for initial limit Datalog is proven decidable over any suitable background theory.
  • Expressivity Gains: The authors demonstrate that higher-order initial limit Datalog is strictly more expressive than its first-order predecessors. It can express complex database queries and system properties—such as path counting in directed acyclic graphs or retweet reach in social networks—that first-order versions cannot.
  • The Necessity of Restrictions: The work proves that the "initial" restriction is vital, as the general case remains undecidable.

Conclusion and Future Directions

While initial limit Datalog provides a robust theoretical foundation for higher-order verification, challenges remain regarding computational complexity. The current decision procedure involves constructing large numerical bounds and enumerating complex structures, which may lead to high runtimes in practice.

Future work will focus on identifying even broader sets of types that preserve decidability and implementing these "entwined structure" searches into practical solvers. This will allow the verification community to test the framework against real-world industrial benchmarks, moving from theoretical decidability to practical efficiency.

Summary updated

BibTeX
@inproceedings{burn2021initial,
  author = {Toby Cathcart Burn and Luke Ong and Steven J. Ramsay and Dominik Wagner},
  title = {{Initial Limit Datalog: a New Extensible Class of Decidable Constrained Horn Clauses}},
  booktitle = {LICS},
  year = {2021},
  doi = {10.1109/lics52264.2021.9470527},
}
Figure