Regenerate: a language generator for extended regular expressions
Author(s) -
Gabriel Radanne,
Peter Thiemann
Publication year - 2020
Publication title -
acm sigplan notices
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.31
H-Index - 99
eISSN - 1558-1160
pISSN - 0362-1340
DOI - 10.1145/3393934.3278133
Subject(s) - regular expression , haskell , computer science , complement (music) , generator (circuit theory) , programmer , programming language , expression (computer science) , intersection (aeronautics) , toolbox , operator (biology) , regular language , variety (cybernetics) , word (group theory) , domain specific language , matching (statistics) , theoretical computer science , algorithm , artificial intelligence , functional programming , mathematics , automaton , engineering , aerospace engineering , biochemistry , geometry , complementation , phenotype , statistics , transcription factor , gene , quantum mechanics , chemistry , repressor , physics , power (physics)
Regular expressions are part of every programmer’s toolbox. They are used for a wide variety of language-related tasks and there are many algorithms for manipulating them. In particular, matching algorithms that detect whether a word belongs to the language described by a regular expression are well explored, yet new algorithms appear frequently. However, there is no satisfactory methodology for testing such matchers. We propose a testing methodology which is based on generating positive as well as negative examples of words in the language. To this end, we present a new algorithm to generate the language described by a generalized regular expression with intersection and complement operators. The complement operator allows us to generate both positive and negative example words from a given regular expression. We implement our generator in Haskell and OCaml and show that its performance is more than adequate for testing.
Accelerating Research
Robert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom
Address
John Eccles HouseRobert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom