本文研究带否定的合取查询(Conjunctive Queries with negation,简称CQ¬)的求值复杂度。首先,针对一类名为自由连通符号无环查询的带否定合取查询,提出一种预处理时间为线性、枚举延迟为常数的算法;并证明在下界猜想成立的前提下,其他查询类均无法拥有此类算法。其次,将该算法扩展到一般半环上带否定与聚合的合取查询,我们称之为带否定的函数聚合查询(Functional Aggregate Queries with negation,简称FAQ¬);该算法对同一查询类可实现常数延迟枚举,但预处理时间略有增加,其中包含逆阿克曼函数。我们证明,对于一般半环,阿克曼函数的这一出人意料的出现很可能是不可避免的,但当半环具有特定结构时可以消除。最后,展示了该结果在计算合取查询差运算中的应用。
英文摘要:
In this paper, we study the complexity of evaluating Conjunctive Queries with negation (\cqneg). First, we present an algorithm with linear preprocessing time and constant delay enumeration for a class of CQs with negation called free-connex signed-acyclic queries. We show that no other queries admit such an algorithm subject to lower bound conjectures. Second, we extend our algorithm to Conjunctive Queries with negation and aggregation over a general semiring, which we call Functional Aggregate Queries with negation (\faqneg). Such an algorithm achieves constant delay enumeration for the same class of queries, but with a slightly increased preprocessing time which includes an inverse Ackermann function. We show that this surprising appearance of the Ackermmann function is probably unavoidable for general semirings, but can be removed when the semiring has specific structure. Finally, we show an application of our results to computing the difference of CQs.