We study an extension of first-order logic that allows to express cardinality conditions in a similar way as SQL's COUNT operator. The corresponding logic FOC(P) was introduced by Kuske and Schweikardt (LICS 2017), who showed that query evaluation for this logic is fixed-parameter tractable on classes of databases of bounded degree. In the present paper, we first show that the fixed-parameter tractability of FOC(P) cannot even be generalised to very simple classes of databases of unbounded degree, such as unranked trees or strings with a linear order relation. Then we identify a fragment FOC_1(P) of FOC(P) which is still sufficiently strong to express standard applications of SQL's COUNT operator. Our main result shows that query evaluation for FOC_1(P) is fixed-parameter tractable on nowhere-dense classes of databases.
翻译:我们研究了一阶逻辑的一种扩展,该扩展允许以类似于SQL的COUNT运算符的方式表达基数约束。相应的逻辑FOC(P)由Kuske和Schweikardt(LICS 2017)提出,他们证明了该逻辑的查询评估在有界度数据库类上是固定参数易解的。在本文中,我们首先证明FOC(P)的固定参数易解性甚至无法推广到非常简单的无界度数据库类,例如无秩树或具有线性序关系的字符串。然后,我们确定了FOC(P)的一个片段FOC_1(P),它仍然足够强大,能够表达SQL的COUNT运算符的标准应用。我们的主要结果表明,FOC_1(P)的查询评估在无处稠密数据库类上是固定参数易解的。