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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Barrière, Aurèle, Deng, Victor, Pit-Claudel, Clément
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915918286684160
author Barrière, Aurèle
Deng, Victor
Pit-Claudel, Clément
author_facet Barrière, Aurèle
Deng, Victor
Pit-Claudel, Clément
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2507_13091
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Formal Verification for JavaScript Regular Expressions: a Proven Semantics and its Applications (Extended Version)
Barrière, Aurèle
Deng, Victor
Pit-Claudel, Clément
Programming Languages
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.
title Formal Verification for JavaScript Regular Expressions: a Proven Semantics and its Applications (Extended Version)
topic Programming Languages
url https://arxiv.org/abs/2507.13091