Skip to main content

Magic Sets and Their Application to Data Integration

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3363))

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

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Ullman, J.D.: Principles of Database and Knowledge Base Systems. Computer Science Press, Rockville (1989)

    Google Scholar 

  2. Gelfond, M., Lifschitz, V.: The Stable Model Semantics for Logic Programming. In: ICLP/SLP 1988, pp. 1070–1080. MIT Press, Cambridge (1988)

    Google Scholar 

  3. Bidoit, N., Froidevaux, C.: Negation by Default and Unstratifiable Logic Programs. Theoretical Computer Science 78, 85–112 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  4. Dantsin, E., Eiter, T., Gottlob, G., Voronkov, A.: Complexity and Expressive Power of Logic Programming. ACM Computing Surveys 33, 374–425 (2001)

    Article  Google Scholar 

  5. Bidoit, N., Froidevaux, C.: General Logical Databases and Programs: Default Logic Semantics and Stratification. Information and Computation 91, 15–54 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  6. Marek, V.W., Truszczyński, M.: Autoepistemic Logic. JACM 38, 588–619 (1991)

    Article  MATH  Google Scholar 

  7. Schlipf, J.: The Expressive Powers of Logic Programming Semantics. JCSS 51, 64–86 (1995); Abstract in Proc. PODS 1990, pp. 196–204

    MATH  MathSciNet  Google Scholar 

  8. 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)

    Google Scholar 

  9. Niemelä, I., Simons, P., Syrjänen, T.: Smodels: A System for Answer Set Programming. In: NMR 2000 (2000)

    Google Scholar 

  10. 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)

    Google Scholar 

  11. 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)

    Chapter  Google Scholar 

  12. 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)

    Google Scholar 

  13. 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)

    Google Scholar 

  14. Bravo, L., Bertossi, L.: Logic programming for consistently querying data integration systems. In: Proc. of IJCAI 2003, pp. 10–15 (2003)

    Google Scholar 

  15. Chomicki, J., Marcinkowski, J.: Minimal-Change Integrity Maintenance Using Tuple Deletions. Information and Computation (2004) (to appear)

    Google Scholar 

  16. Lifschitz, V., Turner, H.: Splitting a Logic Program. In: Van Hentenryck, P. (ed.) ICLP 1994, pp. 23–37. MIT Press, Cambridge (1994)

    Google Scholar 

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

    Article  Google Scholar 

  18. Dung, P.M.: On the Relations between Stable and Well-Founded Semantics of Logic Programs. Theoretical Computer Science 105, 7–25 (1992)

    Article  MATH  MathSciNet  Google Scholar 

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

    Article  MATH  MathSciNet  Google Scholar 

  20. Calì, A., Calvanese, D., De Giacomo, G., Lenzerini, M.: Data integration under integrity constraints. Information Systems 29, 147–163 (2004)

    Article  Google Scholar 

  21. 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)

    Google Scholar 

  22. 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 

  23. Mumick, I.S., Finkelstein, S.J., Pirahesh, H., Ramakrishnan, R.: Magic is relevant. In: SIGMOD Conference 1990, pp. 247–258 (1990)

    Google Scholar 

  24. Stuckey, P.J., Sudarshan, S.: Compiling query constraints. In: PODS 1994, pp. 56–67. ACM Press, New York (1994)

    Google Scholar 

  25. Ross, K.A.: Modular Stratification and Magic Sets for Datalog Programs with Negation. JACM 41, 1216–1266 (1994)

    Article  MATH  Google Scholar 

  26. 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)

    Article  MATH  MathSciNet  Google Scholar 

  27. 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)

    Chapter  Google Scholar 

  28. Behrend, A.: Soft stratification for magic set based query evaluation in deductive databases. In: PODS 2003, pp. 102–110. ACM Press, New York (2003)

    Chapter  Google Scholar 

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

    Google Scholar 

  30. 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)

    Google Scholar 

  31. Greco, G., Greco, S., Trubitsyna, I., Zumpano, E.: Optimization of Bound Disjunctive Queries with Constraints. TPLP (to appear (CoRR report cs.LO/0406013))

    Google Scholar 

  32. 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)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics