论文标题

SMT求解器用于正则表达式和线性算术长度的线性算术

An SMT Solver for Regular Expressions and Linear Arithmetic over String Length

论文作者

Berzish, Murphy, Kulczynski, Mitja, Mora, Federico, Manea, Florin, Day, Joel D., Nowotka, Dirk, Ganesh, Vijay

论文摘要

我们提出了一种新颖的长度感知求解算法,该算法是针对REGEX成员谓词谓词和线性算术在弦长上的无量词的一阶理论。我们在Z3 Theorem Prover中实施和评估该算法和相关的启发式方法。基于我们的算法的一个关键见解是,现实世界实例包含有关限制下字符串长度的上限和下限的大量信息,并且可以非常有效地使用此类信息来简化代表正则表达式的自动机的操作。此外,我们提出了许多新型的通用启发式方法,例如前缀/后缀方法,可以与各种正则求解算法一起使用,从而更有效。我们通过对57256 ROGEX繁重的实例的大型和多样化的基准进行广泛的经验评估来展示我们的算法和启发式方法的力量,其中近75%来自工业应用或其他求解器开发人员的贡献。我们的求解器的表现优于其他五个最先进的弦乐器,即CVC4,Ostrich,Z3Seq,Z3Str3和Z3-trau,尤其是在CVC4上实现2.4倍加速,在Z3Seq,6.4 x速度上超过了Z3-x超过Z3-Z3-Z3-Z3-traus和9.4 x的速度,速度为4.4 x,速度超过了9.4倍,并速度超过了9.4 x的速度。

We present a novel length-aware solving algorithm for the quantifier-free first-order theory over regex membership predicate and linear arithmetic over string length. We implement and evaluate this algorithm and related heuristics in the Z3 theorem prover. A crucial insight that underpins our algorithm is that real-world instances contain a wealth of information about upper and lower bounds on lengths of strings under constraints, and such information can be used very effectively to simplify operations on automata representing regular expressions. Additionally, we present a number of novel general heuristics, such as the prefix/suffix method, that can be used in conjunction with a variety of regex solving algorithms, making them more efficient. We showcase the power of our algorithm and heuristics via an extensive empirical evaluation over a large and diverse benchmark of 57256 regex-heavy instances, almost 75% of which are derived from industrial applications or contributed by other solver developers. Our solver outperforms five other state-of-the-art string solvers, namely, CVC4, OSTRICH, Z3seq, Z3str3, and Z3-Trau, over this benchmark, in particular achieving a 2.4x speedup over CVC4, 4.4x speedup over Z3seq, 6.4x speedup over Z3-Trau, 9.1x speedup over Z3str3, and 13x speedup over OSTRICH.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源