Abstract 1 Introduction 2 Preliminaries 3 Formalizing the Missing Answer Problem 4 Combined Complexity 5 Data Complexity 6 Concluding Remarks and Future Work References

The Complexity of Finding Missing Answer Repairs

Jesse Comer ORCID University of Pennsylvania, Philadelphia, PA, USA Val Tannen ORCID University of Pennsylvania, Philadelphia, PA, USA
Abstract

We investigate the problem of identifying database repairs for missing tuples in query answers. We show that when the query is part of the input – the combined complexity setting – determining whether or not a repair exists is polynomial-time equivalent to the satisfiability problem for classes of queries admitting a weak form of projection and selection. We then identify the sub-classes of unions of conjunctive queries with negated atoms, defined by the relational algebra operations permitted to appear in the query, for which the minimal repair problem can be solved in polynomial time. In contrast, we show that the problem is 𝐍𝐏-hard, as well as set cover-hard to approximate via strict reductions, whenever both projection and join are permitted in the input query. Additionally, we show that finding the size of a minimal repair for unions of conjunctive queries (with negated atoms permitted) is 𝐎𝐩𝐭𝐏[log(n)]-complete, while computing a minimal repair is possible with O(n2) queries to an 𝐍𝐏 oracle. With recursion permitted, the combined complexity of all of these variants increases significantly, with an 𝐄𝐗𝐏 lower bound. However, from the data complexity perspective, we show that minimal repairs can be identified in polynomial time for all queries expressible as semi-positive datalog programs.

Keywords and phrases:
Missing answers, database repairs, datalog, computational complexity
Copyright and License:
[Uncaptioned image] © Jesse Comer and Val Tannen; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Complexity theory and logic
; Theory of computation Logic and databases
Related Version:
Extended Version: https://arxiv.org/abs/2601.06764 [14]
Editors:
Balder ten Cate and Maurice Funk

1 Introduction

We study the computational complexity of the following missing answer repair problem: given a query Q, a database instance 𝐈 (the input or source database) and a tuple a¯ which may not be in the answer Q(𝐈), the problem asks to find an update 𝖴 to 𝐈 (a collection of insertions and deletions of tuples in 𝐈, collectively called a repair), producing a repaired instance 𝐈𝖴 such that a¯Q(𝐈𝖴). The notion of “finding” a repair can be made precise in four ways: deciding if a repair exists (MAdec), deciding if a repair of size at most k exists (MAbound), determining the size of a minimal repair (MAsize), and computing a repair of minimum size (MAmin). For each version of the problem, we consider both combined complexity, where the problem is parametrized by a class of queries, and data complexity, where the problem is parametrized by a single fixed query. In both cases, we consider the schema of the database to be fixed. The missing answer problem is related to two concepts already studied in some depth in the literature: view updates and database repairs. We outline both and explain how our results differ from previous ones. We also discuss how negation relates the missing answer repair problem to other similar problems in the literature.

View updates.

The missing answer repair problem has applications to the view update problem [19]: if Q defines a view, then the missing answer repair problem is to find an update to the input database instance so that a given tuple is inserted in the view defined by Q on the updated instance. To the best knowledge of the present authors, most complexity studies of updating views have focused so far on the problem of finding instance updates in order to delete a tuple from a view. This previous work was restricted to monotonic queries, and so updates were limited to deletions of tuples from the input database (see the work on deletion propagation [8, 16, 32, 31, 43] and on resilience [22, 23, 37]). In contrast, we focus on view insertions, rather than view deletions, and we consider more general (non-monotonic) queries. Consequently, our updates are comprised of both insertions and deletions. Furthermore, our results are much more optimistic than those for deleting tuples from queries. In contrast to resilience, whose data complexity is 𝐍𝐏-hard even for some conjunctive queries, we show here that the missing answer repair problem is solvable in polynomial time, in data complexity, for all semi-positive datalog programs.

Work has also been done on insertion propagation, which seeks to add tuples to views, and annotation propagation, which seeks to modify an annotation of a tuple in the source database in order to modify the annotation of a target tuple in the view [8, 52, 15, 16]. Previous work on these problems differs in important ways from the missing answer problem studied here. To understand these differences, note that, in general, updates to a database instance with the goal of updating a view are not unique. As a result, the work on view updates has always emphasized finding instance updates which satisfy some desired criteria [19]. As mentioned previously, we focus on making insertions of tuples to query results while minimizing the size of the update applied to the database. In our later discussion of related work, we outline alternative criteria for updates that have been considered.

Database repairs.

The notion of a database repair originates in the literature on consistent query answering (CQA) [3]. In that context, given a set 𝐈𝐂 of integrity constraints and an inconsistent database instance 𝐈 (one not satisfying 𝐈𝐂), a repair is a minimally-modified consistent database instance 𝐈. The goal of CQA is to identify whether or not a given tuple is a certain answer, i.e., in the result of a given query Q for all repairs 𝐈. There are a number of ways to define what it means for 𝐈 to be “minimally-modified” from 𝐈. Most similar to the notion used here are the cardinality repair semantics [3, 36]. Given an inconsistent database instance 𝐈 and consistent database instances 𝐈 and 𝐈′′, write 𝐈C𝐈𝐈′′ if |𝐈𝐈||𝐈𝐈′′| (where ST denotes the symmetric difference of sets S and T). In CQA with cardinality repairs, the goal is to find tuples which appear in Q(𝐈) for all C𝐈-minimal consistent databases 𝐈. In other words, minimality for cardinality repairs is defined by the size of the symmetric difference between the input database and the modified database.

CQA under cardinality repair semantics is different from the missing answer repair problem in a number of important ways. A repair in CQA is a C𝐈-minimal database which is consistent with the integrity constraints 𝐈𝐂 in the input. In contrast, a repair for us is any update which places the input tuple in the answer to the input query on the updated database. This means that, given an input database and input query, the minimal repair size depends on the input tuple as well. Intuitively, rather than fixing the repair size and looking for tuples appearing in the answer to the query on all repairs, we fix the tuple and look for the smallest repair. Due to these differences, it is not immediately clear how to relate the computational complexity of these two problems.

Another context in which database repairs appear is data cleaning [21]. One of the aspects of cleaning data collected, for example, from the Web, requires restoring expected integrity constraints, and hence repairing inconsistent database instances (e.g. [33, 57, 5, 10, 25]). This is similar to CQA, except that the priority is only to restore consistency. If we consider a query language capable of expressing certain integrity constraints (typically as the truth of a Boolean query), then the missing answer repair problem asks for a minimal cardinality repair in order to update an inconsistent database to a consistent one. We do not view the work in the present paper as particularly relevant to this line of research, since expressing commonly studied forms of integrity constraints, such as functional and inclusion dependencies, or tuple-generating dependencies, is not possible without using some form of universal quantification in the query. In contrast, we focus here on fragments of semi-positive datalog, which lacks universal quantification111However, it should be noted that some integrity constraints, such as tuple-generating dependencies, can be expressed in semi-positive datalog when the universally-quantified variables are instantiated with constants. In this sense, our results show that tuple-generating dependencies can be repaired “tuple-by-tuple” in polynomial-time (for each tuple) data complexity..

Missing answers and negation.

As deletion propagation and resilience are concerned with modifying a database to add tuples to the answer of a query, they might be aptly interpreted as wrong answer repair problems. Missing and wrong answer repairs are related as follows. Given a query Q, let ¬Q (the negation of Q; see Remark 2.3) denote a query which, on each database instance 𝐈, returns the complement of Q(𝐈) (with respect to all tuples of appropriate arity over the active domain of 𝐈). Clearly, the problem of deleting a tuple from the answer to Q is the same as inserting a tuple into the answer to ¬Q. Prior work on wrong answer repairs has focused on non-recursive monotone queries, primarily conjunctive queries or unions of conjunctive queries [15, 16, 22, 40, 41, 44, 45]. In contrast, the present paper focuses on semi-positive datalog and its fragments. While negation provides a direct link between missing and wrong answer repairs, the application of negation to unions of conjunctive queries yields universal (rather than existential) queries which are not expressible in the sub-classes of semi-positive datalog that we consider here.

Contributions.

We consider four versions of the problem in the combined complexity setting: MAdec, MAbound, MAsize, and MAmin, where the problem is parametrized by a class of queries. Our main combined complexity results are summarized in the following table.

Table 1: Combined complexity results. We write UCQ¬[sjf] to denote the class of self-join-free UCQ¬ queries. Note that SJU¬ (resp. SPU¬) denotes the class of projection-free (resp. join-free) UCQ¬ queries. Similarly, PJ denotes the class of selection-free conjunctive queries. The tag “sp” for Datalog stands for “semi-positive” (i.e., programs having atomic negation). We formally define these classes in Section 2.
Query Class MAdec MAbound MAsize MAmin
UCQ¬[sjf] 𝐏 𝐏 𝐏 𝐏
SJU¬ 𝐏 𝐏 𝐏 𝐏
SPU¬ 𝐏 𝐏 𝐏 𝐏
PJ 𝐏 𝐍𝐏-compl. 𝐎𝐩𝐭𝐏[log(n)]-compl. 𝐅𝐏𝐍𝐏[n2]
UCQ¬ 𝐏 𝐍𝐏-compl. 𝐎𝐩𝐭𝐏[log(n)]-compl. 𝐅𝐏𝐍𝐏[n2]
Datalog 𝐄𝐗𝐏-compl. 𝐄𝐗𝐏-compl. 𝐅𝐄𝐗𝐏 𝐅𝐄𝐗𝐏
sp-Datalog 𝐄𝐗𝐏-compl. 𝟐𝐄𝐗𝐏 𝐅𝟐𝐄𝐗𝐏 𝐅𝟐𝐄𝐗𝐏
RA Undecidable 𝟐𝐍𝐄𝐗𝐏 Uncomputable Uncomputable

Some of the results in Table 1 are not tight; in cases like this, the table depicts only our best upper bound for the complexity of the problem. For example, the upper bound we provide for MAmin for {PJ,UCQ¬} is 𝐅𝐏𝐍𝐏[O(n2)], which does not match our lower bound of 𝐅𝐏𝐍𝐏[O(log(n))]. However, this is typical for such results on oracle complexity for (the function versions of) optimization problems222The formal definitions of 𝐅𝐏𝐍𝐏[O(log(n))] and 𝐅𝐏𝐍𝐏[O(n2)] can be found in Section 2.. For example, to the authors’ knowledge, the best known lower bound for constructing optimal solutions for optimization problems like minimum set cover, minimum vertex cover, maximum clique, and others, is 𝐅𝐏𝐍𝐏[O(log(n))], while the tightest known upper bound known for these problems is 𝐅𝐏𝐍𝐏[O(n)]. Another bound which is not tight is the complexity of MAsp-Datalogbound. We show in Section 4 that this problem is 𝐄𝐗𝐏-hard and contained in 𝟐𝐄𝐗𝐏, but we leave open its precise complexity.

In addition to the results depicted in the Table 1, we also provide a minimum set cover-hardness of approximation result for MAPJmin via strict reductions (a special case of the L-reductions defined in [48]; see Definition 2.5). The class 𝐎𝐩𝐭𝐏, introduced in [34] and expounded further in [24], is used to capture the complexity of determining the optimal value for 𝐍𝐏-complete optimization problems. Given the 𝐍𝐏-completeness of MAPJbound, this is the natural class to capture the complexity of MAPJsize.

In data complexity, we study the MAQdec, MAQbound, and MAQmin problems, where the query Q is fixed; the results are summarized in Table 2. Note that the complexity of the MAQbound, MAQsize, and MAQmin problems for RA queries Q varies from query to query; we discuss the decidability of these problems at the end of Section 5. Furthermore, the results on CCQ follow immediately from the observations in the introduction involving negation, together with results from [22, 23] providing dichotomies for resilience of certain sub-classes of conjunctive queries. The MAQsize and MAQmin results for this class follow from standard arguments ([47, pgs. 415-422]) using binary search with 𝐍𝐏 oracle queries to identify the size of an optimal repair as well as a polynomial-time construction of a minimal repair via 𝐍𝐏 oracle queries. We include this row to indicate that the various missing answer problems can be intractable, even in data complexity, for reasonable classes of queries.

Table 2: Data complexity results. We write CCQ to denote the class of queries of the form ¬Q (see Remark 2.3), where Q is a conjunctive query.
Query Class MAQbound MAQsize MAQmin
sp-Datalog 𝐏 𝐏 𝐏
CCQ 𝐏 or 𝐍𝐏-compl. 𝐏 or 𝐅𝐏𝐍𝐏[log(n)] 𝐏 or 𝐅𝐏𝐍𝐏
RA Decidable Computable Computable

Related work.

Under combined complexity, the missing answer repair problem generalizes query satisfiability [1] (recall that a query Q is satisfiable if there exists a database instance 𝐈 where Q(𝐈)). More precisely, a Boolean query Q is satisfiable if and only if there exists a repair for the input Q,𝐄,ϵ to the missing answer decision problem, where 𝐄 and ϵ are the empty database and empty tuple, respectively. In Section 4, we extend this observation to non-Boolean queries, and we use this relationship to transfer known complexity lower bounds for satisfiability to the missing answer problem for many classes of queries.

As mentioned in the introduction, there are, in general, many updates to a database which might yield a desired change in a view. Consequently, work on view updates has focused on finding updates with certain goals in mind: (1) minimizing the size of the instance update, (2) updating the instance while preserving specified integrity constraints, (3) determining if an update to the view exists which does not induce any other view “side-effects,” and (4) minimizing “side-effects” on the view. Note that view side-effects refer to additional changes to the tuples appearing in the view beyond the original desired update.

We focus on view insertions which minimize the number of insertions and deletions made to the database (i.e., goal (1) above). This problem has been studied to some extent in prior work. In particular, it was shown in [15, 16] that for selection-free conjunctive queries, under combined complexity, computing a minimal repair for view insertions is 𝐍𝐏-hard, while it can be done in polynomial-time for unions of conjunctive queries which lack either joins or projections. We refine this result in several ways. First, we provide a similar hardness result for selection-free conjunctive queries, even under the assumption that the schema is fixed. In contrast, [15] allows for arbitrarily many relations to occur in the schema, and their proof of hardness depends on this fact. Second, we show that the polynomial-time results are extendable to queries with atomic negation. Finally, we provide concrete upper bounds in 𝐎𝐩𝐭𝐏 and 𝐅𝐏𝐍𝐏 for the functional versions of these problems (MAsize and MAmin). Other work on insertion propagation has emphasized (2) and (3), particularly on computing updates to the source database which maintain integrity constraints such as functional dependencies without view side-effects [43, 44]. This has also been the focus for much of the work on annotation propagation [15, 16]. In the study of deletion propagation and resilience, all of (1) through (4) have been studied [8, 15, 16, 32, 31, 22, 41, 40, 45, 23, 42], albeit not for query languages as powerful as those we study in this paper.

In [41], the authors define a bounded insertion propagation problem, which they show is Σ2P-complete for conjunctive queries under combined complexity. The problem defined in that paper is analogous to our definition of the MAbound problem, but differs in important ways. First, the schema is not fixed. Second, the relations are assumed to be associated with typed attributes, where the domain of each attribute is specified in the input. In contrast, we assume that the schema is fixed, and that any data (even outside the active domain of the input structure) can appear in repairs. Both of these differences feature prominently in the Σ2P-completeness proof in [41, Theorem 4], and so it is clear that the problem is computationally much different. In particular, a consequence of our results is that the MAbound problem for conjunctive queries is 𝐍𝐏-complete.

One significant difference between the work presented here and prior work on the missing and wrong answer problems is that we consider more powerful query languages. We consider conjunctive queries, unions of conjunctive queries, and datalog, as well as their extensions with negated (extensional) atoms. In particular, such extensions require that repairs consist of both insertions and deletions, as opposed to just insertions, which suffice only to repair missing answers for monotone queries. With respect to combined complexity, the relationship with satisfiability is for arbitrary classes of queries closed only under composition with weak forms of selection or projection. In contrast, previous work on wrong answers focuses on unions of conjunctive queries (UCQs) [8, 16] or just conjunctive queries (CQs) [32, 31, 22, 23]. Another significant difference is that we allow for insertions with data that is not necessarily in the active domain of the input database 𝐈 or the query Q. For queries without negation, this makes no difference; however, as mentioned above, we consider queries with negated atoms. In contrast, prior work on missing answers for arbitrary first-order queries [25, 57] limits insertions to those constructed from active domain elements.

It is also important to highlight a distinct approach to view updates originating in [19], where the authors define update translations and provide conditions for a correct translation of view updates. This work is extended in [4], which introduces the notion of the complement of the view, which is a particular type of mapping from database instances to pairs of views. Note that the translation and complement definitions are independent of a given database model. In [17], the authors apply this framework specifically to the relational database model, in the simplified setting with a single relation, functional dependencies, and views defined by projections on that relation. The authors provide several complexity results for decision problems related to view insertions and view complements. In general, these problems appear in the lower levels of the polynomial hierarchy, and more work is needed to determine the relationship of this framework to the missing answer repair problem studied here.

The issue of finding explanations for missing answers has also been studied using a variety of techniques [12, 28, 27, 54, 56, 50, 7, 6, 49], and especially using formalizations of provenance [9, 26, 29, 25, 57] and of causality. The latter work discusses two ways of quantifying the relative importance of causes: responsibility [39, 38] and resilience [22, 23, 37]. In fact, computing resilience is essentially computing repairs for wrong answers.

2 Preliminaries

Basic notation and definitions.

We fix countably infinite sets 𝐕𝐚𝐫 and 𝐃𝐨𝐦 of variables and constants, respectively. Terms are elements of 𝐕𝐚𝐫𝐃𝐨𝐦. An assignment is a partial map g:𝐕𝐚𝐫𝐃𝐨𝐦. We write x,y,z,u,v to denote variables, a,b,c,d,e to denote constants, and s,t to denote arbitrary terms. We use an overline notation to denote tuples of variables or constants, and we write len(a¯) to denote the length of a tuple a¯. Given a tuple t¯ of terms and an assignment g, we write g(t¯) to denote the tuple of constants obtained by replacing all variables in t¯ with their image under g. We will sometimes abuse notation by treating tuples as sets. We fix a finite schema Σ of extensional database predicates (EDBs) and an infinite schema 𝐒 of intensional database predicates (IDBs). Each relation symbol FΣ𝐒 has an associated natural number arity (denoted 𝐚𝐫𝐢𝐭𝐲(F)), and we assume 𝐒 contains infinitely many symbols of each arity.

Atoms are either equalities of the form s=t, where s and t are terms, or expressions of the form F(t1,,tk), where FΣ𝐒 with 𝐚𝐫𝐢𝐭𝐲(F)=k and t1,,tk are terms. An extensional (resp. intensional) atom is one constructed with a relation symbol from Σ (resp. 𝐒). A positive literal is an atom, and a negative literal is an expression of the form ¬α, where α is a positive literal. We write α,β,γ to denote (positive or negative) literals. We write 𝐫𝐞𝐥(α) to denote the relation symbol occurring in a literal α and 𝐯𝐚𝐫(α) to denote the variables occurring in α. A fact is an extensional atom with no variables. Given a subset D𝐃𝐨𝐦, we write 𝐅𝐚𝐜𝐭𝐬(D) to denote the set of all facts containing only constants in D. An instance is a finite set of facts; we denote instances by 𝐈, 𝐉.

A datalog rule is an expression r of the form

S(x¯):-α1,,αn, (1)

where S(x¯) is an intensional atom, x¯ is a tuple over 𝐕𝐚𝐫 with len(x¯)=𝐚𝐫𝐢𝐭𝐲(S), each αi is a positive literal with 𝐫𝐞𝐥(αi)Σ𝐒, and x¯y¯=in𝐯𝐚𝐫(αi). We refer to S(x¯) as the head of r, and α1,,αn as the body of r, denoted 𝐁𝐨𝐝𝐲r(y¯). While we do not allow constants to appear in the head of rules, these can be simulated using equality atoms in the body of the rule. We write 𝐟𝐫𝐞𝐞(r) to denote the variables occurring in the head of r and 𝐛𝐨𝐮𝐧𝐝(r) to denote the variables in the body of r which do not occur in 𝐟𝐫𝐞𝐞(r). Additionally, we set 𝐯𝐚𝐫(r)=𝐟𝐫𝐞𝐞(r)𝐛𝐨𝐮𝐧𝐝(r). If t¯ is a tuple of terms with len(y¯)=len(t¯), then we write 𝐁𝐨𝐝𝐲r(t¯) to denote the expression obtained by substituting the terms in t¯ for the corresponding variables in y¯.

A datalog program P is a finite sequence r1,,rm of rules such that every intensional relation symbol which occurs in the body of some ri also must occur in the head of some rj; each datalog program P also has a designated intensional relation symbol 𝐚𝐧𝐬P denoting the answer predicate for P. The arity of a program P (denoted by 𝐚𝐫𝐢𝐭𝐲(P)) is the arity of its answer predicate. We also assume that all datalog programs are safe, meaning that every variable in each rule appears in some positive literal in the body of the rule.

A conjunctive query is a datalog program containing a single rule whose body contains only extensional atoms, and a union of conjunctive queries is a datalog program consisting of conjunctive queries, each having the same head. We write CQ, UCQ, and Datalog to denote the classes of conjunctive queries, unions of conjunctive queries, and datalog programs, respectively. A semi-positive datalog rule has the same form as a datalog rule (see Equation 1), except that we allow each αi to be a positive literal with 𝐫𝐞𝐥(αi)Σ𝐒, a negative literal with 𝐫𝐞𝐥(αi)Σ, or an inequality atom of the form st, where s,t𝐃𝐨𝐦𝐕𝐚𝐫. We write CQ¬, UCQ¬, and sp-Datalog for the extensions of CQ, UCQ, and Datalog with negated extensional atoms and inequality atoms. We will generally use P to denote Datalog or sp-Datalog programs, and Q to denote queries in UCQ¬ or its sub-classes. We write adom(Q) for the set of constants occurring in a query Q, and for a database instance 𝐈, we also set adom(Q,𝐈)=adom(Q)adom(𝐈).

In Section 4, we provide a characterization of which subclasses of UCQ¬ (i.e., SPJU¬), defined by operations of the relational algebra, admit polynomial-time solvability of the missing answer problem. Rather than introduce the notation of the relational algebra, we instead look at the equivalent notions in our rule-based framework. We say that a semi-positive datalog program P is self-join-free if, for each rule r in P, the body of r does not contain more than one occurrence of a given relation symbol in Σ𝐒. We say that a semi-positive datalog program P is projection-free if, for each rule r in P, we have that 𝐛𝐨𝐮𝐧𝐝(r)=. We say that a semi-positive datalog program is selection-free if it contains no occurrences of constants or equality atoms and none of its atoms contain duplicate variables. We say that r is join-free if the body of the rule contains only one atom. We write PJ for the selection-free sub-class of CQ, SPU¬ for the join-free sub-class of UCQ¬, and SJU¬ for the projection-free sub-class of UCQ¬. We study these classes in Section 4.

As suggested in the introduction, the missing answer repair problem for a class of queries may be seen as a generalization of the satisfiability problem for , formally defined below.

Definition 2.1.

Let denote an arbitrary class of queries. The dbSAT problem is to determine, given a query Q, whether or not there exists an instance 𝐈 such that Q(𝐈).

It is well-known that this problem is undecidable for the relational calculus [53], and hence also for relational algebra and stratified datalog. In addition to satisfiability, we will also compare the evaluation problem to the missing answer repair problem.

Definition 2.2.

Let denote an arbitrary class of queries. Given an input of the form Q,𝐈,a¯, where Q, 𝐈 is an instance, and a¯𝐃𝐨𝐦, the evaluation problem for , denoted EvalL, is to determine whether or not a¯Q(𝐈).

We write EvalQ to denote the data complexity version of this problem, where the query Q is fixed, and inputs are of the form 𝐈,a¯. Finally, for ease of reference, we define the following notion of the negation of a query.

 Remark 2.3.

In the introduction, we defined the negation of a query as follows: given a query Q, let ¬Q (the negation of Q) denote a query which, on each database instance 𝐈, returns the complement of Q(𝐈) (with respect to all tuples of appropriate arity over the active domain of 𝐈). Note that we do not specify to which query class the negation of a query belongs; we define it only in terms of the map between database instances that it represents. However, it should be noted that if Q is expressible in the relational algebra (RA), then ¬Q is also expressible in RA as the difference of D𝐚𝐫𝐢𝐭𝐲(Q) and Q, where D𝐚𝐫𝐢𝐭𝐲(Q) is the UCQ query that returns the set of all tuples of length 𝐚𝐫𝐢𝐭𝐲(Q) over the active domain of an instance.

Complexity Definitions.

We assume familiarity with the usual classes 𝐏, 𝐍𝐏, 𝐄𝐗𝐏, 𝐍𝐄𝐗𝐏, 𝟐𝐄𝐗𝐏, and 𝟐𝐍𝐄𝐗𝐏. We prepend an “F” to a class to indicate the corresponding class of function problems (e.g., 𝐅𝐏, 𝐅𝐄𝐗𝐏).

Definition 2.4.

An approximation problem is a triple P=(,𝒮,cost), where is a set of instances, 𝒮 is a map from instances x to sets 𝒮(x) of feasible solutions, and cost is a map from pairs (x,S(x)) to natural numbers. The optimal cost for an instance x is cost(x):=miny𝒮(x)cost(x,y). We write opt(x) to denote the set of solutions y such that cost(x,y)=cost(x).

Definition 2.5 (Strict reduction, [46]).

Consider approximation problems P1=(1,𝒮1,cost1) and P2=(2,𝒮2,cost2). A strict reduction from P1 to P2 is a pair of polynomial-time computable functions (f,h) where f:12 and h is a map from pairs (x,y), where x1 and y𝒮2(f(x)), to elements of 𝒮1(x), such that

  1. 1.

    If x1, y𝒮2(f(x)), and yopt(f(x)), then h(x,y)opt(x), and

  2. 2.

    for all x1 and y𝒮2(f(x)), we have that cost(h(x,y))cost(y).

Definition 2.6.

The class 𝐅𝐏𝐍𝐏 is the class of function problems computable in polynomial time with access to an 𝐍𝐏 oracle. For a time-constructible function l(n), we write 𝐅𝐏𝐍𝐏[l(n)] for the class of function problems computable in polynomial time with O(l(n)) queries to an 𝐍𝐏 oracle, where n is the size of the input.

For the next three definitions, we fix a finite tape alphabet Γ.

Definition 2.7 (𝐍𝐏 metric Turing machines, [34]).

An 𝐍𝐏 metric Turing machine M is a nondeterministic polynomially-time-bounded Turing machine such that every branch writes a binary number and accepts or rejects. The output of such a machine on an input xΓ is the smallest value on any accepting branch of M on the input x, denoted optM(x).

Definition 2.8 (Optimization Polynomial Time, [34]).

A function f:Γ is in 𝐎𝐩𝐭𝐏 if there is an 𝐍𝐏 metric Turing machine M such that f(x)=optM(x) for all xΓ. Furthermore, f is in 𝐎𝐩𝐭𝐏[l(n)] if f𝐎𝐩𝐭𝐏 and the binary encoding of f(x) is bounded by l(|x|) for all xΓ.

Definition 2.9 (Metric reductions, [34]).

Let P1,P2:Γ. A metric reduction from P1 to P2 is a pair of polynomial-time computable functions (f,g) where f:ΓΓ and g:Γ× such that P1(x)=g(x,P2(f(x))) for all xΓ. A metric reduction (f,g) is linear if the map kg(x,k) is linear and exact if g(x,k)=k.

3 Formalizing the Missing Answer Problem

To address the problem of finding minimal repairs for missing answers, we also study the problems of determining if a repair exists at all, determining if a repair within a given size bound exists, and determining the size of a minimal repair. Thus we define repairs as updates placing the desired tuple in the query answer, without reference to the size of the update.

Definition 3.1 (Updates).

An update for a database instance 𝐈 is a pair 𝖴=(𝖨𝗇𝗌,𝖣𝖾𝗅), where 𝖨𝗇𝗌𝐅𝐚𝐜𝐭𝐬(𝐃𝐨𝐦)𝐈 and 𝖣𝖾𝗅𝐈 are finite sets of facts to be inserted into and deleted from 𝐈. Given an update 𝖴 for 𝐈, we define 𝐈𝖴=(𝐈𝖨𝗇𝗌)𝖣𝖾𝗅. The size of an update 𝖴 is |𝖴|=|𝖨𝗇𝗌𝖣𝖾𝗅|. We say that 𝖴 is an update over D𝐃𝐨𝐦 if 𝖨𝗇𝗌𝖣𝖾𝗅𝐅𝐚𝐜𝐭𝐬(D). We say that an update 𝖴 is a repair with respect to a triple Q,𝐈,a¯ if a¯Q(𝐈𝖴).

In other words, the size of an update is the number of insertions and deletions that it contains. Note that |𝖴|=|𝐈𝐈𝖴|; i.e., a minimal repair is one which minimizes the size of the symmetric difference between the input instance 𝐈 and the updated instance 𝐈𝖴. This measure of minimality is similar to the notion of a repair in consistent query answering under the cardinality-based repair semantics [3, 36].

Definition 3.2 (The missing answer problems).

Let denote an arbitrary class of queries. We define four computational problems.

  1. 1.

    MAdec (the missing answer decision problem): given Q,𝐈,a¯, determine whether or not there exists a repair 𝖴 with respect to Q,𝐈,a¯;

  2. 2.

    MAsize (the bounded missing answer repair problem): given Q,𝐈,a¯,k, determine whether or not there exists a repair 𝖴 with respect to Q,𝐈,a¯ such that |𝖴|k;

  3. 3.

    MAsize (the missing answer repair size problem): given an input Q,𝐈,a¯ compute the minimum size of a repair 𝖴 with respect to Q,𝐈,a¯, or otherwise indicate that a repair does not exist; and

  4. 4.

    MAmin (the missing answer repair problem): given Q,𝐈,a¯, compute a minimum-cardinality repair 𝖴 with respect to Q,𝐈,a¯, or otherwise indicate that a repair does not exist;

where Q, 𝐈 is an instance, a¯ is a tuple over 𝐃𝐨𝐦 with len(a¯)=𝐚𝐫𝐢𝐭𝐲(Q), and k.

Note that the above definitions allow arbitrary queries of the class to appear in the input – this is the combined complexity setting, discussed in Section 4. We will also study MAQbound, the variant of the bounded missing answer repair problem in which the query Q is fixed, inputs are of the form 𝐈,a¯,k, and the goal is to determine whether or not a repair 𝖴 with respect to Q,𝐈,a¯ such that |𝖴|k exists. Similarly, we study MAQsize and MAQmin, the missing answer repair size and missing answer repair problems in which the query Q is fixed, inputs are of the form 𝐈,a¯, and the goal is to compute a repair 𝖴 with respect to Q,𝐈,a¯ of minimal cardinality. The MAQbound, MAQsize, and MAQmin problems are the data complexity versions, which are the focus of Section 5. In both the data and combined complexity settings, we consider the schema Σ of extensional database predicates to be fixed.

Preliminary complexity observations.

Before turning to our main results, we begin with some preliminary observations.

Proposition 3.3.

Let be a class of queries. Then

  1. 1.

    EvalL𝐏MAbound; and

  2. 2.

    EvalL can be decided in linear time with a single call to an MAsize (or MAmin) oracle.

Proof.

The first claim is by the reduction Q,𝐈,a¯Q,𝐈,a¯,0. The second claim follows from the observation that MAsize(Q,𝐈,a¯)=0 if and only if MAmin(Q,𝐈,a¯)=(,) if and only if EvalL(Q,𝐈,a¯) returns true. The linear running time is only required in order to copy the input to the oracle tape, call the oracle, and return the answer.

Note that the relationships in Proposition 3.3 also hold for the data complexity versions of the problems. Since EvalCQ is 𝐍𝐏-complete [11], it follows immediately from Proposition 3.3 that MACQbound is 𝐍𝐏-hard, and that MACQmin cannot be solved in polynomial time (unless 𝐏=𝐍𝐏). We refine these statements significantly in Section 4. Proposition 3.3 also implies that MADatalogbound is 𝐄𝐗𝐏-hard, since EvalDatalog is 𝐄𝐗𝐏-complete [18] (implicit in [55, 30]).

We now consider some basic relationships between the different versions of the missing answer problem. Clearly, the MAmin problem is at least as hard as MAdec, MAbound, and MAsize; similarly, MAQmin is at least as hard as MAQsize and MAQbound. Furthermore, MAbound is the natural “decision version” of the MAmin optimization problem. There is no immediate relationship between MAbound and MAdec, since for a given triple Q,𝐈,a¯, there may be a repair, but not one of size k. However, a straightforward relationship can be identified for classes of queries with the following property.

Definition 3.4 (Computable bounded repairs).

We say that a class of queries admits computable bounded repairs if there exists a computable function β which takes as input tuples of the form Q,𝐈,a¯ and returns a finite set S𝐃𝐨𝐦 such that, if a repair 𝖴 with respect to Q,𝐈,a¯ exists, then a repair 𝖴 with respect to Q,𝐈,a¯ over S also exists.

The intuition for Definition 3.4 is in the name: for a class of queries which admits computable bounded repairs, there is a computable function which outputs a finite search space of repairs for any missing answer input for that class. A notion similar to Definition 3.4 will appear in Section 5 when analyzing the data complexity of the MAQmin problem for sp-Datalog queries Q (cf. Definition 5.1). It is straightforward from Definition 3.4 to verify the following proposition.

Proposition 3.5.

If is a class of queries which admits computable bounded repairs and EvalL is decidable, then the map Q,𝐈,a¯Q,𝐈,a¯,pΣ(|β(Q,𝐈,a¯)|) is a computable reduction from MAdec to MAbound, where pΣ(n)=RΣn𝐚𝐫𝐢𝐭𝐲(R).

Importantly, although the MAbound problem for a class of queries appears to have the flavor of an 𝐍𝐏 problem, this is not true in general. As an example, the combined complexity of Datalog evaluation is 𝐄𝐗𝐏-complete [18, 55, 30], and so MAbound is not in 𝐍𝐏 (unless 𝐍𝐏=𝐄𝐗𝐏), since EvalDatalogPMADatalogbound per Proposition 3.3. However, since inputs to MAbound include the integer k which bounds the total number of insertions and deletions in witness repairs, it suffices to consider repairs which are at most exponentially-large with respect to the input. This allows us to state a general upper bound, which requires only that the class of queries in question has an evaluation problem in 𝐍𝐄𝐗𝐏, and that the class contains only generic queries, as defined below.

Definition 3.6 (Generic queries).

Let ρ:𝐃𝐨𝐦𝐃𝐨𝐦 be an arbitrary bijective map. Given an instance 𝐈, we write ρ(𝐈) to denote the instance obtained by replacing each constant in each fact of 𝐈 with its image under ρ. We define ρ(𝖴) similarly for an update 𝖴. A query Q is D-generic for a subset D𝐃𝐨𝐦 if, for any database 𝐈 and any bijective map ρ:𝐃𝐨𝐦𝐃𝐨𝐦 which fixes D point-wise (i.e., such that ρ(d)=d for all dD), we have that ρ(Q(𝐈))=Q(ρ(𝐈)). We say that a query Q is generic if it is adom(Q)-generic.

In other words, a query is generic if its answer is invariant to renaming constants not explicitly appearing in the active domain of the query. We are now ready to state and prove the general upper bound for MAbound.

Proposition 3.7.

Let be a class of generic queries. If EvalL is in 𝐍𝐄𝐗𝐏, then MAbound is in 𝟐𝐍𝐄𝐗𝐏.

Proof (sketch)..

By genericity, for an input Q,𝐈,a¯,k of size N, it suffices to consider repairs over a¯adom(Q,𝐈)C, where C is a set of fresh constants of size k. The algorithm proceeds as follows: non-deterministically generate an update 𝖴 of cardinality at most k, and then non-deterministically generate a possible witness for EvalL for the instance 𝐈𝖴. The algorithm concludes by computing EvalL(𝐈𝖴) and returning the answer. This algorithm is clearly correct. Furthermore, note that, since k is represented in binary, the instance 𝐈𝖴 may be exponentially-larger than the encoding of the input. Then, because the witness for EvalL may be exponentially-larger than 𝐈𝖴, the algorithm is in 𝟐𝐍𝐄𝐗𝐏.

Since Evalsp-Datalog is in 𝐄𝐗𝐏 and EvalRA is in 𝐏𝐒𝐏𝐀𝐂𝐄 ([1]), the above result implies that MADatalogbound, MAsp-Datalogbound, and MARAbound are in 𝟐𝐍𝐄𝐗𝐏. Note that the argument for Proposition 3.7 also yields a 𝟐𝐍𝐄𝐗𝐏 upper bound for the complexity of MAbound even if we assume that EvalL is in 𝐄𝐗𝐏; we state the proposition for the hypothesis that EvalL is in 𝐍𝐄𝐗𝐏 to make it as general as possible. In Section 4, we refine the upper bound for MADatalogbound (resp. MAsp-Datalogbound) down to 𝐄𝐗𝐏 (resp. 𝟐𝐄𝐗𝐏) by giving a 𝐅𝐄𝐗𝐏 (resp. 𝐅𝟐𝐄𝐗𝐏) algorithm for MADatalogmin (resp. MAsp-Datalogmin).

While MAbound is not always an 𝐍𝐏 problem, we can give a very simple general criterion for MAbound to be in 𝐍𝐏. Say that a class of queries admits polynomially-bounded repairs if admits computable bounded repairs and β is computable in polynomial time. Then by a similar algorithm to the proof of Proposition 3.7, we obtain the following proposition.

