arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2507.13091cs.PL
收藏

JavaScript正则表达式形式验证:一种证明语义及其应用(扩展版)

Formal Verification for JavaScript Regular Expressions: a Proven Semantics and its Applications (Extended Version)

EPFL(洛桑联邦理工学院);DI ENS, École Normale Supérieure, PSL, CNRS(巴黎高等师范学院计算机科学研究所,PSL大学,法国国家科学研究中心)

Aurèle Barrière, Victor Deng, Clément Pit-Claudel

AI总结:

本文提出首个机验证的正则表达式语义,通过证明等价于ECMAScript规范,展示其在实际应用中的有效性,包括新上下文等价性概念和PikeVM算法的首次形式证明。

摘要:

我们提出了首个机验证的简洁、实用、完整且证明忠实的现代正则表达式语言语义,具有回溯语义。我们通过证明其等价于现有逐行嵌入的官方ECMAScript规范来确保其忠实性。我们通过展示两个实际应用来证明其实用性。首先,一个新的现代正则表达式上下文等价性概念,用于证明或反驳先前工作的重写。其次,首次形式证明了用于许多实际引擎的PikeVM算法。与规范和其他形式化工作不同,我们的语义不仅捕获了最高优先级匹配,还记录了所有可能匹配的完整回溯树及其各自的优先级。所有定义和结果均已用Rocq证明助手机验证。

英文摘要:

We present the first mechanized, succinct, practical, complete, and proven-faithful semantics for a modern regular expression language with backtracking semantics. We ensure its faithfulness by proving it equivalent to a preexisting line-by-line embedding of the official ECMAScript specification of JavaScript regular expressions. We demonstrate its practicality by presenting two real-world applications. First, a new notion of contextual equivalence for modern regular expressions, which we use to prove or disprove rewrites drawn from previous work. Second, the first formal proof of the PikeVM algorithm used in many real-world engines. In contrast with the specification and other formalization work, our semantics captures not only the top-priority match, but a full backtracking tree recording all possible matches and their respective priority. All our definitions and results have been mechanized in the Rocq proof assistant.

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

↑