Abstract
We propose a generalization of the well-known Magic Sets technique to Datalog¬ programs with (possibly unstratified) negation under stable model semantics. Our technique produces a new program whose evaluation is generally more efficient (due to a smaller instantiation), while preserving soundness under cautious reasoning. Importantly, if the original program is consistent, then full query-equivalence is guaranteed for both brave and cautious reasoning, which turn out to be sound and complete.
In order to formally prove the correctness of our Magic Sets transformation, we introduce a novel notion of modularity for Datalog¬ under the stable model semantics, which is relevant per se. We prove that a module can be evaluated independently from the rest of the program, while preserving soundness under cautious reasoning. For consistent programs, both soundness and completeness are guaranteed for brave reasoning and cautious reasoning as well. Our Magic Sets optimization constitutes an effective method for enhancing the performance of data-integration systems in which query-answering is carried out by means of cautious reasoning over Datalog¬ programs. In fact, preliminary results of experiments in the EU project INFOMIX, show that Magic Sets are fundamental for the scalability of the system.
This work was supported by the European Commission under projects IST-2002-33570 INFOMIX, and IST-2001-37004 WASP.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Ullman, J.D.: Principles of Database and Knowledge Base Systems. Computer Science Press, Rockville (1989)
Gelfond, M., Lifschitz, V.: The Stable Model Semantics for Logic Programming. In: ICLP/SLP 1988, pp. 1070–1080. MIT Press, Cambridge (1988)
Bidoit, N., Froidevaux, C.: Negation by Default and Unstratifiable Logic Programs. Theoretical Computer Science 78, 85–112 (1991)
Dantsin, E., Eiter, T., Gottlob, G., Voronkov, A.: Complexity and Expressive Power of Logic Programming. ACM Computing Surveys 33, 374–425 (2001)
Bidoit, N., Froidevaux, C.: General Logical Databases and Programs: Default Logic Semantics and Stratification. Information and Computation 91, 15–54 (1991)
Marek, V.W., Truszczyński, M.: Autoepistemic Logic. JACM 38, 588–619 (1991)
Schlipf, J.: The Expressive Powers of Logic Programming Semantics. JCSS 51, 64–86 (1995); Abstract in Proc. PODS 1990, pp. 196–204
Leone, N., Pfeifer, G., Faber, W., Eiter, T., Gottlob, G., Perri, S., Scarcello, F.: The DLV System for Knowledge Representation and Reasoning. In: ACM TOCL (2004) (to appear)
Niemelä, I., Simons, P., Syrjänen, T.: Smodels: A System for Answer Set Programming. In: NMR 2000 (2000)
Arenas, M., Bertossi, L.E., Chomicki, J.: Specifying and querying database repairs using logic programs with exceptions. In: Proc. of FQAS 2000, pp. 27–41. Springer, Heidelberg (2000)
Greco, G., Greco, S., Zumpano, E.: A logic programming approach to the integration, repairing and querying of inconsistent databases. In: Codognet, P. (ed.) ICLP 2001. LNCS, vol. 2237, pp. 348–364. Springer, Heidelberg (2001)
Barceló, P., Bertossi, L.: Repairing databases with annotated predicate logic. In: Proc. the 10th Int. Workshop on Non-Monotonic Reasoning (NMR 2002), pp. 160–170 (2002)
Calì, A., Lembo, D., Rosati, R.: Query rewriting and answering under constraints in data integration systems. In: Proc. of IJCAI 2003, pp. 16–21 (2003)
Bravo, L., Bertossi, L.: Logic programming for consistently querying data integration systems. In: Proc. of IJCAI 2003, pp. 10–15 (2003)
Chomicki, J., Marcinkowski, J.: Minimal-Change Integrity Maintenance Using Tuple Deletions. Information and Computation (2004) (to appear)
Lifschitz, V., Turner, H.: Splitting a Logic Program. In: Van Hentenryck, P. (ed.) ICLP 1994, pp. 23–37. MIT Press, Cambridge (1994)
Eiter, T., Gottlob, G., Mannila, H.: Disjunctive Datalog. ACM TODS 22, 364–418 (1997)
Dung, P.M.: On the Relations between Stable and Well-Founded Semantics of Logic Programs. Theoretical Computer Science 105, 7–25 (1992)
Beeri, C., Ramakrishnan, R.: On the power of magic. JLP 10, 255–259 (1991)
Calì, A., Calvanese, D., De Giacomo, G., Lenzerini, M.: Data integration under integrity constraints. Information Systems 29, 147–163 (2004)
Calì, A., Lembo, D., Rosati, R.: On the decidability and complexity of query answering over inconsistent and incomplete databases. In: PODS 2003, pp. 260–271 (2003)
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)
Mumick, I.S., Finkelstein, S.J., Pirahesh, H., Ramakrishnan, R.: Magic is relevant. In: SIGMOD Conference 1990, pp. 247–258 (1990)
Stuckey, P.J., Sudarshan, S.: Compiling query constraints. In: PODS 1994, pp. 56–67. ACM Press, New York (1994)
Ross, K.A.: Modular Stratification and Magic Sets for Datalog Programs with Negation. JACM 41, 1216–1266 (1994)
Kemp, D.B., Srivastava, D., Stuckey, P.J.: Bottom-up evaluation and query optimization of well-founded models. Theoretical Computer Science 146, 145–184 (1995)
Seshadri, P., Hellerstein, J.M., Pirahesh, H., Leung, T.Y.C., Ramakrishnan, R., Srivastava, D., Stuckey, P.J., Sudarshan, S.: Cost-based optimization for magic: Algebra and implementation. In: SIGMOD Conference 1996, pp. 435–446. ACM Press, New York (1996)
Behrend, A.: Soft stratification for magic set based query evaluation in deductive databases. In: PODS 2003, pp. 102–110. ACM Press, New York (2003)
Greco, S.: Binding Propagation Techniques for the Optimization of Bound Disjunctive Queries. IEEE TKDE 15, 368–385 (2003)
Cumbo, C., Faber, W., Greco, G.: Enhancing the magic-set method for disjunctive datalog programs. In: Proc. of ICLP 2004, Saint-Malo, France (2004) (forthcoming)
Greco, G., Greco, S., Trubitsyna, I., Zumpano, E.: Optimization of Bound Disjunctive Queries with Constraints. TPLP (to appear (CoRR report cs.LO/0406013))
Eiter, T., Fink, M., Greco, G., Lembo, D.: Efficient evaluation of logic programs for querying data integration systems. In: Palamidessi, C. (ed.) ICLP 2003. LNCS, vol. 2916, pp. 163–177. Springer, Heidelberg (2003)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Faber, W., Greco, G., Leone, N. (2004). Magic Sets and Their Application to Data Integration. In: Eiter, T., Libkin, L. (eds) Database Theory - ICDT 2005. ICDT 2005. Lecture Notes in Computer Science, vol 3363. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30570-5_21
Download citation
DOI: https://doi.org/10.1007/978-3-540-30570-5_21
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-24288-8
Online ISBN: 978-3-540-30570-5
eBook Packages: Computer ScienceComputer Science (R0)