arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.17329cs.DBcs.DScs.FL
收藏

字符串上MSO查询评估的动态直接访问

Dynamic direct access of MSO query evaluation over strings

Univ. Lille, CNRS, Inria, Centrale Lille, UMR 9189 CRIStAL(里尔大学);Univ. Artois, CNRS, UMR 8188, Centre de Recherche en Informatique de Lens (CRIL)(阿尔托瓦大学);Pontificia Universidad Católica de Chile & Millennium Institute for Foundational Research on Data(智利天主教 Pontificia 大学)

Pierre Bourhis, Florent Capelli, Stefan Mengel, Cristian Riveros

AI总结:

提出首个针对字符串上MSO查询的高效直接访问算法,通过矩阵表示和半群动态数据结构实现,支持用户自由选择变量顺序和高效字符串更新操作。

摘要:

我们研究了在直接访问设置下,对字符串上的一元二阶逻辑(MSO)查询在更新下进行评估的问题。我们提出了一种算法,给定一个由无歧义变量集自动机 $\mathcal{A}$(状态集 $Q$,变量 $X$)表示的、具有一阶自由变量的 MSO 查询和一个字符串 $s$,在时间 $\mathcal{O}(|Q|^\omega \cdot |X|^2 \cdot |s|)$ 内计算一个数据结构,然后,给定索引 $i$,使用该数据结构在时间 $\mathcal{O}(|Q|^\omega \cdot |X|^3 \cdot \log(|s|)^2)$ 内检索 $\mathcal{A}$ 在 $s$ 上评估的第 $i$ 个输出,其中 $\omega$ 是矩阵乘法的指数。这是首个针对字符串上 MSO 查询评估的高效直接访问算法;此前此类算法仅针对关系数据上的一阶查询和合取查询进行了研究。我们的算法按字典序给出答案,与合取查询的设置不同,变量之间的顺序可以由用户自由选择而不会降低运行时间。此外,我们的数据结构可以在输入字符串更改后高效更新,允许比枚举文献中更强大的更新,例如子串的高效删除、字符串的连接和拆分以及剪切粘贴操作。我们的方法结合了 MSO 查询的矩阵表示和一种用于半群上动态单词问题的新型数据结构,从而产生了一个优雅且易于表述的整体算法。

英文摘要:

We study the problem of evaluating a Monadic Second Order (MSO) query over strings under updates in the setting of direct access. We present an algorithm that, given an MSO query with first-order free variables represented by an unambiguous variable-set automaton $\mathcal{A}$ with state set $Q$ and variables $X$ and a string $s$, computes a data structure in time $\mathcal{O}(|Q|^ω\cdot |X|^2 \cdot |s|)$ and, then, given an index $i$ retrieves, using the data structure, the $i$-th output of the evaluation of $\mathcal{A}$ over $s$ in time $\mathcal{O}(|Q|^ω\cdot |X|^3 \cdot \log(|s|)^2)$ where $ω$ is the exponent for matrix multiplication. Ours is the first efficient direct access algorithm for MSO query evaluation over strings; such algorithms so far had only been studied for first-order queries and conjunctive queries over relational data. Our algorithm gives the answers in lexicographic order where, in contrast to the setting of conjunctive queries, the order between variables can be freely chosen by the user without degrading the runtime. Moreover, our data structure can be updated efficiently after changes to the input string, allowing more powerful updates than in the enumeration literature, e.g.~efficient deletion of substrings, concatenation and splitting of strings, and cut-and-paste operations. Our approach combines a matrix representation of MSO queries and a novel data structure for dynamic word problems over semi-groups which yields an overall algorithm that is elegant and easy to formulate.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