Proposition 3.8.

Let be a class of generic queries. If admits polynomially-bounded repairs and EvalL is in 𝐍𝐏, then MAbound is in 𝐍𝐏.

Recall that a query Q in UCQ¬ is satisfied in an instance if there exists a satisfying assignment from the domain of the instance to one of the conjunctive queries in the definition of Q. Let m denote the number of variables in the conjunctive query in the definition of Q with the most variables. The range of a satisfying assignment for Q has size at most m, and so it suffices to consider repairs over the domain a¯adom(Q,𝐈)C, where C is a set of m fresh constants. We conclude that UCQ¬ admits polynomially-bounded repairs. Furthermore, it is already known that EvalUCQ¬ is in 𝐍𝐏 [1]. Hence UCQ¬ satisfies the hypotheses of Proposition 3.8, and so the MAUCQ¬bound problem (and MAbound for all syntactic fragments of UCQ¬) are in 𝐍𝐏.

4 Combined Complexity

We now show that for many classes of queries , the MAdec (see Definition 3.2) and dbSAT (see Definition 2.1) problems are mutually polynomial-time reducible, and we deduce a number of complexity results as corollaries. We then show that MAUCQ¬[sjf]min, MASJU¬min, and MASPU¬min can be solved in polynomial time. From this, it also follows that MAUCQ¬[sjf]bound, MASJU¬bound, and MASPU¬bound are in 𝐏. Recall that SJU¬ and SPU¬ are the projection-free and join-free fragments of UCQ¬, respectively. Then, we provide a strict polynomial-time reduction, which doubles as a metric reduction (see Section 2 for the reduction definitions), which shows that MAPJbound is 𝐍𝐏-complete and MAPJsize is 𝐎𝐩𝐭𝐏[log(n)]-hard. We conclude by showing that there exist an 𝐎𝐩𝐭𝐏[log(n)] algorithm for MAPJsize, an 𝐅𝐏𝐍𝐏 algorithm for MAUCQ¬min, and a 𝐅𝐄𝐗𝐏 algorithm for MAmin.

The missing answer decision problem.

For our results relating MAdec and dbSAT, we need only to assume that the query class is closed under a weak form of selection and projection. We say that a class of queries is closed under (weak) selection if there is a polynomial-time computable map which, given an n-ary query Q and a tuple a¯ of length n, constructs a query Q such that for all instances 𝐈, we have Q(𝐈) if and only if a¯Q(𝐈). We say that a class of queries is closed under (weak) projection if there is a polynomial-time computable map which, given Q, constructs a query Q such that for all instances 𝐈 we have Q(𝐈)= if and only if Q(𝐈).

Theorem 4.1.

If is closed under (weak) selection, then MAdec𝐏dbSAT.

Proof.

Given an input Q,𝐈,a¯ to MAdec, let Q be the query in guaranteed by closure under weak selection. If Q,𝐈,a¯MAdec, then Q(𝐈𝖴), and so QdbSAT. Conversely, if QdbSAT, then there exists an instance 𝐉 such that Q(𝐉)=, and so a¯Q(𝐉). Then for the repair 𝖴=(𝖨𝗇𝗌,𝖣𝖾𝗅) where 𝖨𝗇𝗌=𝐉𝐈 and 𝖣𝖾𝗅=𝐈𝐉, we have that 𝐈𝖴=𝐉. Hence a¯Q(𝐈𝖴), and so we conclude that Q,𝐈,a¯MAdec.

The proof of the next theorem is similar to the proof of Theorem 4.1.

Theorem 4.2.

If is closed under (weak) projection, then dbSAT𝐏MAdec.

All query classes mentioned in Section 2 satisfy the weak selection and projection properties, and the maps are in fact computable in time linear in the size of the query.

Corollary 4.3.

The following statements hold.

  1. 1.

    MAUCQ¬dec is decidable in 𝐏;

  2. 2.

    MADatalogdec and MAsp-Datalogdec are 𝐄𝐗𝐏-complete;

  3. 3.

    MARAdec is undecidable.

Proof.

By Theorems 4.1 and 4.2, together with known results on the complexity of the satisfiability problems for these classes [1, 51, 35, 53].

Since MAdec can be solved with an oracle for MAsize or MAmin, Corollary 4.3 implies MADatalogsize, MAsp-Datalogsize, MADatalogmin, and MAsp-Datalogmin are 𝐄𝐗𝐏-hard, while MARAsize and MARAmin are uncomputable.

The (bounded) missing answer repair problem.

We now turn to the complexity of the MAbound and MAmin problems for sub-classes of UCQ¬. For the polynomial-time cases of MAbound, it clearly suffices to show that MAmin can be solved in polynomial time.

Theorem 4.4.

The MAUCQ¬[sjf]min, MASJU¬min, and MASPU¬min problems are in 𝐅𝐏.

Proof (sketch).

To find a minimal repair for a query QUCQ which is the union of conjunctive queries Q1,,Qm, it suffices to find minimal repairs 𝖴i for each Qi and return the smallest of these. Thus we need only to show that minimal repairs for CQ¬[sjf], SJ¬, and SP¬ queries can be found in polynomial time. For the first, observe that for a self-join-free conjunctive query, the body contains at most |Σ| literals. Since the schema is fixed, we can form a repair for a triple Q,𝐈,a¯ with only a constant number of insertions or deletions over the domain a¯adom(Q,𝐈){c}, where c is a fresh constant. Furthermore, the EvalCQ¬[sjf] is in polynomial-time, and so we can solve MACQ¬[sjf]min in polynomial-time with a brute force search of all possible repairs. The MASJ¬min and MASP¬min cases are similar, and their proofs can be found in the extended version of this paper [14].

Theorem 4.5.

MAUCQ¬size is in 𝐎𝐩𝐭𝐏[O(log(n))] and MAUCQ¬min is in 𝐅𝐏𝐍𝐏.

Proof.

We know that UCQ¬ has polynomially-bounded repairs (see Section 3). Hence we can solve MAUCQ¬size with an 𝐍𝐏 metric Turing machine as follows. Given an input Q,𝐈,a¯, on each branch of the computation, we non-deterministically generate a possible update, non-deterministically generate a possible satisfying assignment, and then check if the satisfying assignment witnesses that the update is a repair with respect to Q,𝐈,a¯. If yes, then we write down the size of the repair in binary and accept. Otherwise, we reject on that branch. This algorithm is clearly correct, and each branch runs in polynomial time.

For membership of MAUCQ¬min in 𝐅𝐏𝐍𝐏[O(n2)], let Q,𝐈,a¯ be an input with Q in UCQ¬. We first determine the size K of the optimal repair (if it exists) by a binary search, using 𝐍𝐏 queries to MAUCQ¬bound, on the interval [0,m], where m is the number of literals in the rule of Q with the most literals. Then, we construct an optimal repair as follows. First, we let C denote a set of constants distinct from a¯adom(𝐈) equal to the number of variables occurring in Q, and we initialize a partial assignment g={xi,aiilen(a¯)}. For each variable x in Q and each element b in a¯adom(D)C, we query the oracle for an answer to “does there exist a repair with respect to Q,𝐈,a¯ of size K where the fact that a¯Q(𝐈) is witnessed by an assignment extending g{x,b}?” It is straightforward to see that this query is in 𝐍𝐏. Furthermore, we need only ask O(m(|a¯|+|adom(𝐈)|+m)) queries to this oracle, which is quadratic in the size of the input. Hence MAUCQ¬min is in 𝐅𝐏𝐍𝐏[O(n2)].

We now provide 𝐎𝐩𝐭𝐏[log(n)] and 𝐅𝐏𝐍𝐏[log(n)] lower bounds for MAPJbound and MAPJmin, respectively, by providing a strict and metric reduction to the minimum set cover333The MIN-SC problem is, given a collection X={s1,,sm} of sets, where U=imsi, to find a set CX such that for each uU, there exists sC such that us. (MIN-SC) problem. See Section 2 for the definitions of strict and metric reductions. Note that we view MAmin as an approximation algorithm by taking repairs 𝖴 with respect to Q,𝐈,a¯ as feasible solutions for instances Q,𝐈,a¯, and the size |𝖴| of the repair as its cost. It is known that if there exists an approximation algorithm for MIN-SC with approximation ratio (1α)ln(n) for any α>0, where n is the size of the instance, then 𝐏=𝐍𝐏 [20]. The proof of the following theorem can be found in the extended version of this paper [14].

Theorem 4.6.

If the (EDB) schema Σ contains a unary and a binary relation symbol, then

  1. 1.

    the MAPJbound problem is 𝐍𝐏-complete, and

  2. 2.

    the MAPJsize problem is 𝐎𝐩𝐭𝐏[log(n)]-complete.

  3. 3.

    the MAPJmin problem is 𝐅𝐏𝐍𝐏[log(n)]-hard.

  4. 4.

    the MAPJmin problem is MIN-SC-hard to approximate under strict reductions.

We conclude this section with an upper bound for MADatalogmin. The proof can be found in the extended version of this paper [14].

Theorem 4.7.

MADatalogmin is in 𝐅𝐄𝐗𝐏 and MAsp-Datalogmin is in 𝐅𝟐𝐄𝐗𝐏.

5 Data Complexity

In this section, we show that MAPmin is polynomial-time computable for all sp-Datalog programs P. This will be a special case of a general result on polynomial-time computability, under data complexity, of minimal repairs for a large class of queries. For this, we first introduce the following necessary definition, which is the key observation leading to the polynomial-time computability of MAsp-Datalogmin.

Definition 5.1.

