NAME
FLAT::DFA - Deterministic finite automata
SYNOPSIS
A FLAT::DFA object is a finite automata whose transitions are labeled with single characters. Furthermore, each state has exactly one outgoing transition for each available label/character.
USAGE
In addition to implementing the interface specified in FLAT and FLAT::NFA, FLAT::DFA objects provide the following DFA-specific methods:
- $dfa->unset_starting
-
Because a DFA, by definition, must have only ONE starting state, this allows one to unset the current start state so that a new one may be set.
- $dfa->trim_sinks
-
This method returns a FLAT::DFA (though in theory an NFA) that is lacking a transition for all symbols from all states. This method eliminates all transitions from all states that lead to a sink state; it also eliminates the sink state.
This has no affect on testing if a string is valid using
FLAT::DFA::is_valid_string
, discussed below. - $dfa->as_min_dfa
-
This method minimizes the number of states and transitions in the given DFA. The modifies the current/calling DFA object.
- $dfa->is_valid_string($string)
-
This method tests if the given string is accepted by the DFA.
AUTHORS & ACKNOWLEDGEMENTS
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
LICENSE
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.