arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2104.12039cs.PL
收藏

通过重写引导的合成优化正则表达式

Optimizing Regular Expressions via Rewrite-Guided Synthesis

Jedidiah McClurg, Miles Claver, Jackson Garner, Jake Vossen, Jordan Schmerge, Mehmet E. Belviranli

摘要:

正则表达式在现代系统中无处不在。许多现实世界中的正则表达式是低效的,有时候它们很容易受到基于复杂性的攻击,虽然很多研究都集中在检测低效的正则表达式或在硬件级别加速正则表达式匹配,但我们研究了自动转换正则表达式以消除低效。我们把这个问题归结为一般的表达式优化,这是一个重要的任务,在各种领域甚至超越了编译器,例如,具有成本函数的语法引导合成(SyGuS)可用于此目的,但通过候选表达式的大空间的有序枚举可能过于昂贵。等式饱和是一种替代方法,它允许有效地构造和维护重写规则生成的表达式等价类,但该过程可能不会达到饱和,这意味着无法确认全局最小值。我们提出了一种新的方法,称为重写引导合成(ReGiS),其中一个独特的相互作用之间的SyGuS和平等饱和的重写有助于克服这些问题,从而在一个有效的,可扩展的框架表达式优化。

英文摘要:

Regular expressions are pervasive in modern systems. Many real-world regular expressions are inefficient, sometimes to the extent that they are vulnerable to complexity-based attacks, and while much research has focused on detecting inefficient regular expressions or accelerating regular expression matching at the hardware level, we investigate automatically transforming regular expressions to remove inefficiencies. We reduce this problem to general expression optimization, an important task necessary in a variety of domains even beyond compilers, e.g., digital logic design, etc. Syntax-guided synthesis (SyGuS) with a cost function can be used for this purpose, but ordered enumeration through a large space of candidate expressions can be prohibitively expensive. Equality saturation is an alternative approach which allows efficient construction and maintenance of expression equivalence classes generated by rewrite rules, but the procedure may not reach saturation, meaning global minimality cannot be confirmed. We present a new approach called rewrite-guided synthesis (ReGiS), in which a unique interplay between SyGuS and equality saturation-based rewriting helps to overcome these problems, resulting in an efficient, scalable framework for expression optimization.

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

↑