A query Q admits constant-sized repairs if there is some cQ such that, for any instance 𝐈 and tuple a¯, if a repair with respect to Q,𝐈,a¯ exists, then there exists a repair 𝖴 with respect to Q,𝐈,a¯ such that |𝖴|cQ.

Note that Definition 5.1 describes a property of queries, rather than query classes. It also only involves a finite bound on the size of repairs, but does not necessarily imply that a bounded domain of constants for repairs can be computed. However, such a domain can be computed if the map QcQ is computable and Q is generic (see Definition 3.6) – this will be implicit in the proof of Theorem 5.4. However, when studying data complexity, it does not matter whether or not QcQ is computable, only that cQ exists for the query Q of interest. The following example sheds some light on the notion of constant-sized repairs.

Example 5.2.

Let QCQ¬ be defined by the rule S(x,y,z):-R(x,y),R(y,z),¬R(z,x). Given an arbitrary instance 𝐈 and a tuple a1,a2,a3, a repair 𝖴 needs at most two insertions and one deletion in order to ensure that a1,a2,a3𝐈𝖴 – namely, we must have that R(a1,a2),R(a2,a3)𝐈𝖴 and R(a3,a1)𝐈𝖴. Hence Q admits constant-sized repairs with cQ=3. Note that admitting constant-sized repairs does not mean that a repair always exists: for example, if the input tuple is a1,a1,a1, then there is no repair 𝖴 such that a1,a1,a1Q(𝐈𝖴), since this would require that the fact R(a1,a1) is both in and not in 𝐈𝖴.

Lemma 5.3.

Every query QCQ¬ admits constant-sized repairs.

Proof.

Let QCQ¬ be an arbitrary query defined by a rule r of the form

S(x¯):-α1,,an1,¬β1,,¬βn2,γ1,,γn3,

where the αi are positive literals, the ¬βi are negative literals, the γi are either inequality or equality atoms. Let 𝐈 denote an arbitrary instance and a¯ denote an arbitrary tuple over 𝐃𝐨𝐦. To ensure that a¯𝐈𝖴, we need to find a repair 𝖴 such that for some assignment g with g(x¯)=a¯, we have that αi[g]𝐈𝖴 for each in1, βi[g]𝐈𝖴 for each in2, and the γi equalities/inequalities are satisfied by g. For any assignment g which satisfies the γi, the maximum number of insertions needed is n1, and the maximum number of deletions needed in n2. Therefore, the maximum size of any minimal repair, if one exists at all, is n1+n2.

Theorem 5.4.

If Q is an adom(Q)-generic query which admits constant-sized repairs and such that EvalQ is polynomial-time computable, then MAQmin is in 𝐅𝐏.

Proof.

Let Q be as in the statement of the claim, and let 𝐈,a¯ be an input to MAQmin. Let m=max{𝐚𝐫𝐢𝐭𝐲(R)RΣ} and let C={c1,,cmcQ} be a set of constants disjoint from adom(Q,𝐈)a¯. We use the following claim.

Claim 5.5.

If there exists a minimal cardinality repair 𝖴 such that a¯Q(𝐈𝖴), then there exists a minimal cardinality repair 𝖴 over Cadom(Q,𝐈)a¯.

Proof of claim..

Let D denote the set of constants occurring in 𝖴 which do not occur in adom(Q,𝐈)a¯. Since 𝖴 is minimal and Q admits constant-sized repairs, we have |D|mcQ. By the adom(Q)-genericity of Q, we have that ρ(Q(𝐈𝖴))=Q(ρ(𝐈𝖴)) for any bijective map ρ:𝐃𝐨𝐦𝐃𝐨𝐦 with Imρ[D]C and which fixes adom(Q)a¯ point-wise. In particular, 𝖴=ρ(𝖴), obtained by replacing each constant in 𝖴 by its image under ρ, is also a minimal cardinality repair over Cadom(Q,𝐈)a¯ such that a¯Q(𝐈𝖴).

To find a minimal update 𝖴 such that a¯Q(I), it suffices by Claim 5.5 to check, for all repairs 𝖴 over adom(Q,𝐈)Ca¯ (in order of size) such that |𝖴|cQ, whether or not a¯Q(𝐈𝖴) (by a call to EvalQ), outputting the first repair found. Since Q and cQ are both constants, while adom(Q,𝐈)Ca¯ is linear in the size of the input, this procedure checks only O(ncQ) repairs. Furthermore, since EvalQ is in 𝐅𝐏, this algorithm is also in 𝐅𝐏.

We now recall the notion of unfoldings [13]. Intuitively, an unfolding of an sp-Datalog program P is a conjunctive query whose head predicate is 𝐚𝐧𝐬P, whose body contains only EDB predicates, and which is obtained by repeatedly substituting the IDB atoms of some rule of P with the body of rules in P whose heads contain the relevant IDB predicate.

Definition 5.6 (Unfoldings).

Let P be an sp-Datalog program with rules r1,,rm and answer predicate 𝐚𝐧𝐬P. We define P to be the smallest set containing each rule of P with 𝐚𝐧𝐬P in the head and such that, whenever P contains a rule r of the form

𝐚𝐧𝐬P(x¯):-α1,,αi1,αi,αi+1,,αn,

where 𝐫𝐞𝐥(αi)=S𝐒, 𝐯𝐚𝐫(αi)=y¯, and r is a rule in P of the form S(u¯):-𝐁𝐨𝐝𝐲r(u¯,v¯) with 𝐟𝐫𝐞𝐞(r)=u¯ and 𝐛𝐨𝐮𝐧𝐝(r)=v¯, then P also contains the rule

𝐚𝐧𝐬P(x¯):-α1,,αi1,𝐁𝐨𝐝𝐲r(y¯,z¯),αi+1,,αn

where z¯ is a tuple of fresh variables not occurring in r or r. We define 𝐔𝐧𝐟𝐨𝐥𝐝𝐢𝐧𝐠𝐬(P) to be the set of all rules r in P such that the body of r contains only extensional relation symbols.

The next theorem, originally stated for Datalog but generalizable to sp-Datalog programs, enables us to view sp-Datalog programs as (possibly infinite) unions of CQ¬ queries.

Theorem 5.7 ([13]).

If Psp-Datalog has answer predicate 𝐚𝐧𝐬(x¯), then

𝐚𝐧𝐬(𝐈)={a¯𝐃𝐨𝐦len(x¯)a¯Q(𝐈)for someQ𝐔𝐧𝐟𝐨𝐥𝐝𝐢𝐧𝐠𝐬(P)}.
Corollary 5.8.

MAPmin can be computed in polynomial-time for all Psp-Datalog.

Proof.

Since it is known that evaluation for semi-positive datalog queries is computable in polynomial-time with respect to data complexity [30], it suffices by Theorem 5.4 to show that every Psp-Datalog admits constant-size repairs. For this, fix a program Psp-Datalog, let adom(P)=a1,,an, and set k=𝐚𝐫𝐢𝐭𝐲(𝐚𝐧𝐬), where 𝐚𝐧𝐬 is the answer predicate for P. Define an equivalence relation on tuples in 𝐃𝐨𝐦k, where for tuples b¯=b1,,bk and c¯=c1,,ck, we set b¯c¯ if and only if both of the following conditions hold:

  1. 1.

    bi=bj if and only if ci=cj, and

  2. 2.

    bi=aj if and only if ci=aj.

If b¯c¯, then by adom(Q)-genericity of P, we have that b¯𝐚𝐧𝐬(𝐈) for some instance 𝐈 if and only if c¯𝐚𝐧𝐬(ρ(𝐈)), where ρ:𝐃𝐨𝐦𝐃𝐨𝐦 is the bijective map obtained by setting ρ(b¯)=c¯, ρ(c¯)=b¯, and ρ(e)=e for all other e𝐃𝐨𝐦. Hence for each equivalence class 𝒞 in 𝐃𝐨𝐦k, either there exists some Q𝒞𝐔𝐧𝐟𝐨𝐥𝐝𝐢𝐧𝐠𝐬(P) such that, for all b¯𝒞, there exists an instance 𝐈 such that b¯Q𝒞(𝐈), or no such Q𝒞 exists. In the first case, set N𝒞=cQ𝒞; otherwise, set N𝒞=0. Since there are finitely-many equivalences classes, we have that cP=max𝒞𝐃𝐨𝐦kcQ𝒞 is finite. Hence P admits constant-sized repairs bounded by cP, which is what we wanted to show.

Since MAPmin is polynomial-time computable for programs P in sp-Datalog, it is natural to ask if the above argument can be extended to the relational algebra (RA) or even to stratified datalog (Datalog¬). The following example shows that this is not the case.

Example 5.9.

Consider the Boolean Datalog¬ query, also expressible in RA, given by the rules R:-P(x) and 𝐚𝐧𝐬:-¬R, where P is an EDB predicate and R,𝐚𝐧𝐬 are IDB predicates. In the notation of the relational calculus, this is equivalent to the formula x¬P(x) (with the universal quantifier interpreted over the active domain). It is easy to see that, for any instance 𝐈, we have 𝐚𝐧𝐬(𝐈) if and only if 𝐈 contains no facts of the form P(a) for any a𝐃𝐨𝐦. Hence minimal repairs for this query may be arbitrarily large.

The above example illustrates an important theme: all queries Q in sp-Datalog are existential, and can be satisfied by modifying only a small local part of the database. On the other hand, the query in Example 5.9 is universal in the sense that it expresses a global condition on the active domain of the database. Consequently, minimal repairs for this query can be arbitrarily large, depending on the number of P facts in the input database. While “existential” and “local” rules yield tractable complexity for the missing answer problems, the opposite is true for the wrong answer problems, by the duality discussed in the introduction.

