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

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

TL;DR

This paper introduces initial limit Datalog, a new class of higher-order logic programs that remain decidable even when integrated with infinite background theories like integer arithmetic. By enforcing a specific "initial" type restriction and utilizing a novel model-checking structure called entwined structures, the authors provide a way to verify complex properties in automated reasoning and data analysis that were previously considered undecidable.

What Problem Does This Paper Address?

In the world of automated reasoning and program verification, Constrained Horn Clauses (CHCs) are a standard way to represent logic. They allow us to combine pure logic with "background theories"—mathematical domains like linear integer arithmetic.

However, there is a major trade-off: expressivity vs. decidability. While CHCs are powerful, adding infinite background theories often makes the question "is this set of clauses satisfiable?" impossible for a computer to answer (undecidable).

A previous solution, limit DatalogZ, regained decidability by restricting predicates to be monotonic (upwards or downwards closed). For example, instead of asking if a value is exactly 5, you ask if it is "at least 5." While this worked for first-order logic, moving to higher-order logic—where predicates can take other predicates as arguments—remained a frontier. Naive attempts to make limit Datalog higher-order immediately crash into undecidability. This paper seeks the "Goldilocks zone": a higher-order extension that is more expressive than first-order logic but still decidable.

Methods

The authors employ two primary innovations to achieve decidability:

  1. The "Initial" Type Restriction: The authors identified that undecidability in higher-order logic often stems from "nested" terms where a high-order predicate captures a term of even higher order. They designed a restriction called initial types. This ensures that in any partial application of a predicate, the arguments are of a strictly lower "order" than the predicate itself. This discipline prevents the logical "feedback loops" that lead to undecidability.
  2. Entwined Structures: Standard models for higher-order logic are often uncountable, making them impossible to search through. The authors invented entwined structures, a new kind of term model. These structures are built inductively: you interpret lower-order predicates first, and then use those results to define the interpretation of higher-order types. Crucially, the set of all entwined structures is recursively enumerable, meaning a computer can systematically list and check them.

The final decision procedure works by running two processes in parallel: one searches for a satisfying "entwined model," while the other searches for a logical refutation (proof of unsatisfiability). Because the logic is decidable, one of these two processes is guaranteed to finish.

Datasets

As a theoretical paper in formal logic and computer science, this work does not use empirical datasets or benchmarks in the style of machine learning. Instead, it provides formal proofs and illustrative examples, such as:

  • Social Networking: Modeling tweet propagation based on retweet thresholds.
  • Path Counting: Reasoning about the number of paths in directed acyclic graphs.
  • Lossy Counter Machines: Proving reachability in systems that can spontaneously lose data.

Key Insights and Ideas

  • Monotonicity Tames Infinity: The "limit" restriction (requiring predicates to be upwards-closed) is the fundamental reason why infinite domains like integers become manageable. It turns an infinite search space into a search for "minimal" witnesses.
  • Bootstrapping Interpretations: The core "aha moment" is that you don't need to know every possible value of a higher-order argument to understand how a predicate behaves. By "entwining" the interpretation of types with the interpretation of terms, you can build a finite representation of an infinite logical space.
  • Extensibility: The framework isn't just for integers. It works for any Well-Quasi-Order (WQO) with a decidable first-order theory. This includes natural number vectors and even words in a context-free language under the subword relation.

Key Results

  • Decidability Theorem: The paper formally proves that the satisfiability problem for initial limit Datalog is decidable (Theorem IV.3).
  • Higher-Order Power: The authors show that their higher-order version is strictly more expressive than the first-order version. It can express queries that first-order Datalog simply cannot.
  • Boundary of Undecidability: They demonstrate that if you remove the "initial" type restriction, the logic becomes powerful enough to encode Diophantine equations, rendering it undecidable (Theorem III.7).

Limitations and Future Work

  • Computational Complexity: While the problem is decidable (it can be solved in finite time), the authors note that the current algorithm's runtime is likely extremely high—involving "the construction of large numbers." It is a proof of possibility, not yet a high-performance tool.
  • Type Flexibility: The "initial" restriction is sufficient for decidability, but is it necessary? The authors suggest there may be other, broader type systems that also remain decidable.
  • Practical Implementation: A promising next step is identifying "tractable subsets" of this logic that can be used in real-world software verification tools without hitting the theoretical worst-case complexity.

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