Abstract
As a primary means for representing and reasoning about knowledge, Answer Set Programming (ASP) has been applying in many areas such as planning, decision making, fault diagnosing and increasingly prevalent e-service. Based on the stable model semantics of logic programming, ASP can be used to solve various combinatorial search problems by finding the answer sets of logic programs which declaratively describe the problems. It's not an easy task to compute answer sets of a logic program using Gelfond and Lifschitz's definition directly. In this paper, we show some results on characterization of answer sets of a logic program with constraints, and propose a way to split a program into several non-intersecting parts step by step, thus the computation of answer sets for every subprogram becomes relatively easy. To instantiate our splitting computation theory, an example about personalized product configuration in e-retailing is given to show the effectiveness of our method.
Introduction
Answer Set Programming (ASP) has emerged as a powerful declarative paradigm for knowledge representation and reasoning. By leveraging stable model semantics, ASP allows developers to describe complex combinatorial problems—such as planning, fault diagnosis, and decision-making—through logic programs. However, the computational cost of finding answer sets is significant; the task is generally co-NP-complete.
While theoretical frameworks for "splitting" programs exist (notably the work of Lifschitz and Turner), they often rely on the existence of a "splitting set" that must be identified or guessed. This paper addresses the lack of constructive, computable methods to automatically divide a program into manageable chunks. We propose a stepwise splitting method that algorithmically partitions a large logic program into smaller, non-intersecting subprograms, thereby reducing the search space and improving computational efficiency.
Theoretical Framework
The proposed approach moves from theoretical "guessing" to algorithmic "computing" by introducing two primary theoretical pillars:
- The $\Lambda$-operator: This operator is used to characterize the positive bodies of rules that can be derived from facts in a stepwise fashion. It allows for the identification of literals that are necessarily true based on the current state of the program.
- Compatibility: This concept defines a necessary condition for the negative bodies of rules. It ensures that the heads of rules are disjoint from their negative bodies and that they satisfy all program constraints, maintaining the integrity of the stable model.
The Stepwise Splitting Algorithm
The core of our methodology is the Stepwise Splitting Algorithm, which iteratively identifies subprograms ($\Pi_i$) that can be solved independently. The algorithm utilizes three key functions:
BASIC(Π): Identifies the fundamental rules, including facts and rules without negation, which form the program's foundation.T_Π: A monotonic function that computes the logical consequences of these basic rules.SPLITTING(Π): The main routine that partitions the remaining rules into a sequence of subprograms based on the dependencies established by the previous functions.
The mathematical validity of this approach is established in Theorem 5, which proves that a program has an answer set $S$ if and only if there exists a finer splitting where $S$ is the union of the answer sets of each individual subprogram.
Complexity and Efficiency
The primary motivation for splitting is the reduction of computational complexity. For a logic program $\Pi$, the complexity of finding answer sets is typically $O(2^{|\Pi|})$. By partitioning the program into $n$ subprograms, the complexity is reduced to $O(\sum_{i=1}^{n} 2^{|\Pi_i|})$. Since the exponent is tied to the size of the smaller subprograms rather than the entire rule base, the total computation time is significantly decreased, especially for large-scale applications.
Application: Personalized PC Configuration
To demonstrate the effectiveness of the stepwise splitting theory, we apply it to a personalized product configuration scenario in e-retailing. In this example, a system must select components (CPU, mainboard, memory) based on customer preferences while adhering to technical constraints (e.g., specific CPUs only working with specific mainboards).
The algorithm successfully splits the complex, interdependent rules into a sequence:
- $\Pi_0$: Establishes basic facts and available components.
- $\Pi_1$: Applies customer preferences and selections.
- $\Pi_2$: Filters out invalid configurations using constraints.
This structured approach allows the system to handle incomplete knowledge—such as a customer having no preference for a specific component—by generating multiple valid answer sets (configurations) efficiently. Furthermore, the method demonstrates how constraints can prune the search space early by eliminating invalid subprogram branches.
Conclusion and Future Work
This paper provides a rigorous, constructive method for splitting ASP programs, moving beyond theoretical existence proofs to a computable algorithm. By reducing the search space through stepwise partitioning, we enable more efficient reasoning in complex domains like e-commerce.
Future research will focus on integrating this algorithm into high-performance ASP solvers such as Clingo or DLV. Additionally, we aim to apply stepwise splitting to other domains characterized by incomplete knowledge and the "frame problem," such as software diagnosis and alias analysis.
Summary updated