Corollary 4.3 provides a pessimistic picture of the combined complexity of determining whether or not repairs exist, particularly for RA and its extensions. However, in data complexity setting, the MAQmin problem is always decidable for RA queries. To see this, observe that, given a fixed query QRA, one of the following algorithms is correct:

  1. 1.

    if Q is satisfiable: the algorithm which enumerates all possible repairs from smallest to largest until finding a repair; and

  2. 2.

    if Q is unsatisfiable: the algorithm that returns “no repair” on all inputs.

Of course, it is undecidable which of the above algorithms is correct, and even for RA queries which we know to be satisfiable, the running time of such a brute-force search is severely intractable. However, it seems that this is the best that we can say in general for RA queries, since there is no computable bound in general on the size of repairs required for such queries. If such a bound did exist, then dbSATRA would be solvable by checking all repairs within the computable bound for the input Q,𝐄,ϵ – which is impossible.

6 Concluding Remarks and Future Work

Our primary interest in this paper was to identify the dividing line between tractability and intractability of finding missing answer repairs. In combined complexity, we answer this question for various important sub-classes of UCQ¬ queries. We also provide 𝐄𝐗𝐏-hardness of Datalog and sp-Datalog, with a matching 𝐅𝐄𝐗𝐏 (resp. 𝐅𝟐𝐄𝐗𝐏) membership result for MADatalogmin (resp. MAsp-Datalogmin). In data complexity, we show that computing missing answer repairs is tractable for the expressive class of sp-Datalog queries. We also discuss the principal difficulty in extending tractability to queries with stronger forms of negation.

One avenue of future work is to close the gaps in Table 1, such as those for MAsp-Datalogsize, MAsp-Datalogmin, and MARAbound. As mentioned in the introduction, the missing answer repair also provides an elegant generalization of the problem of repairing integrity constraints in databases, and so it would be valuable to extend the work in this paper to query classes which can express universal quantification in limited ways, in order to build a more general theory of consistency repairs. Furthermore, while we chose to emphasize minimizing cardinality repairs in this paper, it is certainly worthwhile to investigate other desired constraints upon the repairs computed, such as minimizing side effects on the answer to the query. Another avenue is to generalize the problem to allow an arbitrary number of tuples to appear in the input, all of which must be added to the answer to a query by the repair.

Another important avenue of future work is to consider the generalization of the missing answer repair problem to semiring semantics [26, 25]. In this generalization, facts in databases are not simply true or false, but are annotated with values in a fixed semiring. The result of evaluating queries propagates these annotations through simple semiring operations, yielding an output annotation for each output. The present paper can be seen as studying the special case of set semantics, which are induced naturally by the Boolean semiring. Some recent work studies a related problem for bag-set semantics, where the goal is to maximize the value of a Boolean query Q on a set database by making a minimal number of insertions [2].

References

  • [1] Serge Abiteboul, Richard Hull, and Victor Vianu. Foundations of Databases: The Logical Level. Addison-Wesley Longman Publishing Co., Inc., USA, 1st edition, 1995.
  • [2] Mahmoud Abo Khamis, Jesse Comer, Phokion G. Kolaitis, Sudeepa Roy, and Val Tannen. A unifying algorithm for hierarchical queries. Proc. ACM Manag. Data, 3(5), 2025. doi:10.1145/3767710.
  • [3] Marcelo Arenas, Leopoldo Bertossi, and Jan Chomicki. Answer sets for consistent query answering in inconsistent databases. Theory Pract. Log. Program., 3(4):393–424, 2003. doi:10.1017/S1471068403001832.
  • [4] F. Bancilhon and N. Spyratos. Update semantics of relational views. ACM Trans. Database Syst., 6(4):557–575, 1981. doi:10.1145/319628.319634.
  • [5] Leopoldo Bertossi. Measuring and computing database inconsistency via repairs. In Davide Ciucci, Gabriella Pasi, and Barbara Vantaggi, editors, Scalable Uncertainty Management, pages 368–372, Cham, 2018. Springer International Publishing. doi:10.1007/978-3-030-00461-3_26.
  • [6] Nicole Bidoit, Melanie Herschel, and Katerina Tzompanaki. Immutably answering why-not questions for equivalent conjunctive queries. In Adriane Chapman, Bertram Ludäscher, and Andreas Schreiber, editors, 6th Workshop on the Theory and Practice of Provenance, TaPP’14, Cologne, Germany, June 12-13, 2014. USENIX Association, 2014. URL: https://www.usenix.org/conference/tapp2014/agenda/presentation/bidoit.
  • [7] Nicole Bidoit, Melanie Herschel, and Katerina Tzompanaki. Query-based why-not provenance with NedExplain. In Sihem Amer-Yahia, Vassilis Christophides, Anastasios Kementsietsidis, Minos N. Garofalakis, Stratos Idreos, and Vincent Leroy, editors, Proceedings of the 17th International Conference on Extending Database Technology, EDBT 2014, Athens, Greece, March 24-28, 2014, pages 145–156. OpenProceedings.org, 2014. doi:10.5441/002/EDBT.2014.14.
  • [8] Peter Buneman, Sanjeev Khanna, and Wang-Chiew Tan. On propagation of deletions and annotations through views. In Proceedings of the Twenty-First ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS ’02, pages 150–158, New York, NY, USA, 2002. Association for Computing Machinery. doi:10.1145/543613.543633.
  • [9] Peter Buneman, Sanjeev Khanna, and Tan Wang-Chiew. Why and where: A characterization of data provenance. In Jan Van den Bussche and Victor Vianu, editors, Database Theory — ICDT 2001, pages 316–330, Berlin, Heidelberg, 2001. Springer Berlin Heidelberg. doi:10.1007/3-540-44503-X_20.
  • [10] Nofar Carmeli, Martin Grohe, Benny Kimelfeld, Ester Livshits, and Muhammad Tibi. Database repairing with soft functional dependencies. ACM Trans. Database Syst., 49(2), 2024. doi:10.1145/3651156.
  • [11] Ashok K. Chandra and Philip M. Merlin. Optimal implementation of conjunctive queries in relational data bases. In Proceedings of the Ninth Annual ACM Symposium on Theory of Computing, STOC ’77, pages 77–90, New York, NY, USA, 1977. Association for Computing Machinery. doi:10.1145/800105.803397.
  • [12] Adriane Chapman and H. V. Jagadish. Why not? In Ugur Çetintemel, Stanley B. Zdonik, Donald Kossmann, and Nesime Tatbul, editors, Proceedings of the ACM SIGMOD International Conference on Management of Data, SIGMOD 2009, Providence, Rhode Island, USA, June 29 - July 2, 2009, pages 523–534. ACM, 2009. doi:10.1145/1559845.1559901.
  • [13] Surajit Chaudhuri and Moshe Y Vardi. On the equivalence of recursive and nonrecursive datalog programs. Journal of Computer and System Sciences, 54(1):61–78, 1997. doi:10.1006/jcss.1997.1452.
  • [14] Jesse Comer and Val Tannen. The complexity of finding missing answer repairs, 2026. arXiv:2601.06764.
  • [15] Gao Cong, Wenfei Fan, and Floris Geerts. Annotation propagation revisited for key preserving views. In Proceedings of the 15th ACM International Conference on Information and Knowledge Management, CIKM ’06, pages 632–641, New York, NY, USA, 2006. Association for Computing Machinery. doi:10.1145/1183614.1183705.
  • [16] Gao Cong, Wenfei Fan, Floris Geerts, Jianzhong Li, and Jizhou Luo. On the complexity of view update analysis and its application to annotation propagation. IEEE Trans. Knowl. Data Eng., 24(3):506–519, 2012. doi:10.1109/TKDE.2011.27.
  • [17] Stavros S. Cosmadakis and Christos H. Papadimitriou. Updates of relational views. J. ACM, 31(4):742–760, September 1984. doi:10.1145/1634.1887.
  • [18] Evgeny Dantsin, Thomas Eiter, Georg Gottlob, and Andrei Voronkov. Complexity and expressive power of logic programming. In Proceedings of the Twelfth Annual IEEE Conference on Computational Complexity, Ulm, Germany, June 24-27, 1997, pages 82–101. IEEE Computer Society, 1997. doi:10.1109/CCC.1997.612304.
  • [19] Umeshwar Dayal and Philip A. Bernstein. On the correct translation of update operations on relational views. ACM Trans. Database Syst., 7(3):381–416, 1982. doi:10.1145/319732.319740.
  • [20] Irit Dinur and David Steurer. Analytical approach to parallel repetition. In Proceedings of the Forty-Sixth Annual ACM Symposium on Theory of Computing, STOC ’14, pages 624–633, New York, NY, USA, 2014. Association for Computing Machinery. doi:10.1145/2591796.2591884.
  • [21] Wenfei Fan and Floris Geerts. Foundations of Data Quality Management. Morgan & Claypool Publishers, 2012.
  • [22] Cibele Freire, Wolfgang Gatterbauer, Neil Immerman, and Alexandra Meliou. The complexity of resilience and responsibility for self-join-free conjunctive queries. Proc. VLDB Endow., 9(3):180–191, 2015. doi:10.14778/2850583.2850592.
  • [23] Cibele Freire, Wolfgang Gatterbauer, Neil Immerman, and Alexandra Meliou. New results for the complexity of resilience for binary conjunctive queries with self-joins. In Dan Suciu, Yufei Tao, and Zhewei Wei, editors, Proceedings of the 39th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2020, Portland, OR, USA, June 14-19, 2020, pages 271–284. ACM, 2020. doi:10.1145/3375395.3387647.
  • [24] William Gasarch, M. Krentel, and K. Rappoport. OptP as the normal behavior of NP-complete problems. Theory of Computing Systems / Mathematical Systems Theory - MST, 28, November 1995. doi:10.1007/BF01204168.
  • [25] Erich Grädel and Val Tannen. Provenance analysis and semiring semantics for first-order logic. In Klaus Meer, Alexander Rabinovich, Elena Ravve, and Andrés Villaveces, editors, Model Theory, Computer Science, and Graph Polynomials: Festschrift in Honor of Johann A. Makowsky, pages 351–401. Springer Nature Switzerland, Cham, 2025. doi:10.1007/978-3-031-86319-6_21.
  • [26] T. Green, G. Karvounarakis, and V. Tannen. Provenance semirings. In Principles of Database Systems PODS, pages 31–40. ACM, 2007. doi:10.1145/1265530.1265535.
  • [27] Melanie Herschel and Mauricio A. Hernández. Explaining missing answers to SPJUA queries. Proc. VLDB Endow., 3(1):185–196, 2010. doi:10.14778/1920841.1920869.
  • [28] Melanie Herschel, Mauricio A. Hernández, and Wang Chiew Tan. Artemis: A system for analyzing missing answers. Proc. VLDB Endow., 2(2):1550–1553, 2009. doi:10.14778/1687553.1687588.
  • [29] Jiansheng Huang, Ting Chen, AnHai Doan, and Jeffrey F. Naughton. On the provenance of non-answers to queries over extracted data. Proc. VLDB Endow., 1(1):736–747, 2008. doi:10.14778/1453856.1453936.
  • [30] Neil Immerman. Relational queries computable in polynomial time. Information and Control, 68(1):86–104, 1986. doi:10.1016/S0019-9958(86)80029-8.
  • [31] Benny Kimelfeld. A dichotomy in the complexity of deletion propagation with functional dependencies. In Michael Benedikt, Markus Krötzsch, and Maurizio Lenzerini, editors, Proceedings of the 31st ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS 2012, Scottsdale, AZ, USA, May 20-24, 2012, pages 191–202. ACM, 2012. doi:10.1145/2213556.2213584.
  • [32] Benny Kimelfeld, Jan Vondrák, and Ryan Williams. Maximizing conjunctive views in deletion propagation. ACM Trans. Database Syst., 37(4):24:1–24:37, 2012. doi:10.1145/2389241.2389243.
  • [33] Solmaz Kolahi and Laks V. S. Lakshmanan. On approximating optimum repairs for functional dependency violations. In Proceedings of the 12th International Conference on Database Theory, ICDT ’09, pages 53–62, New York, NY, USA, 2009. Association for Computing Machinery. doi:10.1145/1514894.1514901.
  • [34] Mark W. Krentel. The complexity of optimization problems. Journal of Computer and System Sciences, 36(3):490–509, 1988. doi:10.1016/0022-0000(88)90039-6.
  • [35] Alon Levy, Inderpal Singh Mumick, Yehoshua Sagiv, and Oded Shmueli. Equivalence, query-reachability and satisfiability in datalog extensions. In Proceedings of the Twelfth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, PODS ’93, pages 109–122, New York, NY, USA, 1993. Association for Computing Machinery. doi:10.1145/153850.153860.
  • [36] Andrei Lopatenko and Leopoldo Bertossi. Complexity of consistent query answering in databases under cardinality-based and incremental repair semantics. In Thomas Schwentick and Dan Suciu, editors, Database Theory – ICDT 2007, pages 179–193, Berlin, Heidelberg, 2006. Springer Berlin Heidelberg. doi:10.1007/11965893_13.
  • [37] Neha Makhija and Wolfgang Gatterbauer. A unified approach for resilience and causal responsibility with integer linear programming (ILP) and LP relaxations. Proc. ACM Manag. Data, 1(4):228:1–228:27, 2023. doi:10.1145/3626715.
  • [38] A. Meliou, W. Gatterbauer, K. Moore, and D. Suciu. WHY so? or WHY no? functional causality for explaining query answers. In VLDB workshop on Management of Uncertain Data (MUD 2010), volume WP10-04 of CTIT Workshop Proceedings Series, pages 3–17, 2010. URL: http://ewi1276.ewi.utwente.nl:3000/papers/MUD2010_whyso.pdf.
  • [39] Alexandra Meliou, Wolfgang Gatterbauer, Joseph Y. Halpern, Christoph Koch, Katherine F. Moore, and Dan Suciu. Causality in databases. IEEE Data Eng. Bull., 33(3):59–67, 2010. URL: http://sites.computer.org/debull/A10sept/suciu.pdf.
  • [40] Dongjing Miao and Zhipeng Cai. On the complexity of resilience for aggregation queries. In Donghyun Kim, R. N. Uma, and Alexander Zelikovsky, editors, Combinatorial Optimization and Applications, pages 696–706, Cham, 2018. Springer International Publishing. doi:10.1007/978-3-030-04651-4_47.
  • [41] Dongjing Miao, Zhipeng Cai, and Jianzhong Li. On the complexity of bounded view propagation for conjunctive queries. IEEE Transactions on Knowledge and Data Engineering, 30(1):115–127, 2018. doi:10.1109/TKDE.2017.2758361.
  • [42] Dongjing Miao, Zhipeng Cai, and Jianzhong Li. Deletion propagation revisited for multiple key preserving views. IEEE Transactions on Knowledge and Data Engineering, 35(3):2445–2456, 2023. doi:10.1109/TKDE.2021.3110851.
  • [43] Dongjing Miao, Zhipeng Cai, Xianmin Liu, and Jianzhong Li. On the complexity of insertion propagation with functional dependency constraints. In Thang N. Dinh and My T. Thai, editors, Computing and Combinatorics, pages 623–632, Cham, 2016. Springer International Publishing. doi:10.1007/978-3-319-42634-1_50.
  • [44] Dongjing Miao, Zhipeng Cai, Xianmin Liu, and Jianzhong Li. Functional dependency restricted insertion propagation. Theoretical Computer Science, 819:1–8, 2020. Computing and Combinatorics. doi:10.1016/j.tcs.2017.03.043.
  • [45] Dongjing Miao, Jianzhong Li, and Zhipeng Cai. New results on the complexity of deletion propagation. In Zhao Zhang, Wei Li, and Ding-Zhu Du, editors, Algorithmic Aspects in Information and Management, pages 336–345, Cham, 2020. Springer International Publishing. doi:10.1007/978-3-030-57602-8_30.
  • [46] Pekka Orponen and Heikki Mannila. On approximation preserving reductions: complete problems and robust measures. University of Helsinki, 1987.
  • [47] Christos H. Papadimitriou. Computational complexity. Addison-Wesley, 1994.
  • [48] Christos H. Papadimitriou and Mihalis Yannakakis. Optimization, approximation, and complexity classes. Journal of Computer and System Sciences, 43(3):425–440, 1991. doi:10.1016/0022-0000(91)90023-X.
  • [49] Sudeepa Roy, Laurel J. Orr, and Dan Suciu. Explaining query answers with explanation-ready databases. Proc. VLDB Endow., 9(4):348–359, 2015. doi:10.14778/2856318.2856329.
  • [50] Sudeepa Roy and Dan Suciu. A formal approach to finding explanations for database queries. In Curtis E. Dyreson, Feifei Li, and M. Tamer Özsu, editors, International Conference on Management of Data, SIGMOD 2014, Snowbird, UT, USA, June 22-27, 2014, pages 1579–1590. ACM, 2014. doi:10.1145/2588555.2588578.
  • [51] Oded Shmueli. Equivalence of DATALOG queries is undecidable. J. Log. Program., 15(3):231–241, 1993. doi:10.1016/0743-1066(93)90040-N.
  • [52] Wang-Chiew Tan. Containment of relational queries with annotation propagation. In Georg Lausen and Dan Suciu, editors, Database Programming Languages, pages 37–53, Berlin, Heidelberg, 2004. Springer Berlin Heidelberg. doi:10.1007/978-3-540-24607-7_4.
  • [53] Boris Trakhtenbrot. Impossibility of an algorithm for the decision problem on finite classes. Doklady Akademii Nauk SSSR, 70:569–572, 1950.
  • [54] Quoc Trung Tran and Chee-Yong Chan. How to conquer why-not questions. In Ahmed K. Elmagarmid and Divyakant Agrawal, editors, Proceedings of the ACM SIGMOD International Conference on Management of Data, SIGMOD 2010, Indianapolis, Indiana, USA, June 6-10, 2010, pages 15–26. ACM, 2010. doi:10.1145/1807167.1807172.
  • [55] Moshe Y. Vardi. The complexity of relational query languages (extended abstract). In Harry R. Lewis, Barbara B. Simons, Walter A. Burkhard, and Lawrence H. Landweber, editors, Proceedings of the 14th Annual ACM Symposium on Theory of Computing, May 5-7, 1982, San Francisco, California, USA, pages 137–146. ACM, 1982. doi:10.1145/800070.802186.
  • [56] Eugene Wu and Samuel Madden. Scorpion: Explaining away outliers in aggregate queries. Proc. VLDB Endow., 6(8):553–564, 2013. doi:10.14778/2536354.2536356.
  • [57] J. Xu, W. Zhang, A. Alawini, and V. Tannen. Provenance analysis for missing answers and integrity repairs. IEEE Data Eng. Bull., 41(1):39–50, 2018. URL: http://sites.computer.org/debull/A18mar/p39.pdf.