# An algebraic rewriting theorem of multiple linear recursions and its applications

• Xiaoyong Du
• Naohiro Ishii
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 978)

## Abstract

A Horn clause in linear recursive programs can be represented by a relational operator, and the set of all such operators can be constructed as an algebraic framework, called closed semiring. In the closed semiring, the evaluation of a linear recursive query can be reduced to solving a linear equation. This paper focuses on multiple linear (mL) recursions, which consist of m linear recursive rules and one or more exit rules. We first prove an algebraic rewriting theorem for 2L recursions, that is, (A+B)*=B*(A+B+)*A*, where A and B are two operators corresponding to the two recursive rules. Then two applications of this theorem are described. The first application is that a 2L recursion can be always transformed into a set of single linear (1L) recursions so that some existed algorithms for 1L recursions can be utilized to evaluate 2L recursions. The other one is to weaken existing sufficient conditions for testing rule sequencability. Sequencability is a very important semantic property of mL recursions, because a mL recursion satisfying rule sequencability can be evaluated sequentially, therefore, efficiently.

## References

1. 1.
Bancilhon, F., Maier, D., Sagiv, Y., Ullman, J.D.: Magic Sets and Other Strange Ways to Implement Logic Programs. Proc. ACM Symp. PODS, Mar.1986, pp. 1–15Google Scholar
2. 2.
Beeri, C., Ramakrishnan, R.: On the Power of Magic. Proc. ACM Symp. PODS, Mar 1987, pp.269–283Google Scholar
3. 3.
Guh, K.C., Yu, C.: Efficient Query Processing for a Subset of Linear Recursive Binary Rules. IEEE Trans. Know. and Data Eng., Vol. 6, No.5, October 1994, pp. 842–849Google Scholar
4. 4.
Jiawei Han: Multi-Way Counting Method, Information Systems Vol. 14 No. 3 pp. 219–229, 1989
5. 5.
Han, J., Henschen, L.J.: Handling Redundancy in the Processing of Recursive Database Queries. Proc. 1987 ACM-SIGMOD Int'l Conf., May 1987, pp59–68Google Scholar
6. 6.
Han J., Liu, L.: Efficient Evaluation of Multiple Linear Recursions. IEEE Trans. Software Engineering, Vol. 17, No. 12, December 1991, pp. 1241–1252Google Scholar
7. 7.
Ioannidis, Y.E.: Commutativity and Its Role in the Processing of Linear Recursion. Proc. 15th Int'l Conf. on VLDB.1989, pp.155–163Google Scholar
8. 8.
Ioannidis, Y.E., Wong, E.: Towards an Algebraic Theory of Recursion. J.ACM, Vol. 38, NO.2, April 1991, pp. 329–381
9. 9.
Maher, M.J.: Semantics of Logic Programs. TR85/14, Dept. of Computer Science, Univ. of Melbourne, 1985Google Scholar
10. 10.
Naughton, J.F.: Compiling Separable Recursions. Proc. ACM SIGMOD Int'l Conf., June 1988, pp. 312–319Google Scholar
11. 11.
Plambeck, T.: Semigroup Techniques in Recursive Query Optimization. Proc. ACM Symp. PODS, 1990, pp. 145–153Google Scholar
12. 12.
Ramakrishnan, R., Sagiv, Y., Ullman, J.D., Vardi, M.Y.: Proof-Tree Transformation Theorems and Their Applications. Proc. ACM Symp. PODS, 1989, pp. 172–181Google Scholar
13. 13.
Saraiya, Y.P.: Polynomial-Time Program Transformations in Deductive Databases. Proc. ACM Symp. PODS, 1990, pp. 132–144Google Scholar