Abstract
We present a general solution to the problem of optimized execution of logic programs containing linear recursive rules. Our solution is based on extensions of the classical counting method, which is known to be efficient but of limited applicability. In fact, the range of applicability of the counting method, and its variants proposed by previous researchers, suffer from one or more of the following limitations: the method can be applied only when (1) the adorned program contains one recursive rule, (2) the ‘left part’ and the ‘right part’ of the recursive rule do not have any common variable and (3) the relation associated with the left part of the recursive rule is ‘acyclic’. In this paper, a simple and unified framework is presented, where those limitations are removed, and the counting method thus become applicable to all programs with linear rules. This framework also allows a simple treatment of programs factorizable into segments, which can be computed separately yielding a much faster execution. A simple factorization technique based on argument reduction is presented that produces optimizations similar to those defined in the literature for RLC-linear programs (i.e., programs with right- linear rules, left-linear rules and a combination of the two).
Work done while visiting MCC, Austin, Texas, and supported by the project “Sistemi Informatici e Calcolo Parallelo” obiettivo ”Logidata+” of C.N.R. Italy.
Preview
Unable to display preview. Download preview PDF.
References
A.V. Aho, Hopcroft J.E., and Ullman J.D. The Design and Analysis of Computer Algorithms. Addison-Wesley, 1974.
H. Aly and Z.M. Ozsoyoglu. Synchronized counting method. In Proceedings of the Fifth Intern. Conference on Data Engineering, pages 366–373, 1989.
F. Bancilhon, D. Maier, Y. Sagiv, and J. Ullman. Magic sets and other strange ways to implement logic programs. In Proceedings of the Fifth ACM Symposium on Principles of Database Systems, pages 1–15, 1986.
F. Bancilhon and R. Ramakrishnan. Performance evaluation of data intensive logic programs. In J. Minker, editor, Foundations of Deductive Databases and Logic Programming, pages 439–518, Morgan-Kaufman, Los Altos, CA, 1988.
C. Beeri, S. Naqvi, R. Ramakrishnan, O. Shmueli, and S. Tsur. Sets and negation in a logic database language (LDL1). In Proceedings of the Sixth ACM Symposium on Principles of Database Systems, pages 21–37, 1987.
C. Beeri and R. Ramakrishnan. On the power of magic. Journal of Logic Programming, 10(3 & 4):333–361, 1991.
D. Chimenti, R. Gamboa, R. Krishnamurthy, S. Naqvi, T. Shalom, and C. Zaniolo. The LDL system prototype. In IEEE Transaction on Knowledge and Data Engineering, pages 76–90, 1990.
S. Greco and C. Zaniolo. Optimization of Linear Logic Programs Using Counting Methods. Research Report, MCC, 1991.
R. Haddad and J. Naughton. A counting algorithm for a cyclic binary query. Journal of Computer and System Science, 43(1):145–169, 1991.
J. Lloyd. Foundations of Logic Programming. Springer-Verlag, New York, 2nd edition, 1987.
A. Marchetti-Spaccamela, A. Pelaggi, and D. Saccà. Comparison of methods for logic query implementation. Journal of Logic Programming, 10(3 & 4):333–361, 1991.
S. Naqvi and S Tsur. A Logic Language for Data and Knowledge Bases. Computer Science Press, New York, 1989.
J.F. Naughton, R. Ramakrisnhan, Y. Sagiv, and J.D. Ullman. Argument reduction by factoring. In Proceedings of the 15th Conference on Very Large Data Bases, pages 173–182, 1989.
J.F. Naughton, R. Ramakrisnhan, Y. Sagiv, and J.D. Ullman. Efficient evaluation of right-, left-, and multi-linear rules. In Proceedings of the 1988 ACM SIGMOD Int. Conf. on Management of Data, pages 235–242, 1989.
D. Saccà and C. Zaniolo. The generalized counting method of recursive logic queries for databases. Theoretical Computer Science, 187–220, 1988.
D. Saccà and C. Zaniolo. Magic counting methods. In Proceedings of the 1987 ACM SIGMOD Int. Conf. on Management of Data, pages 49–59, 1987.
D. Saccà and C. Zaniolo. On the implementation of a simple class of logic queries for databases. In Proceedings of the Fifth ACM Symposium on Principles of Database Systems, pages 16–23, 1986.
R Tarjan. Depth first search of linear graphs algorithms. SIAM J. Computing, 1(2):146–160, 1972.
J. Ullman. Principles of Data and Knowledge-Base Systems. Volume 2, Computer Science Press, New York, 1989.
J. Ullman. Principles of Data and Knowledge-Base Systems. Volume 1, Computer Science Press, New York, 1988.
C. Zaniolo. Design and implementation of a logic based language for data intensive applications. In Proc. of the Intern. Conf. on Logic Programming, 1988.
C. Zaniolo. Óbject identity and inheritance in deductive databases: an evolotionary approach. In Proc. 1st Int. Conf. on Deductive and Object-Oriented Databases, 1989.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1992 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Greco, S., Zaniolo, C. (1992). Optimization of linear logic programs using counting methods. In: Pirotte, A., Delobel, C., Gottlob, G. (eds) Advances in Database Technology — EDBT '92. EDBT 1992. Lecture Notes in Computer Science, vol 580. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0032424
Download citation
DOI: https://doi.org/10.1007/BFb0032424
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-55270-3
Online ISBN: 978-3-540-47003-8
eBook Packages: Springer Book Archive