Class MealyFilter
- java.lang.Object
-
- net.automatalib.util.automaton.transducer.MealyFilter
-
public final class MealyFilter extends Object
Various utility methods to filter Mealy machines.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <I,O>
CompactMealy<I,O>filterByOutput(MealyMachine<?,I,?,O> in, Alphabet<I> inputs, Predicate<? super O> outputPred)
static <S1,T1,S2,I,O>
Mapping<S1,S2>filterByOutput(MealyMachine<S1,I,T1,O> in, Collection<? extends I> inputs, MutableMealyMachine<S2,I,?,O> out, Predicate<? super O> outputPred)
static <I,O>
CompactMealy<I,O>pruneTransitionsWithOutput(MealyMachine<?,I,?,O> in, Alphabet<I> inputs, Collection<? super O> outputs)
Returns a Mealy machine with all transitions removed that have one of the specified output values.static <I,O>
CompactMealy<I,O>pruneTransitionsWithOutput(MealyMachine<?,I,?,O> in, Alphabet<I> inputs, O... outputs)
Returns a Mealy machine with all transitions removed that have one of the specified output values.static <I,O>
CompactMealy<I,O>retainTransitionsWithOutput(MealyMachine<?,I,?,O> in, Alphabet<I> inputs, Collection<? super O> outputs)
Returns a Mealy machine with all transitions removed that have an output not among the specified values.static <I,O>
CompactMealy<I,O>retainTransitionsWithOutput(MealyMachine<?,I,?,O> in, Alphabet<I> inputs, O... outputs)
Returns a Mealy machine with all transitions removed that have an output not among the specified values.
-
-
-
Method Detail
-
pruneTransitionsWithOutput
@SafeVarargs public static <I,O> CompactMealy<I,O> pruneTransitionsWithOutput(MealyMachine<?,I,?,O> in, Alphabet<I> inputs, O... outputs)
Returns a Mealy machine with all transitions removed that have one of the specified output values. The resulting Mealy machine will not contain any unreachable states.This is a convenience varargs overload of
pruneTransitionsWithOutput(MealyMachine, Alphabet, Collection)
.- Parameters:
in
- the input Mealy machineinputs
- the input alphabetoutputs
- the outputs to remove- Returns:
- a Mealy machine with all transitions removed that have one of the specified outputs.
-
pruneTransitionsWithOutput
public static <I,O> CompactMealy<I,O> pruneTransitionsWithOutput(MealyMachine<?,I,?,O> in, Alphabet<I> inputs, Collection<? super O> outputs)
Returns a Mealy machine with all transitions removed that have one of the specified output values. The resulting Mealy machine will not contain any unreachable states.- Parameters:
in
- the input Mealy machineinputs
- the input alphabetoutputs
- the outputs to remove- Returns:
- a Mealy machine with all transitions removed that have one of the specified outputs.
-
filterByOutput
public static <I,O> CompactMealy<I,O> filterByOutput(MealyMachine<?,I,?,O> in, Alphabet<I> inputs, Predicate<? super O> outputPred)
-
filterByOutput
public static <S1,T1,S2,I,O> Mapping<S1,S2> filterByOutput(MealyMachine<S1,I,T1,O> in, Collection<? extends I> inputs, MutableMealyMachine<S2,I,?,O> out, Predicate<? super O> outputPred)
-
retainTransitionsWithOutput
@SafeVarargs public static <I,O> CompactMealy<I,O> retainTransitionsWithOutput(MealyMachine<?,I,?,O> in, Alphabet<I> inputs, O... outputs)
Returns a Mealy machine with all transitions removed that have an output not among the specified values. The resulting Mealy machine will not contain any unreachable states.This is a convenience varargs overload of
retainTransitionsWithOutput(MealyMachine, Alphabet, Collection)
.- Parameters:
in
- the input Mealy machineinputs
- the input alphabetoutputs
- the outputs to retain- Returns:
- a Mealy machine with all transitions retained that have one of the specified outputs.
-
retainTransitionsWithOutput
public static <I,O> CompactMealy<I,O> retainTransitionsWithOutput(MealyMachine<?,I,?,O> in, Alphabet<I> inputs, Collection<? super O> outputs)
Returns a Mealy machine with all transitions removed that have an output not among the specified values. The resulting Mealy machine will not contain any unreachable states.- Parameters:
in
- the input Mealy machineinputs
- the input alphabetoutputs
- the outputs to retain- Returns:
- a Mealy machine with all transitions retained that have one of the specified outputs.
-
-