Proceedings

Tabling as a Library with Delimited Control

Download BibTeX Cite

Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence. Pages 4145-4148.

Abstract

The logic programming language Prolog uses a resource-efficient SLD resolution strategy for query answering. Yet, its propensity for nontermination seriously detracts from the language's declarative nature. This problem is remedied by tabling, a modified execution strategy that allows a larger class of programs to terminate. Unfortunately, few Prolog systems provide tabling, because the documented implementation techniques are complex, low-level and require a prohibitive engineering effort. To enable more widespread adoption, this paper presents a novel implementation of tabling for Prolog that is both high-level and compact. It comes in the form of a Prolog library that weighs in at under 600 lines of code, is based on delimited control and delivers reasonable performance.

  1. [Aït-Kaci, 1999] Hassan Aït-Kaci. Warren's Abstract Ma- chine -a Tutorial Reconstruction. http://wambook. sourceforge.net/, 1999. Online edition of the 1991 book published by MIT Press. Link
  2. [Chen and Warren, 1996] Weidong Chen and David S. War- ren. Tabled evaluation with delaying for general logic pro- grams. J. ACM, 43(1):20-74, 1996.
  3. [Danvy and Filinski, 1990] Olivier Danvy and Andrzej Filin- ski. Abstracting control. In Proceedings of LFP'90, LFP '90, pages 151-160. ACM, 1990.
  4. [de Guzmán et al., 2008] Pablo Chico de Guzmán, Manuel Carro, Manuel V. Hermenegildo, Cláudio Silva, and Ri- cardo Rocha. An improved continuation call-based imple- mentation of tabling. In Proceedings of PADL'08, volume 4902 of LNCS, pages 197-213. Springer, 2008.
  5. [Demoen and Sagonas, 1998a] Bart Demoen and Konstanti- nos Sagonas. Cat: The copying approach to tabling. In Catuscia Palamidessi, Hugh Glaser, and Karl Meinke, editors, Principles of Declarative Programming, volume 1490 of LNCS, pages 21-35. Springer, 1998.
  6. [Demoen and Sagonas, 1998b] Bart Demoen and Konstanti- nos Sagonas. Chat: The copy-hybrid approach to tabling. In Gopal Gupta, editor, Proceedings of PADL'98, volume 1551 of LNCS, pages 106-121. Springer, 1998.
  7. [Desouter et al., 2015] Benoit Desouter, Marko van Dooren, and Tom Schrijvers. Tabling as a library with delimited control. Theory and Practice of Logic Programming, 15(4- 5):419-433, 2015.
  8. [Fan and Dietrich, 1992] Changguan Fan and Suzanne Wag- ner Dietrich. Extension table built-ins for Prolog. Soft- ware: Practice and Experience, 22(7):573-597, 1992.
  9. [Felleisen, 1988] Mattias Felleisen. The theory and practice of first-class prompts. In Proceedings of POPL'88, POPL, pages 180-190. ACM, 1988.
  10. [Guo and Gupta, 2001] Hai-Feng Guo and Gopal Gupta. A simple scheme for implementing tabled logic program- ming systems based on dynamic reordering of alternatives. In Proceedings of ICLP'01, pages 181-196. Springer, 2001.
  11. [Guo and Gupta, 2004] Hai-Feng Guo and Gopal Gupta. An efficient and flexible engine for computing fixed points. CoRR, abs/cs/0412041, 2004.
  12. [Hermenegildo et al., 2012] M. V. Hermenegildo, F. Bueno, M. Carro, P. Lípez-García, E. Mera, J. F. Morales, and G. Puebla. An overview of Ciao and its design philosophy. Theory and Practice of Logic Programming, 12(1-2):219- 252, January 2012.
  13. [Kowalski, 1974] Robert Kowalski. Predicate logic as pro- gramming language. In Proceedings of International Fed- eration for Information Processing (IFIP), pages 569-574, 1974.
  14. [Kowalski, 1979] Robert Kowalski. Logic for Problem Solv- ing. North-Holland, 1979.
  15. [Lloyd, 1984] J. W. Lloyd. Foundations of Logic Program- ming. Springer-Verlag, New York, 1984.
  16. [Plotkin and Pretnar, 2013] Gordon D. Plotkin and Matija Pretnar. Handling algebraic effects. Logical Methods in Computer Science, 9(4), 2013.
  17. [Ramesh and Chen, 1994] R. Ramesh and Weidong Chen. A portable method for integrating SLG resolution into Prolog systems. In Proceedings of ILPS'94, ILPS, pages 618- 632, Cambridge, 1994. MIT Press.
  18. [Rocha et al., 2000] Ricardo Rocha, Fernando Silva, and Vítor Santos Costa. YapTab: A tabling engine designed to support parallelism. In Conference on Tabulation in Pars- ing and Deduction, pages 77-87, 2000.
  19. [Santos Costa et al., 2012] Vítor Santos Costa, Ricardo Rocha, and Luís Damas. The YAP Prolog system. Theory and Practice of Logic Programming, 12(1-2):5-34, 2012.
  20. [Schrijvers et al., 2013a] Tom Schrijvers, Bart Demoen, and Benoit Desouter. Delimited continuations in Prolog: Se- mantics, use and implementation in the WAM. Report CW 631, Dept. of Computer Science, KU Leuven, 2013.
  21. [Schrijvers et al., 2013b] Tom Schrijvers, Bart Demoen, Benoit Desouter, and Jan Wielemaker. Delimited continu- ations for Prolog. Theory and Practice of Logic Program- ming, 13(4-5):533-546, 2013.
  22. [Swift and Warren, 2012] Terrance Swift and David S. War- ren. XSB: Extending Prolog with tabled logic program- ming. Theory and Practice of Logic Programming, 12(1- 2):157-187, January 2012.
  23. [Tarau and Dahl, 1994] Paul Tarau and Veronica Dahl. Logic programming and logic grammars with first-order contin- uations. In Proceedings of LOPSTR '94, volume 883. Springer, June 1994.
  24. [Tarau, 2012] Paul Tarau. The BinProlog experience: Archi- tecture and implementation choices for continuation pass- ing Prolog and first-class logic engines. Theory and Prac- tice of Logic Programming, 12(1-2):97-126, 2012.
  25. [Warren, 1983] D. H. D. Warren. An Abstract Prolog In- struction Set. Technical Report 309, SRI, 1983.
  26. [Zhou et al., 2000] Neng-Fa Zhou, Yi-Dong Shen, Li-Yan Yuan, and Jia-Huai You. Implementation of a linear tabling mechanism. In Practical Aspects of Declara- tive Languages, volume 1753 of LNCS, pages 109-123. Springer, 2000.
  27. [Zhou, 2012] Neng-Fa Zhou. The language features and ar- chitecture of B-Prolog. Theory and Practice of Logic Pro- gramming, 12(1-2):189-218, 2012.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards