In this chapter we introduce a number of rewriting methods for Datalog programs. Section 10.1 presents rewriting methods that apply directly to Datalog programs: the Magic Sets, Counting, Static Filtering and Semi-naive Evaluation by Rewriting. Section 10.2 presents a structured approach to the optimization of algebraic systems; it consists of a number of preliminary steps, after which the optimization methods of reduction of variables and reduction of constants are applied.
Unable to display preview. Download preview PDF.