S
- state class.L
- transition label class.public final class MinimizationResult<S,L> extends Object
Block
s 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
.
Modifier and Type | Method and Description |
---|---|
BlockAutomaton<S,L> |
asBlockAutomaton()
Creates a
BlockAutomaton using this results structure. |
Block<S,L> |
getBlockForState(S origState)
Retrieves the block to which a given original state belongs.
|
Collection<Block<S,L>> |
getBlocks()
Retrieves all blocks in the final partition.
|
int |
getNumBlocks()
Retrieves the number of blocks in the final partition.
|
S |
getRepresentative(Block<S,L> block)
Chooses a representative (i.e., an arbitrary element of the set of states) from a block.
|
static <S,L> Collection<S> |
getStatesInBlock(Block<S,L> block)
Retrieves all (original) states in a block.
|
public static <S,L> Collection<S> getStatesInBlock(Block<S,L> block)
block
- the block.public int getNumBlocks()
public Collection<Block<S,L>> getBlocks()
public S getRepresentative(Block<S,L> block)
block
- the block.public Block<S,L> getBlockForState(S origState)
origState
- the original state.public BlockAutomaton<S,L> asBlockAutomaton()
BlockAutomaton
using this results structure.Copyright © 2020. All rights reserved.