Search code examples
regexcommand-linefinite-automataautomata

Automata and Regex Theory Tools


Back in 2000 when I was a student I took a course in automata theory. In the exercises to this course we essentially re-programmed a unix command-line tool called Grail (http://www.csd.uwo.ca/Research/grail/). Grail allows you to read in files with regular expressions or deterministic/nondeterministic finite state machines and apply the typical theoretical operations on them: minimizing the FSM, checking for emptiness, reversing, product of FSMs, FSM to RegEx and RegEx to FSMs, applying an input string and simulating the machine and so on.

Grail seems to be available but apparently has not been developed since 2002. Therefore my question: does anybody know about similar tools that are still under active development? (i.e., the modern Grail?) What is used in classes today?

What I am looking for is a command-line tool that reads FSMs or RegExes from stdin, applies an operation, and outputs the result to stdout, the Unix way, so that you can create your own pipes. Simple FSMs and RegExes are enough, so things like pushdown automatas or Büchi automatas are not really necessary.

If no command-line tool, are there good libraries or graphical tools out there?


Solution

  • OpenFst is a set of command line tools for manipulating Finite state Transducers, there is a companion grammar toolkit OpenGrm. The machines can be visualized with GraphViz.

    foma is another transducer toolkit with regex support.