Skip to main content Accessibility help
×
Home
Hostname: page-component-77ffc5d9c7-ctdxh Total loading time: 0.34 Render date: 2021-04-23T12:18:10.375Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "metricsAbstractViews": false, "figures": false, "newCiteModal": false, "newCitedByModal": true }

Swapping evaluation: A memory-scalable solution for answer-on-demand tabling*

Published online by Cambridge University Press:  09 July 2010

PABLO CHICO DE GUZM'AN
Affiliation:
U. Politécnica de Madrid (e-mail: pchico@clip.dia.fi.upm.es)
MANUEL CARRO
Affiliation:
U. Politécnica de Madrid (e-mail: mcarro@fi.upm.es)
DAVID S. WARREN
Affiliation:
State University of New York at Stony Brook (e-mail: warren@cs.sunysb.edu)

Abstract

One of the differences among the various approaches to suspension-based tabled evaluation is the scheduling strategy. The two most popular strategies are local and batched evaluation. The former collects all the solutions to a tabled predicate before making any one of them available outside the tabled computation. The latter returns answers one by one before computing them all, which in principle is better if only one answer (or a subset of the answers) is desired. Batched evaluation is closer to SLD evaluation in that it computes solutions lazily as they are demanded, but it may need arbitrarily more memory than local evaluation, which is able to reclaim memory sooner. Some programs which in practice can be executed under the local strategy quickly run out of memory under batched evaluation. This has led to the general adoption of local evaluation at the expense of the more depth-first batched strategy. In this paper we study the reasons for the high memory consumption of batched evaluation and propose a new scheduling strategy which we have termed swapping evaluation. Swapping evaluation also returns answers one by one before completing a tabled call, but its memory usage can be orders of magnitude less than batched evaluation. An experimental implementation in the XSB system shows that swapping evaluation is a feasible memory-scalable strategy that need not compromise execution speed.

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2010

Access options

Get access to the full version of this content by using one of the access options below.

References

Ait-Kaci, H. 1991. Warren's Abstract Machine, A Tutorial Reconstruction. MIT Press.Google Scholar
Chen, W. and Warren, D. S. 1996. Tabled evaluation with delaying for general logic programs. Journal of the ACM 43, 1 (January), 2074.CrossRefGoogle Scholar
Codish, M., Demoen, B., and Sagonas, K. F. 1998. Semantics-based program analysis for logic-based languages using XSB. STTT 2, 1, 2945.CrossRefGoogle Scholar
Dawson, S., Ramakrishnan, C. R., and Warren, D. S. 1996. Practical program analysis using general purpose logic programming systems – A case study. In Proceedings of PLDI'96. ACM Press, New York, USA, 117126.CrossRefGoogle Scholar
Freire, J., Swift, T., and Warren, D. S. 2001. Beyond depth-first: Improving tabled logic programs through alternative scheduling strategies. In International Symposium on Programming Language Implementation and Logic Programming. Lecture Notes in Computer Science, vol. 1140. Springer, 243258.Google Scholar
Hermenegildo, M. and Nasr, R. I. 1986. Efficient management of backtracking in and-parallelism. In Third International Conference on Logic Programming. Lecture Notes in Computer Science, vol. 225. Imperial College, Springer, 4055.CrossRefGoogle Scholar
Ramakrishna, Y., Ramakrishnan, C., Ramakrishnan, I., Smolka, S., Swift, T., and Warren, D. 1997. Efficient model checking using tabled resolution. In Computer Aided Verification. Lecture Notes in Computer Science, vol. 1254. Springer, 143154.CrossRefGoogle Scholar
Ramakrishnan, R. and Ullman, J. D. 1993. A survey of research on deductive database systems. Journal of Logic Programming 23, 2, 125149.CrossRefGoogle Scholar
Rocha, R., Silva, F. M. A., and Costa, V. S. 2005. Dynamic mixed-strategy evaluation of tabled logic programs. In ICLP. Lecture Notes in Computer Science, vol. 3668. Springer, 250264.Google Scholar
Sagonas, K. and Swift, T. 1998. An abstract machine for tabled execution of fixed-order stratified logic programs. ACM Transactions on Programming Languages and Systems 20, 3 (May), 586634.CrossRefGoogle Scholar
Sagonas, K., Swift, T., and Warren, D. 1993. The XSB programming system. In ILPS Workshop on Programming with Logic Databases. Number TR #1183. University of Wisconsin, 164–164.Google Scholar
Sagonas, K. F. and Stuckey, P. J. 2004. Just enough tabling. In Principles and Practice of Declarative Programming. ACM, 7889.Google Scholar
Tamaki, H. and Sato, M. 1986. OLD resolution with tabulation. In Int'l. Conf. on Logic Programming. Lecture Notes in Computer Science. Springer, 8498.Google Scholar
Tarjan, R. 1972. Depth-first search and linear graph algorithms. SIAM Journal Computing 1, 140160.CrossRefGoogle Scholar
Warren, D. S. 1992. Memoing for logic programs. Communications of the ACM 35, 3, 93111.CrossRefGoogle Scholar
Warren, R., Hermenegildo, M., and Debray, S. K. 1988. On the practicality of global flow analysis of logic programs. In Fifth International Conference and Symposium on Logic Programming. MIT Press, 684699.Google Scholar
Zou, Y., Finin, T., and Chen, H. 2005. F-OWL: An inference engine for semantic web. In Formal Approaches to Agent-Based Systems. Lecture Notes in Computer Science, vol. 3228. Springer, 238248.Google Scholar

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: 0
Total number of PDF views: 17 *
View data table for this chart

* Views captured on Cambridge Core between September 2016 - 23rd April 2021. This data will be updated every 24 hours.

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.

Swapping evaluation: A memory-scalable solution for answer-on-demand tabling*
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.

Swapping evaluation: A memory-scalable solution for answer-on-demand tabling*
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.

Swapping evaluation: A memory-scalable solution for answer-on-demand tabling*
Available formats
×
×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *