FLAT::NFA - Nondeterministic finite automata
A FLAT::NFA object is a finite automata whose transitions are labeled either with characters or the empty string (epsilon).
In addition to implementing the interface specified in FLAT, FLAT::NFA objects provide the following NFA-specific methods:
Returns the set of states (without duplicates) which are reachable from @states via zero or more epsilon-labeled transitions.
Returns a list of N+1 arrayrefs, where N is the length of $string. The I-th arrayref contains the states which are reachable from the starting state(s) of $nfa after reading I characters of $string. Correctly accounts for epsilon transitions.
Outputs FA in a format that may be easily read into an external program as a description of an undirected graph.
Outputs FA in a format that may be easily read into an external program as a description of an directed graph.
Outputs FA in Graph Description Language (GDL), including directed transitions with symbols and state names labeled.
Outputs FA in Graphviz format,
including directed transitions with symbols and and state names labeled.
This output may be directly piped into any of the Graphviz layout programs,
and in turn one may output an image using a single commandline instruction.
fash uses this function to implement its "nfa2gv" command:
fash nfa2gv "a*b" | dot -Tpng > nfa.png
Outputs FA in Graphviz format, with out the directed transitions or labels. The output is suitable for any of the Graphvize layout programs, as discussed above.
Outputs a summary of the FA, including its states, symbols, and transition matrix. It is useful for manually validating what the FA looks like.
FLAT is written by Mike Rosulek <mike at mikero dot com> and Brett Estrade <estradb at gmail dot com>.
The initial version (FLAT::Legacy) by Brett Estrade was work towards an MS thesis at the University of Southern Mississippi.
Please visit the Wiki at http://www.0x743.com/flat
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.