In this work, answer-set programs that specify repairs of databases are used as a basis for solving computational and reasoning problems about causes for query answers from databases.
IntroductionCausality appears at the foundations of many scientific disciplines. In data and knowledge management, the need to represent and compute causes may be related to some form of uncertainty about the information at hand. More specifically in data management, we need to understand why certain results, e.g. query answers, are obtained or not. Or why certain natural semantic conditions are not satisfied. These tasks become more prominent and difficult when dealing with large volumes of data. One would expect the database to provide explanations, to understand, explore and make sense of the data, or to reconsider queries and integrity constraints (ICs). Causes for data phenomena can be seen as a kind of explanations.Seminal work on causality in DBs introduced in [17], and building on work on causality as found in artificial intelligence, appeals to the notions of counterfactuals, interventions and structural models [15]. Actually, [17] introduces the notions of: (a) a DB tuple as an actual cause for a query result, (b) a contingency set for a cause, as a set of tuples that must accompany the cause for it to be such, and (c) the responsibility of a cause as a numerical measure of its strength (building on [11]).Most of our research on causality in DBs has been motivated by an attempt to understand causality from different angles of data and knowledge management. In [6], precise reductions between causality in DBs, DB repairs, and consistency-based diagnosis were established; and the relationships where investigated and exploited. In [7], causality in DBs was related to view-based DB updates and abductive diagnosis. These are all interesting and fruitful connections among several forms of non-monotonic reasoning; each of them reflecting some form of uncertainty about the information at hand. In the case of DB repairs [3], it is about the uncertainty due the non-satisfaction of given ICs, which is represented by presence of possibly multiple intended repairs of the inconsistent DB.DB repairs can be specified by means of answer-set programs (or disjunctive logic programs with stable model semantics) [14], the so-called repair-programs. Cf. [10,3] for repair-programs and additional references. In this work we exploit the reduction of DB causality to DB repairs established in [6], by taking advantage of repair programs for specifying and computing causes, their contingency sets, and their responsibility degrees. We show that that the resulting causality-programs have the necessary and sufficient expressive power to capture and compute not only causes, which can be done with ⋆