public abstract class AbstractCompactSimpleDet<I,SP> extends Object implements MutableDeterministic<Integer,I,Integer,SP,Void>, UniversalFiniteAlphabetAutomaton<Integer,I,Integer,SP,Void>, StateIDs<Integer>, MutableDeterministic.StateIntAbstraction<I,Integer,SP,Void>, MutableDeterministic.FullIntAbstraction<Integer,SP,Void>, 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 int[] |
transitions |
INVALID_STATE
Modifier | Constructor and Description |
---|---|
|
AbstractCompactSimpleDet(Alphabet<I> alphabet) |
protected |
AbstractCompactSimpleDet(Alphabet<I> alphabet,
AbstractCompactSimpleDet<?,?> other) |
|
AbstractCompactSimpleDet(Alphabet<I> alphabet,
float resizeFactor) |
|
AbstractCompactSimpleDet(Alphabet<I> alphabet,
int stateCapacity) |
|
AbstractCompactSimpleDet(Alphabet<I> alphabet,
int stateCapacity,
float resizeFactor) |
protected |
AbstractCompactSimpleDet(Alphabet<I> alphabet,
int numStates,
int initial,
int[] transitions,
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.
|
Integer |
copyTransition(Integer trans,
Integer succ) |
Integer |
createTransition(Integer successor,
Void properties) |
Integer |
createTransition(int successor,
Void property) |
void |
ensureCapacity(int newCapacity) |
protected void |
ensureCapacity(int oldCap,
int newCap) |
MutableDeterministic.FullIntAbstraction<Integer,SP,Void> |
fullIntAbstraction() |
MutableDeterministic.FullIntAbstraction<Integer,SP,Void> |
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. |
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.
|
int |
getIntState(Iterable<? extends I> input) |
int |
getIntSuccessor(Integer transition)
Retrieves the (abstracted) successor of a transition object.
|
int |
getIntSuccessor(int state,
I input) |
int |
getIntSuccessor(int state,
Iterable<? extends I> input) |
int |
getIntTransition(int state,
I input) |
int |
getIntTransition(int state,
int input) |
Integer |
getState(int id) |
Integer |
getState(Iterable<? extends I> input)
Retrieves the state reachable by the given sequence of input symbols from the initial state.
|
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(Integer transition)
Retrieves the successor state of a given transition.
|
Integer |
getSuccessor(Integer state,
Iterable<? extends I> input)
Retrieves the successor state reachable by the given sequence of input symbols.
|
int |
getSuccessor(int state,
I input)
Retrieves the (abstracted) successor state for a given (abstracted) source state and input symbol.
|
int |
getSuccessor(int state,
int input)
Retrieves the (abstracted) successor for a given (abstracted) source state and (abstracted) input.
|
Integer |
getTransition(Integer state,
I input)
Retrieves the transition triggered by the given input symbol.
|
Integer |
getTransition(int state,
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. |
Integer |
getTransition(int state,
int input)
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. |
Void |
getTransitionProperty(Integer transition)
Retrieves the transition property for the given state.
|
protected abstract void |
initState(int stateId,
SP property) |
int |
numInputs()
Retrieves the number of input symbols.
|
DeterministicPowersetView<Integer,I,Integer> |
powersetView()
Retrieves a "powerset view" of this transition system.
|
void |
removeAllTransitions(int state) |
void |
removeAllTransitions(Integer state) |
void |
setInitialState(int state) |
void |
setInitialState(Integer state)
Sets the initial state to the given state.
|
void |
setStateProperty(Integer state,
SP property) |
abstract void |
setStateProperty(int stateId,
SP property) |
void |
setTransition(Integer state,
I input,
Integer transition)
Sets the transition for the given state and input symbol.
|
void |
setTransition(Integer state,
I input,
Integer transition,
Void property)
Sets the transition for the given state and input symbol to a newly created one.
|
void |
setTransition(int state,
I input,
int succ) |
void |
setTransition(int state,
I input,
Integer transition) |
void |
setTransition(int state,
I input,
int successor,
Void property) |
void |
setTransition(int state,
int inputIdx,
int succ) |
void |
setTransition(int state,
int input,
Integer transition) |
void |
setTransition(int state,
int input,
int successor,
Void property) |
void |
setTransitionProperty(Integer transition,
Void property) |
int |
size()
Retrieves the size (number of states) of this transition system.
|
StateIDs<Integer> |
stateIDs() |
MutableDeterministic.StateIntAbstraction<I,Integer,SP,Void> |
stateIntAbstraction()
Retrieves a
SimpleDeterministicAutomaton.StateIntAbstraction of this automaton. |
protected static int |
unwrapState(Integer state) |
protected static Integer |
wrapState(int id) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTransition, fullIntAbstraction, removeAllTransitions, removeTransition, setInitial, setTransitions
getTransitionProperty
getSuccessor, getSuccessors, getTransitions, transToSet
getInitialStates, getStates, getSuccessors, stateToSet
addInitialState, addInitialState, addState, addTransition, addTransitions
transitionGraphView
createStaticStateMapping, iterator
forEach, spliterator
createDynamicStateMapping, getSuccessors
transitionGraphView
graphView
getTransitionProperty
getTransitionProperty
public static final float DEFAULT_RESIZE_FACTOR
public static final int DEFAULT_INIT_CAPACITY
protected final float resizeFactor
protected int alphabetSize
protected int[] transitions
protected int stateCapacity
protected int numStates
protected int initial
public AbstractCompactSimpleDet(Alphabet<I> alphabet, int stateCapacity, float resizeFactor)
protected AbstractCompactSimpleDet(Alphabet<I> alphabet, AbstractCompactSimpleDet<?,?> other)
public Alphabet<I> getInputAlphabet()
getInputAlphabet
in interface InputAlphabetHolder<I>
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 Integer getState(Iterable<? extends I> input)
SimpleDTS
getState
in interface SimpleDTS<Integer,I>
input
- the input word.null
if no state is reachable by this word.SimpleTS.getStates(Iterable)
public Integer getInitialState()
SimpleDTS
getInitialState
in interface SimpleDTS<Integer,I>
SimpleTS.getInitialStates()
public Integer getSuccessor(Integer state, Iterable<? extends I> input)
SimpleDTS
getSuccessor
in interface SimpleDTS<Integer,I>
state
- the source state.input
- the input symbol.null
if no state is
reachable by this symbol.SimpleTS.getSuccessors(Object, Iterable)
public Integer getSuccessor(Integer transition)
TransitionSystem
getSuccessor
in interface TransitionSystem<Integer,I,Integer>
transition
- the transition.public int getSuccessor(int state, I input)
SimpleDeterministicAutomaton.StateIntAbstraction
getSuccessor
in interface DeterministicAutomaton.StateIntAbstraction<I,Integer>
getSuccessor
in interface SimpleDeterministicAutomaton.StateIntAbstraction<I>
state
- the integer representing the source stateinput
- the input symbolSimpleDeterministicAutomaton.IntAbstraction.INVALID_STATE
if there is no
successor state.public int getSuccessor(int state, int input)
SimpleDeterministicAutomaton.FullIntAbstraction
getSuccessor
in interface DeterministicAutomaton.FullIntAbstraction<Integer>
getSuccessor
in interface SimpleDeterministicAutomaton.FullIntAbstraction
state
- the integer representing the source stateinput
- the integer representing the input symbolSimpleDeterministicAutomaton.IntAbstraction.INVALID_STATE
if there is no
successor state.public void setInitialState(int state)
setInitialState
in interface MutableDeterministic.IntAbstraction<Integer,SP,Void>
public void setInitialState(Integer state)
MutableDeterministic
null
can be
passed.setInitialState
in interface MutableDeterministic<Integer,I,Integer,SP,Void>
state
- the new initial state, or null
.public Integer createTransition(int successor, Void property)
createTransition
in interface MutableDeterministic.IntAbstraction<Integer,SP,Void>
public Integer createTransition(Integer successor, Void properties)
createTransition
in interface MutableAutomaton<Integer,I,Integer,SP,Void>
public int addIntState()
addIntState
in interface MutableDeterministic.IntAbstraction<Integer,SP,Void>
public int addIntState(SP property)
addIntState
in interface MutableDeterministic.IntAbstraction<Integer,SP,Void>
public int addIntInitialState()
addIntInitialState
in interface MutableDeterministic.IntAbstraction<Integer,SP,Void>
public int addIntInitialState(SP property)
addIntInitialState
in interface MutableDeterministic.IntAbstraction<Integer,SP,Void>
public void ensureCapacity(int newCapacity)
protected void ensureCapacity(int oldCap, int newCap)
protected abstract void initState(int stateId, SP property)
protected static Integer wrapState(int id)
public int getIntSuccessor(Integer transition)
DeterministicAutomaton.IntAbstraction
getIntSuccessor
in interface DeterministicAutomaton.IntAbstraction<Integer>
transition
- the transition objectpublic int getIntSuccessor(int state, I input)
public int getIntTransition(int state, I input)
public int getIntTransition(int state, int input)
public int getIntInitialState()
SimpleDeterministicAutomaton.IntAbstraction
SimpleDeterministicAutomaton.IntAbstraction.INVALID_STATE
is returned.getIntInitialState
in interface SimpleDeterministicAutomaton.IntAbstraction
SimpleDeterministicAutomaton.IntAbstraction.INVALID_STATE
.public MutableDeterministic.StateIntAbstraction<I,Integer,SP,Void> stateIntAbstraction()
SimpleDeterministicAutomaton
SimpleDeterministicAutomaton.StateIntAbstraction
of this automaton.stateIntAbstraction
in interface DeterministicAutomaton<Integer,I,Integer>
stateIntAbstraction
in interface MutableDeterministic<Integer,I,Integer,SP,Void>
stateIntAbstraction
in interface SimpleDeterministicAutomaton<Integer,I>
stateIntAbstraction
in interface UniversalDeterministicAutomaton<Integer,I,Integer,SP,Void>
SimpleDeterministicAutomaton.StateIntAbstraction
public Integer getTransition(Integer state, I input)
DeterministicTransitionSystem
getTransition
in interface DeterministicTransitionSystem<Integer,I,Integer>
state
- the source state.input
- the input symbol.null
if no transition is triggered.TransitionSystem.getTransitions(Object, Object)
public Integer getTransition(int state, I input)
DeterministicAutomaton.StateIntAbstraction
null
if the automaton has no transition for this state and input.getTransition
in interface DeterministicAutomaton.StateIntAbstraction<I,Integer>
state
- the integer representing the source stateinput
- the input symbolnull
public Integer getTransition(int state, int input)
DeterministicAutomaton.FullIntAbstraction
null
if the automaton has no transition for this state and input.getTransition
in interface DeterministicAutomaton.FullIntAbstraction<Integer>
state
- the integer representing the source stateinput
- the integer representing the input symbolnull
public void clear()
MutableAutomaton
public Integer addState(SP property)
MutableAutomaton
public MutableDeterministic.FullIntAbstraction<Integer,SP,Void> 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,Integer>
fullIntAbstraction
in interface MutableDeterministic<Integer,I,Integer,SP,Void>
fullIntAbstraction
in interface SimpleDeterministicAutomaton<Integer,I>
fullIntAbstraction
in interface UniversalDeterministicAutomaton<Integer,I,Integer,SP,Void>
alphabet
- the alphabet inducing the abstractionSimpleDeterministicAutomaton.FullIntAbstraction
public MutableDeterministic.FullIntAbstraction<Integer,SP,Void> fullIntAbstraction()
public void setStateProperty(Integer state, SP property)
setStateProperty
in interface MutableAutomaton<Integer,I,Integer,SP,Void>
public abstract void setStateProperty(int stateId, SP property)
setStateProperty
in interface MutableDeterministic.IntAbstraction<Integer,SP,Void>
public void setTransitionProperty(Integer transition, Void property)
setTransitionProperty
in interface MutableAutomaton<Integer,I,Integer,SP,Void>
setTransitionProperty
in interface MutableDeterministic.IntAbstraction<Integer,SP,Void>
public void removeAllTransitions(Integer state)
removeAllTransitions
in interface MutableAutomaton<Integer,I,Integer,SP,Void>
public void removeAllTransitions(int state)
public Integer copyTransition(Integer trans, Integer succ)
copyTransition
in interface MutableAutomaton<Integer,I,Integer,SP,Void>
public SP getStateProperty(Integer state)
UniversalTransitionSystem
getStateProperty
in interface UniversalTransitionSystem<Integer,I,Integer,SP,Void>
state
- the state.public abstract SP getStateProperty(int stateId)
UniversalDeterministicAutomaton.IntAbstraction
getStateProperty
in interface UniversalDeterministicAutomaton.IntAbstraction<Integer,SP,Void>
stateId
- the integer representing the state of which to retrieve the propertypublic Void getTransitionProperty(Integer transition)
UniversalTransitionSystem
getTransitionProperty
in interface UniversalDeterministicAutomaton.IntAbstraction<Integer,SP,Void>
getTransitionProperty
in interface UniversalTransitionSystem<Integer,I,Integer,SP,Void>
transition
- the transition.protected static int unwrapState(Integer state)
public void setTransition(int state, int input, Integer transition)
setTransition
in interface MutableDeterministic.FullIntAbstraction<Integer,SP,Void>
public void setTransition(int state, int input, int successor, Void property)
setTransition
in interface MutableDeterministic.FullIntAbstraction<Integer,SP,Void>
public void setTransition(int state, I input, Integer transition)
setTransition
in interface MutableDeterministic.StateIntAbstraction<I,Integer,SP,Void>
public void setTransition(int state, I input, int successor, Void property)
setTransition
in interface MutableDeterministic.StateIntAbstraction<I,Integer,SP,Void>
public void setTransition(Integer state, I input, Integer transition, Void property)
MutableDeterministic
setTransition
in interface MutableDeterministic<Integer,I,Integer,SP,Void>
state
- the source stateinput
- the triggering input symboltransition
- the target stateproperty
- the transition's propertypublic void setTransition(Integer state, I input, Integer transition)
MutableDeterministic
setTransition
in interface MutableDeterministic<Integer,I,Integer,SP,Void>
state
- the source stateinput
- the triggering input symboltransition
- the transitionpublic void setTransition(int state, I input, int succ)
public void setTransition(int state, int inputIdx, int succ)
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.public DeterministicPowersetView<Integer,I,Integer> powersetView()
TransitionSystem
powersetView
in interface TransitionSystem<Integer,I,Integer>
Copyright © 2018. All rights reserved.