TL;DR
This paper introduces "DLP*4", an extension of Disjunctive Logic Programming (DLP) that incorporates aggregate functions (like sum, count, min, max). This extension allows for more natural and concise representation of complex properties, without increasing the computational complexity of reasoning. The authors provide a formal semantics, an implementation in the DLV system, and experimental results demonstrating significant performance improvements.
What Problem Does This Paper Address?
Disjunctive Logic Programming (DLP) is a powerful formalism capable of expressing properties decidable within the $E^P$ complexity class. However, certain "real-world" properties, particularly those involving arithmetic operations on sets of elements (e.g., calculating sums, counts, or averages), are difficult to express naturally and efficiently in standard DLP. For instance, checking if the total salary of a team exceeds a budget requires complex, recursive encodings that are both unnatural and computationally inefficient. This paper addresses this gap by extending DLP with aggregate functions, aiming to simplify knowledge representation and improve computational efficiency for such problems.
Methods
The core contribution is the extension of DLP with aggregate functions, creating the "DLP4" language. The authors formally define the syntax and semantics of DLP4, introducing aggregate atoms of the form Lg <1 f(S) <2 Rg, where f is an aggregate function (#count, #min, #max, #sum, #times) and S is a symbolic set. Symbolic sets are defined as {Vars: Conj}, allowing for the representation of sets of tuples.
Key methodological aspects include:
- Formal Semantics: A truth valuation for aggregate atoms, literals, and rules is defined, extending standard DLP semantics.
- Syntactic Restrictions: The language imposes safety and aggregate-stratification restrictions to ensure well-defined semantics and prevent unclear behavior.
- Implementation in DLV: The DLP*4 language is implemented within the existing DLV system. This involved modifying DLV's modules, particularly the Intelligent Grounding and Model Generator.
- Optimization Techniques: The implementation incorporates techniques like standardization of aggregate atoms, bottom-up instantiation respecting stratification, duplicate set recognition (hashing), and an extended Deterministic Consequences operator for efficient model generation.
Datasets
Not discussed in the paper. The paper uses benchmark problems for evaluation, specifically "Timetabling" and "Seating," which are described as real-world instances from their university.
Key Insights and Ideas
- Bridging the Expressiveness Gap: Aggregate functions provide a natural way to express common computational patterns (sums, counts) that were previously cumbersome in DLP, significantly improving knowledge representation.
- No Computational Complexity Increase: A crucial finding is that adding aggregate functions to DLP does not increase the worst-case computational complexity of reasoning tasks (Brave and Cautious Reasoning remain $\Sigma_2^P$-complete and $\Pi_2^P$-complete, respectively). This is a significant theoretical result.
- Efficiency Gains Through Succinctness: The more concise DLP*4 encodings lead to smaller ground instantiations. Since DLV's evaluation complexity is often exponential in the size of the instantiation, this succinctness translates directly into substantial performance improvements.
- Symbolic Sets for Sets and Multisets: The formalism elegantly handles both pure sets (e.g., counting distinct skills) and multisets (e.g., summing salaries of multiple employees with the same salary) through the definition of symbolic sets.
Key Results
- Performance Improvement: Experiments on Timetabling and Seating problems showed that DLV4 significantly outperforms standard DLV. For Timetabling, execution times were an order of magnitude lower, and DLV4 solved instances that DLV could not. For Seating, the difference was even more pronounced, with DLV*4 solving much larger instances.
- Instantiation Size Reduction: The ground instantiation size for DLV4 encodings was considerably smaller than for standard DLP encodings, explaining the performance gains. For example, in the Timetabling experiment with 9 groups, the instantiation size for DLV4 was 74,027, compared to 618,23 for DLV.
- Theoretical Complexity Maintained: Theorems 5 and 6 formally establish that Brave Reasoning on ground DLP*4 programs is $\Sigma_2^P$-complete, and Cautious Reasoning is $\Pi_2^P$-complete, matching the complexity of standard DLP.
Limitations and Future Work
- Limitations:
- The current implementation does not support #sum and #times applied over empty sets returning 0 and 1 respectively in all cases (though this is noted as a minor implementation detail).
- The paper notes that aggregate atoms cannot occur in the heads of rules, a feature present in other systems like Smodels that offers powerful KR capabilities but can lead to semantic issues.
- The current aggregate functions are limited to specific arithmetic operations; more general aggregates are not yet supported.
- Future Work:
- Introduction of further aggregate operators (e.g., #any, #avg).
- Relaxation of syntactic restrictions (safety and aggregate-stratification).
- Design of additional optimization techniques and heuristics for further efficiency improvements.
- Investigating the connection to 4-valued logics and approximating operators for aggregate semantics.
Summary updated