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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Lobo, J., Minker, J., Rajasekar, A.: Foundations of Disjunctive Logic Programming. The MIT Press, Cambridge (1992)
Eiter, T., Gottlob, G., Mannila, H.: Disjunctive Datalog. ACM TODS 22(3), 364–418 (1997)
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)
Manna, M., Ruffolo, M., Oro, E., Alviano, M., Leone, N.: The HiLeX System for Semantic Information Extraction. TLDKS(2011) (to appear)
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)
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)
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)
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)
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)
Kemp, D.B., Stuckey, P.J.: Semantics of Logic Programs with Aggregates. In: ISLP 1991, pp. 387–401. MIT Press, Cambridge (1991)
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)
Dix, J., Osorio, M.: On Well-Behaved Semantics Suitable for Aggregation. In: ILPS 1997, Port Jefferson, N.Y (1997)
Simons, P., Niemelä, I., Soininen, T.: Extending and Implementing the Stable Model Semantics. AI 138, 181–234 (2002)
Pelov, N., Truszczyński, M.: Semantics of disjunctive programs with monotone aggregates - an operator-based approach. In: NMR 2004, pp. 327–334 (2004)
Manna, M., Ricca, F., Terracina, G.: Consistent Query Answering via ASP from Different Perspectives: Theory and Practice. TPLP (2011) (to appear)
Ullman, J.D.: Principles of Database and Knowledge Base Systems, vol. 2. CS Press, Rockvillie (1989)
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)
Beeri, C., Ramakrishnan, R.: On the power of magic. JLP 10(1-4), 255–259 (1991)
Kowalski, R.A.: Predicate Logic as Programming Language. In: IFIP Congress, pp. 569–574 (1974)
Greco, S.: Binding Propagation Techniques for the Optimization of Bound Disjunctive Queries. IEEE TKDE 15(2), 368–385 (2003)
Cumbo, C., Faber, W., Greco, G.: Improving Query Optimization for Disjunctive Datalog. In: APPIA-GULP-PRODE, pp. 252–262 (2003)
Faber, W., Greco, G., Leone, N.: Magic Sets and their Application to Data Integration. JCSS 73(4), 584–609 (2007)
Gelfond, M., Lifschitz, V.: Classical Negation in Logic Programs and Disjunctive Databases. NGC 9, 365–385 (1991)
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)
Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison-Wesley, Reading (1995)
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)
Alviano, M., Faber, W., Leone, N.: Using unfounded sets for computing answer sets of programs with recursive aggregates. In: CILC 2007 (2007)
Alviano, M.: Dynamic Magic Sets for Disjunctive Datalog Programs. In: ICLP 2010. LIPIcs, vol. 7, pp. 226–235 (2010)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)