Class PaigeTarjanMinimization
- java.lang.Object
-
- net.automatalib.util.automaton.minimizer.paigetarjan.PaigeTarjanMinimization
-
public final class PaigeTarjanMinimization extends Object
A utility class that offers shorthand methods for minimizing automata using the partition refinement approach ofPaigeTarjan
.This implementation is specifically tailored towards partial automata by allowing to provide a custom
sinkClassification
, which will be used as the on-demand "successor" of undefined transitions. When extracting information from thePaigeTarjan
datastructure viaPaigeTarjanExtractors
, the original automaton is used to determine the state-transitions from one partition block to another. If thesinkClassification
did not match the signature of any existing state, no transition will enter the artificial partition block of the sink. Consequently, this class will always prune unreachable states, because otherwise we might not return a minimal automaton.For minimizing complete automata, use
HopcroftMinimization
.- See Also:
PaigeTarjan
,HopcroftMinimization
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <S,I,A extends DFA<S,I> & InputAlphabetHolder<I>>
CompactDFA<I>minimizeDFA(A dfa)
Minimizes the given DFA.static <I> CompactDFA<I>
minimizeDFA(DFA<?,I> dfa, Alphabet<I> alphabet)
Minimizes the given DFA.static <A extends MutableDFA<?,I>,I>
AminimizeDFA(DFA<?,I> dfa, Alphabet<I> alphabet, AutomatonCreator<A,I> creator)
Minimizes the given DFA.static <S,I,T,O,A extends MealyMachine<S,I,T,O> & InputAlphabetHolder<I>>
CompactMealy<I,O>minimizeMealy(A mealy)
Minimizes the given Mealy machine.static <I,O>
CompactMealy<I,O>minimizeMealy(MealyMachine<?,I,?,O> mealy, Alphabet<I> alphabet)
Minimizes the given Mealy machine.static <A extends MutableMealyMachine<?,I,?,O>,I,O>
AminimizeMealy(MealyMachine<?,I,?,O> mealy, Alphabet<I> alphabet, AutomatonCreator<A,I> creator)
Minimizes the given Mealy machine.static <I,T,SP,TP,A extends MutableDeterministic<?,I,?,SP,TP>>
AminimizeUniversal(UniversalDeterministicAutomaton<?,I,T,SP,TP> automaton, Alphabet<I> alphabet, AutomatonCreator<A,I> creator, AutomatonInitialPartitioning ap, Object sinkClassification)
Minimizes the given automaton depending on the given partitioning function.
-
-
-
Method Detail
-
minimizeDFA
public static <S,I,A extends DFA<S,I> & InputAlphabetHolder<I>> CompactDFA<I> minimizeDFA(A dfa)
Minimizes the given DFA. The result is returned in the form of aCompactDFA
, using the input alphabet obtained viadfa.
.getInputAlphabet()
- Parameters:
dfa
- the DFA to minimize- Returns:
- a minimized version of the specified DFA
-
minimizeDFA
public static <I> CompactDFA<I> minimizeDFA(DFA<?,I> dfa, Alphabet<I> alphabet)
Minimizes the given DFA. The result is returned in the form of aCompactDFA
.- Parameters:
dfa
- the DFA to minimizealphabet
- the input alphabet (this will be the input alphabet of the returned DFA)- Returns:
- a minimized version of the specified DFA
-
minimizeDFA
public static <A extends MutableDFA<?,I>,I> A minimizeDFA(DFA<?,I> dfa, Alphabet<I> alphabet, AutomatonCreator<A,I> creator)
Minimizes the given DFA. The result is returned in the form of aMutableDFA
, constructed by the givencreator
.- Parameters:
dfa
- the DFA to minimizealphabet
- the input alphabet (this will be the input alphabet of the returned DFA)creator
- the creator for constructing the automata instance to return- Returns:
- a minimized version of the specified DFA
-
minimizeMealy
public static <S,I,T,O,A extends MealyMachine<S,I,T,O> & InputAlphabetHolder<I>> CompactMealy<I,O> minimizeMealy(A mealy)
Minimizes the given Mealy machine. The result is returned in the form of aCompactMealy
, using the alphabet obtained viamealy.
.getInputAlphabet()
- Parameters:
mealy
- the Mealy machine to minimize- Returns:
- a minimized version of the specified Mealy machine
-
minimizeMealy
public static <I,O> CompactMealy<I,O> minimizeMealy(MealyMachine<?,I,?,O> mealy, Alphabet<I> alphabet)
Minimizes the given Mealy machine. The result is returned in the form of aCompactMealy
.- Parameters:
mealy
- the Mealy machine to minimizealphabet
- the input alphabet (this will be the input alphabet of the resulting Mealy machine)- Returns:
- a minimized version of the specified Mealy machine
-
minimizeMealy
public static <A extends MutableMealyMachine<?,I,?,O>,I,O> A minimizeMealy(MealyMachine<?,I,?,O> mealy, Alphabet<I> alphabet, AutomatonCreator<A,I> creator)
Minimizes the given Mealy machine. The result is returned in the form of aMutableMealyMachine
, constructed by the givencreator
.- Parameters:
mealy
- the Mealy machine to minimizealphabet
- the input alphabet (this will be the input alphabet of the resulting Mealy machine)creator
- the creator for constructing the automata instance to return- Returns:
- a minimized version of the specified Mealy machine
-
minimizeUniversal
public static <I,T,SP,TP,A extends MutableDeterministic<?,I,?,SP,TP>> A minimizeUniversal(UniversalDeterministicAutomaton<?,I,T,SP,TP> automaton, Alphabet<I> alphabet, AutomatonCreator<A,I> creator, AutomatonInitialPartitioning ap, Object sinkClassification)
Minimizes the given automaton depending on the given partitioning function. ThesinkClassification
is used to describe the signature of the sink state ("successor" of undefined transitions) and may introduce a new, on-thy-fly equivalence class if it doesn't match a signature of any existing state. See theStateSignature
class for creating signatures for existing states.- Parameters:
automaton
- the automaton to minimizealphabet
- the input alphabet (this will be the input alphabet of the resulting Mealy machine)creator
- the creator for constructing the automata instance to returnap
- the initial partitioning function, determining how states will be distinguishedsinkClassification
- the classification used when an undefined transition is encountered- Returns:
- the minimized automaton, initially constructed from the given
creator
. - See Also:
AutomatonInitialPartitioning
,StateSignature
-
-