Abstract
We identify a useful property of a program with respect to a predicate, called factoring. While we prove that detecting factorability is undecidable in general, we show that for a large class of programs, the program obtained by applying the Magic Sets transformation is factorable with respect to the recursive predicate. When the factoring property holds, a simple optimization of the program generated by the Magic Sets transformation results in a new program that is never less efficient than the Magic Sets program and is often dramatically more efficient, due to the reduction of the arity of the recursive predicate. We show that the concept of factoring generalizes some previously identified special cases of recursions, including separable recursions and right- and left-linear recursions, and that the specialized evaluation algorithms and rewriting strategies developed for those classes can be derived automatically by applying the Magic Sets transformation and then factoring the result.
Original language | English |
---|---|
Pages | 173-182 |
Number of pages | 10 |
State | Published - Aug 1989 |
Event | Proceedings of the Fifteenth International Conference on Very Large Data Bases - Amsterdam, Neth Duration: 22 Aug 1989 → 25 Aug 1989 |
Conference
Conference | Proceedings of the Fifteenth International Conference on Very Large Data Bases |
---|---|
City | Amsterdam, Neth |
Period | 22/08/89 → 25/08/89 |