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.


翻译:我们首次为现代支持回溯语义的正则表达式语言提出了机械化、简洁、实用、完备且具有证明忠实性的语义。通过证明该语义与ECMAScript官方规范中JavaScript正则表达式的逐行嵌入等价,我们确保了其忠实性。通过展示两个实际应用,我们证明了其实用性:其一,针对现代正则表达式提出了一种新的上下文等价概念,用于证明或证伪先前工作中的重写规则;其二,对多个现实引擎中使用的PikeVM算法进行了首次形式化证明。与规范和其它形式化工作不同,我们的语义不仅捕获最高优先级匹配,还记录了所有可能匹配及其优先级的完整回溯树。所有定义和结果均已在Rocq证明助手中机械化实现。

0
下载
关闭预览

相关内容

ICML2026 | 重新思考顺序知识编辑中的正则化
专知会员服务
10+阅读 · 5月27日
《软件定义网络元素与机器代码的形式化验证》
专知会员服务
14+阅读 · 2025年11月18日
【2023新书】程序证明,Program Proofs,642页pdf
专知会员服务
67+阅读 · 2023年3月29日
专知会员服务
34+阅读 · 2021年5月8日
可解释强化学习,Explainable Reinforcement Learning: A Survey
专知会员服务
133+阅读 · 2020年5月14日
智能合约的形式化验证方法研究综述
专知
16+阅读 · 2021年5月8日
【翻译技术速递】测评:免费的术语抽取工具
翻译技术沙龙
139+阅读 · 2019年11月2日
WebAssembly在QQ邮箱中的一次实践
IMWeb前端社区
13+阅读 · 2018年12月19日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
推荐中的序列化建模:Session-based neural recommendation
机器学习研究会
18+阅读 · 2017年11月5日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关主题
最新内容
《同步多无人机系统中的故障与通信》
专知会员服务
2+阅读 · 今天6:23
面向国防作战的最佳自主与蜂群无人机技术
专知会员服务
7+阅读 · 7月28日
《异构人类团队的协作决策过程混合建模研究》
博士论文 | 面向大模型推理的内存高效算法
专知会员服务
5+阅读 · 7月27日
美空军新型反无人机部队初探
专知会员服务
9+阅读 · 7月27日
相关资讯
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员