public interface DeterministicFiniteAutomaton
Modifier and Type | Field and Description |
---|---|
static byte |
AC |
static byte |
PS |
static byte |
PV |
static byte |
TS |
static byte |
TV |
Modifier and Type | Method and Description |
---|---|
short |
addState(boolean isInitial,
byte type,
boolean addSelfLoops)
Adds a new state to the matrix
|
void |
addTransition(short fromS,
short toS,
short label)
Add a transition from state fromS to state toS labeled with label
|
void |
complete()
Adds a single PV type state to which all other states can transition
using any label not currently in the DFA.
|
boolean |
equals(java.lang.Object o) |
short |
getInitialState()
Returns the initial state
|
java.lang.String |
getLabel() |
short |
getNextState(short currentState,
int label)
returns the new state after executing a transition with the given label
in currentState, or NOSTATE is no such new state exists.
|
byte |
getStateType(short state)
Returns the type of the state (PV, TV, PS, or TS)
|
int |
hashCode() |
boolean |
isAcceptingState(short state)
Returns true if the given state is an accepting state
|
boolean |
isAllowed(short currentState,
int label)
Checks if the transition with the given label is possible in the given
state
|
boolean |
isComplete()
Check if the automaton is complete, i.e.
|
void |
reduce()
Reduces the DFA to remove all permanently violated states by simply
removing all transitions into these states and then removing unreachable
states.
|
void |
removeTransition(short fromS,
short label)
Remove transition labeled with label from state fromS
|
void |
setInitialState(short state)
Sets the initial state
|
void |
setStateType(short state,
byte type) |
java.lang.String |
toString() |
static final byte PV
static final byte TV
static final byte PS
static final byte TS
static final byte AC
short addState(boolean isInitial, byte type, boolean addSelfLoops)
isInitial
- type
- void addTransition(short fromS, short toS, short label)
fromS
- toS
- label
- void removeTransition(short fromS, short label)
fromS
- toS
- label
- short getNextState(short currentState, int label)
currentState
- label
- boolean isAllowed(short currentState, int label)
currentState
- label
- short getInitialState()
void setInitialState(short state)
state
- boolean isAcceptingState(short state)
state
- void setStateType(short state, byte type)
void reduce()
void complete()
boolean isComplete()
byte getStateType(short state)
state
- boolean equals(java.lang.Object o)
equals
in class java.lang.Object
int hashCode()
hashCode
in class java.lang.Object
java.lang.String toString()
toString
in class java.lang.Object
java.lang.String getLabel()