Answer Update for Rule-Based Stream Reasoning

Harald Beck, Minh Dao-Tran, Thomas EiterIJCAI 2015

Abstract

Stream reasoning is the task of continuously deriving conclusions on streaming data. To get results instantly one evaluates a query repeatedly on recent data chunks selected by window operators. However, simply recomputing results from scratch is impractical for rule-based reasoning with semantics similar to Answer Set Programming, due to the trade-off between complexity and data throughput. To address this problem, we present a method to efficiently update models of a rule set. In particular, we show how an answer stream (model) of a LARS program can be incrementally adjusted to new or outdated input by extending truth maintenance techniques. We obtain in this way a means towards practical rule-based stream reasoning with nonmonotonic negation, various window operators and different forms of temporal reference.

Introduction

Stream reasoning serves as the "brain" for real-time systems managing dynamic environments like public transport networks or sensor arrays. It involves continuously deriving conclusions from a constant flow of data. To maintain computational feasibility, these systems typically employ "window" operators that restrict reasoning to a specific temporal or count-based subset of recent data (e.g., "the last 5 minutes").

Public transport scenario and timeline used to illustrate stream reasoning challenges.

The primary challenge lies in expressive, rule-based languages—specifically those utilizing Answer Set Programming (ASP) semantics. In such frameworks, re-evaluating the entire window every time a new data point arrives is computationally prohibitive. For instance, if a bus is detected at a station, we might conclude it will reach the next stop in three minutes. Ideally, we should not need to re-verify this conclusion every second as the clock advances, provided the underlying facts remain unchanged. This paper introduces a method for incremental re-evaluation, updating only the necessary components of an "answer stream."

Methodology

The proposed solution is built upon the LARS (Logic-based framework for Analyzing Reasoning over Streams) language and introduces three core technical innovations.

Stream-Stratified Programs

To enable efficient updates, the authors define a method for partitioning LARS programs into layers, or strata. This stratification ensures that information flows unidirectionally through the "stream," preventing the complex logical cycles that often hinder incremental updates in nonmonotonic reasoning.

A stratified dependency graph illustrating how logical conclusions are layered and justified over time.

Extended Truth Maintenance Systems (TMS)

Traditional Truth Maintenance Systems track justifications for the truth or falsity of statements. This work extends TMS by incorporating time labels. Instead of a binary status, each atom is associated with a status and a set of time intervals during which that status is valid. This allows the system to treat time itself as a component of the logical justification.

The AnswerUpdate Algorithm

The AnswerUpdate algorithm serves as the core engine. As the time window slides, the algorithm identifies "expired" data exiting the window and "fired" data entering it. It then propagates these changes through the strata, performing two types of updates simultaneously:

  1. Temporal Updates: Adjusting time labels for conclusions that remain logically valid but have shifted in time.
  2. Status Updates: Re-evaluating the truth status of atoms directly affected by new or disappearing data.

Key Insights and Results

A central insight of this approach is the concept of temporal justification. In standard logic, if $A \to B$ and $A$ is true, then $B$ is true. In the context of stream reasoning, if $A$ is true during the interval $[10:00, 10:05]$, then $B$ is also derived as true specifically for that interval.

The authors demonstrate the following:

  • Correctness: They provide a formal proof that the AnswerUpdate algorithm correctly produces a valid answer stream for a given LARS program and data stream.
  • Efficiency: While full re-evaluation can be intractable, this incremental approach is significantly faster. For common window types, the runtime is generally sub-quadratic relative to the program size, making it suitable for high-throughput real-time applications.
  • Nonmonotonic Negation: Unlike simpler stream processing systems, this method handles "negation as failure" (e.g., "If there is no traffic jam, take the bus"), which is critical for sophisticated AI decision-making.

Limitations and Future Work

The current algorithm is "greedy," meaning it may fail to find a valid answer stream in the presence of certain conflicts, even if one exists. Future work involves implementing "proper backtracking" to enhance robustness, albeit with a potential trade-off in speed. Additionally, the stratification requirement currently precludes handling certain types of complex, circular logical dependencies. Further optimization of specific window functions is also planned to maximize performance in industrial settings.

Summary updated

BibTeX
@inproceedings{beck2015answer,
  author = {Harald Beck and Minh Dao-Tran and Thomas Eiter},
  title = {{Answer Update for Rule-Based Stream Reasoning}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2015},
  url = {https://openreview.net/forum?id=ryEc8HfOWS},
}
Figure