A Verified Operational Semantics for Regular Expression Parsing

  • Elton Máximo Cardoso UFOP
  • Leonardo Vieira dos Santos Reis UFJF
  • Rodrigo Geraldo Ribeiro UFOP

Abstract

Regular expressions (REs) are pervasive in computing. We use REs in text editors, string search tools (like GNU-Grep) and lexical analysers generators. Most of these tools rely on converting REs to their corresponding finite state machines or use REs derivatives to directly parse an input string. In this work, we investigate the suitability of another approach: instead of using derivatives or generating a finite state machine for a given RE, we developed an operational semantics for parsing regular languages, in such a way that a RE is merely a program executed according to the semantics over the input string. We show that the proposed semantics is sound w.r.t. a standard inductive semantics for RE and that the evidence produced by it denotes a valid parsing result. All of our results are formalized using Coq proof assistant.
Published
2023-09-25
How to Cite
CARDOSO, Elton Máximo; REIS, Leonardo Vieira dos Santos; RIBEIRO, Rodrigo Geraldo. A Verified Operational Semantics for Regular Expression Parsing. Proceedings of the Brazilian Symposium on Programming Languages (SBLP), [S.l.], p. 82–90, sep. 2023. ISSN 0000-0000. Available at: <https://sol.sbc.org.br/index.php/sblp/article/view/28336>. Date accessed: 18 may 2024.