Skip to main content

An Efficient Implementation of Linear Tabling Based on Dynamic Reordering of Alternatives

  • Conference paper
Practical Aspects of Declarative Languages (PADL 2010)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 5937))

Included in the following conference series:

  • 388 Accesses

Abstract

Tabling is a technique of resolution that overcomes some limitations of traditional Prolog systems in dealing with recursion and redundant sub-computations. We can distinguish two main categories of tabling mechanisms: suspension-based tabling and linear tabling. In suspension-based tabling, a tabled evaluation can be seen as a sequence of sub-computations that suspend and later resume. Linear tabling mechanisms maintain a single execution tree where tabled subgoals always extend the current computation without requiring suspension and resumption of sub-computations. In this work, we present a new and efficient implementation of linear tabling, but for that we have extended an already existent suspension-based implementation, the YapTab engine. Our design is based on dynamic reordering of alternatives but it innovates by considering a strategy that schedules the re-evaluation of tabled calls in a similar manner to the suspension-based strategies of YapTab. Our implementation also shares the underlying execution environment and most of the data structures used to implement tabling in YapTab. We thus argue that all these common features allows us to make a first and fair comparison between suspension-based and linear tabling and, therefore, better understand the advantages and weaknesses of each.

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. Chen, W., Warren, D.S.: Tabled Evaluation with Delaying for General Logic Programs. Journal of the ACM 43(1), 20–74 (1996)

    Article  MATH  MathSciNet  Google Scholar 

  2. Sagonas, K., Swift, T.: An Abstract Machine for Tabled Execution of Fixed-Order Stratified Logic Programs. ACM Transactions on Programming Languages and Systems 20(3), 586–634 (1998)

    Article  Google Scholar 

  3. Rocha, R., Silva, F., Santos Costa, V.: YapTab: A Tabling Engine Designed to Support Parallelism. In: Conference on Tabulation in Parsing and Deduction, pp. 77–87 (2000)

    Google Scholar 

  4. Somogyi, Z., Sagonas, K.: Tabling in Mercury: Design and Implementation. In: Van Hentenryck, P. (ed.) PADL 2006. LNCS, vol. 3819, pp. 150–167. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  5. Demoen, B., Sagonas, K.: CAT: the Copying Approach to Tabling. In: Palamidessi, C., Meinke, K., Glaser, H. (eds.) ALP 1998 and PLILP 1998. LNCS, vol. 1490, pp. 21–35. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  6. Demoen, B., Sagonas, K.: CHAT: The Copy-Hybrid Approach to Tabling. Future Generation Computer Systems 16(7), 809–830 (2000)

    Article  Google Scholar 

  7. Rocha, R., Silva, C., Lopes, R.: Implementation of Suspension-Based Tabling in Prolog using External Primitives. In: Local Proceedings of the 13th Portuguese Conference on Artificial Intelligence, pp. 11–22 (2007)

    Google Scholar 

  8. de Guzmn, P.C., Carro, M., Hermenegildo, M.V.: Towards a Complete Scheme for Tabled Execution Based on Program Transformation. In: Gill, A., Swift, T. (eds.) PADL 2009. LNCS, vol. 5418, pp. 224–238. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  9. Ramesh, R., Chen, W.: Implementation of Tabled Evaluation with Delaying in Prolog. IEEE Transactions on Knowledge and Data Engineering 9(4), 559–574 (1997)

    Article  Google Scholar 

  10. Zhou, N.F., Shen, Y.D., Yuan, L.Y., You, J.H.: Implementation of a Linear Tabling Mechanism. In: Pontelli, E., Santos Costa, V. (eds.) PADL 2000. LNCS, vol. 1753, pp. 109–123. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  11. Guo, H.F., Gupta, G.: A Simple Scheme for Implementing Tabled Logic Programming Systems Based on Dynamic Reordering of Alternatives. In: Codognet, P. (ed.) ICLP 2001. LNCS, vol. 2237, pp. 181–196. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  12. Zhou, N.F., Sato, T., Shen, Y.D.: Linear Tabling Strategies and Optimizations. Theory and Practice of Logic Programming 8(1), 81–109 (2008)

    Article  MATH  MathSciNet  Google Scholar 

  13. Ramakrishnan, I.V., Rao, P., Sagonas, K., Swift, T., Warren, D.S.: Efficient Access Mechanisms for Tabled Logic Programs. Journal of Logic Programming 38(1), 31–54 (1999)

    Article  MATH  Google Scholar 

  14. Freire, J., Swift, T., Warren, D.S.: Beyond Depth-First: Improving Tabled Logic Programs through Alternative Scheduling Strategies. In: Kuchen, H., Swierstra, S.D. (eds.) PLILP 1996. LNCS, vol. 1140, pp. 243–258. Springer, Heidelberg (1996)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Areias, M., Rocha, R. (2010). An Efficient Implementation of Linear Tabling Based on Dynamic Reordering of Alternatives. In: Carro, M., Peña, R. (eds) Practical Aspects of Declarative Languages. PADL 2010. Lecture Notes in Computer Science, vol 5937. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-11503-5_23

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-11503-5_23

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-11502-8

  • Online ISBN: 978-3-642-11503-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics