This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
Implementation of Tabled Evaluation with Delaying in Prolog
July-August 1997 (vol. 9 no. 4)
pp. 559-574

Abstract—Unlike SLD resolution as implemented in Prolog, tabled evaluation with delaying guarantees termination for function-free logic programs, avoids repeated computation of identical subqueries, and handles recursion through negation. It is often used in query processing and nonmonotonic reasoning where termination is required. This paper presents a new technique for incorporating tabled evaluation into existing Prolog systems. It requires neither time consuming modifications of a Prolog engine nor metainterpretation that can enormously slow down program execution. Instead, using a program transformation approach, the technique allows effective use of the advanced Prolog technology. The transformed program uses tabling primitives implemented externally in C that provide direct control over the search strategies. This brings efficiency as well as portability across Prolog systems. Experiences with a prototype implementation indicate that the approach results in a flexible and pragmatic method for query processing and nonmonotonic reasoning on top of Prolog. Performance measurements show that the method is efficient for practical applications.

[1] C. Beeri and R. Ramakrisnhan, “On the Power of Magic,” J. Logic Programming, vol. 11, nos. 3 and 4, pp. 255-299, 1991.
[2] W. Chen, "Extending Prolog with Nonmonotonic Reasoning," J. Logic Programming, vol. 27, no. 2, pp. 169-183, May 1996.
[3] W. Chen, T. Swift, and D.S. Warren, "Efficient Top-Down Computation of Queries Under the Well-Founded Semantics," J. Logic Programming, vol. 24, no. 3, pp. 161-199, Sept. 1995.
[4] W. Chen and D.S. Warren, "Query Evaluation Under the Well Founded Semantics," The 12th ACM Symp Principles of Database Systems, 1993.
[5] W. Chen and D.S. Warren, "Tabled Evaluation with Delaying for General Logic Programs," J. ACM, vol. 43, no. 1, pp. 20-74, Jan. 1996.
[6] D. Chimenti, The LDL System Prototype, IEEE Trans. on Knowledge and Data Eng., vol. 2, no. 1, March 1990, pp. 76-90.
[7] C. Fan and S.W. Dietrich, "Extension Table Built-Ins for Prolog," Software—Practice and Experience, vol. 22, no. 7, pp. 573-597, July 1992.
[8] D.B. Kemp, P.J. Stuckey, and D. Srivastava, "Query Restricted Bottom-Up Evaluation of Normal Logic Programs," Proc. Joint Int'l Conf. and Symp. Logic Programming, pp. 288-302. MIT Press, 1992.
[9] J.W. Lloyd, Foundations of Logic Programming, Springer Series in Symbolic Computation, second ed. New York: Springer-Verlag, 1987.
[10] S. Morishita, "An Alternating Fixpoint Tailored to Magic Programs," Proc. ACM SIGACT-SIGMOD-SIGART Symp. Principles Database Systems, pp. 123-134, May 1993.
[11] J.F. Naughton and R. Ramakrishnan, "Bottom-Up Evaluation of Logic Programs," Computational Logic: Essays in Honor of Alan Robinson, J.-L. Lassez and Gordon Plotkin, eds., pp. 640-700, MIT Press, 1991.
[12] U. Nilsson, "Goal-Directed Bottom-Up Evaluation of Normal Logic Programs," Proc. Int'l Logic Programming Symp., p. 647, MIT Press, Oct. 1993.
[13] I.V. Ramakrishnan, P. Rao, K. Sagonas, T. Swift, and D.S. Warren, "Efficient Tabling Mechanisms for Logic Programs," Proc. Int'l Conf. Logic Programming L. Sterling, ed., pp. 697-711, MIT Press, 1995.
[14] R. Ramakrishnan, D. Srivastava, and S. Sudarshan, "Controlling the Search in Bottom-Up Evaluation," Proc. Joint Int'l Conf. and Symp. Logic Programming, pp. 273-287, MIT Press, 1992.
[15] R. Ramakrishnan,D. Srivastava,, and S. Sudarshan,“Coral_Control, relations and logic,” Proc. 18th Int’l Conf. Very Large Data Bases, pp. 547-559.,Vancouver, Can., Aug. 1992.
[16] K. Sagonas, T. Swift, and D.S. Warren, The XSB Programmer's Manual, State Univ. of New York at Stony Brook, 1993.
[17] K. Sagonas, T. Swift, and D.S. Warren, "XSB as an Efficient Deductive Database Engine," Proc. ACM SIGMOD Int'l Conf. Management of Data, pp. 442-453, May 1994.
[18] Swedish Inst. of Computer Science, SICStus Prolog User's Manual, sixth edition, Kista, Sweden, Aug. 1992.
[19] H. Tamaki and T. Sato, "OLD Resolution with Tabulation," Proc. Int'l Conf. Logic Programming, pp. 84-98, MIT Press, 1986.
[20] A. van Gelder,K. Ross, and J.S. Schlipf,"The well-founded semantics for general logic programs," J. ACM, vol. 38, no. 3, pp. 620-650, July 1991.
[21] L. Vieill, “Recursive Query Processing: The Power of Logic,” Int'l J. Theoretical Computer Science, vol. 69, no. 1, pp. 1-53, 1989.

Index Terms:
Tabled evaluation, query processing, program transformation, nonmonotonic reasoning, search strategy.
Citation:
R. Ramesh, Weidong Chen, "Implementation of Tabled Evaluation with Delaying in Prolog," IEEE Transactions on Knowledge and Data Engineering, vol. 9, no. 4, pp. 559-574, July-Aug. 1997, doi:10.1109/69.617050
Usage of this product signifies your acceptance of the Terms of Use.