Skip to main content

Dynamic Magic Sets for Programs with Monotone Recursive Aggregates

  • Conference paper
Logic Programming and Nonmonotonic Reasoning (LPNMR 2011)

Part of the book series: Lecture Notes in Computer Science ((LNAI,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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Lobo, J., Minker, J., Rajasekar, A.: Foundations of Disjunctive Logic Programming. The MIT Press, Cambridge (1992)

    MATH  Google Scholar 

  2. Eiter, T., Gottlob, G., Mannila, H.: Disjunctive Datalog. ACM TODS 22(3), 364–418 (1997)

    Article  Google Scholar 

  3. Ricca, F., Grasso, G., Alviano, M., Manna, M., Lio, V., Iiritano, S., Leone, N.: Team-building with Answer Set Programming in the Gioia-Tauro Seaport. TPLP (2011) (to appear)

    Google Scholar 

  4. Manna, M., Ruffolo, M., Oro, E., Alviano, M., Leone, N.: The HiLeX System for Semantic Information Extraction. TLDKS(2011) (to appear)

    Google Scholar 

  5. Ricca, F., Alviano, M., Dimasi, A., Grasso, G., Ielpa, S.M., Iiritano, S., Manna, M., Leone, N.: A Logic–Based System for e-Tourism. FI 105, 35–55 (2010)

    MathSciNet  Google Scholar 

  6. Leone, N., Pfeifer, G., Faber, W., Eiter, T., Gottlob, G., Perri, S., Scarcello, F.: The DLV System for Knowledge Representation and Reasoning. ACM TOCL 7(3), 499–562 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  7. Janhunen, T., Niemelä, I., Simons, P., You, J.H.: Partiality and Disjunctions in Stable Model Semantics. In: KR 2000, April 12-15, pp. 411–419 (2000)

    Google Scholar 

  8. Lierler, Y.: Disjunctive Answer Set Programming via Satisfiability. In: Baral, C., Greco, G., Leone, N., Terracina, G. (eds.) LPNMR 2005. LNCS (LNAI), vol. 3662, pp. 447–451. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  9. Drescher, C., Gebser, M., Grote, T., Kaufmann, B., König, A., Ostrowski, M., Schaub, T.: Conflict-Driven Disjunctive Answer Set Solving. In: KR 2008, pp. 422–432. AAAI Press, Menlo Park (2008)

    Google Scholar 

  10. Kemp, D.B., Stuckey, P.J.: Semantics of Logic Programs with Aggregates. In: ISLP 1991, pp. 387–401. MIT Press, Cambridge (1991)

    Google Scholar 

  11. Denecker, M., Pelov, N., Bruynooghe, M.: Ultimate Well-Founded and Stable Semantics for Logic Programs with Aggregates. In: Codognet, P. (ed.) ICLP 2001. LNCS, vol. 2237, pp. 212–226. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  12. Dix, J., Osorio, M.: On Well-Behaved Semantics Suitable for Aggregation. In: ILPS 1997, Port Jefferson, N.Y (1997)

    Google Scholar 

  13. Simons, P., Niemelä, I., Soininen, T.: Extending and Implementing the Stable Model Semantics. AI 138, 181–234 (2002)

    MathSciNet  MATH  Google Scholar 

  14. Pelov, N., Truszczyński, M.: Semantics of disjunctive programs with monotone aggregates - an operator-based approach. In: NMR 2004, pp. 327–334 (2004)

    Google Scholar 

  15. Manna, M., Ricca, F., Terracina, G.: Consistent Query Answering via ASP from Different Perspectives: Theory and Practice. TPLP (2011) (to appear)

    Google Scholar 

  16. Ullman, J.D.: Principles of Database and Knowledge Base Systems, vol. 2. CS Press, Rockvillie (1989)

    Google Scholar 

  17. Bancilhon, F., Maier, D., Sagiv, Y., Ullman, J.D.: Magic Sets and Other Strange Ways to Implement Logic Programs. In: PODS 1986, pp. 1–16 (1986)

    Google Scholar 

  18. Beeri, C., Ramakrishnan, R.: On the power of magic. JLP 10(1-4), 255–259 (1991)

    Article  MathSciNet  MATH  Google Scholar 

  19. Kowalski, R.A.: Predicate Logic as Programming Language. In: IFIP Congress, pp. 569–574 (1974)

    Google Scholar 

  20. Greco, S.: Binding Propagation Techniques for the Optimization of Bound Disjunctive Queries. IEEE TKDE 15(2), 368–385 (2003)

    Google Scholar 

  21. Cumbo, C., Faber, W., Greco, G.: Improving Query Optimization for Disjunctive Datalog. In: APPIA-GULP-PRODE, pp. 252–262 (2003)

    Google Scholar 

  22. Faber, W., Greco, G., Leone, N.: Magic Sets and their Application to Data Integration. JCSS 73(4), 584–609 (2007)

    MathSciNet  MATH  Google Scholar 

  23. Gelfond, M., Lifschitz, V.: Classical Negation in Logic Programs and Disjunctive Databases. NGC 9, 365–385 (1991)

    Article  MATH  Google Scholar 

  24. Faber, W., Leone, N., Pfeifer, G.: Recursive aggregates in disjunctive logic programs: Semantics and complexity. In: Alferes, J.J., Leite, J. (eds.) JELIA 2004. LNCS (LNAI), vol. 3229, pp. 200–212. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  25. Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison-Wesley, Reading (1995)

    MATH  Google Scholar 

  26. Faber, W., Pfeifer, G., Leone, N., Dell’Armi, T., Ielpa, G.: Design and implementation of aggregate functions in the dlv system. TPLP 8(5-6), 545–580 (2008)

    MathSciNet  MATH  Google Scholar 

  27. Alviano, M., Faber, W., Leone, N.: Using unfounded sets for computing answer sets of programs with recursive aggregates. In: CILC 2007 (2007)

    Google Scholar 

  28. Alviano, M.: Dynamic Magic Sets for Disjunctive Datalog Programs. In: ICLP 2010. LIPIcs, vol. 7, pp. 226–235 (2010)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Alviano, M., Greco, G., Leone, N. (2011). Dynamic Magic Sets for Programs with Monotone Recursive Aggregates. In: Delgrande, J.P., Faber, W. (eds) Logic Programming and Nonmonotonic Reasoning. LPNMR 2011. Lecture Notes in Computer Science(), vol 6645. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-20895-9_14

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-20895-9_14

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-20894-2

  • Online ISBN: 978-3-642-20895-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics