vvulpes0 / fsa-tools

generate random finite state automata and determine their complexity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FSA Tools

Generate random finite state automata and determine their complexity.

Requirements

  • genfsa requires only a C99 compiler.
  • dotify-att is an AWK script
  • the verify-* tests require GHC and the LTK
  • the Makefile is written for BSD-compatible make

Installation

Run make, then run make install. The default installation prefix is /usr/local. You can use a different prefix using make PREFIX=/path/to/dir install

Basic Use

Generate a random FSA with seven states and an alphabet of four symbols and view it (requires GraphViz and a display program):

genfsa 7 4 | dotify-att | dot -Tpng | display

GraphViz (which provides the dot program) has several other layout options and can generate other types of files, including PDF, if desired.

Generate a somewhat sparse graph and determine if it is strictly local:

genfsa -e15 7 4 | verify-sl

Generate 100 random automata and determine what proportion is strictly piecewise:

yes | head -n100 | xargs -L1 sh -c 'genfsa 7 5 | verify-sp && printf "1\n" || true' | wc -l | tr -d '[:blank:]'

If you have a BSD-compatible xargs then you can add, say, -P16 after -L1 in order to run up to 16 checks in parallel at a time.

About

generate random finite state automata and determine their complexity

License:MIT License


Languages

Language:C 56.4%Language:Awk 16.7%Language:Haskell 14.0%Language:Makefile 12.9%