Skip to main content

Implementation of a Linear Tabling Mechanism

  • Conference paper
  • First Online:
Practical Aspects of Declarative Languages (PADL 2000)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1753))

Included in the following conference series:

Abstract

Delaying-based tabling mechanisms, such as the one adopted in XSB, are non-linear in the sense that the computation state of delayed calls has to be preserved. In this paper, we present the implementation of a linear tabling mechanism. The key idea is to let a call execute from the backtracking point of a former variant call if such a call exists. The linear tabling mechanism has the following advantages over non-linear ones: (1) it is relatively easy to implement; (2) it imposes no overhead on standard Prolog programs; and (3) the cut operator works as for standard Prolog programs and thus it is possible to use the cut operator to express negation-as-failure and conditionals in tabled programs. The weakness of the linear mechanism is the necessity of re-computation for computing fix-points. However, we have found that re-computation can be avoided for a large portion of calls of directly-recursive tabled predicates. We have implemented the linear tabling mechanism in B-Prolog. Experimental comparison shows that B-Prolog is close in speed to XSB and outperforms XSB when re-computation can be avoided. Concerning space efficiency, B-Prolog is an order of magnitude better than XSB for some programs.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bancilhon, F. and Ramakrishnan, R.: An Amateur’s Introduction to Recursive Query Processing Strategies, SIGMOD’86.

    Google Scholar 

  2. Chen, W. and Warren, D.S.: Tabled Evaluation with Delaying for General Logic Programs, J. ACM, Vol.43,No.1, 20–74, 1996.

    Article  MATH  MathSciNet  Google Scholar 

  3. Demoen, B. and Sagonas, K.: CAT: The Copying Approach to Tabling, Proceedings of PLILP’98, 1998.

    Google Scholar 

  4. Demoen, B. and Sagonas, K.: CHAT: The Copy-Hybrid Approach to Tabling, Proceedings of PADL’99, LNCS 1551, pp.106–121, 1999.

    Google Scholar 

  5. Fa, C.G. and Dietrich, S.W.: Extension Table Built-ins for Prolog, Software Practice and Experience, Vol.22,No.7, 573–597, 1992.

    Article  Google Scholar 

  6. Lloyd, J.W.: Foundations of Logic Programming, Springer-Verlag, 1987.

    Google Scholar 

  7. Parker, D.S., Carey, M. Jarke, M. Sciore, E. and Walker, A.: Logic Programming and Databases, Expert Database Systems, Kersobberg Larry, Ed., The Benjamin/Cummings Pub., 1986.

    Google Scholar 

  8. Sagonas, K. and Swift, T.: An Abstract Machine for Tabled Execution of Fixed-Order Stratified Logic Programs, ACM Transactions on Programming Languages and Systems. Vol.20,No.3, 1998.

    Google Scholar 

  9. Shen, Y.D., Yuan, L., You, J.H. and Zhou, N.F.: Linear Tabulated Resolution Based on Prolog Control Strategy, submitted for publication.

    Google Scholar 

  10. Ramakrishnan, I.V., Rao, P., Sagonas, K., Swift, T., and Warren, D.S.: Efficient Access Mechanisms for Tabled Logic Programs, J. Logic Programming, vol. 38, pp.31–54, 1998.

    Article  Google Scholar 

  11. Tamaki, H. and Sato, T.: OLD Resolution with Tabulation, Proc. of the Third ICLP, LNCS 225, 84–98, 1986.

    Google Scholar 

  12. Warren, D.H.D.: An Abstract Prolog Instruction Set, Technical Report 309, SRI International, 1983.

    Google Scholar 

  13. Warren, D.S.: Memoing for Logic Programs, CACM, Vol.35,No.3, pp.93–111, 1992.

    Google Scholar 

  14. Zhou, N.F.: Parameter Passing and Control Stack Management in Prolog Implementation Revisited, ACM Transactions on Programming Languages and Systems, Vol.18,No.6, 752–779, 1996.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Zhou, NF., Shen, YD., Yuan, LY., You, JH. (1999). Implementation of a Linear Tabling Mechanism. In: Pontelli, E., Santos Costa, V. (eds) Practical Aspects of Declarative Languages. PADL 2000. Lecture Notes in Computer Science, vol 1753. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46584-7_8

Download citation

  • DOI: https://doi.org/10.1007/3-540-46584-7_8

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-66992-0

  • Online ISBN: 978-3-540-46584-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics