ColinRunciman / MrE

simplifying regular expressions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MrE Regular Expression Simplifier (c) 2020 by Stefan Kahrs & Colin Runciman

The material in this MrE repository is licensed under a Creative Commons
Attribution-NonCommercial-ShareAlike 4.0 International License.  You should
find a copy of the license in the LICENSE file.  If not, see
<http://creativecommons.org/licenses/by-nc-sa/4.0/>.

1. This directory contains mostly Haskell programs and modules implementing
a regular-expression simplifier, and various ways of checking, testing and
measuring it.

2. Building the executables requires a host operating system classed as
"darwin", "linux" or "windows", with the ghc Haskell compiler and libraries
(version 8.6 or later) installed.

3. As noted in following paragraphs, some test-related programs use the
QuickCheck library; others use the LeanCheck library.  If these are not
included in your Haskell installation you may be able to add them using the
Cabal tool, like this:
$ cabal update
$ cabal v1-install quickcheck --lib
$ cabal v1-install leancheck --lib

4. A Makefile specifies how to build the simplifier and how to obtain test
data and measured test results, filed in subdirectories.  So check that you
have 'make' installed.

5. A 'make' command with no arguments is equivalent to 'make simplifier'.
It compiles the MrE executable, and it also compiles and runs programs to
generate the syntactic and semantic catalogues MrE may need.

6. The command 'make testdata' (requiring QuickCheck) runs programs to
generate in the 'populations' directory random sample populations of
expressions of given sizes, and in the 'expansions' directory samples of
expanded equivalents of known minimal expressions.  These files are
examples of MrE inputs.

7. Without command-line arguments MrE reads each line of the standard input
as a regular expression, and writes a simplified equivalent to standard output.
For greater simplifying power, at the cost of longer simplification times,
try one of the options -p (press), -y (lookup in the syntactic catalogue) or
-c (lookup in the semantic catalogue).

8. The command 'make correctnesscheck' (requiring LeanCheck) compiles and
runs a program to check, for a large number of test expressions and for
each of the simplifying transformations, that output expressions are
equivalent to input expressions, and no larger.

9. The command 'make results' (requiring QuickCheck) builds and runs
various programs to generate results of measured tests of effectiveness &
performance.  After 30 minutes or more it should produce a series of tables
in the file TestResults.pdf.  Tables are generated as latex sources, so
check that you have 'pdflatex' installed.

10. The Haskell sources (*.hs) are lightly commented.  Typically a source
file contains an overall short paragraph of explanation near the top, and
some brief explanatory remarks among the declarations of datatypes and
functions.

11. For a fuller discussion of how the simplifier works, and the results it
gives, see our paper:

  "Simplifying Regular Expressions Further",
  submitted for publication 2020.

Stefan Kahrs, University of Kent (S.M.Kahrs@kent.ac.uk)
Colin Runciman, University of York (Colin.Runciman@york.ac.uk)

About

simplifying regular expressions

License:Other


Languages

Language:Haskell 97.5%Language:Makefile 2.3%Language:TeX 0.3%