public abstract class AbstractCompactDeterministic<I,T,SP,TP> extends Object implements MutableDeterministic<Integer,I,T,SP,TP>, StateIDs<Integer>, UniversalFiniteAlphabetAutomaton<Integer,I,T,SP,TP>, MutableDeterministic.StateIntAbstraction<I,T,SP,TP>, MutableDeterministic.FullIntAbstraction<T,SP,TP>, GrowableAlphabetAutomaton<I>, Serializable
MutableDeterministic.FullIntAbstraction<T,SP,TP>, MutableDeterministic.IntAbstraction<T,SP,TP>, MutableDeterministic.StateIntAbstraction<I,T,SP,TP>
MutableDeterministic.StateIntAbstraction.DefaultAbstraction<S,I,T,SP,TP,A extends MutableDeterministic<S,I,T,SP,TP>>
MutableDeterministic.FullIntAbstraction.DefaultAbstraction<I,T,SP,TP,A extends MutableDeterministic.StateIntAbstraction<I,T,SP,TP>>
Modifier and Type | Field and Description |
---|---|
protected Alphabet<I> |
alphabet |
protected int |
alphabetSize |
static int |
DEFAULT_INIT_CAPACITY |
static float |
DEFAULT_RESIZE_FACTOR |
protected int |
initial |
protected int |
numStates |
protected float |
resizeFactor |
protected int |
stateCapacity |
protected Object[] |
transitions |
INVALID_STATE
Constructor and Description |
---|
AbstractCompactDeterministic(Alphabet<I> alphabet) |
AbstractCompactDeterministic(Alphabet<I> alphabet,
float resizeFactor) |
AbstractCompactDeterministic(Alphabet<I> alphabet,
int stateCapacity) |
AbstractCompactDeterministic(Alphabet<I> alphabet,
int stateCapacity,
float resizeFactor) |
Modifier and Type | Method and Description |
---|---|
void |
addAlphabetSymbol(I symbol)
Adds a new symbol to the alphabet of the automaton.
|
int |
addIntInitialState() |
int |
addIntInitialState(SP property) |
int |
addIntState() |
int |
addIntState(SP property) |
Integer |
addState(SP property)
Adds a state to the automaton.
|
void |
clear()
Removes all states and transitions.
|
abstract T |
copyTransition(T trans,
int succId) |
T |
copyTransition(T trans,
Integer succ) |
protected int |
createState() |
T |
createTransition(Integer succ,
TP property) |
abstract T |
createTransition(int succId,
TP property) |
protected void |
ensureCapacity() |
void |
ensureCapacity(int newCapacity) |
MutableDeterministic.FullIntAbstraction<T,SP,TP> |
fullIntAbstraction() |
MutableDeterministic.FullIntAbstraction<T,SP,TP> |
fullIntAbstraction(Alphabet<I> alphabet)
Retrieves a
SimpleDeterministicAutomaton.FullIntAbstraction of this automaton, using the mapping induced by the given alphabet as the
abstraction for the input symbols. |
protected static int |
getId(Integer id) |
Integer |
getInitialState()
Retrieves the initial state of this transition system.
|
Alphabet<I> |
getInputAlphabet() |
int |
getIntInitialState()
Retrieves the initial state of the (abstracted) automaton as an integer.
|
Integer |
getState(int id) |
int |
getStateId(Integer state) |
abstract SP |
getStateProperty(int stateId)
Retrieves the state property of a given (abstracted) state.
|
SP |
getStateProperty(Integer state)
Retrieves the state property for the given state.
|
Collection<Integer> |
getStates()
Retrieves all states of the transition system.
|
Integer |
getSuccessor(T transition)
Retrieves the successor state of a given transition.
|
T |
getTransition(Integer state,
I input)
Retrieves the transition triggered by the given input symbol.
|
T |
getTransition(int stateId,
I input)
Retrieves the outgoing transition for an (abstracted) source state and input symbol, or returns
null
if the automaton has no transition for this state and input. |
T |
getTransition(int stateId,
int inputIdx)
Retrieves the outgoing transition for an (abstracted) source state and (abstracted) input symbol, or returns
null if the automaton has no transition for this state and input. |
protected static Integer |
makeId(int id) |
int |
numInputs()
Retrieves the number of input symbols.
|
void |
removeAllTransitions(Integer state) |
void |
setInitialState(int stateId) |
void |
setInitialState(Integer state)
Sets the initial state to the given state.
|
void |
setStateProperty(Integer state,
SP property) |
abstract void |
setStateProperty(int state,
SP property) |
void |
setTransition(Integer state,
I input,
T transition)
Sets the transition for the given state and input symbol.
|
void |
setTransition(int stateId,
I input,
int succId,
TP property) |
void |
setTransition(int stateId,
int inputIdx,
int succId) |
void |
setTransition(int stateId,
int inputIdx,
int succId,
TP property) |
void |
setTransition(int state,
int inputIdx,
T trans) |
void |
setTransition(int state,
I input,
T trans) |
int |
size()
Retrieves the size (number of states) of this transition system.
|
StateIDs<Integer> |
stateIDs() |
MutableDeterministic.StateIntAbstraction<I,T,SP,TP> |
stateIntAbstraction()
Retrieves a
SimpleDeterministicAutomaton.StateIntAbstraction of this automaton. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTransition, fullIntAbstraction, removeAllTransitions, removeTransition, setInitial, setTransition, setTransitions
getTransitionProperty
getSuccessor, getSuccessors, getTransitions, transToSet
getInitialStates, getState, getStates, getSuccessor, getSuccessors, stateToSet
addInitialState, addInitialState, addState, addTransition, addTransitions, setTransitionProperty
transitionGraphView
createStaticStateMapping, iterator
forEach, spliterator
getTransitionProperty
powersetView
createDynamicStateMapping, getSuccessors
transitionGraphView
graphView
getTransitionProperty
getSuccessor
setTransitionProperty
getTransitionProperty
getTransitionProperty
getSuccessor
getIntSuccessor
public static final float DEFAULT_RESIZE_FACTOR
public static final int DEFAULT_INIT_CAPACITY
protected final float resizeFactor
protected int alphabetSize
protected Object[] transitions
protected int stateCapacity
protected int numStates
protected int initial
public AbstractCompactDeterministic(Alphabet<I> alphabet, int stateCapacity, float resizeFactor)
public AbstractCompactDeterministic(Alphabet<I> alphabet, int stateCapacity)
public void setTransition(int stateId, int inputIdx, int succId)
public void setTransition(int state, int inputIdx, T trans)
setTransition
in interface MutableDeterministic.FullIntAbstraction<T,SP,TP>
public void setTransition(int stateId, int inputIdx, int succId, TP property)
setTransition
in interface MutableDeterministic.FullIntAbstraction<T,SP,TP>
public void setTransition(Integer state, I input, T transition)
MutableDeterministic
setTransition
in interface MutableDeterministic<Integer,I,T,SP,TP>
state
- the source stateinput
- the triggering input symboltransition
- the transitionpublic void setTransition(int state, I input, T trans)
setTransition
in interface MutableDeterministic.StateIntAbstraction<I,T,SP,TP>
public void setTransition(int stateId, I input, int succId, TP property)
setTransition
in interface MutableDeterministic.StateIntAbstraction<I,T,SP,TP>
protected static int getId(Integer id)
public void setInitialState(Integer state)
MutableDeterministic
null
can be
passed.setInitialState
in interface MutableDeterministic<Integer,I,T,SP,TP>
state
- the new initial state, or null
.public void setInitialState(int stateId)
setInitialState
in interface MutableDeterministic.IntAbstraction<T,SP,TP>
public MutableDeterministic.FullIntAbstraction<T,SP,TP> fullIntAbstraction(Alphabet<I> alphabet)
SimpleDeterministicAutomaton
SimpleDeterministicAutomaton.FullIntAbstraction
of this automaton, using the mapping induced by the given alphabet as the
abstraction for the input symbols.
This method is provided for convenience. It is equivalent to calling fullIntAbstraction(alphabet.size(),
alphabet)
.
fullIntAbstraction
in interface DeterministicAutomaton<Integer,I,T>
fullIntAbstraction
in interface MutableDeterministic<Integer,I,T,SP,TP>
fullIntAbstraction
in interface SimpleDeterministicAutomaton<Integer,I>
fullIntAbstraction
in interface UniversalDeterministicAutomaton<Integer,I,T,SP,TP>
alphabet
- the alphabet inducing the abstractionSimpleDeterministicAutomaton.FullIntAbstraction
public MutableDeterministic.FullIntAbstraction<T,SP,TP> fullIntAbstraction()
public MutableDeterministic.StateIntAbstraction<I,T,SP,TP> stateIntAbstraction()
SimpleDeterministicAutomaton
SimpleDeterministicAutomaton.StateIntAbstraction
of this automaton.stateIntAbstraction
in interface DeterministicAutomaton<Integer,I,T>
stateIntAbstraction
in interface MutableDeterministic<Integer,I,T,SP,TP>
stateIntAbstraction
in interface SimpleDeterministicAutomaton<Integer,I>
stateIntAbstraction
in interface UniversalDeterministicAutomaton<Integer,I,T,SP,TP>
SimpleDeterministicAutomaton.StateIntAbstraction
public final Integer getSuccessor(T transition)
TransitionSystem
getSuccessor
in interface TransitionSystem<Integer,I,T>
transition
- the transition.protected static Integer makeId(int id)
public Collection<Integer> getStates()
SimpleAutomaton
getStates
in interface SimpleAutomaton<Integer,I>
public StateIDs<Integer> stateIDs()
stateIDs
in interface SimpleAutomaton<Integer,I>
public int size()
SimpleAutomaton
size
in interface SimpleAutomaton<Integer,I>
size
in interface SimpleDeterministicAutomaton.IntAbstraction
public int getStateId(Integer state)
getStateId
in interface StateIDs<Integer>
public int getIntInitialState()
SimpleDeterministicAutomaton.IntAbstraction
SimpleDeterministicAutomaton.IntAbstraction.INVALID_STATE
is returned.getIntInitialState
in interface SimpleDeterministicAutomaton.IntAbstraction
SimpleDeterministicAutomaton.IntAbstraction.INVALID_STATE
.public Integer getInitialState()
SimpleDTS
getInitialState
in interface SimpleDTS<Integer,I>
SimpleTS.getInitialStates()
public int addIntState()
addIntState
in interface MutableDeterministic.IntAbstraction<T,SP,TP>
public int addIntState(SP property)
addIntState
in interface MutableDeterministic.IntAbstraction<T,SP,TP>
public int addIntInitialState()
addIntInitialState
in interface MutableDeterministic.IntAbstraction<T,SP,TP>
public int addIntInitialState(SP property)
addIntInitialState
in interface MutableDeterministic.IntAbstraction<T,SP,TP>
protected final int createState()
public void setStateProperty(Integer state, SP property)
setStateProperty
in interface MutableAutomaton<Integer,I,T,SP,TP>
public abstract void setStateProperty(int state, SP property)
setStateProperty
in interface MutableDeterministic.IntAbstraction<T,SP,TP>
public final void ensureCapacity(int newCapacity)
protected void ensureCapacity()
public T getTransition(int stateId, I input)
DeterministicAutomaton.StateIntAbstraction
null
if the automaton has no transition for this state and input.getTransition
in interface DeterministicAutomaton.StateIntAbstraction<I,T>
stateId
- the integer representing the source stateinput
- the input symbolnull
public T getTransition(int stateId, int inputIdx)
DeterministicAutomaton.FullIntAbstraction
null
if the automaton has no transition for this state and input.getTransition
in interface DeterministicAutomaton.FullIntAbstraction<T>
stateId
- the integer representing the source stateinputIdx
- the integer representing the input symbolnull
public T getTransition(Integer state, I input)
DeterministicTransitionSystem
getTransition
in interface DeterministicTransitionSystem<Integer,I,T>
state
- the source state.input
- the input symbol.null
if no transition is triggered.TransitionSystem.getTransitions(Object, Object)
public SP getStateProperty(Integer state)
UniversalTransitionSystem
getStateProperty
in interface UniversalTransitionSystem<Integer,I,T,SP,TP>
state
- the state.public abstract SP getStateProperty(int stateId)
UniversalDeterministicAutomaton.IntAbstraction
getStateProperty
in interface UniversalDeterministicAutomaton.IntAbstraction<T,SP,TP>
stateId
- the integer representing the state of which to retrieve the propertypublic void clear()
MutableAutomaton
public Integer addState(SP property)
MutableAutomaton
public void removeAllTransitions(Integer state)
removeAllTransitions
in interface MutableAutomaton<Integer,I,T,SP,TP>
public T createTransition(Integer succ, TP property)
createTransition
in interface MutableAutomaton<Integer,I,T,SP,TP>
public abstract T createTransition(int succId, TP property)
createTransition
in interface MutableDeterministic.IntAbstraction<T,SP,TP>
public T copyTransition(T trans, Integer succ)
copyTransition
in interface MutableAutomaton<Integer,I,T,SP,TP>
public Alphabet<I> getInputAlphabet()
getInputAlphabet
in interface InputAlphabetHolder<I>
public int numInputs()
SimpleDeterministicAutomaton.FullIntAbstraction
[0,
numInputs() - 1]
.numInputs
in interface SimpleDeterministicAutomaton.FullIntAbstraction
public void addAlphabetSymbol(I symbol)
GrowableAlphabetAutomaton
addAlphabetSymbol
in interface GrowableAlphabetAutomaton<I>
symbol
- The symbol to add to the alphabet.Copyright © 2018. All rights reserved.