Datalogo is an extension of Datalog that allows for aggregation and recursion over an arbitrary commutative semiring. Like Datalog, Datalogo programs can be evaluated via the natural iterative algorithm until a fixed point is reached. However unlike Datalog, the natural iterative evaluation of some Datalogo programs over some semirings may not converge. It is known that the commutative semirings for which the iterative evaluation of Datalogo programs is guaranteed to converge are exactly those semirings that are stable~\cite{Khamis0PSW22}. Previously, the best known upper bound on the number of iterations until convergence over $p$-stable semirings is $\sum_{i=1}^n (p+2)^i = \Theta(p^n)$ steps, where $n$ is (essentially) the output size. We establish that, in fact, the natural iterative evaluation of a Datalogoprogram over a $p$-stable semiring converges within a polynomial number of iterations. In particular our upper bound is $O( \sigma p n^2( n^2 \lg \lambda + \lg \sigma))$ where $\sigma$ is the number of elements in the semiring present in either the input databases or the Datalogo program, and $\lambda$ is the maximum number of terms in any product in the Datalogo program.
翻译:Datalogo是Datalog的扩展,允许在任意交换半环上进行聚合与递归运算。与Datalog类似,Datalogo程序可通过自然迭代算法直至抵达不动点。然而不同于Datalog,某些Datalogo程序在半环上的自然迭代求值可能不收敛。已知确保Datalogo程序迭代求值收敛的交换半环恰为稳定半环~\cite{Khamis0PSW22}。此前,在$p$-稳定半环上收敛所需迭代次数的最佳上界为$\sum_{i=1}^n (p+2)^i = \Theta(p^n)$步,其中$n$(本质上)为输出规模。我们证明:实际上,Datalogo程序在$p$-稳定半环上的自然迭代求值可在多项式次迭代内收敛。具体而言,我们的上界为$O( \sigma p n^2( n^2 \lg \lambda + \lg \sigma))$,其中$\sigma$为输入数据库或Datalogo程序中出现的半环元素数目,$\lambda$为Datalogo程序任一乘积项中最大项数。