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 B. Estarde <estradb at gmail dot com>.
LICENSE
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.