Dynamic magic sets for programs with monotone recursive aggregates

  • Authors:
  • Mario Alviano;Gianluigi Greco;Nicola Leone

  • Affiliations:
  • Department of Mathematics, University of Calabria, Rende (CS), Italy;Department of Mathematics, University of Calabria, Rende (CS), Italy;Department of Mathematics, University of Calabria, Rende (CS), Italy

  • Venue:
  • LPNMR'11 Proceedings of the 11th international conference on Logic programming and nonmonotonic reasoning
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Disjunctive Logic Programming (DLP) is an extension of Datalog that allows for disjunction in rule head and nonmonotonic negation in bodies. All of the queries in the second level of the polynomial hierarchy can be expressed in this language. However, DLP does not allow for representing properties which involve sets of data in a natural way. Extending the language by introducing aggregate functions has been proposed in the literature to overcome this lack, then leading to the language DLPA,¬. In particular, DLPA,¬ allows for using recursive aggregates, which naturally arise in many practical application scenarios. An aggregate is recursive if its aggregate set depends on the evaluation of the aggregate itself. The evaluation of programs with aggregates is hard, especially when aggregates are recursive, optimization techniques are highly needed to make these programs usable in real-world applications. In this paper, we focus on the optimization of queries over programs with recursive aggregates. In particular, we design an extension of the Dynamic Magic Set (DMS) technique to programs with stratified negation and monotone recursive aggregates, and we demonstrate the correctness of the proposed technique. For assessing the effectiveness of the new technique, we consider a standard benchmark for recursive aggregates, referred to as Company Controls, along with a couple of benchmarks involving aggregates over the WordNet database. Experimental results confirm the effectiveness of our technique.