Abstract
In the dynamic programming paradigm the value of an optimal solution is recursively defined in terms of optimal solutions to subproblems. Such dynamic programming definitions can be very tricky and error-prone to specify. This paper presents a novel, elegant method based on tabled logic programming that simplifies the specification of such dynamic programming solutions. Our method introduces a new mode declaration for tabled predicates. The arguments of each tabled predicate are divided into indexed and non-indexed ones so that tabled predicates can be regarded as functions: indexed arguments represent input values and non-indexed arguments represent output values. The non-indexed arguments in a tabled predicate can be further declared to be aggregate, e.g., the minimum, so that while generating answers, the global table will dynamically maintain the smallest value for that argument. This mode declaration scheme, coupled with recursion, provides a considerably easy-to-use method for dynamic programming: there is no need to define the value of an optimal solution recursively, instead, defining a general solution suffices. The optimal value as well as its corresponding concrete solution can be derived implicitly and automatically using tabled logic programming systems. Experimental results are shown to indicate that the mode declaration improves both time and space performances in solving dynamic programming problems on tabled LP systems. Additionally, our mode declaration scheme provides an alternative implementation vehicle for preference logic programming.
This research is supported by NSF Nebraska EPSCoR grant.
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
Applied Logic Systems, Inc., http://www.als.com
Brown, A., Mantha, S., Wakayama, T.: Preference Logics: Towards a Unified Approach to Non-Monotonicity in Deductive Reasoning. Annals of Mathematics and Artificial Intelligence 10, 233–280 (1994)
Chen, W., Warren, D.S.: Query Evaluation under the Well Founded Semantics. In: ACM Symposium on Principles of Database Systems, pp. 168–179 (1993)
Cormen, T.H., Leiserson, C.E., Rivest, R.L.: Introduction to Algorithms. The MIT Press, Cambridge (2001)
Cui, B., Swift, T.: Preference Logic Grammars: Fixed Point Semantics and Application to Data Standardization. Artificial Intelligence 138(1-2), 117–147 (2002)
Govindarajan, K., Jayaraman, B., Mantha, S.: Preference Logic Programming. In: Proceedings of International Conference on Logic Programming (ICLP), pp. 731–745 (1995)
Guo, H.-F., Gupta, G.: A Simple Scheme for Implementing Tabled Logic Programming Systems Based on Dynamic Reordering of Alternatives. In: Proceedings of International Conference on Logic Programming (ICLP), pp. 181–196 (2001)
Lloyd, J.W.: Foundations of Logic Programming. Springer, Heidelberg (1987)
Pemmasani, G., Guo, H.-F., Dong, Y., Ramakrishnan, C.R., Ramakrishnan, I.V.: Online Justification for Tabled Logic Programs. To appear in Proceedings of International Symposium of Functional and Logic Programming (April 2004)
Ramakrishnan, Y.S., Ramakrishnan, C.R., Ramakrishnan, I.V., Smolka, S.A., Swift, T., Warren, D.S.: Efficient Model Checking using Tabled Resolution. In: Grumberg, O. (ed.) CAV 1997. LNCS, vol. 1254, pp. 143–154. Springer, Heidelberg (1997)
Rocha, R., Silva, F., Costa, V.S.: On a Tabling Engine That Can Exploit Or-Parallelism. In: ICLP Proceedings, pp. 43–58 (2001)
Roychoudhury, A., Ramakrishnan, C.R., Ramakrishnan, I.V.: Justifying proofs using memo tables. In: Second International ACM SIGPLAN conference on Principles and Practice of Declarative Programming (PPDP), pp. 178–189 (2000)
Specht, G.: Generating Explanation Trees even for Negations in Deductive Database Systems. In: Proc. of the 5th Workshop of Logic Programming Environments (1992)
Swift, T.: Tabling for Non-Monotonic Programming. Annals of Mathematics and Artificial Intelligence 25(3-4), 201–240 (1999)
XSB system, http://xsb.sourceforge.net
Warren, D.S.: Programming in Tabled Prolog (Draft Book), http://www.cs.sunysb.edu/~warren
Neng-Fa Zhou, Y., Shen, L.: Implementation of a Linear Tabling Mechanism. In: Pontelli, E., Santos Costa, V. (eds.) PADL 2000. LNCS, vol. 1753, p. 109. Springer, Heidelberg (2000)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Guo, HF., Gupta, G. (2004). Simplifying Dynamic Programming via Tabling. In: Jayaraman, B. (eds) Practical Aspects of Declarative Languages. PADL 2004. Lecture Notes in Computer Science, vol 3057. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24836-1_12
Download citation
DOI: https://doi.org/10.1007/978-3-540-24836-1_12
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-22253-8
Online ISBN: 978-3-540-24836-1
eBook Packages: Springer Book Archive