Generative Datalog with Stable Negation

Mario Alviano, Matthias Lanzinger, Michael Morak, Andreas Pieris · DOI

Abstract

Recent advancements in database theory have introduced Generative Datalog, a probabilistic extension of Datalog that allows for sampling from probability distributions within logic rules. However, these frameworks have historically been limited by monotonicity, preventing the modeling of scenarios where new information can retract previous conclusions. This paper presents a robust framework for incorporating negation into Generative Datalog by leveraging stable model semantics. By representing outcomes as infinitary ground programs and introducing a novel chase procedure, the authors provide a mathematically sound foundation for non-monotonic probabilistic logic programming.

Introduction

In the domain of logic programming and database theory, Datalog serves as a foundational language for expressing recursive queries. The evolution of Generative Datalog (often associated with Probabilistic Progressive Datalog, or PPDL) has expanded its utility by allowing users to sample from probability distributions directly within the logic. Despite this power, standard Generative Datalog remains monotonic: the addition of new facts can only expand the set of derived truths, never diminish it.

This monotonicity is a significant hurdle for modeling real-world "non-monotonic" properties. For instance, consider a network resilience scenario where a network is defined as "dominated" by malware if every router is either infected or isolated. If a previously unknown, uninfected router is discovered and connected, the property "the network is dominated" may flip from true to false. To capture such dynamics, a system must support negation as failure (e.g., "a router is uninfected if it is not infected"). Defining the intersection of probability and negation is complex, as a single set of random choices can lead to multiple possible logical "worlds" (stable models) or none at all. This paper addresses these challenges by providing a formal bridge between probabilistic sampling and stable model semantics.

Methodology

The authors' framework relies on several technical innovations to reconcile probabilistic choices with the potential for multiple stable models.

1. Symbolic Representation

Traditional probabilistic databases often treat outcomes as single database states. In contrast, this framework represents outcomes as infinitary ground programs. This symbolic approach allows the system to explicitly track the specific probabilistic choices that lead to a particular set of stable models, preserving the relationship between randomness and logical consequence.

2. The Chase for Programs

The paper introduces a modified chase procedure. While a standard chase operates on data to satisfy constraints, this version operates on ground programs. It constructs a "Chase Tree" where each branch represents a sequence of probabilistic choices. This procedure continues until it reaches a fixpoint, representing the final state of the program under those specific random outcomes.

3. Grounding Strategies and Stratification

A critical component of the framework is the grounder, a function that maps probabilistic choices to sets of rules. The authors distinguish between two types:

  • Simple Grounder: A basic mapping of choices to rules.
  • Perfect Grounder: An optimized strategy designed for stratified negation—scenarios where negation does not involve circular dependencies. The Perfect Grounder ensures that the maximum possible information is captured from the probabilistic choices.

Key Insights

The Shift in Sample Space

In positive (monotonic) Generative Datalog, a set of random choices typically leads to a unique minimal model. The introduction of negation fundamentally changes this: one set of choices can result in a set of stable models. The authors demonstrate that the sample space must therefore be defined over these sets of models, which are represented symbolically by the generated programs.

Fixpoint Equivalence

A major contribution of the work is the proof that the declarative "stable model" view of the world is equivalent to the procedural "chase" view. This equivalence is vital for implementation, as it provides a concrete algorithmic path (the chase) to realize the abstract semantics of the logic.

Results

The theoretical validity of the framework is established through several key theorems:

  • Theorem 3.9: Confirms that the proposed semantics define a mathematically sound discrete probability space.
  • Theorem 4.6: Establishes that the fixpoint semantics of the Chase procedure faithfully mimic the declarative probabilistic semantics.
  • Theorem 5.3: Demonstrates that for stratified programs, the Perfect Grounder is the optimal semantics, capturing the most information possible from the underlying probability distributions.

Qualitatively, the authors show that this formalism can correctly calculate the probability of complex, non-monotonic states. For example, in a malware propagation model, the framework can accurately determine the probability of a network being "dominated," a calculation that was impossible under previous monotonic versions of the language.

Limitations and Future Work

While the framework provides a rigorous foundation for negation in probabilistic Datalog, several areas for future research remain:

  • Continuous Distributions: The current model is restricted to discrete probability distributions. Extending the framework to handle continuous variables (e.g., Gaussian or Beta distributions) is a necessary next step for broader applicability.
  • Computational Efficiency: The described chase and grounding procedures are currently theoretical. Practical implementation will require "lazy" or "top-down" grounding techniques to avoid the impossible task of generating infinite ground rules.
  • Complex Constraints: Further investigation is needed to explore how complex logical constraints interact with stable negation in high-performance probabilistic database engines.

Summary updated

BibTeX
@inproceedings{alviano2023generative,
  author = {Mario Alviano and Matthias Lanzinger and Michael Morak and Andreas Pieris},
  title = {{Generative Datalog with Stable Negation}},
  booktitle = {PODS},
  year = {2023},
  doi = {10.1145/3584372.3588656},
}
Figure