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 [7]. 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程序迭代评估收敛的交换半环恰好是稳定半环[7]。此前,在$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程序任意乘积项中的最大项数。