The logic programming language Prolog uses a resource-efficient SLD resolution strategy for query answering. Yet, its propensity for non-termination 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.
@inproceedings{ijcai2016,
author = {Benoit Desouter and
Marko van Dooren and
Tom Schrijvers and
Alexander Vandenbroucke},
title = {Tabling as a Library with Delimited Control},
booktitle = {Proceedings of the Twenty-Fifth International Joint Conference on
Artificial Intelligence, {IJCAI} 2016, New York, NY, USA, 9-15 July
2016},
pages = {4145--4149},
year = {2016},
editor = {Subbarao Kambhampati},
publisher = {{IJCAI/AAAI} Press},
url = {/Research/papers/ijcai2016.pdf},
abstract = {The logic programming language Prolog uses a resource-efficient SLD resolution
strategy for query answering. Yet, its propensity for non-termination
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.
},
}