Kernels on Prolog Proof Trees: Statistical Learning in the ILP Setting

Andrea Passerini, Paolo Frasconi, Luc De Raedt

Abstract

This paper introduces a novel framework for integrating symbolic logic with statistical learning by defining kernels on Prolog proof trees. Traditional Inductive Logic Programming (ILP) excels at relational reasoning but often lacks the robustness of statistical methods, while kernel machines like Support Vector Machines (SVMs) typically require propositionalized data. By utilizing "visitor programs" to generate execution traces (and-trees), the authors define Prolog Ground Term Kernels (PGTKs) that allow statistical models to operate directly on structured logical proofs. Evaluation on Bongard problems, string patterns, and molecular mutagenicity datasets demonstrates that this approach maintains high accuracy and stability across varying levels of structural complexity.

Introduction

Machine learning in relational domains faces a fundamental trade-off between the expressive power of Inductive Logic Programming (ILP) and the robustness of statistical learning. ILP systems are adept at handling complex background knowledge and multi-relational data but are often sensitive to noise and struggle with probabilistic patterns. Conversely, statistical methods like Support Vector Machines (SVMs) offer excellent generalization and noise tolerance but generally require data to be "flattened" into fixed-length feature vectors—a process known as propositionalization that can discard critical structural information. This paper proposes a bridge between these paradigms by defining kernels directly on the proof trees generated during logical inference.

Methods

The core innovation is the trace kernel, which compares the execution traces of Prolog programs rather than the raw data points themselves. This approach allows the model to learn from the process of reasoning about the data, capturing significantly more context than a binary logical result.

  1. Visitor Programs: The user provides a "visitor program," a set of Prolog clauses that define which features of the data are relevant. This acts as a declarative interface between the raw background knowledge and the kernel.
  2. And-Trees: When a visitor program runs on an example, it generates "and-trees" (proof trees) representing the logical steps taken to satisfy a goal.
  3. Prolog Ground Term Kernels (PGTKs): Kernels are defined directly on these trees, treating them as typed ground terms. These kernels can be customized via sum/product combinations, functor equality (comparing logical structure while ignoring specific variable values), and pruning (designating specific predicates as leaf nodes to manage computational complexity).

Datasets and Results

The methodology was validated across three distinct problem domains:

  • Bongard Problems: In these geometric reasoning tasks, the trace kernel SVM significantly outperformed the standard ILP system Tilde. While Tilde's performance degraded as the complexity of nested patterns increased, the kernel-based approach remained stable.
  • M-of-N String Problems: The system achieved perfect generalization (AUC = 1.0) on test strings significantly longer than those in the training set, indicating it successfully captured the underlying relational concept.
  • Mutagenicity: Using a dataset of 188 molecules, the authors demonstrated the flexibility of visitor programs. By adjusting the visitor, the model could switch from analyzing simple paths between atoms to identifying complex functional groups like benzene rings.
Relational representation of a molecule from the mutagenicity dataset, showing both Prolog facts and its chemical structure.

Combining these structural kernels with global molecular attributes (such as LUMO energy) yielded results competitive with state-of-the-art methods.

Discussion and Conclusion

Trace kernels offer a principled way to embed domain knowledge into statistical learning algorithms without the limitations of traditional propositionalization. By using visitor programs as feature selectors, experts can guide the learner toward relevant structural features without manual feature engineering. Unlike standard tree kernels that compare every possible subtree, PGTKs only compare parts of proofs reached through similar logical inference steps, enhancing both meaning and efficiency.

While computational complexity remains a challenge for very large proof trees, techniques like pruning make the approach feasible. Future work may explore optimizing resolution orders to find more informative traces and extending the framework to unsupervised learning tasks like clustering and ranking.

Summary updated

BibTeX
@inproceedings{passerini2005kernels,
  author = {Andrea Passerini and Paolo Frasconi and Luc De Raedt},
  title = {{Kernels on Prolog Proof Trees: Statistical Learning in the ILP Setting}},
  booktitle = {AAIP},
  year = {2005},
  url = {https://openreview.net/forum?id=nommmIIrCm},
}
Figure