Skip to main content Accessibility help
×
Home
Hostname: page-component-559fc8cf4f-dxfhg Total loading time: 0.4 Render date: 2021-02-27T22:25:34.498Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "metricsAbstractViews": false, "figures": false, "newCiteModal": false, "newCitedByModal": true }

Tabling as a library with delimited control

Published online by Cambridge University Press:  03 September 2015

BENOIT DESOUTER
Affiliation:
Ghent University, Belgium (e-mail: benoit.desouter@ugent.be, marko.vandooren@ugent.be)
MARKO VAN DOOREN
Affiliation:
Ghent University, Belgium (e-mail: benoit.desouter@ugent.be, marko.vandooren@ugent.be)
TOM SCHRIJVERS
Affiliation:
KU Leuven, Belgium (e-mail: tom.schrijvers@cs.kuleuven.be)
Rights & Permissions[Opens in a new window]

Abstract

Tabling is probably the most widely studied extension of Prolog. But despite its importance and practicality, tabling is not implemented by most Prolog systems. Existing approaches require substantial changes to the Prolog engine, which is an investment out of reach of most systems. To enable more widespread adoption, we present a new implementation of tabling in under 600 lines of Prolog code. Our lightweight approach relies on delimited control and provides reasonable performance.

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2015 

References

Ceri, S., Gottlob, G. and Tanca, L. 1989. What you always wanted to know about Datalog (and never dared to ask). IEEE Trans. on Knowl. and Data Eng. 1, 1, 146166.CrossRefGoogle Scholar
Chen, W. and Warren, D. S. 1996. Tabled evaluation with delaying for general logic programs. J. ACM 43, 1, 2074.CrossRefGoogle Scholar
Danvy, O. and Filinski, A. 1990. Abstracting control. In Proceedings of the 1990 ACM conference on LISP and functional programming. LFP '90. ACM, 151–160.Google Scholar
de Guzmán, P. C., Carro, M., Hermenegildo, M. V., Silva, C. and Rocha, R. 2008. An improved continuation call-based implementation of tabling. In Practical Aspects of Declarative Languages, 10th International Symposium. Lecture Notes in Computer Science, vol. 4902. Springer, 197213.CrossRefGoogle Scholar
Demoen, B. and Sagonas, K. 1998a. Cat: The copying approach to tabling. In Principles of Declarative Programming, Palamidessi, C., Glaser, H., and Meinke, K., Eds. Lecture Notes in Computer Science, vol. 1490. Springer Berlin Heidelberg, 2135.CrossRefGoogle Scholar
Demoen, B. and Sagonas, K. 1998b. Chat: The copy-hybrid approach to tabling. In Practical Aspects of Declarative Languages, Gupta, G., Ed. Lecture Notes in Computer Science, vol. 1551. Springer Berlin Heidelberg, 106121.CrossRefGoogle Scholar
Fan, C. and Dietrich, S. W. 1992. Extension table built-ins for Prolog. Software: Practice and Experience 22, 7, 573597.Google Scholar
Felleisen, M. 1988. The theory and practice of first-class prompts. In Proceedings of the 15th ACM SIGPLAN-SIGACT symposium on Principles of programming languages. POPL '88. ACM, 180–190.Google Scholar
Guo, H. and Gupta, G. 2008. Simplifying dynamic programming via mode-directed tabling. Softw., Pract. Exper. 38, 1, 7594.CrossRefGoogle Scholar
Guo, H.-F. and Gupta, G. 2001. A simple scheme for implementing tabled logic programming systems based on dynamic reordering of alternatives. In Proceedings of ICLP'01. Springer, 181–196.Google Scholar
Guo, H.-F. and Gupta, G. 2004. An efficient and flexible engine for computing fixed points. CoRR abs/cs/0412041.Google Scholar
Hermenegildo, M. V., Bueno, F., Carro, M., Lípez-García, P., Mera, E., Morales, J. F. and Puebla, G. 2012. An overview of Ciao and its design philosophy. Theory Pract. Log. Program. 12, 1–2 (Jan.), 219252.CrossRefGoogle Scholar
Plotkin, G. D. and Pretnar, M. 2013. Handling algebraic effects. Logical Methods in Computer Science 9, 4.CrossRefGoogle Scholar
Raimundo, J. and Rocha, R. 2011. Global trie for subterms. Online Proceedings of the 11th International Colloquium on Implementation of Constraint Logic Programming Systems (CICLOPS 2011).Google Scholar
Ramesh, R. and Chen, W. 1994. A portable method for integrating SLG resolution into Prolog systems. In Proceedings of the 1994 International Symposium on Logic Programming. ILPS '94. MIT Press, Cambridge, MA, USA, 618632.Google Scholar
Rocha, R., Silva, F. and Santos Costa, V. 2000. YapTab: A tabling engine designed to support parallelism. In Conference on Tabulation in Parsing and Deduction. 77–87.Google Scholar
Santos, J. and Rocha, R. 2013. On the efficient implementation of mode-directed tabling. In Practical Aspects of Declarative Languages - 15th International Symposium, PADL 2013. Lecture Notes in Computer Science, vol. 7752. Springer, 141156.Google Scholar
Santos Costa, V., Rocha, R. and Damas, L. 2012. The YAP Prolog system. TPLP 12, 1–2, 534.Google Scholar
Schrijvers, T., Demoen, B. and Desouter, B. 2013. Delimited continuations in Prolog: Semantics, use and implementation in the WAM. Report CW 631, Dept. of Computer Science, KU Leuven.Google Scholar
Schrijvers, T., Demoen, B., Desouter, B. and Wielemaker, J. 2013. Delimited continuations for Prolog. Theory and Practice of Logic Programming (TPLP). Proceedings of the International Conference on Logic Programming (ICLP).Google Scholar
Swift, T. and Warren, D. S. 2012. XSB: Extending Prolog with tabled logic programming. Theory Pract. Log. Program. 12, 1–2 (Jan.), 157187.CrossRefGoogle Scholar
Tarau, P. 2012. The BinProlog experience: Architecture and implementation choices for continuation passing Prolog and first-class logic engines. TPLP 12, 1–2, 97126.Google Scholar
Tarau, P. and Dahl, V. 1994. Logic programming and logic grammars with first-order continuations. In LOPSTR '94. Vol. 883.Google Scholar
Zhou, N. 2012. The language features and architecture of B-Prolog. TPLP 12, 1–2, 189218.Google Scholar
Zhou, N.-F., Shen, Y.-D., Yuan, L.-Y. and You, J.-H. 2000. Implementation of a linear tabling mechanism. In Practical Aspects of Declarative Languages, Pontelli, E. and Santos Costa, V., Eds. Lecture Notes in Computer Science, vol. 1753. Springer Berlin Heidelberg, 109123.Google Scholar

Desouter supplementary material

Online Appendix

PDF 149 KB

Altmetric attention score

Full text views

Full text views reflects PDF downloads, PDFs sent to Google Drive, Dropbox and Kindle and HTML full text views.

Total number of HTML views: 1
Total number of PDF views: 223 *
View data table for this chart

* Views captured on Cambridge Core between September 2016 - 27th February 2021. This data will be updated every 24 hours.

Access

Send article to Kindle

To send this article to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about sending to your Kindle. Find out more about sending to your Kindle.

Note you can select to send to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be sent to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Tabling as a library with delimited control
Available formats
×

Send article to Dropbox

To send this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Dropbox.

Tabling as a library with delimited control
Available formats
×

Send article to Google Drive

To send this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Google Drive.

Tabling as a library with delimited control
Available formats
×
×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *