Skip to main content

A Local Algorithm for Incremental Evaluation of Tabled Logic Programs

  • Conference paper

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

Abstract

This paper considers the problem of efficient incremental maintenance of memo tables in a tabled logic programming system. Most existing techniques for this problem consider insertion and deletion of facts as primitive changes, and treat update as deletion of the old version followed by insertion of the new version. They handle insertion and deletion using independent algorithms, consequently performing many redundant computations when processing updates. In this paper, we present a local algorithm for handling updates to facts. The key idea is to interleave the propagation of deletion and insertion operations generated by the updates through a dynamic (and potentially cyclic) dependency graph. The dependency graph used in our algorithm is more general than that used in algorithms previously proposed for incremental evaluation of attribute grammars and functional programs. Nevertheless, our algorithm’s complexity matches that of the most efficient algorithms built for these specialized cases. We demonstrate the effectiveness of our algorithm using data-flow analysis and parsing examples.

This research was supported in part by NSF grants CCR-0205376 and CCR-0311512.

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. 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. Alpern, B., Hoover, R., Rosen, B.K., Sweeney, P.F., Zadeck, F.K.: Incremental evaluation of computational circuits. In: Symposium on Discrete algorithms, pp. 32–42 (1990)

    Google Scholar 

  4. Bol, R., Degerstadt, L.: Tabulated resolution for well-founded semantics. In: ILPS (1993)

    Google Scholar 

  5. Chen, W., Swift, T., Warren, D.S.: Efficient implementation of general logical queries. In: 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. Conway, C.L., Namjoshi, K.S., Dams, D., Edwards, S.A.: Incremental Algorithms for Inter-procedural Analysis of Safety Properties. In: Etessami, K., Rajamani, S.K. (eds.) CAV 2005. LNCS, vol. 3576, pp. 449–461. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

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

  9. Demers, A., Reps, T., Teitelbaum, T.: Incremental evaluation for attribute grammars with application to syntax-directed editors. In: POPL, pp. 105–116. ACM Press, New York (1981)

    Google Scholar 

  10. Dietz, P., Sleator, D.: Two algorithms for maintaining order in a list. In: STOC, pp. 365–372. ACM Press, New York (1987)

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

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

  14. Jones, L.G.: Efficient evaluation of circular attribute grammars. ACM Trans. Program. Lang. Syst. 12(3), 429–462 (1990)

    Article  Google Scholar 

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

  16. Paige, R., Koenig, S.: Finite differencing of computable expressions. TOPLAS 4(3), 402–454 (1982)

    Article  MATH  Google Scholar 

  17. Pearce, D.J., Kelly, P.H.J.: Online algorithms for topological order and strongly connected components. Technical report, Imperial College, London (2003)

    Google Scholar 

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

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

    Google Scholar 

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

  21. Reps, T.: Optimal-time incremental semantic analysis for syntax-directed editors. In: POPL, pp. 169–176. ACM Press, New York (1982)

    Google Scholar 

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

  23. Saha, D., Ramakrishnan, C.R.: Incremental and demand-driven points-to analysis using logic programming. In: PPDP. ACM Press, New York (2005)

    Google Scholar 

  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. Saha, D., Ramakrishnan, C.R.: Incremental Evaluation of Tabled Prolog: Beyond Pure Logic Programs. In: Van Hentenryck, P. (ed.) PADL 2006. LNCS, vol. 3819, pp. 215–229. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  26. Saha, D., Ramakrishnan, C.R.: A local algorithm for incremental evaluation of logic programs. Technical report, Stony Brook University (2006); available at: http://www.lmc.cs.sunysb.edu/~dsaha/local

  27. Seljee, R., de Swart, H.: Three types of redundancy in integrity checking; an optimal solution. Journal of Data and Knowledge Enigineering 30, 135–151 (1999)

    Article  MATH  Google Scholar 

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

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

    Google Scholar 

  30. Walz, J.A., Johnson, G.F.: Incremental evaluation for a general class of circular attribute grammars. In: PLDI, pp. 209–221. ACM Press, New York (1988)

    Google Scholar 

  31. XSB. The XSB logic programming system. available at: http://xsb.sourceforge.net

  32. Yang, G., Kifer, M.: FLORA: Implementing an Efficient DOOD System Using a Tabling Logic Engine. In: Palamidessi, C., Moniz Pereira, L., Lloyd, J.W., Dahl, V., Furbach, U., Kerber, M., Lau, K.-K., Sagiv, Y., Stuckey, P.J. (eds.) CL 2000. LNCS (LNAI), vol. 1861, pp. 1078–1093. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

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

    Google Scholar 

  34. Yur, J., Ryder, B.G., Landi, W., Stocks, P.: Incremental analysis of side effects for C software system. In: ICSE, pp. 422–432 (1997)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Saha, D., Ramakrishnan, C.R. (2006). A Local Algorithm for Incremental Evaluation of Tabled Logic Programs. In: Etalle, S., Truszczyński, M. (eds) Logic Programming. ICLP 2006. Lecture Notes in Computer Science, vol 4079. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11799573_7

Download citation

  • DOI: https://doi.org/10.1007/11799573_7

  • Publisher Name: Springer, Berlin, Heidelberg

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

  • Online ISBN: 978-3-540-36636-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics