We study the data complexity of consistent query answering (CQA) on databases that may violate the primary key constraints. A repair is a maximal consistent subset of the database. For a Boolean query $q$, the problem $\mathsf{CERTAINTY}(q)$ takes a database as input, and asks whether or not each repair satisfies $q$. It is known that for any self-join-free Boolean conjunctive query $q$, $\mathsf{CERTAINTY}(q)$ is in $\mathbf{FO}$, $\mathbf{LSPACE}$-complete, or $\mathbf{coNP}$-complete. In particular, $\mathsf{CERTAINTY}(q)$ is in $\mathbf{FO}$ for any self-join-free Boolean path query $q$. In this paper, we show that if self-joins are allowed, the complexity of $\mathsf{CERTAINTY}(q)$ for Boolean path queries $q$ exhibits a tetrachotomy between $\mathbf{FO}$, $\mathbf{NL}$-complete, $\mathbf{PTIME}$-complete, and $\mathbf{coNP}$-complete. Moreover, it is decidable, in polynomial time in the size of the query~$q$, which of the four cases applies.
翻译:我们研究了在可能违反主键约束的数据库上,一致性查询应答(CQA)的数据复杂度。修复是指数据库的一个最大一致子集。对于布尔查询$q$,问题$\mathsf{CERTAINTY}(q)$以数据库为输入,询问每个修复是否满足$q$。已知对于任何无自连接的布尔合取查询$q$,$\mathsf{CERTAINTY}(q)$要么属于$\mathbf{FO}$,要么是$\mathbf{LSPACE}$-完全的,要么是$\mathbf{coNP}$-完全的。特别地,对于任何无自连接的布尔路径查询$q$,$\mathsf{CERTAINTY}(q)$属于$\mathbf{FO}$。在本文中,我们证明如果允许自连接,对于布尔路径查询$q$,$\mathsf{CERTAINTY}(q)$的复杂度呈现出介于$\mathbf{FO}$、$\mathbf{NL}$-完全、$\mathbf{PTIME}$-完全和$\mathbf{coNP}$-完全之间的四分性。此外,在查询$q$规模的多项式时间内可判定四种情况中的哪一种适用。