public class Automaton extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
alphabetLength |
static int |
EPSILON |
protected IntSequence |
initialStates |
GenericWholeArrray |
stateFinalities |
protected GenericWholeArrray |
stateNumberOfTransitions |
protected int |
statesStored |
protected int[] |
stateTransitions |
int[] |
transitionsFrom |
GenericWholeArrray |
transitionsLabel |
protected int |
transitionsStored |
int[] |
transitionsTo |
Constructor and Description |
---|
Automaton(AutomatonBuildHelp help,
int stateFinalityType) |
Automaton(AutomatonBuildHelp help,
int stateFinalityType,
int stateNumberOfTransitionsType) |
Modifier and Type | Method and Description |
---|---|
void |
addState(AutomatonBuildHelp help,
int state) |
void |
addTransition(AutomatonBuildHelp help,
int stateFrom,
int label,
int stateTo)
Adds a transition in the automaton
|
protected int |
computeSetFinality(int[] states,
int pos,
StatePDA[] finalities) |
Automaton |
determinize(StatePDA[] finalities)
Determinizes the automaton.
|
void |
generateGraphVizInput(File file,
String charSet) |
int |
getInitialState()
Gets the initial state of the automaton
|
protected int |
getNextTransition(int state,
int letter,
int transition) |
int |
getStatesStored()
Gets the number of the states of the automaton
|
int |
getTransitionsStored()
Gets the number of transitions in the automaton
|
protected AutomatonMinimizationHelp |
hopcroftMinimize(int labelsStored) |
protected void |
init(AutomatonBuildHelp help,
int stateFinalityType,
int stateNumberOfTransitionsType) |
Automaton |
minimize()
Minimizes a deterministic automaton according to Hopcroft's minimization
algorithm.
|
protected Automaton |
removeEpsilonTransitions(StatePDA[] finalities) |
void |
setTheInitialState(int s) |
protected void |
sortTransitions() |
StatePDA[] |
toFSM(TripleTransitions tripleTransitions)
Converts the automaton into State[].
|
protected int |
trCmp(int tr1,
int tr2) |
protected void |
trCpy(int trTo,
int trFrom) |
protected int |
trLabelCmp(int tr1,
int tr2) |
protected void |
trPush(int tr) |
protected void |
trSink(int heapStored) |
protected void |
trSwap(int tr1,
int tr2) |
protected void |
writeStateOtput(OutputStreamWriter osw,
int s) |
protected void |
writeTransitionLabel(OutputStreamWriter osw,
int tr) |
public static final int EPSILON
public int[] transitionsFrom
public GenericWholeArrray transitionsLabel
public int[] transitionsTo
protected int transitionsStored
protected int[] stateTransitions
public GenericWholeArrray stateFinalities
protected GenericWholeArrray stateNumberOfTransitions
protected int statesStored
protected IntSequence initialStates
protected int alphabetLength
public Automaton(AutomatonBuildHelp help, int stateFinalityType, int stateNumberOfTransitionsType)
public Automaton(AutomatonBuildHelp help, int stateFinalityType)
protected void init(AutomatonBuildHelp help, int stateFinalityType, int stateNumberOfTransitionsType)
public void addState(AutomatonBuildHelp help, int state)
public void addTransition(AutomatonBuildHelp help, int stateFrom, int label, int stateTo)
help
- stateFrom
- label
- stateTo
- protected void sortTransitions()
public Automaton determinize(StatePDA[] finalities)
finalities
- finalities[f] is a State that has a finality f.protected AutomatonMinimizationHelp hopcroftMinimize(int labelsStored)
public Automaton minimize()
public void generateGraphVizInput(File file, String charSet) throws IOException
IOException
protected void writeTransitionLabel(OutputStreamWriter osw, int tr) throws IOException
IOException
protected void writeStateOtput(OutputStreamWriter osw, int s) throws IOException
IOException
protected int getNextTransition(int state, int letter, int transition)
protected int computeSetFinality(int[] states, int pos, StatePDA[] finalities)
public void setTheInitialState(int s)
protected void trPush(int tr)
protected void trSink(int heapStored)
protected void trSwap(int tr1, int tr2)
protected int trCmp(int tr1, int tr2)
protected int trLabelCmp(int tr1, int tr2)
protected void trCpy(int trTo, int trFrom)
public int getStatesStored()
public int getInitialState()
public int getTransitionsStored()
public StatePDA[] toFSM(TripleTransitions tripleTransitions)
tripleTransitions
-