Representation of DFAs and some simple algorithms on them.
- data DFA
- type Label = CUInt
- type State = CUInt
- initialize :: Bool -> State -> IO DFA
- finished :: DFA -> IO ()
- addTransition :: DFA -> (State, Label, State) -> IO ()
- setFinal :: DFA -> State -> IO ()
- minimize :: DFA -> Bool -> IO ()
- foldTransitions :: DFA -> ((State, Label, State, Bool) -> b -> IO b) -> b -> IO b
- getInitialState :: DFA -> IO State
- numStates :: DFA -> IO CUInt
- numSymbols :: DFA -> IO CUInt
- isFinal :: DFA -> State -> IO Bool
- debugging :: DFA -> IO Bool
- loadFromFile :: FilePath -> IO DFA
- dumpToFile :: DFA -> FilePath -> IO ()
Add a transition from the given
State on the given
Set the final bit associated with
The minimization algorithm will distinguish states with different bits (that are otherwise bisimilar).
DFA using Antti Valmari's algorithm. The result
should be the same as for the standard algorithm due to Hopcroft.
Traverse the transitions of
DFA by invoking the given function
on each of them.
DFAs aren't functorial (they're monomorphic), so we cannot use
DFA from a file in a standard format. (See the accompanying examples and
dfa.c for details.)