字符串变换的正则组合器
Regular Combinators for String Transformations
摘要:
我们专注于将输入字符串映射到幺半群的(部分)函数,例如具有加法的整数集和具有串联的输出字符串集。这种功能的规律性的概念已被定义为使用双向有限状态转换器,(单向)成本寄存器自动机,和MSO定义的图形转换。在本文中,我们给出了一个代数和机器无关的特征,这类类似于正则语言的正则表达式的定义。当幺半群是可交换的,我们证明了每一个正规函数可以构造从常数函数使用组合子的选择,分裂和,迭代和,这是类似的联盟,连接,和Kleene-*,分别,但执行独特的(或明确的)解析。我们的主要结果是一般情况下的非交换幺半群,这是特别感兴趣的捕获定期字符串到字符串的转换文件处理。我们证明了以下额外的组合子足以构造所有的正则函数:(1)分裂和和迭代和的左加性版本,允许诸如字符串反转之类的变换;(2)函数的和,允许诸如字符串复制之类的变换;(3)函数组合,或者替代地,链式和的新概念,允许来自相邻块的输出值混合。
英文摘要:
We focus on (partial) functions that map input strings to a monoid such as the set of integers with addition and the set of output strings with concatenation. The notion of regularity for such functions has been defined using two-way finite-state transducers, (one-way) cost register automata, and MSO-definable graph transformations. In this paper, we give an algebraic and machine-independent characterization of this class analogous to the definition of regular languages by regular expressions. When the monoid is commutative, we prove that every regular function can be constructed from constant functions using the combinators of choice, split sum, and iterated sum, that are analogs of union, concatenation, and Kleene-*, respectively, but enforce unique (or unambiguous) parsing. Our main result is for the general case of non-commutative monoids, which is of particular interest for capturing regular string-to-string transformations for document processing. We prove that the following additional combinators suffice for constructing all regular functions: (1) the left-additive versions of split sum and iterated sum, which allow transformations such as string reversal; (2) sum of functions, which allows transformations such as copying of strings; and (3) function composition, or alternatively, a new concept of chained sum, which allows output values from adjacent blocks to mix.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。