Skip to main content

Magic Sets for the Bottom-Up Evaluation of Finitely Recursive Programs

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

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 5753))

Abstract

The support for function symbols in logic programming under answer set semantics allows to overcome some modeling limitations of traditional Answer Set Programming (ASP) systems, such as the inability of handling infinite domains. On the other hand, admitting function symbols in ASP makes inference undecidable in the general case. Lately, the research community is focusing on finding proper subclasses for which decidability of inference is guaranteed. The two major proposals, so far, are finitary programs and finitely-ground programs. These two proposals are somehow complementary: indeed, the former is conceived to allow decidable querying (by means of a top-down evaluation strategy), while the latter supports the computability of answer-sets (by means of a bottom-up evaluation strategy). One of the main advantages of finitely-ground programs is that they can be ”directly” evaluated by current ASP systems, which are based on a bottom-up computational model. However, there are also some interesting programs which are suitable for top-down query evaluation; but do not fall in the class of finitely-ground programs.

In this paper, we focus on disjunctive finitely-recursive positive (DFRP) programs. We present a proper adaptation of the magic-sets technique for DFRP programs, which ensures query equivalence under both brave and cautious reasoning. We show that, if the input program is DFRP, then its magic-set rewriting is guaranteed to be finitely ground. Thus, reasoning on DFRP programs turns out to be decidable, and we provide an effective method for its computation on the ASP system DLV.

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 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.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. Baral, C.: Knowledge Representation, Reasoning and Declarative Problem Solving. CUP (2003)

    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. Gelfond, M., Lifschitz, V.: Classical Negation in Logic Programs and Disjunctive Databases. NGC 9, 365–385 (1991)

    Article  MATH  Google Scholar 

  4. Lifschitz, V.: Answer Set Planning. In: ICLP 1999, pp. 23–37 (1999)

    Google Scholar 

  5. Marek, V.W., Truszczyński, M.: Stable Models and an Alternative Logic Programming Paradigm. In: The Logic Programming Paradigm – A 25-Year Perspective, pp. 375–398 (1999)

    Google Scholar 

  6. Syrjänen, T.: Omega-restricted logic programs. In: Eiter, T., Faber, W., Truszczyński, M. (eds.) LPNMR 2001. LNCS (LNAI), vol. 2173, p. 267. Springer, Heidelberg (2001)

    Google Scholar 

  7. Bonatti, P.A.: Reasoning with infinite stable models II: Disjunctive programs. In: Stuckey, P.J. (ed.) ICLP 2002. LNCS, vol. 2401, pp. 333–346. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  8. Bonatti, P.A.: Reasoning with infinite stable models. AI 156(1), 75–111 (2004)

    MathSciNet  MATH  Google Scholar 

  9. Simkus, M., Eiter, T.: FDNC: Decidable Non-monotonic Disjunctive Logic Programs with Function Symbols. In: Dershowitz, N., Voronkov, A. (eds.) LPAR 2007. LNCS (LNAI), vol. 4790, pp. 514–530. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  10. Lin, F., Wang, Y.: Answer Set Programming with Functions. In: KR 2008, Sydney, Australia, pp. 454–465. AAAI Press, Menlo Park (2008)

    Google Scholar 

  11. Cabalar, P.: Partial Functions and Equality in Answer Set Programming. In: Garcia de la Banda, M., Pontelli, E. (eds.) ICLP 2008. LNCS, vol. 5366, pp. 392–406. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  12. Calimeri, F., Cozza, S., Ianni, G., Leone, N.: Computable Functions in ASP: Theory and Implementation. In: Garcia de la Banda, M., Pontelli, E. (eds.) ICLP 2008. LNCS, vol. 5366, pp. 407–424. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  13. Baselice, S., Bonatti, P.A., Criscuolo, G.: On Finitely Recursive Programs. Tech. Report 0901.2850v1, arXiv.org (2009); To appear in TPLP (TPLP)

    Google Scholar 

  14. Bonatti, P.A.: Erratum to: Reasoning with infinite stable models. AI 172(15), 1833–1835 (2008)

    MATH  Google Scholar 

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

  16. Calimeri, F., Cozza, S., Ianni, G., Leone, N.: DLV-Complex, homepage (since 2008), http://www.mat.unical.it/dlv-complex

  17. Marano, M., Ianni, G., Ricca, F.: A Magic Set Implementation for Disjunctive Logic Programming with Function Symbols. Submitted to CILC 2009 (2009)

    Google Scholar 

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

    Google Scholar 

  19. Ullman, J.D.: Principles of Database and Knowledge Base Systems, vol. 2. Computer Science Press (1989)

    Google Scholar 

  20. Beeri, C., Ramakrishnan, R.: On the Power of Magic. In: PODS 1987, pp. 269–284. ACM, New York (1987)

    Google Scholar 

  21. Cumbo, C., Faber, W., Greco, G., Leone, N.: Enhancing the magic-set method for disjunctive datalog programs. In: Demoen, B., Lifschitz, V. (eds.) ICLP 2004. LNCS, vol. 3132, pp. 371–385. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  22. Van Gelder, A., Ross, K.A., Schlipf, J.S.: The Well-Founded Semantics for General Logic Programs. J. ACM 38(3), 620–650 (1991)

    MathSciNet  MATH  Google Scholar 

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

    Google Scholar 

  24. Naqvi, S., Tsur, S.: A logical language for data and knowledge bases. CS Press, NY (1989)

    Google Scholar 

  25. Schreye, D.D., Decorte, S.: Termination of Logic Programs: The Never-Ending Story. JLP 19/20, 199–260 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  26. Bossi, A., Cocco, N., Fabris, M.: Norms on Terms and their use in Proving Universal Termination of a Logic Program. Theoretical Computer Science 124(2), 297–328 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  27. Bruynooghe, M., Codish, M., Gallagher, J.P., Genaim, S., Vanhoof, W.: Termination analysis of logic programs through combination of type-based norms. ACM TOPLAS 29(2), 10 (2007)

    Article  Google Scholar 

  28. Behrend, A.: Soft stratification for magic set based query evaluation in deductive databases. In: PODS 2003, San Diego, CA, USA, pp. 102–110 (2003)

    Google Scholar 

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

    MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Calimeri, F., Cozza, S., Ianni, G., Leone, N. (2009). Magic Sets for the Bottom-Up Evaluation of Finitely Recursive Programs. In: Erdem, E., Lin, F., Schaub, T. (eds) Logic Programming and Nonmonotonic Reasoning. LPNMR 2009. Lecture Notes in Computer Science(), vol 5753. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-04238-6_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-04238-6_9

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-04237-9

  • Online ISBN: 978-3-642-04238-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics