The Window Validity Problem in Rule-Based Stream Reasoning

Alessandro Ronca, Mark Kaminski, Bernardo Cuenca Grau, Ian Horrocks

Abstract

In the field of stream reasoning, systems must process continuous data flows in real-time while operating under strict memory constraints. This paper addresses the "Window Validity Problem": determining the minimum amount of historical data (the window) required to ensure that a rule-based reasoning algorithm remains perfectly accurate. By introducing a fragment of Temporal Datalog known as Forward-Propagating (FP) queries, the authors establish a formal framework for analyzing memory requirements, proving complexity bounds, and identifying conditions under which window sizes can be safely optimized.

Introduction

Stream reasoning involves the application of complex, rule-based logic to high-velocity data streams, such as network logs, sensor readings, or financial transactions. Languages like Temporal Datalog are often employed to express patterns over time—for instance, identifying a security threat if multiple failed logins occur within a specific temporal threshold.

However, a fundamental challenge arises: rules may theoretically refer to facts from the indefinite past. Since storing the entire history of a stream is infeasible for long-running applications, developers typically employ a "window"—a fixed buffer of recent history. The critical question is whether a chosen window size $w$ is sufficient to guarantee that the system will never miss a conclusion it would have reached if it had access to the full history. This is defined as the Window Validity Problem.

Forward-Propagating Queries

To make this problem tractable, the authors define Forward-Propagating (FP) Queries. This is a specific fragment of Temporal Datalog where rules are restricted such that information only flows from the past or present into the future. This restriction serves two primary purposes:

  1. Elimination of Paradoxes: It prevents "time travel" dependencies where the present depends on future events that have not yet occurred.
  2. Computational Efficiency: It ensures that query evaluation remains polynomial relative to the data (P-complete), making it suitable for high-intensity stream applications.

Theoretical Framework and Methodology

The research approaches the validity problem through several theoretical lenses:

Reductions to Query Containment

The authors demonstrate that checking window validity is fundamentally linked to the problem of query containment—deciding if the results of one query are always a subset of another. This connection allows the application of established logic techniques to the stream reasoning domain.

Fixed-Domain Analysis

Because the general window validity problem is undecidable for recursive rules, the authors analyze the problem under a fixed object domain assumption. In this scenario, the set of entities (e.g., specific IP addresses in a network or a fixed set of sensors) is known and finite. Under these conditions, the problem becomes decidable, though it remains computationally intensive.

Uniform Validity

Recognizing the difficulty of absolute validity checks, the authors introduce Uniform Validity. This is a sufficient condition that allows developers to verify if a window is safe by analyzing the rules themselves, independent of the specific data stream. This provides a practical "offline" optimization tool for system designers.

Key Insights

  • The Radius Limitation: While a query's "radius" (the maximum time offset in its rules) is a safe window size, it is often overly conservative. The authors' framework seeks the minimal valid window to minimize memory overhead.
  • The Impact of Recursion: For non-recursive queries, determining validity is relatively straightforward. However, recursive rules require the system to potentially store derived facts (intermediate conclusions) in addition to raw input data to maintain a small window.
  • Decidability Gap: The transition from an open domain to a fixed domain is the key factor that makes the Window Validity problem solvable by a computer, highlighting the importance of environment assumptions in stream reasoning.

Results and Complexity

The paper establishes rigorous complexity bounds for determining window validity under a fixed domain:

  • Object-ground queries: PSPACE-complete.
  • General FP-queries: EXPSPACE-complete.
  • Non-recursive queries: coNP-complete to coNEXP-complete.

Despite the high complexity of the validity check itself (which is performed once during system design), the actual data complexity for running the queries is P-complete, ensuring that the reasoning remains efficient once the window size is established.

Limitations and Future Work

While providing a robust foundation, the current research has limitations. The fixed domain assumption may not hold in open environments where new objects (like new MAC addresses) appear dynamically. Furthermore, the current framework does not yet support negation (e.g., "if an event did not occur") or the more complex temporal operators found in languages like DatalogMTL. Future research will likely focus on extending these validity proofs to more expressive logic fragments and exploring binary encoding for temporal offsets.

Summary updated

BibTeX
@inproceedings{ronca2018window,
  author = {Alessandro Ronca and Mark Kaminski and Bernardo Cuenca Grau and Ian Horrocks},
  title = {{The Window Validity Problem in Rule-Based Stream Reasoning}},
  booktitle = {KR},
  year = {2018},
  url = {https://openreview.net/forum?id=dT9jf95Od82},
}
Figure