Bidirectional Answer Set Programs with Function Symbols

Thomas Eiter, Mantas SimkusIJCAI 2009

Abstract

Current Answer Set Programming (ASP) solvers largely build on logic programming without function symbols. This limitation makes ASP decidable, but greatly complicates the modeling of indefinite time, recursive data structures (e.g., lists), and infinite processes and objects in general. Recent research thus aims at finding decidable fragments of ASP with function symbols and studying their complexity. We identify bidirectional ASP programs as an expressive such fragment that is useful, e.g., for reasoning about actions involving both the future and the past. We tightly characterize the computational complexity of bidirectional programs and of some of their subclasses, addressing the main reasoning tasks. Our results also imply that the recently introduced FDNC programs can be extended by inverse predicates while retaining decidability, but computational costs are unavoidably higher.

Introduction

Answer Set Programming (ASP) has established itself as a powerful paradigm for knowledge representation and reasoning. However, it traditionally operates under a "finiteness" constraint: most standard solvers prohibit the use of function symbols. While this ensures that reasoning remains decidable, it imposes significant modeling hurdles. Without function symbols, representing infinite domains—such as unbounded time horizons, recursive data structures like linked lists, or infinite sequences of actions—becomes nearly impossible.

Adding function symbols to ASP is not a trivial task; doing so generally renders the logic undecidable, meaning there is no guaranteed algorithm that can always find an answer. Previous research introduced fragments like FDNC programs to allow function symbols under strict conditions. However, FDNC only permitted "forward" reasoning (deriving properties of a complex term $f(x)$ from $x$). This paper introduces Bidirectional (BD) Answer Set Programs, a more expressive fragment that allows for both forward and backward reasoning while maintaining decidability.

The Bidirectional Framework

The core innovation of BD-programs is their ability to handle rules that reason in two directions. In temporal modeling, for instance, a forward rule might state that an action at time $t$ results in a state at time $t+1$. A backward rule, conversely, can reason about the past: "If a certain condition holds at time $t+1$, a specific prerequisite must have been true at time $t$."

To keep this expressive power from spiraling into undecidability, the authors impose specific syntactic restrictions. They define $t$-atoms, which restrict the structure of atoms to ensure that any stable model (the "answer" to the program) can be represented as a tree. Even if the tree is infinite, its structured nature allows for specialized algorithmic treatment.

Methodology: Automata and Reductions

The authors employ several sophisticated techniques to characterize the complexity of BD-programs:

  1. Core Program Reduction: They demonstrate that any complex BD-program can be reduced to a simplified "core" version consisting only of unary predicates and a single constant. This reduction preserves the essential properties of the program while making the mathematical analysis more tractable.
  2. 2-Way Alternating Tree Automata (2ATA): The primary tool for proving decidability is the 2ATA. Because these automata can move both up and down the branches of an infinite tree, they are uniquely suited to simulate the bidirectional rules of BD-programs. The problem of finding a stable model is essentially transformed into checking whether a specific 2ATA accepts any input.
  3. Splitting for Disjunction: For disjunctive programs—those allowing "OR" in the head of a rule—the authors use a "splitting" technique. This breaks down the complex task of checking minimal models into a series of simpler, non-disjunctive checks.

Complexity Characterization

The paper provides a comprehensive map of the computational costs associated with BD-programs. The complexity varies significantly based on whether the program is "normal" (no disjunction) or "disjunctive," and whether the number of arguments in a predicate (arity) is bounded.

Program Type Predicate Arity Complexity
Normal (No OR) Bounded EXPTIME-complete
Disjunctive (With OR) Bounded 2EXPTIME-complete
Normal Unbounded 2EXPTIME-complete
Disjunctive Unbounded 3EXPTIME-complete
Single Function Symbol Bounded PSPACE to EXPSPACE

These results show that while BD-programs are computationally demanding—jumping to 2EXPTIME or even 3EXPTIME in the most complex cases—they remain decidable, providing a formal upper bound for reasoning in these expressive fragments.

Significance and Future Directions

BD-programs represent a significant bridge between logic programming and other formalisms like Description Logics (DL). Specifically, the bidirectional nature of these programs allows them to naturally simulate "inverse roles" (e.g., if $x$ is the child of $y$, then $y$ is the parent of $x$), a common feature in web-ontology languages that was previously difficult to integrate into ASP with function symbols.

While the high computational complexity suggests that general-purpose solvers may struggle with very large BD-programs, this research lays the theoretical groundwork for more optimized, specialized algorithms. Future work aims to integrate these findings into practical ASP implementations and explore their utility in advanced database queries via "Datalog with function symbols."

Summary updated

BibTeX
@inproceedings{eiter2009bidirectional,
  author = {Thomas Eiter and Mantas Simkus},
  title = {{Bidirectional Answer Set Programs with Function Symbols}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2009},
  url = {https://openreview.net/forum?id=rJV2ONzdbr},
}
Figure