Finite Open-World Query Answering with Number Restrictions (Extended Version)

Antoine Amarilli, Michael Benedikt

Abstract

This paper provides the first decidability results for Finite Open-World Query Answering (FQA) under constraints that combine referential integrity (Inclusion Dependencies) and number restrictions (Functional Dependencies) on relations of arbitrary arity. We establish that for Unary Inclusion Dependencies (UIDs) and Functional Dependencies (FDs), the problem is decidable and matches the complexity of unrestricted query answering. This is achieved through a reduction to unrestricted query answering over the "finite closure" of the constraints, supported by a novel "thrifty chase" algorithm and algebraic cycle-blowing techniques.

1. Introduction

In database theory and logic, Open-World Query Answering (OQA) asks whether a query is guaranteed to be true in every possible world that satisfies a given set of facts and constraints. Traditionally, OQA considers all possible models, including infinite ones. However, in most computer science applications—such as relational databases and software verification—we are primarily concerned with finite worlds.

This is the domain of Finite Open-World Query Answering (FQA). FQA is notoriously difficult because many standard logical tools, such as the classical "chase" algorithm, can fail to terminate or behave differently when the model is forced to be finite. This paper bridges a significant gap by handling both Unary Inclusion Dependencies (UIDs) and Functional Dependencies (FDs) for relations with any number of columns (arbitrary arity).

2. The Challenge of Arbitrary Arity

Prior to this work, researchers could handle referential constraints and number restrictions separately, or together only for simple binary relations (arity-2). Extending these results to relations with arbitrary arity is complex because Functional Dependencies (e.g., "an employee ID uniquely determines a name") and Inclusion Dependencies (e.g., "every manager must be an employee") can interact to force a model to be infinite unless the construction is carefully managed.

The authors address this by proving that a finite "counter-example" model always exists if a query is not entailed, providing a path to decidability for more complex database schemas.

3. Methodology

The authors utilize a sophisticated constructive approach to build finite models that satisfy the required constraints without accidentally satisfying the query.

3.1 Finite Closure

A central contribution is the use of finite closure. This technique involves pre-computing all the extra rules that must hold specifically because the world is finite. The authors prove that answering a query over finite models with constraints $\Sigma$ is equivalent to answering it over any model (finite or infinite) using the finite closure of $\Sigma$.

3.2 The Thrifty Chase

To construct the necessary models, the authors introduce the "thrifty" chase. The standard chase algorithm builds a model by adding new elements to satisfy constraints, which often leads to infinite structures. The thrifty version reuses existing elements whenever possible. To ensure this reuse doesn't violate Functional Dependencies, the authors developed a framework to identify "dangerous positions" in a relation where element reuse must be avoided.

3.3 Cycle Blowup (Mixed Products)

To ensure the finite model doesn't accidentally satisfy a query it shouldn't, the authors use mixed products, a technique from algebraic graph theory. By taking the product of their model with a high-girth group, they "blow up" short cycles in the data. This makes the model look "locally" like an infinite tree to any small query, preventing the query from "noticing" that the model is actually finite.

4. Key Results and Complexity

The paper establishes that FQA for the combination of UIDs and FDs is not only decidable but also computationally manageable:

  • Decidability: FQA is decidable for UIDs and FDs on arbitrary signatures.
  • Combined Complexity: NP-complete, matching the complexity of standard query evaluation.
  • Data Complexity: PTIME, meaning the process scales polynomially with the number of facts in the database.
  • Finite Controllability: The authors prove these constraints are "finitely controllable up to finite closure," showing that the finite and infinite cases are more similar than previously thought for this class of logic.

5. Limitations and Future Work

The results are currently limited to Unary Inclusion Dependencies (where only one variable is exported). If multi-attribute inclusion dependencies are allowed (e.g., linking a pair like (City, Zip) to another table), the problem becomes undecidable.

Additionally, while the theoretical complexity is low, the "cycle blowup" and "finite closure" steps involve massive constants that may pose challenges for practical implementation. Future research may focus on extending these model-building techniques to more expressive languages, such as those including disjunction or more complex guarded logic constraints.

Summary updated

BibTeX
@inproceedings{amarilli2015finite,
  author = {Antoine Amarilli and Michael Benedikt},
  title = {{Finite Open-World Query Answering with Number Restrictions (Extended Version)}},
  booktitle = {LICS},
  year = {2015},
  doi = {10.1109/lics.2015.37},
}
Figure