Abstract
In complex reasoning tasks, as expressible by Answer Set Programming (ASP), problems often permit for multiple solutions. In dynamic environments, where knowledge is continuously changing, the question arises how a given model can be incrementally adjusted relative to new and outdated information. This paper introduces Ticker, a prototypical engine for well-defined logical reasoning over streaming data. Ticker builds on a practical fragment of the recent rule-based language LARS which extends Answer Set Programming for streams by providing flexible expiration control and temporal modalities. We discuss Ticker's reasoning strategies: First, the repeated one-shot solving mode calls Clingo on an ASP encoding. We show how this translation can be incrementally updated when new data is streaming in or time passes by. Based on this, we build on Doyle's classic justification-based truth maintenance system (TMS) to update models of non-stratified programs. Finally, we empirically compare the obtained evaluation mechanisms.
Introduction
Modern intelligent systems, such as smart network routers or real-time fraud detection monitors, must perform complex logical analysis on data that is constantly flowing and expiring. This domain, known as "Stream Reasoning," requires languages that can handle both the expressive power of logic and the high velocity of streaming data.
Answer Set Programming (ASP) is a natural candidate for these tasks. As a powerful declarative language, it excels at handling defaults, contradictions, and non-monotonic reasoning. However, traditional ASP solvers are "one-shot": they typically re-read the entire history and recompute solutions from scratch every time new data arrives. As data windows grow, this approach becomes computationally prohibitive. The central challenge is incrementality: adjusting an existing logical model to account for new additions and expirations without redundant computation.
The Ticker Architecture
Ticker is a prototypical engine designed to bridge the gap between ASP and stream reasoning. It implements a fragment of the LARS (Logic-based Framework for Analytic Reasoning over Streams) language, which introduces temporal modalities and window operators to ASP.
Tick Streams and Windows
At the heart of Ticker is the concept of a Tick Stream. Time is discretized into "ticks," where each tick represents either a time increment or the arrival of a new data point.
As shown in Figure 1, a sliding window (e.g., from tick 37 to 40) defines the subset of the stream currently relevant for reasoning. Ticker manages this by generating "annotated rules." Instead of a static program, rules are tagged with an expiration time based on LARS window operators. For instance, a rule might be valid only for the "last 10 seconds" or the "last 5 data points."
Incremental Reasoning Strategies
Ticker explores two primary strategies for evaluating these dynamic programs:
- One-shot Solving (Baseline): This approach utilizes the state-of-the-art solver Clingo. At every tick, Ticker re-encodes the current window's data and the relevant rules into a standard ASP program and solves it from scratch. While robust, its performance is heavily dependent on the window size.
- Incremental Truth Maintenance System (TMS): To achieve true incrementality, Ticker employs a TMS based on Doyle’s classic 1979 algorithm. The TMS maintains a dependency graph (justifications) for every conclusion. When a rule expires or new data arrives, the TMS identifies only the affected parts of the model. By retracting justifications rather than recomputing the entire state, the TMS handles the non-monotonic nature of ASP—where adding a fact might invalidate previous conclusions—more efficiently.
Empirical Evaluation
The authors evaluated Ticker using two simulated scenarios based on the Abilene network topology, a high-performance backbone network.
- Scenario A (Caching Strategy): A program that dynamically selects cache replacement strategies (e.g., FIFO vs. LRU) based on shifting request patterns.
- Scenario B (Content Retrieval): A complex scenario involving recursive pathfinding and multiple possible models to determine optimal data routing.
Key Results
The experiments revealed a significant performance advantage for the incremental approach:
- Window Scaling: The execution time for the one-shot Clingo approach grew proportionally with the size of the data window. Conversely, the Incremental TMS approach remained nearly constant, performing orders of magnitude faster as windows expanded.
- Temporal Scaling: While both systems scale linearly over time, the incremental approach maintains a significantly lower slope, indicating faster per-tick processing.
- Initialization Overhead: The TMS mode requires a "pre-grounding" phase to prepare rules, leading to a higher initial setup time. However, this investment is quickly recovered through faster stream processing.
Conclusion and Future Work
Ticker demonstrates that integrating a Truth Maintenance System with ASP-based stream reasoning can yield substantial performance gains. By treating windows as rule lifecycles, the system effectively manages the expiration of information.
Future research will focus on several key areas, including developing incremental grounding for streaming data to remove the need for pre-grounding, and improving the TMS's ability to handle "odd loops" and hard constraints to ensure termination across a wider variety of programs.
Summary updated