Minimize.Ininclude DFA with type label := Label.tval states : states Fix.Indexing.cardinalThe set of DFA nodes
val transitions : transitions Fix.Indexing.cardinalThe set of DFA transitions
val label : transitions Fix.Indexing.index -> Label.tGet the label associated with a transition
val source : transitions Fix.Indexing.index -> states Fix.Indexing.indexGet the source state of the transition
val target : transitions Fix.Indexing.index -> states Fix.Indexing.indexGet the target state of the transition
val initials : (states Fix.Indexing.index -> unit) -> unitIterate on initial states
val finals : (states Fix.Indexing.index -> unit) -> unitIterate final states
val refinements :
((add:(states Fix.Indexing.index -> unit) -> unit) -> unit) ->
unitThe minimization algorithms operate on a DFA plus an optional initial refinement (state that must be distinguished, because of some external properties not observable from the labelled transitions alone).
If no refinements are needed, the minimum implementation is just: let refinements ~refine:_ = ()
Otherwise, the refinements function should invoke the refine function for each set of equivalent states and call the iter for each equivalent state.
E.g if our automata has 5 states, and states 2 and 3 have tag A while states 4 and 5 have tag B, we will do:
let refinements ~refine = refine (fun ~iter -> iter 2; 3); refine (fun ~iter -> iter 4; 5)