基于反向后缀扫描的有限自动机次线性匹配
Sublinear Matching With Finite Automata Using Reverse Suffix Scanning
摘要:
我们给出了算法来加速确定性有限自动机(DFA)的计算,通过计算状态的DFA n个位置提前利用下一个n个字符的反向扫描。这通常需要扫描少于n个字符,导致一部分输入被跳过,处理速度相应提高。在我们的几个例子中,跳过的分数> 80%。我们引入偏移有限自动机(OFA)编码的加速计算。OFA通过在每个状态转换处向当前输入索引添加整数偏移来推广DFA。我们给出了算法,用于构建一个OFA,接受相同的语言作为DFA,而可能跳过输入,并与OFA匹配。与尝试跳过一些输入的先前算法相比,新的匹配算法可以更频繁地跳过并且可以跳过更远。在最坏的情况下,新的匹配算法扫描相同数量的字符作为一个简单的前向扫描,而以前的方法往往扫描更多,所以新的算法可以作为一个可靠的替代简单的前向扫描。此外,新算法适应可用的内存和时间限制。
英文摘要:
We give algorithms to accelerate the computation of deterministic finite automata (DFA) by calculating the state of a DFA n positions ahead utilizing a reverse scan of the next n characters. Often this requires scanning fewer than n characters resulting in a fraction of the input being skipped and a commensurate increase in processing speed. The skipped fraction is > 80% in several of our examples. We introduce offsetting finite automata (OFA) to encode the accelerated computation. OFA generalize DFA by adding an integer offset to the current input index at each state transition. We give algorithms for constructing an OFA that accepts the same language as a DFA while possibly skipping input, and for matching with an OFA. Compared to previous algorithms that attempt to skip some of the input, the new matching algorithm can skip more often and can skip farther. In the worst case the new matching algorithm scans the same number of characters as a simple forward scan, whereas previous approaches often scan more, so the new algorithm can be used as a reliable replacement for the simple forward scan. Additionally, the new algorithm adapts to available memory and time constraints.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。