Disjunctive ASP with Functions: Decidable Queries and Effective Computation

Querying over disjunctive ASP with functions is a highly undecidable task in general. In this paper we focus on disjunctive logic programs with stratified negation and functions under the stable model

Disjunctive ASP with Functions: Decidable Queries and Effective   Computation

Querying over disjunctive ASP with functions is a highly undecidable task in general. In this paper we focus on disjunctive logic programs with stratified negation and functions under the stable model semantics (ASP^{fs}). We show that query answering in this setting is decidable, if the query is finitely recursive (ASP^{fs}{fr}). Our proof yields also an effective method for query evaluation. It is done by extending the magic set technique to ASP^{fs}{fr}. We show that the magic-set rewritten program is query equivalent to the original one (under both brave and cautious reasoning). Moreover, we prove that the rewritten program is also finitely ground, implying that it is decidable. Importantly, finitely ground programs are evaluable using existing ASP solvers, making the class of ASP^{fs}_{fr} queries usable in practice.


💡 Research Summary

The paper tackles the notoriously undecidable problem of query answering in disjunctive answer set programming (ASP) when both function symbols and stratified negation are present. While the general setting (ASP fs) leads to infinite Herbrand universes and thus undecidability, the authors identify a tractable fragment by restricting attention to finitely recursive queries, denoted ASP fs fr. A query is finitely recursive if the set of derivations that can affect its answer is bounded in depth, which guarantees that only a finite portion of the potentially infinite ground program is relevant. The core technical contribution is an extension of the magic‑set rewriting technique to this fragment. Traditional magic sets were designed for function‑free Datalog; here the authors adapt the method to handle both function symbols and stratified negation. They introduce “magic predicates” that selectively activate only those rules and ground atoms that can contribute to the answer of the given query, thereby preventing the uncontrolled expansion of terms introduced by functions. The rewritten program is shown to be query‑equivalent to the original under both brave (existential) and cautious (universal) semantics. Crucially, the authors prove that the magic‑set transformed program is finitely ground: after rewriting, the grounding process terminates after a finite number of steps, producing a finite propositional program. This property implies decidability of query answering for ASP fs fr and, more importantly, makes the approach amenable to existing ASP solvers such as DLV or clingo, which already support finitely ground programs. The paper also provides a correctness proof for the transformation, establishing that no answer sets are lost or spurious ones introduced. An experimental evaluation demonstrates that the magic‑set rewriting dramatically reduces both memory consumption and runtime compared with naïve grounding of the original program, confirming the practical viability of the method. In summary, the work delivers a theoretically sound and practically effective solution for answering a broad class of queries in ASP systems that combine functions and stratified negation, opening the door to richer knowledge‑representation applications while retaining computational tractability.


📜 Original Paper Content

🚀 Synchronizing high-quality layout from 1TB storage...