Class MealyMachines


  • public final class MealyMachines
    extends Object
    • Method Detail

      • combine

        public static <I,​O1,​O2> CompactMealy<I,​Pair<O1,​O2>> combine​(MealyMachine<?,​I,​?,​O1> mealy1,
                                                                                            MealyMachine<?,​I,​?,​O2> mealy2,
                                                                                            Alphabet<I> inputAlphabet)
        Constructs the product automaton for two Mealy Machines.
        Type Parameters:
        I - input symbol type
        O1 - output symbol type of the first Mealy Machine
        O2 - output symbol type of the second Mealy Machine
        Parameters:
        mealy1 - the first Mealy Machine
        mealy2 - the second Mealy Machine
        inputAlphabet - the input alphabet of the returned automaton
        Returns:
        a new Mealy Machine representing the product automaton of the specified Mealy Machines
      • combine

        public static <I,​O1,​O2,​A extends MutableMealyMachine<?,​I,​?,​Pair<O1,​O2>>> A combine​(MealyMachine<?,​I,​?,​O1> mealy1,
                                                                                                                                     MealyMachine<?,​I,​?,​O2> mealy2,
                                                                                                                                     Collection<? extends I> inputs,
                                                                                                                                     A out)
        Constructs the product automaton for two Mealy Machines.
        Type Parameters:
        I - input symbol type
        O1 - output symbol type of the first Mealy Machine
        O2 - output symbol type of the second Mealy Machine
        Parameters:
        mealy1 - the first Mealy Machine
        mealy2 - the second Mealy Machine
        inputs - the input symbols to consider
        out - the instance to which the combined automaton should be written
        Returns:
        out, for convenience
      • complete

        public static <I,​O> CompactMealy<I,​O> complete​(MealyMachine<?,​I,​?,​O> mealy,
                                                                   Alphabet<I> inputs,
                                                                   O undefinedOutput)
        Constructs a copy of the given Mealy machine in which every transition (in regard to the specified alphabet) is guaranteed to be defined. This includes adding a sink state if the original Mealy machine has undefined transitions.
        Type Parameters:
        I - input symbol type
        O - output symbol type
        Parameters:
        mealy - the original Mealy machine
        inputs - the inputs to consider for completing the automaton
        undefinedOutput - the output symbol that should be used for new transitions
        Returns:
        a copy of the given Mealy machine in which every transition (in regard to the specified alphabet) is guaranteed to be defined
      • complete

        public static <S,​I,​T,​O,​A extends MutableMealyMachine<S,​I,​T,​O>> A complete​(MealyMachine<?,​I,​?,​O> mealy,
                                                                                                                            Collection<? extends I> inputs,
                                                                                                                            O undefinedOutput,
                                                                                                                            A out)
        Constructs a copy of the given Mealy machine in which every transition (in regard to the specified alphabet) is guaranteed to be defined. This includes adding a sink state if the original Mealy machine has undefined transitions.
        Type Parameters:
        S - automaton state type
        I - input symbol type
        T - automaton transition type
        O - output symbol type
        A - output automaton type
        Parameters:
        mealy - the original Mealy machine
        inputs - the inputs to consider for completing the automaton
        undefinedOutput - the output symbol that should be used for new transitions
        out - the instance to which the copy should be written
        Returns:
        out, for convenience.