Restricted Chase Termination: You Want More than Fairness

David Carral, Lukas Gerlach, Lucas Larroque, Michaël Thomazo · DOI

Introduction

In the field of database theory, the chase algorithm serves as a foundational mechanism for reasoning with existential rules, also known as tuple-generating dependencies (TGDs). It is the primary engine behind critical tasks such as query optimization, data exchange, and ontology-based query answering. At its core, the chase iteratively expands a database by adding new facts to satisfy a set of logical rules.

However, the chase is not guaranteed to terminate. Because rules can trigger other rules in an infinite cycle, a central challenge for researchers has been identifying which sets of rules and databases ensure a halt. While the complexity of most chase variants—such as the "oblivious" or "core" chase—has been well-documented, the restricted chase remained a significant gap in the literature. The restricted chase is particularly efficient because it only adds new data if a rule is not already satisfied by existing data. Despite its popularity, previous claims regarding its termination complexity were found to be underestimated. This paper corrects the record, proving that deciding restricted chase termination is far more complex than previously thought.

The Complexity of the Restricted Chase

The authors establish that deciding whether the restricted chase terminates is $\Pi^1_1$-complete. This result applies to two primary scenarios:

  1. Knowledge Base Termination ($CTK^{\text{rest}}_{\forall}$): Determining if the chase terminates for a specific set of rules and a specific starting database.
  2. Rule Set Termination ($CTR^{\text{rest}}_{\forall}$): Determining if a set of rules terminates for all possible starting databases.

This classification places the problem significantly higher in the analytical hierarchy than other variants. For comparison, the oblivious chase is Recursively Enumerable (RE)-complete, and the core chase is $\Pi^0_2$-complete. The $\Pi^1_1$-completeness of the restricted chase indicates that it is not just undecidable, but sits at a level of complexity that defies standard computational approaches.

Methodology and Technical Insights

To map this extreme hardness, the authors utilized tools from computability theory and developed several novel logical constructions:

Turing Machine Reductions

The proof for $\Pi^1_1$-hardness involves a reduction from the problem of determining if a Turing Machine is "non-recurring." A Turing Machine is non-recurring if it visits a specific state only finitely many times across all possible inputs. By simulating this behavior within the chase, the authors demonstrate that the termination problem captures the same level of logical complexity.

The "Emergency Brake"

A key technical contribution is the "emergency brake" construction. This logical mechanism allows the chase to proceed for an arbitrary number of steps but forces it to terminate eventually unless a specific condition—representing an infinite run of a Turing Machine—is met. This allows the authors to link the termination of the chase directly to the non-recurrence of the machine.

"Bow Tie" Analysis

When analyzing rule sets where the starting database is unknown, the authors developed a structural analysis of "bow tie" graphs. This analysis shows that even if the chase begins on an arbitrary or "messy" database, the rules are designed to eventually "heal" the data structure. This ensures that the chase eventually simulates a proper Turing Machine configuration, regardless of the initial state.

The Role of Fairness

The paper identifies the standard fairness condition as the primary driver of this high complexity. In the context of the chase, fairness requires that every rule that can be applied must eventually be applied.

Because fairness is a property of an infinite sequence, it is not "finitely verifiable." One cannot determine if a sequence is fair by examining any finite portion of it. This inherent reliance on the infinite behavior of the sequence is what pushes the complexity of the termination problem into the analytical hierarchy ($\Pi^1_1$).

A Practical Alternative: The Breadth-First Chase

To address these complexity challenges, the authors propose a breadth-first restricted chase. This variant utilizes a fairness condition that is finitely verifiable—meaning one can determine if a sequence violates the condition by looking at a finite prefix.

By switching to this breadth-first approach, the termination problem drops from $\Pi^1_1$-complete to $\Pi^0_2$-complete. This shift makes the problem significantly more manageable for static analysis and optimization while preserving the essential properties of the restricted chase, such as semi-decidability for query answering.

Conclusion and Future Directions

This research settles a long-standing mystery in database theory and identifies errors in previous highly-cited literature regarding chase complexity. By proving that restricted chase termination is $\Pi^1_1$-complete, the authors highlight the hidden dangers of standard fairness conditions.

Future work remains to determine if these high complexity bounds hold for more restricted rule fragments, such as:

  • Single-head rules: Rules that conclude only a single atom, where the "emergency brake" is harder to implement.
  • Guarded rules: A common syntactic fragment where Turing Machine simulation is more constrained.

Exploring these boundaries will provide a complete map of the restricted chase, allowing for more robust and predictable database reasoning tools.

Summary updated

BibTeX
@article{carral2025restricted,
  author = {David Carral and Lukas Gerlach and Lucas Larroque and Michaël Thomazo},
  title = {{Restricted Chase Termination: You Want More than Fairness}},
  journal = {Proc. ACM Manag. Data},
  year = {2025},
  doi = {10.1145/3725246},
}
Figure