public abstract class AbstractIntDAFSA extends IntDaciukAlgoIndexed
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractIntDAFSA.State
Basic FSA state.
|
| Constructor and Description |
|---|
AbstractIntDAFSA() |
| Modifier and Type | Method and Description |
|---|---|
int |
addState()
Adds a new state to the automaton
|
int |
cloneState(int srcState)
Clones given state.
|
static int |
decodeDest(long val)
Decode destination from the transition table value
|
static int |
decodeLabel(long val)
Decode label from the transition table value
|
static long |
encodeTransition(int input,
int next)
Encode transition to table value
|
abstract void |
finalAssign(int destState,
int srcState)
Copy final value from source state to destination state
|
abstract boolean |
finalEquals(int state1,
int state2)
Check if final values of two states are equal
|
abstract int |
finalHash(int state)
Compute hash code for the final value of the state
|
abstract void |
finalReset(int state)
Reset the final value of the given state
|
int |
getNext(int state,
int input)
Find matching outbound transition for given state
|
int |
getStartState() |
java.util.List<AbstractIntDAFSA.State> |
getStates() |
int |
getTransitionCount(int state) |
int |
getTransitionInput(int state,
int transitionIndex) |
int |
getTransitionNext(int state,
int transitionIndex) |
abstract void |
initFinals()
Initialize finality values for this FSA
|
boolean |
isConfluence(int state)
Checks a state for confluence (if in has more that 1 inbound transitions)
|
abstract boolean |
isFinalState(int state)
Checks if state is final
|
boolean |
isSource(int stateNumber) |
abstract void |
newFinal(int state)
Initialize final value for given state
|
void |
regAdd(int state)
Add state to register
|
int |
regGet(int state)
Get equivalent state from register
|
void |
regRemove(int state)
Remove given state from register.
|
void |
removeState(int state)
Removes given state from the automaton
|
boolean |
setNext(int src,
int label,
int dest)
Adds a transition from src to dest on given label, if
a transition from src with given label already exists, then change it
to new destination state.
|
int |
size() |
void |
toDot(java.io.PrintWriter pw)
Output this DAFSA to dot format
|
void |
toDot(java.lang.String fileName) |
int |
transitionCount() |
add, addMinWord, addSuffix, hasFinal, replaceOrRegister, setFinalpublic static int decodeLabel(long val)
val - transition table valuepublic static int decodeDest(long val)
val - transition table valuepublic static long encodeTransition(int input,
int next)
input - input symbolnext - next state numberpublic void regAdd(int state)
IntDaciukAlgoIndexedregAdd in class IntDaciukAlgoIndexedstate - state numberpublic int regGet(int state)
IntDaciukAlgoIndexedregGet in class IntDaciukAlgoIndexedstate - reference statepublic void regRemove(int state)
IntDaciukAlgoIndexedregRemove in class IntDaciukAlgoIndexedstate - state to removepublic int getNext(int state,
int input)
IntDaciukAlgoIndexedgetNext in class IntDaciukAlgoIndexedstate - source stateinput - labelpublic boolean isConfluence(int state)
IntDaciukAlgoIndexedisConfluence in class IntDaciukAlgoIndexedstate - state to checkpublic int cloneState(int srcState)
IntDaciukAlgoIndexedcloneState in class IntDaciukAlgoIndexedpublic int addState()
IntDaciukAlgoIndexedaddState in class IntDaciukAlgoIndexedpublic boolean setNext(int src,
int label,
int dest)
IntDaciukAlgoIndexedsetNext in class IntDaciukAlgoIndexedsrc - source statelabel - transition labeldest - destination statepublic void removeState(int state)
IntDaciukAlgoIndexedremoveState in class IntDaciukAlgoIndexedstate - state indexpublic int size()
public int getTransitionCount(int state)
public int getTransitionInput(int state,
int transitionIndex)
public int getTransitionNext(int state,
int transitionIndex)
public int getStartState()
public abstract void initFinals()
public abstract int finalHash(int state)
state - statepublic abstract boolean finalEquals(int state1,
int state2)
state1 - first statestate2 - second statepublic abstract void finalReset(int state)
state - public abstract void finalAssign(int destState,
int srcState)
destState - destination statesrcState - source statepublic abstract void newFinal(int state)
state - public abstract boolean isFinalState(int state)
state - state numberpublic void toDot(java.io.PrintWriter pw)
throws java.io.IOException
pw - print writerjava.io.IOExceptionpublic void toDot(java.lang.String fileName)
throws java.io.IOException
java.io.IOExceptionpublic int transitionCount()
public java.util.List<AbstractIntDAFSA.State> getStates()
public boolean isSource(int stateNumber)