On the Complexity of Inductively Learning Guarded Rules

Andrei Draghici, Georg Gottlob, Matthias Lanzinger

Abstract

Inductive Logic Programming (ILP) is a powerful framework for learning interpretable rules from data. However, the computational complexity of the ILP consistency problem—finding a hypothesis that covers all positive examples while avoiding all negative ones—is traditionally $\Sigma_2^P$-complete for general Horn clauses. This paper investigates the complexity of learning "guarded clauses," where a single literal contains all variables present in the rule. We demonstrate that this restriction reduces the complexity to NP-complete and identify a further "straight" fragment that allows for polynomial-time (PTIME) learning. These results provide a theoretical foundation for more efficient rule-mining systems that remain expressive enough for Semantic Web applications.

Introduction

Rule mining serves as a cornerstone of interpretable artificial intelligence, offering human-readable logical relationships that contrast with the "black box" nature of neural networks. Within this field, Inductive Logic Programming (ILP) provides the formal machinery for discovering these rules. The central challenge in ILP is the consistency problem: given a set of positive and negative examples, can we find a hypothesis (a rule) that explains the positives without capturing any negatives?

For general Horn clauses, this task is notoriously difficult, sitting at the $\Sigma_2^P$ level of the polynomial hierarchy. This complexity stems largely from the "subsumption check"—the process of verifying whether a rule covers a specific example. In the general case, this check is NP-complete, and the search for a consistent rule adds another layer of complexity. This paper explores whether restricting the hypothesis space to "guarded clauses" can make rule mining more computationally tractable without sacrificing too much expressive power.

The Guarded Fragment

A clause is defined as "guarded" if it contains a specific literal, known as the guard, which includes every variable present in the rest of the rule. For example, consider the rule:

FanOf(y, z) ← TalkAbout(x, y, z), Influences(x, y)

In this instance, the atom TalkAbout(x, y, z) acts as the guard because it contains all variables ($x, y, z$) used in the rule. This structural constraint is significant because the guard literal "anchors" the variables. When checking if a rule covers an example, the guard limits the possible mappings of variables to constants, significantly simplifying the subsumption check.

Complexity and Algorithm Design

The authors provide a rigorous analysis of the complexity landscape for guarded ILP, yielding several key insights:

From $\Sigma_2^P$ to NP-Complete

By moving from general Horn clauses to guarded clauses, the complexity of the consistency problem drops exactly one level on the polynomial hierarchy, from $\Sigma_2^P$ to NP-complete. While NP-complete problems remain challenging, they are far more manageable than $\Sigma_2^P$ problems, as they can often be solved efficiently using modern SAT or SMT solvers. The authors prove this NP-hardness using a reduction from the "hitting string problem."

Tractability through "Straightness"

The paper identifies a specific source of intractability: the repetition of relation symbols. They introduce the concept of straight clauses—rules where no relation symbol appears more than once with the same polarity (i.e., no self-joins).

When positive examples are restricted to straight clauses, the authors demonstrate that the ILP consistency problem for guarded clauses enters PTIME (polynomial time). They provide a concrete algorithm (Algorithm 1) to achieve this. The algorithm utilizes a "Least General Induced Guard" (lgig) to efficiently map variables from examples to the hypothesis, allowing the system to not only decide if a rule exists but also to enumerate maximal "canonical" solutions.

Generalization to k-Guards

The research extends beyond single guards to "$k$-guarded" clauses, where a set of $k$ literals collectively covers all variables. This generalization is crucial for capturing more complex logical properties, such as transitive closure, while maintaining the improved complexity profiles identified in the single-guard case.

Significance and Expressivity

Despite these restrictions, guarded fragments remain highly expressive. The authors highlight that these logical subsets are powerful enough to capture popular description logics such as DL-Lite and EL. These languages underpin the Semantic Web (specifically OWL 2), suggesting that the proposed algorithms have immediate relevance for mining rules from large-scale ontological datasets.

Conclusion and Future Directions

This work identifies a significant "sweet spot" in the complexity of rule learning. By focusing on guarded and straight clauses, researchers can bypass the traditional computational bottlenecks of ILP. However, several avenues for future work remain:

  • Background Knowledge: The current analysis assumes an empty set of background knowledge. Integrating background knowledge while maintaining guardedness constraints presents new conceptual challenges.
  • Empirical Validation: While the PTIME algorithm is theoretically efficient, its performance on noisy, large-scale real-world datasets needs to be tested in practical rule-mining environments.
  • Beyond Straightness: Finding a middle ground between the highly restricted "straight" clauses and the general guarded fragment remains an open challenge for researchers seeking to handle self-joins efficiently.

Summary updated

BibTeX
@inproceedings{draghici2022complexity,
  author = {Andrei Draghici and Georg Gottlob and Matthias Lanzinger},
  title = {{On the Complexity of Inductively Learning Guarded Rules}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i5.20500},
}
Figure