Abstract
Tabling of structured data is important to support dynamic programming in logic programs. Several existing tabling systems for Prolog do not efficiently deal with structured data, but duplicate part of the structured data in different instances of tabled goals. As a consequence, time and space complexity may often be significantly higher than the theoretically optimal. A simple program transformation is proposed which uses an indexing of structured data that eliminates this problem, and drastic improvements of time and space complexity can be demonstrated. The technique is demonstrated for dynamic programming examples expressed in Prolog and in PRISM.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Bellman, R.: Dynamic Programming. Princeton University Press (1957)
Christiansen, H., Gallagher, J.P.: Non-discriminating Arguments and Their Uses. In: Hill, P.M., Warren, D.S. (eds.) ICLP 2009. LNCS, vol. 5649, pp. 55–69. Springer, Heidelberg (2009)
Christiansen, H., Have, C.T., Lassen, O.T., Petit, M.: Taming the zoo of discrete HMM subspecies & some of their relatives. In: Biology, Computation and Linguistics, New Interdisciplinary Paradigms. Frontiers in Artificial Intelligence and Applications, vol. 228, pp. 28–42. IOS Press (2011)
Henderson, F., Conway, T., Somogyi, Z., Jeffery, D., Schachte, P., Taylor, S., Speirs, C., Dowd, T., Becket, R., Brown, M., Wang, P.: The Mercury Language Reference Manual. Version 11.01 (2011), http://www.mercury.cs.mu.oz.au/information/documentation.html
Rabiner, L.R.: A tutorial on Hidden Markov Models and selected applications in speech recognition. Proceedings of the IEEE 77(2), 257–286 (1989)
Raimundo, J., Rocha, R.: Global Trie for Subterms. In: Abreu, S., Costa, V.S. (eds.) Proceedings of the 11th Colloquium on Implementation of Constraint and Logic Programming Systems, CICLOPS 2011, Lexington, Kentucky, USA, pp. 34–48 (July 2011)
Rocha, R., Silva, F., Costa, V.S.: A tabling engine for the Yap Prolog system. In: Proceedings of the 2000 APPIA-GULP-PRODE Joint Conference on Declarative Programming (AGP 2000), La Habana, Cuba (December 2000)
Sato, T., Kameya, Y.: PRISM: A language for symbolic-statistical modeling. In: IJCAI, pp. 1330–1339 (1997)
Sato, T., Kameya, Y.: New advances in logic-based probabilistic modeling (2007)
Sato, T., Zhou, N.-F., Kameya, Y., Izumi, Y.: PRISM User’s Manual, Version 2.0 (2010)
Somogyi, Z., Sagonas, K.F.: Tabling in Mercury: Design and Implementation. In: Van Hentenryck, P. (ed.) PADL 2006. LNCS, vol. 3819, pp. 150–167. Springer, Heidelberg (2005)
Swift, T.: Design Patterns for Tabled Logic Programming. In: Abreu, S., Seipel, D. (eds.) INAP 2009. LNCS, vol. 6547, pp. 1–19. Springer, Heidelberg (2011)
Swift, T., Warren, D.S.: XSB: Extending prolog with tabled logic programming. Theory and Practice of Logic Programming (to appear, 2011)
Swift, T., Warren, D.S.: The XSB Programmer’s Manual. Version 3.3 (June 2011)
Tamaki, H., Sato, T.: OLD Resolution with Tabulation. In: Shapiro, E. (ed.) ICLP 1986. LNCS, vol. 225, pp. 84–98. Springer, Heidelberg (1986)
Wong, C.K., Chandra, A.K.: Bounds for the string editing problem. J. ACM 23(1), 13–16 (1976)
Zhou, N.-F.: The language features and architecture of B-Prolog. Theory and Practice of Logic Programming (to appear, 2011)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Theil Have, C., Christiansen, H. (2012). Efficient Tabling of Structured Data Using Indexing and Program Transformation. In: Russo, C., Zhou, NF. (eds) Practical Aspects of Declarative Languages. PADL 2012. Lecture Notes in Computer Science, vol 7149. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-27694-1_8
Download citation
DOI: https://doi.org/10.1007/978-3-642-27694-1_8
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-27693-4
Online ISBN: 978-3-642-27694-1
eBook Packages: Computer ScienceComputer Science (R0)