Dynamic Magic Sets for Programs with Monotone Recursive Aggregates

  • Mario Alviano
  • Gianluigi Greco
  • Nicola Leone
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6645)

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 DLP\(^{\mathcal{A},\neg}\). In particular, DLP\({^{\mathcal{A},\neg}}\) 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.

Keywords

Disjunctive Logic Programming recursive aggregates Magic Sets 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Mario Alviano
    • 1
  • Gianluigi Greco
    • 1
  • Nicola Leone
    • 1
  1. 1.Department of MathematicsUniversity of CalabriaRendeItaly

Personalised recommendations