Issue |
RAIRO-Theor. Inf. Appl.
Volume 58, 2024
12th International Workshop on Non-Classical Models of Automata and Applications (NCMA 2022)
|
|
---|---|---|
Article Number | 6 | |
Number of page(s) | 31 | |
DOI | https://doi.org/10.1051/ita/2023014 | |
Published online | 15 March 2024 |
Monadic Expressions and Their Derivatives
1
LIGM, Université Gustave Eiffel,
5 Boulevard Descartes — Champs s/ Marne
77454
Marne-la-Vallée Cedex 2,
France
2
GR2 IF, Université de Rouen Normandie,
Avenue de l’Université,
76801
Saint-Étienne-du-Rouvray,
France
* Corresponding author: ludovic.mignot@univ-rouen.fr
Received:
27
January
2023
Accepted:
23
November
2023
There are several well-known ways to compute derivatives of regular expressions due to Brzozowski, Antimirov or Lombardy and Sakarovitch. We propose another one which abstracts the underlying data structures (e.g. sets or linear combinations) using the notion of monad. As an example of this generalization advantage, we first introduce a new derivation technique based on the graded module monad and then show an application of this technique to generalize the parsing of expressions with capture groups and back references. We also extend operators defining expressions to any n-ary functions over value sets, such as classical operations (like negation or intersection for Boolean weights) or more exotic ones (like algebraic mean for rational weights). Moreover, we present how to compute a (non-necessarily finite) automaton from such an extended expression, using the Colcombet and Petrisan categorical definition of automata. These category theory concepts allow us to perform this construction in a unified way, whatever the underlying monad. Finally, to illustrate our work, we present a Haskell implementation of these notions using advanced techniques of functional programming, and we provide a web interface to manipulate concrete examples.
Mathematics Subject Classification: 68Q45 / 68Q70
Key words: derivatives of (weighted) regular expressions / monads / automata constructions / haskell implementation
© The authors. Published by EDP Sciences, 2024
This is an Open Access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Current usage metrics show cumulative count of Article Views (full-text article views including HTML views, PDF and ePub downloads, according to the available data) and Abstracts Views on Vision4Press platform.
Data correspond to usage on the plateform after 2015. The current usage metrics is available 48-96 hours after online publication and is updated daily on week days.
Initial download of the metrics may take a while.