Ticker: A system for incremental ASP-based stream reasoning

Harald Beck, Thomas Eiter, Christian Folie

TL;DR

Ticker is a novel stream reasoning engine that brings the expressive power of Answer Set Programming (ASP) to dynamic data environments. By using a Truth Maintenance System (TMS) to incrementally update models rather than recomputing them from scratch, Ticker achieves significant performance gains, especially when dealing with large data windows and complex temporal logic.

What Problem Does This Paper Address?

In the world of "Stream Reasoning," we want to perform complex logical analysis on data that is constantly flowing and expiring—think of a smart router managing network traffic or a monitor detecting fraud in real-time.

Answer Set Programming (ASP) is a powerful declarative language perfect for these "hard" reasoning tasks because it handles defaults and contradictions gracefully. However, ASP solvers are traditionally "one-shot": every time a new piece of data arrives, the solver typically re-reads the entire history and recomputes the solution from zero. This is computationally expensive and scales poorly as data windows grow.

The challenge is incrementality: How can we adjust an existing logical model to account for new information (additions) and outdated information (expirations) without throwing everything away? This is particularly difficult in ASP because it is "nonmonotonic"—adding one new fact might invalidate a whole chain of previous conclusions.

Methods

The authors introduce Ticker, a prototypical engine designed to handle a fragment of the LARS (Logic-based Framework for Analytic Reasoning over Streams) language.

Key technical components include:

  1. Tick Streams: A formal way to represent the passage of time and the arrival of data as discrete "ticks." Each tick represents either a time increment or a new data point.
  2. Incremental Rule Generation: Instead of a static program, Ticker generates "annotated rules." These rules are tagged with an expiration time based on LARS window operators (e.g., "keep this data for the last 10 seconds").
  3. Two Reasoning Strategies:
    • One-shot (Baseline): Uses the popular solver Clingo. It re-encodes the current window and solves it from scratch at every step.
  4. Incremental TMS: Uses a Truth Maintenance System (TMS) based on Doyle’s classic 1979 algorithm. The TMS maintains a dependency graph of conclusions. When a rule expires or new data arrives, the TMS only updates the specific parts of the model affected by that change.

Datasets

The authors evaluated Ticker using two simulated scenarios in the context of content-centric network management:

  • Scenario A (Caching Strategy): A program that dynamically selects cache replacement strategies (like FIFO or LRU) based on request patterns.
  • Scenario B (Content Retrieval): A more complex scenario involving recursive computation and multiple possible solutions (models) to find the best path for data in a network.
  • Topology: They used the Abilene network (a high-performance backbone network topology) as the underlying graph for their simulations.

Key Insights and Ideas

  • Windows as Rule Lifecycles: The "aha moment" is treating window-based reasoning as a management problem for rule lifecycles. By calculating exactly when a rule will "expire," the system can proactively prune its internal logic.
  • TMS for Nonmonotonicity: While TMS is an older AI technique, the authors show it is uniquely suited for stream reasoning because it naturally handles the "justification" of facts. If the reason for a conclusion expires, the TMS automatically retracts that conclusion.
  • Decoupling Update from Solving: The paper demonstrates that the technique for updating the program (adding/removing rules) is independent of the technique used to solve it, allowing for modular engine designs.

Key Results

The empirical evaluation showed a clear divide between the two strategies:

  • Scaling with Window Size: For the one-shot Clingo approach, execution time grew proportionally with the size of the data window. In contrast, the Incremental TMS approach remained nearly constant. As windows got larger, the TMS was orders of magnitude faster.
  • Scaling with Time: Both systems scale linearly as the number of time points increases, but the incremental approach maintains a much lower slope (faster per-tick processing).
  • Initialization Trade-off: The incremental mode requires a "pre-grounding" step (preparing the rules), which takes more time upfront ($t_{init}$) but pays off rapidly during the actual stream processing.

Limitations and Future Work

  • Constraint Handling: The current TMS implementation struggles with "odd loops" and hard constraints, which can lead to non-termination or incorrect models if the program isn't carefully structured.
  • Grounding on the Fly: The system currently relies on "pre-grounding" (knowing the possible values of variables beforehand). The authors note that developing "on-the-fly" grounding for incremental streams is a major open challenge.
  • Model Selection: In cases where multiple valid logical solutions exist, the TMS tends to stay with the "current" model (inertia), which is often desirable but might not always be the most "optimal" solution in every context.

Summary updated

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 ASP 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 to update models of non-stratified programs. Finally, we empirically compare the obtained evaluation mechanisms.
BibTeX
@inproceedings{beck2017ticker,
  author = {Harald Beck and Thomas Eiter and Christian Folie},
  title = {{Ticker: A system for incremental ASP-based stream reasoning}},
  booktitle = {Theory Pract. Log. Program},
  year = {2017},
  url = {https://openreview.net/forum?id=r5tJu0VXlL},
}

Loading related content...

Figure