ReSyn:一种通用的递归正则表达式合成框架
ReSyn: A Generalized Recursive Regular Expression Synthesis Framework
摘要
现有的编程示例法系统通常依赖简化的测试基准,这些基准无法反映真实正则表达式中的复杂结构特征,比如复杂的嵌套结构以及频繁的联合操作。为了克服这种性能下降问题,我们提出了ReSyn这一无需特定合成器的分治算法框架,该框架能够将复杂的合成问题分解为易于处理的子问题。我们还引入了Set2Regex这一参数效率高的合成器,它能够捕捉到示例中的排列不变性特性。实验结果表明,ReSyn能够显著提升各种合成器的准确率,而它与Set2Regex的结合则使得在具有挑战性的真实场景测试集上达到了新的最优水平。完整的源代码、数据集以及预训练模型文件均可在https://github.com/mrseongminkim/ReSyn上获取。
English Abstract
Existing Programming-By-Example (PBE) systems often rely on simplified benchmarks that fail to capture the high structural complexity of real-world regexes, such as deeper nesting and frequent use of union operations. To overcome the resulting performance drop, we propose ReSyn, a synthesizer-agnostic divide-and-conquer framework that decomposes complex synthesis problem into manageable sub-problems. We also introduce Set2Regex, a parameter-efficient synthesizer capturing the permutation invariance of examples. Experimental results demonstrate that ReSyn significantly boosts accuracy across various synthesizers, and its combination with Set2Regex establishes a new state-of-the-art on challenging real-world benchmark. The complete source code, datasets, and pre-trained model checkpoints are publicly available at https://github.com/mrseongminkim/ReSyn.