Skip to main content

Incremental Evaluation of Tabled Prolog: Beyond Pure Logic Programs

  • Conference paper
Practical Aspects of Declarative Languages (PADL 2006)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 3819))

Included in the following conference series:

Abstract

Tabling, or memoization, enables incremental evaluation of logic programs. When the rules or facts of a program change, we need to recompute only those results that are affected by the changes. The current algorithms for incrementally maintaining memo tables treat insertion of facts/rules differently from their deletion. Hence these techniques cannot be directly applied for incremental evaluation of arbitrary tabled programs, especially those involving Prolog builtins such as findall, other aggregation operations, or non-stratified negation. In this paper, we explore a simpler incremental evaluation algorithm that, based on the dynamic call graph, invalidates and re-evaluates entire calls. The algorithm is agnostic to whether a dependency adds or removes answers from tables, and hence can be applied uniformly to programs with negation, even when the negation is implicit (as is the case with certain aggregation operations). We find that the call-based algorithm is very effective in examples where the call dependencies are largely acyclic (e.g. dynamic programming examples) and is moderately effective when the dependencies contain independent cyclic components (e.g. data flow analysis problems). This is the first practical algorithm to handle all legal tabled logic programs for which incremental evaluation is meaningful.

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. Acar, U.A., Blelloch, G.E., Harper, R.: Adaptive functional programming. In: POPL, pp. 247–259. ACM Press, New York (2002)

    Google Scholar 

  2. Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: principles, techniques, and tools, pp. 585–718. Addison-Wesley, Reading (1986)

    Google Scholar 

  3. Anderson, L.O.: Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, Unversity of Copenhagen (1994)

    Google Scholar 

  4. Balmin, A., Papakonstantinou, Y., Vianu, V.: Incremental validation of xml documents. ACM Trans. Database Syst. 29(4), 710–751 (2004)

    Article  Google Scholar 

  5. Chen, W., Swift, T., Warren, D.S.: Efficient implementation of general logical queries. JLP (1995)

    Google Scholar 

  6. Chen, W., Warren, D.S.: Tabled evaluation with delaying for general logic programs. JACM 43(1), 20–74 (1996)

    Article  MATH  MathSciNet  Google Scholar 

  7. Dawson, S., Ramakrishnan, C.R., Warren, D.S.: Practical program analysis using general purpose logic programming systems — a case study. In: ACM PLDI, pp. 117–126 (1996)

    Google Scholar 

  8. Freire, J., Swift, T., Warren, D.S.: Beyond depth-first: Improving tabled logic programs through alternative scheduling strategies. In: PLILP, pp. 243–258 (1996)

    Google Scholar 

  9. Guo, H., Gupta, G.: A simple scheme for implementing tabled logic programming systems based on dynamic reordering of alternatives. In: ICLP, pp. 181–196. Springer, Heidelberg (2001)

    Google Scholar 

  10. Gupta, A., Mumick, I.: Maintenance of materialized views: Problems, techniques, and appfications. IEEE Data Engineering Bulletin 18(2), 3–18 (1995)

    Google Scholar 

  11. Gupta, A., Mumick, I.S., Subrahmanian, V.S.: Maintaining views incrementally. In: SIGMOD, pp. 157–166 (1993)

    Google Scholar 

  12. Hermenegildo, M., Puebla, G., Marriott, K., Stuckey, P.J.: Incremental analysis of constraint logic programs. ACM Trans. Program. Lang. Syst. 22(2), 187–223 (2000)

    Article  Google Scholar 

  13. Hermenegildo, M.V., Puebla, G., Marriott, K., Stuckey, P.J.: Incremental evaluation of tabled logic programs. In: ICLP, pp. 797–811. MIT Press, Cambridge (1995)

    Google Scholar 

  14. Mayol, E., Teniente, E.: A survey of current methods for integrity constraint maintenance and view updating. In: ER Workshops, pp. 62–73 (1999)

    Google Scholar 

  15. PAF. Prolangs analysis framework. Available at, http://www.prolangs.rutgers.edu/public.html

  16. Pollock, L.L., Soffa, M.L.: An incremental version of iterative data flow analysis. IEEE Trans. Softw. Eng. 15(12), 1537–1549 (1989)

    Article  Google Scholar 

  17. Puebla, G., Hermenegildo, M.V.: Optimized algorithms for incremental analysis of logic programs. In: SAS, pp. 270–284 (1996)

    Google Scholar 

  18. Ramakrishnan, C.R., et al.: XMC: A logic-programming-based verification toolset. In: Emerson, E.A., Sistla, A.P. (eds.) CAV 2000. LNCS, vol. 1855, pp. 576–580. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  19. Reps, T., Teitelbaum, T., Demers, A.: Incremental context-dependent analysis for language-based editors. TOPLAS 5(3), 449–477 (1983)

    Article  Google Scholar 

  20. Rocha, R., Silva, F., Costa, V.S.: YapTab: A Tabling Engine Designed to Support Parallelism. In: Workshop on Tabling in Parsing and Deduction (2000)

    Google Scholar 

  21. Saha, D., Ramakrishnan, C.R.: Incremental evaluation of tabled logic programs. In: Palamidessi, C. (ed.) ICLP 2003. LNCS, vol. 2916, pp. 392–406. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  22. Saha, D., Ramakrishnan, C.R.: Incremental and demand-driven points-to analysis using logic programming. In: Principles and Practice of Declarative Programming (2005)

    Google Scholar 

  23. Saha, D., Ramakrishnan, C.R.: A practical framework for incremental evaluation (2005), Available at http://www.lmc.cs.sunysb.edu/~dsaha/callg

  24. Saha, D., Ramakrishnan, C.R.: Symbolic support graph: A space efficient data structure for incremental tabled evaluation. In: Gabbrielli, M., Gupta, G. (eds.) ICLP 2005. LNCS, vol. 3668, pp. 235–249. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  25. Sharir, M.: A strong connectivity algorithm and its application in data flow analysis. Computer and Mathemetics with Applications 7(1), 67–72 (1981)

    Article  MATH  MathSciNet  Google Scholar 

  26. Sokolsky, O.V., Smolka, S.A.: Incremental model checking in the modal mu-calculus. In: Dill, D.L. (ed.) CAV 1994. LNCS, vol. 818, pp. 351–363. Springer, Heidelberg (1994)

    Google Scholar 

  27. Tamaki, H., Sato, T.: OLDT resolution with tabulation. In: ICLP, pp. 84–98 (1986)

    Google Scholar 

  28. XSB. The XSB logic programming system, Available at http://xsb.sourceforge.net

  29. Yur, J., Ryder, B.G., Landi, W.: An incremental flow- and context-sensitive pointer aliasing analysis. In: ICSE, pp. 442–451 (1999)

    Google Scholar 

  30. Zhou, N., Shen, Y., Yuan, L., You, J.: Implementation of a linear tabling mechanism. Journal of Functional and Logic Programming 2001(10) (October 2001)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Saha, D., Ramakrishnan, C.R. (2005). Incremental Evaluation of Tabled Prolog: Beyond Pure Logic Programs. In: Van Hentenryck, P. (eds) Practical Aspects of Declarative Languages. PADL 2006. Lecture Notes in Computer Science, vol 3819. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11603023_15

Download citation

  • DOI: https://doi.org/10.1007/11603023_15

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-30947-5

  • Online ISBN: 978-3-540-31685-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics