Class MinimizationResult<S,​L>

  • Type Parameters:
    S - state class.
    L - transition label class.

    public final class MinimizationResult<S,​L>
    extends Object
    The result structure of a minimization process. The result of a minimization process is a partition on the original set of states. This is represented by a collection of Blocks containing states that are equivalent and thus can be merged.

    Since all states in a block are equivalent (and thus especially have the same set of outgoing edge labels), a minimized automaton can be created from this partition by instantiating a state for each block. The edges between those states are created in the following way: For each state/block, an original state is chosen arbitrarily from this block. The edges are created according to the edges of this state, only that they point to the states representing the blocks the respective target states belong to (using getBlockForState(Object)).

    The blocks in the result partition are guaranteed to have contiguous IDs (see Block.getId()), starting at 0. This allows an efficient construction of the resulting automaton.

    A more convenient way to obtain a representation of the resulting, minimized automaton is using a BlockAutomaton.

    • Method Detail

      • getStatesInBlock

        public static <S,​L> Collection<S> getStatesInBlock​(Block<S,​L> block)
        Retrieves all (original) states in a block.
        Parameters:
        block - the block.
        Returns:
        a collection containing all original states in this block.
      • getNumBlocks

        public int getNumBlocks()
        Retrieves the number of blocks in the final partition.
        Returns:
        the number of blocks.
      • getBlocks

        public Collection<Block<S,​L>> getBlocks()
        Retrieves all blocks in the final partition.
        Returns:
        the final partition.
      • getRepresentative

        public S getRepresentative​(Block<S,​L> block)
        Chooses a representative (i.e., an arbitrary element of the set of states) from a block.
        Parameters:
        block - the block.
        Returns:
        an arbitrary element of the state set of the given block.
      • getBlockForState

        public Block<S,​L> getBlockForState​(S origState)
        Retrieves the block to which a given original state belongs.
        Parameters:
        origState - the original state.
        Returns:
        the corresponding block.
      • asBlockAutomaton

        public BlockAutomaton<S,​L> asBlockAutomaton()
        Creates a BlockAutomaton using this results structure.
        Returns:
        the block automaton.