Equivalent Stream Reasoning Programs

Harald Beck, Minh Dao-Tran, Thomas EiterIJCAI 2016

Abstract

The emerging research field of stream reasoning faces the challenging trade-off between expressiveness of query programs and data throughput. For optimizing programs methods are needed to tell whether two programs are equivalent. Towards providing practical reasoning techniques on streams, we consider LARS programs, which is a powerful extension of Answer Set Programming (ASP) for stream reasoning that supports windows on streams for discarding information. We define different notions of equivalence between such programs and give semantic characterizations in terms of models. We show how a practically relevant fragment can be alternatively captured using Here-and-There models, yielding an extension of equilibrium semantics of ASP to this class of programs. Finally, we characterize the computational complexity of deciding the considered equivalence relations.

Introduction

Stream reasoning is a pivotal domain at the intersection of stream processing and artificial intelligence, aiming to provide complex logical reasoning over high-volume, low-latency data streams. A significant challenge in this field is the inherent trade-off between the expressiveness of query languages and the efficiency of data throughput. In traditional database systems and Answer Set Programming (ASP), program optimization is achieved by transforming programs into equivalent, more efficient versions. However, within the Logic-based Framework for Analyzing Reasoning over Streams (LARS), the formal definition and characterization of "equivalence" were previously undefined. LARS introduces complexities such as window operators and temporal modalities, making the determination of program equivalence mathematically non-trivial.

Methodology and the Bi-LARS Logic

To address these challenges, we extend foundational concepts from ASP to the temporal, window-based environment of LARS. We define four distinct notions of equivalence:

  1. Ordinary Equivalence: Programs yield identical results for a specific data stream.
  2. Strong Equivalence: Programs remain equivalent even when any arbitrary program $R$ is added to both.
  3. Uniform Equivalence: Programs remain equivalent when any set of input facts (data) is added.
  4. Data Equivalence: Programs produce the same results for all possible input data streams.

A core technical contribution is the introduction of Bi-LARS logic. This logic is designed to handle the FLP-semantics used in LARS for negation and rule evaluation. Bi-LARS evaluates formulas over a pair of streams (a "left" and "right" stream), which allows for the capture of minimality conditions essential for answer set semantics.

Semantics of the Bi-LARS logic for characterizing program equivalence.

Furthermore, we identify the class of monotone windows—operators where adding data to the input never decreases the information within the window. For this class, we establish a link to the Logic of Here-and-There (HT-logic), enabling the reuse of optimization techniques from standard ASP.

Complexity Analysis and Results

The complexity of deciding equivalence in LARS depends significantly on the properties of the window operators and the program structure. We provide a comprehensive mapping of these complexities across different fragments of the LARS language.

Complexity of deciding various equivalence relations in LARS.

Key findings include:

  • Monotonicity Impact: For "Plain LARS" with monotone windows, checking strong equivalence is coNP-complete. However, with non-monotonic windows, the complexity escalates to the second level of the polynomial hierarchy ($\Pi^P_2$-complete).
  • Stratified Programs: For stratified LARS programs (those without recursion through negation), the complexity is significantly lower, often falling within P or coNP.

Conclusion and Future Work

This work establishes the formal foundations for program optimization in stream reasoning. By bridging database theory's focus on data equivalence with logic programming's focus on strong/uniform equivalence, we provide the tools necessary for automated optimization in high-throughput environments. Future research will explore infinite timelines using Linear Temporal Logic (LTL) and develop specific syntactic criteria to facilitate practical compiler-level optimizations.

Summary updated

BibTeX
@inproceedings{beck2016equivalent,
  author = {Harald Beck and Minh Dao-Tran and Thomas Eiter},
  title = {{Equivalent Stream Reasoning Programs}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2016},
  url = {https://openreview.net/forum?id=ryZqAEfObr},
}
Figure