Databases may not satisfy integrity constraints (ICs) for several reasons. Nevertheless, in most of the cases an important part of the data is still consistent wrt certain desired ICs, and the database can still give some correct answers to queries wrt those ICs. Consistent query answers are characterized as ordinary answers obtained from every minimally repaired and consistent version of the database. Database repairs can be specified as stable models of disjunctive logic programs with program constraints. In this paper, we optimize repair programs, model computation, and query evaluation from them. We make repair programs more compact by eliminating redundant rules and unnecessary programs denial constraints. These results facilitate the application of magic sets techniques to query evaluation in general, and in DLV, a logic programming system that implements the stable models semantics, in particular. We also analyze the implementation in DLV of queries with aggregate functions.
Mónica Caniupán Marileo, Leopoldo E.