# Magic Sets for disjunctive Datalog programs

@article{Alviano2012MagicSF, title={Magic Sets for disjunctive Datalog programs}, author={Mario Alviano and Wolfgang Faber and Gianluigi Greco and Nicola Leone}, journal={Artif. Intell.}, year={2012}, volume={187}, pages={156-192} }

In this paper, a new technique for the optimization of (partially) bound queries over disjunctive Datalog programs with stratified negation is presented. The technique exploits the propagation of query bindings and extends the Magic Set (MS) optimization technique.
An important feature of disjunctive Datalog is nonmonotonicity, which calls for nondeterministic implementations, such as backtracking search. A distinguishing characteristic of the new method is that the optimization can be…

## Figures from this paper

## 47 Citations

### Dynamic Magic Sets for Disjunctive Datalog Programs

- Computer ScienceICLP
- 2010

Dynamic Magic Sets are an extension of this technique to ASP that allows for dynamic pruning of the search space, which may result in exponential performance gains.

### Dynamic Magic Sets for Super-Consistent Answer Set Programs

- Computer ScienceArXiv
- 2010

The correctness of DMS is formally established and proved for brave and cautious reasoning over the class of super-consistent ASP programs (ASP^{sc} programs), which includes all odd-cycle-free programs.

### Dynamic Magic Sets for Programs with Monotone Recursive Aggregates

- Computer ScienceLPNMR
- 2011

This paper designs an extension of the Dynamic Magic Set (DMS) technique to programs with stratified negation and monotone recursive aggregates, and demonstrates the correctness of the proposed technique.

### Magic-Sets for Datalog with Existential Quantifiers

- Computer ScienceDatalog
- 2012

A rewriting method extending the well-known Magic-Sets technique to any Datalog∃ program is designed, which can be safely applied to shy programs and incorporated in DLV∃, a system supporting shy.

### Enhancing Magic Sets with an Application to Ontological Reasoning

- Computer ScienceTheory and Practice of Logic Programming
- 2019

It turns out that the new version of magic sets is closed for Datalog programs with stratified negation and aggregations, which is very convenient to obtain efficient computation of the stable model of the rewritten program.

### Efficiently Computable Datalog∃ Programs

- Computer ScienceKR
- 2012

The theoretical class of parsimonious Datalog∃ programs is defined, and it is shown that it allows of decidable and efficiently-computable reasoning, and the effectiveness of DLV∃ is confirmed, which outperforms all other systems in the benchmark domain.

### Extended Magic for Negation: Efficient Demand-Driven Evaluation of Stratified Datalog with Precise Complexity Guarantees

- Computer ScienceICLP Technical Communications
- 2019

This paper extends the precise relationship between top-down evaluation and demand-driven bottom-up evaluation to Datalog with stratified negation and shows that the method provides precise complexity guarantees.

### Complexity of super-coherence problems in ASP*

- Computer ScienceTheory and Practice of Logic Programming
- 2013

This paper formally proves that deciding whether a propositional program is super-coherent is Π3 P -complete in the disjunctive case, while it is Φ2 P - complete for normal programs, and shows that all relevant ASP reasoning tasks can be transformed into tasks over super- coherent programs.

### Datalog rewritability of Disjunctive Datalog programs and non-Horn ontologies

- Computer ScienceArtif. Intell.
- 2016

### Disjunctive ASP with functions: Decidable queries and effective computation*

- Computer ScienceTheory and Practice of Logic Programming
- 2010

This paper shows that query answering in this setting is decidable, if the query is finitely recursive (ASPfsfr), and proves that the magic-set rewritten program is query equivalent to the original one (under both brave and cautious reasoning).

## References

SHOWING 1-10 OF 113 REFERENCES

### Binding Propagation Techniques for the Optimization of Bound Disjunctive Queries

- Computer ScienceIEEE Trans. Knowl. Data Eng.
- 2003

This paper presents a technique for the optimization of bound queries on disjunctive deductive databases that reduces the amount of data needed to answer the query and greatly reduces the number of models to be considered.

### Disjunctive datalog

- Computer ScienceTODS
- 1997

It is demonstrated that problems relevant in practice such as computing the optimal tour value in the Traveling Salesman Problem and eigenvector computations can be handled in disjunctive Datalog, but not Datalogs with negation (unless the Polynomial Hierarchy collapses).

### The PushDown Method to Optimize Chain Logic Programs (Extended Abstract)

- Computer ScienceICALP
- 1995

The proposed method, called pushdown, is based on the fact that a chain query can have associated a context-free language and a pushdown automaton recognizing this language can be emulated by rewriting the query as a particular fectorized left-linear program.

### Disjunctive Stable Models: Unfounded Sets, Fixpoint Semantics, and Computation

- Computer ScienceInf. Comput.
- 1997

Stable model semantics is focused on, it is shown that the set of stable models coincides with the family of unfounded-free models, and it is proved that stable models can be defined equivalently by a property of their false literals.

### Enhancing the Magic-Set Method for Disjunctive Datalog Programs

- Computer ScienceICLP
- 2004

The technique exploits the propagation of query bindings, and extends the Magic-Set optimization technique to the disjunctive case, substantially improving on previously defined approaches.

### Bottom-Up Evaluation and Query Optimization of Well-Founded Models

- Computer ScienceTheor. Comput. Sci.
- 1995

### Cost-based optimization for magic: algebra and implementation

- Computer ScienceSIGMOD '96
- 1996

A practical scheme that models magic sets rewriting as a special join method that can be added to any cost-based query optimizer, and a formal algebraic model based on an extension of the multiset relational algebra, which cleanly defines the search space and can be used in a rule-based optimizer.

### On the power of magic

- Computer SciencePODS '87
- 1987

A class of information passing strategies is considered which suffices to describe most query evaluation algorithms in the database literature, and it is shown that these strategies may always be implemented by rewriting a given program and evaluating the rewritten program bottom-up.

### Default Logic as a Query Language

- Computer ScienceIEEE Trans. Knowl. Data Eng.
- 1997

This work proposes a novel application of default logic by introducing a default query language (DQL) for finite relational databases, which is based on default rules, and shows that DQL is as expressive as SO∃∀, the existential universal fragment of second order logic.