Package net.automatalib.automaton.base
Class AbstractCompactDeterministic<I,T,SP,TP>
- java.lang.Object
-
- net.automatalib.automaton.base.AbstractCompact<I,T,SP,TP>
-
- net.automatalib.automaton.base.AbstractCompactDeterministic<I,T,SP,TP>
-
- Type Parameters:
I
- input symbol typeT
- transition typeSP
- state property typeTP
- transition property type
- All Implemented Interfaces:
Iterable<Integer>
,SupportsGrowingAlphabet<I>
,Automaton<Integer,I,T>
,FiniteRepresentation
,InputAlphabetHolder<I>
,StateIDs<Integer>
,StateLocalInput<Integer,I>
,DeterministicAutomaton<Integer,I,T>
,DeterministicAutomaton.FullIntAbstraction<T>
,DeterministicAutomaton.IntAbstraction<T>
,DeterministicAutomaton.StateIntAbstraction<I,T>
,FiniteAlphabetAutomaton<Integer,I,T>
,MutableAutomaton<Integer,I,T,SP,TP>
,MutableDeterministic<Integer,I,T,SP,TP>
,MutableDeterministic.FullIntAbstraction<T,SP,TP>
,MutableDeterministic.IntAbstraction<T,SP,TP>
,MutableDeterministic.StateIntAbstraction<I,T,SP,TP>
,SimpleAutomaton<Integer,I>
,SimpleDeterministicAutomaton<Integer,I>
,SimpleDeterministicAutomaton.FullIntAbstraction
,SimpleDeterministicAutomaton.IntAbstraction
,SimpleDeterministicAutomaton.StateIntAbstraction<I>
,UniversalAutomaton<Integer,I,T,SP,TP>
,UniversalDeterministicAutomaton<Integer,I,T,SP,TP>
,UniversalDeterministicAutomaton.FullIntAbstraction<T,SP,TP>
,UniversalDeterministicAutomaton.IntAbstraction<T,SP,TP>
,UniversalDeterministicAutomaton.StateIntAbstraction<I,T,SP,TP>
,UniversalFiniteAlphabetAutomaton<Integer,I,T,SP,TP>
,GraphViewable
,DeterministicTransitionSystem<Integer,I,T>
,SimpleDTS<Integer,I>
,SimpleTS<Integer,I>
,TransitionSystem<Integer,I,T>
,UniversalDTS<Integer,I,T,SP,TP>
,UniversalTransitionSystem<Integer,I,T,SP,TP>
- Direct Known Subclasses:
AbstractCompactSimpleDeterministic
,CompactMealy
,UniversalCompactDet
public abstract class AbstractCompactDeterministic<I,T,SP,TP> extends AbstractCompact<I,T,SP,TP> implements MutableDeterministic<Integer,I,T,SP,TP>, MutableDeterministic.StateIntAbstraction<I,T,SP,TP>, MutableDeterministic.FullIntAbstraction<T,SP,TP>
Abstract super class that refinesAbstractCompact
for deterministic automata. This class provides default implementations for several of theMutableDeterministic.FullIntAbstraction
concepts, such that subclasses only need to care about the primitive-based implementations.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.automatalib.automaton.base.AbstractCompact
AbstractCompact.Payload
-
Nested classes/interfaces inherited from interface net.automatalib.automaton.MutableDeterministic
MutableDeterministic.FullIntAbstraction<T,SP,TP>, MutableDeterministic.IntAbstraction<T,SP,TP>, MutableDeterministic.StateIntAbstraction<I,T,SP,TP>
-
-
Field Summary
-
Fields inherited from class net.automatalib.automaton.base.AbstractCompact
DEFAULT_INIT_CAPACITY, DEFAULT_RESIZE_FACTOR, INVALID_STATE
-
Fields inherited from interface net.automatalib.automaton.simple.SimpleDeterministicAutomaton.IntAbstraction
INVALID_STATE
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractCompactDeterministic(Alphabet<I> alphabet, int stateCapacity, float resizeFactor)
protected
AbstractCompactDeterministic(Alphabet<I> alphabet, AbstractCompactDeterministic<?,?,?,?> other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addIntInitialState(@Nullable SP property)
void
clear()
Removes all states and transitions.T
createTransition(Integer successor, TP properties)
MutableDeterministic.FullIntAbstraction<T,SP,TP>
fullIntAbstraction(Alphabet<I> alphabet)
Retrieves aSimpleDeterministicAutomaton.FullIntAbstraction
of this automaton, using the mapping induced by the given alphabet as the abstraction for the input symbols.@Nullable Integer
getInitialState()
Retrieves the initial state of this transition system.int
getIntInitialState()
Retrieves the initial state of the (abstracted) automaton as an integer.Collection<I>
getLocalInputs(Integer state)
Returns the collection of input symbols for which a successor state is defined.SP
getStateProperty(Integer state)
Retrieves the state property for the given state.Integer
getSuccessor(T transition)
Retrieves the successor state of a given transition.@Nullable T
getTransition(int state, I input)
Retrieves the outgoing transition for an (abstracted) source state and input symbol, or returnsnull
if the automaton has no transition for this state and input.@Nullable T
getTransition(Integer state, I input)
Retrieves the transition triggered by the given input symbol.DeterministicPowersetView<Integer,I,T>
powersetView()
Retrieves a "powerset view" of this transition system.void
setInitialState(int stateId)
void
setInitialState(@Nullable Integer state)
Sets the initial state to the given state.void
setStateProperty(Integer state, SP property)
void
setTransition(int state, I input, int successor, TP property)
void
setTransition(int state, I input, @Nullable T transition)
void
setTransition(Integer state, I input, @Nullable T transition)
Sets the transition for the given state and input symbol.MutableDeterministic.StateIntAbstraction<I,T,SP,TP>
stateIntAbstraction()
Retrieves aSimpleDeterministicAutomaton.StateIntAbstraction
of this automaton.-
Methods inherited from class net.automatalib.automaton.base.AbstractCompact
addAlphabetSymbol, addIntState, addState, getInputAlphabet, getState, getStateId, getStates, getSymbolIndex, numInputs, setStateProperty, size, stateIDs, toId, toMemoryIndex, toState, updateStateStorage, updateStateStorage, updateTransitionStorage, updateTransitionStorage, updateTransitionStorage, updateTransitionStorage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.automatalib.automaton.DeterministicAutomaton.FullIntAbstraction
getSuccessor, getTransition
-
Methods inherited from interface net.automatalib.automaton.DeterministicAutomaton.IntAbstraction
getIntSuccessor
-
Methods inherited from interface net.automatalib.automaton.DeterministicAutomaton.StateIntAbstraction
getSuccessor
-
Methods inherited from interface net.automatalib.ts.DeterministicTransitionSystem
getSuccessor, getSuccessors, getTransitions
-
Methods inherited from interface net.automatalib.automaton.FiniteAlphabetAutomaton
getTransitions, graphView
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface net.automatalib.automaton.MutableAutomaton
addInitialState, addInitialState, addState, addState, addTransition, addTransitions, copyTransition, removeAllTransitions, setTransitionProperty
-
Methods inherited from interface net.automatalib.automaton.MutableDeterministic
addTransition, fullIntAbstraction, removeAllTransitions, removeTransition, setInitial, setTransition, setTransitions
-
Methods inherited from interface net.automatalib.automaton.MutableDeterministic.FullIntAbstraction
setTransition, setTransition
-
Methods inherited from interface net.automatalib.automaton.MutableDeterministic.IntAbstraction
addIntInitialState, addIntState, addIntState, createTransition, setStateProperty, setTransitionProperty
-
Methods inherited from interface net.automatalib.automaton.simple.SimpleAutomaton
createDynamicStateMapping, createStaticStateMapping, getStates, iterator, size, stateIDs
-
Methods inherited from interface net.automatalib.automaton.simple.SimpleDeterministicAutomaton.FullIntAbstraction
numInputs
-
Methods inherited from interface net.automatalib.ts.simple.SimpleDTS
getInitialStates, getState, getStates, getSuccessor, getSuccessors, getSuccessors
-
Methods inherited from interface net.automatalib.ts.simple.SimpleTS
getSuccessors
-
Methods inherited from interface net.automatalib.automaton.UniversalAutomaton
transitionGraphView
-
Methods inherited from interface net.automatalib.automaton.UniversalDeterministicAutomaton.FullIntAbstraction
getTransitionProperty
-
Methods inherited from interface net.automatalib.automaton.UniversalDeterministicAutomaton.IntAbstraction
getStateProperty, getTransitionProperty
-
Methods inherited from interface net.automatalib.automaton.UniversalDeterministicAutomaton.StateIntAbstraction
getTransitionProperty
-
Methods inherited from interface net.automatalib.ts.UniversalDTS
getTransitionProperty
-
Methods inherited from interface net.automatalib.automaton.UniversalFiniteAlphabetAutomaton
transitionGraphView
-
Methods inherited from interface net.automatalib.ts.UniversalTransitionSystem
getTransitionProperty
-
-
-
-
Constructor Detail
-
AbstractCompactDeterministic
public AbstractCompactDeterministic(Alphabet<I> alphabet, int stateCapacity, float resizeFactor)
-
AbstractCompactDeterministic
protected AbstractCompactDeterministic(Alphabet<I> alphabet, AbstractCompactDeterministic<?,?,?,?> other)
-
-
Method Detail
-
setInitialState
public void setInitialState(@Nullable Integer state)
Description copied from interface:MutableDeterministic
Sets the initial state to the given state. If the current initial state should be unset,null
can be passed.- Specified by:
setInitialState
in interfaceMutableDeterministic<Integer,I,T,SP,TP>
- Parameters:
state
- the new initial state, ornull
.
-
setInitialState
public void setInitialState(int stateId)
- Specified by:
setInitialState
in interfaceMutableDeterministic.IntAbstraction<I,T,SP>
-
getStateProperty
public SP getStateProperty(Integer state)
Description copied from interface:UniversalTransitionSystem
Retrieves the state property for the given state.- Specified by:
getStateProperty
in interfaceUniversalTransitionSystem<Integer,I,T,SP,TP>
- Parameters:
state
- the state.- Returns:
- the corresponding property.
-
getIntInitialState
public int getIntInitialState()
Description copied from interface:SimpleDeterministicAutomaton.IntAbstraction
Retrieves the initial state of the (abstracted) automaton as an integer. If the automaton has no initial state,SimpleDeterministicAutomaton.IntAbstraction.INVALID_STATE
is returned.- Specified by:
getIntInitialState
in interfaceSimpleDeterministicAutomaton.IntAbstraction
- Returns:
- the integer representing the initial state, or
SimpleDeterministicAutomaton.IntAbstraction.INVALID_STATE
.
-
getInitialState
public @Nullable Integer getInitialState()
Description copied from interface:SimpleDTS
Retrieves the initial state of this transition system.- Specified by:
getInitialState
in interfaceSimpleDTS<I,T>
- Returns:
- the initial state.
- See Also:
SimpleTS.getInitialStates()
-
getTransition
public @Nullable T getTransition(int state, I input)
Description copied from interface:DeterministicAutomaton.StateIntAbstraction
Retrieves the outgoing transition for an (abstracted) source state and input symbol, or returnsnull
if the automaton has no transition for this state and input.- Specified by:
getTransition
in interfaceDeterministicAutomaton.StateIntAbstraction<I,T>
- Parameters:
state
- the integer representing the source stateinput
- the input symbol- Returns:
- the outgoing transition, or
null
-
getTransition
public @Nullable T getTransition(Integer state, I input)
Description copied from interface:DeterministicTransitionSystem
Retrieves the transition triggered by the given input symbol.- Specified by:
getTransition
in interfaceDeterministicTransitionSystem<I,T,SP>
- Parameters:
state
- the source state.input
- the input symbol.- Returns:
- the transition triggered by the given input symbol, or
null
if no transition is triggered. - See Also:
TransitionSystem.getTransitions(Object, Object)
-
setTransition
public void setTransition(Integer state, I input, @Nullable T transition)
Description copied from interface:MutableDeterministic
Sets the transition for the given state and input symbol.- Specified by:
setTransition
in interfaceMutableDeterministic<Integer,I,T,SP,TP>
- Parameters:
state
- the source stateinput
- the triggering input symboltransition
- the transition
-
setTransition
public void setTransition(int state, I input, @Nullable T transition)
- Specified by:
setTransition
in interfaceMutableDeterministic.StateIntAbstraction<I,T,SP,TP>
-
setTransition
public void setTransition(int state, I input, int successor, TP property)
- Specified by:
setTransition
in interfaceMutableDeterministic.StateIntAbstraction<I,T,SP,TP>
-
setStateProperty
public void setStateProperty(Integer state, SP property)
- Specified by:
setStateProperty
in interfaceMutableAutomaton<Integer,I,T,SP,TP>
-
createTransition
public T createTransition(Integer successor, TP properties)
- Specified by:
createTransition
in interfaceMutableAutomaton<Integer,I,T,SP,TP>
-
addIntInitialState
public int addIntInitialState(@Nullable SP property)
- Specified by:
addIntInitialState
in interfaceMutableDeterministic.IntAbstraction<I,T,SP>
-
getSuccessor
public Integer getSuccessor(T transition)
Description copied from interface:TransitionSystem
Retrieves the successor state of a given transition.- Specified by:
getSuccessor
in interfaceTransitionSystem<I,T,SP>
- Parameters:
transition
- the transition.- Returns:
- the successor state.
-
clear
public void clear()
Description copied from interface:MutableAutomaton
Removes all states and transitions.
-
fullIntAbstraction
public MutableDeterministic.FullIntAbstraction<T,SP,TP> fullIntAbstraction(Alphabet<I> alphabet)
Description copied from interface:SimpleDeterministicAutomaton
Retrieves aSimpleDeterministicAutomaton.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)
.- Specified by:
fullIntAbstraction
in interfaceDeterministicAutomaton<I,T,SP>
- Specified by:
fullIntAbstraction
in interfaceMutableDeterministic<Integer,I,T,SP,TP>
- Specified by:
fullIntAbstraction
in interfaceSimpleDeterministicAutomaton<I,T>
- Specified by:
fullIntAbstraction
in interfaceUniversalDeterministicAutomaton<Integer,I,T,SP,TP>
- Parameters:
alphabet
- the alphabet inducing the abstraction- Returns:
- a
SimpleDeterministicAutomaton.FullIntAbstraction
-
stateIntAbstraction
public MutableDeterministic.StateIntAbstraction<I,T,SP,TP> stateIntAbstraction()
Description copied from interface:SimpleDeterministicAutomaton
Retrieves aSimpleDeterministicAutomaton.StateIntAbstraction
of this automaton.- Specified by:
stateIntAbstraction
in interfaceDeterministicAutomaton<I,T,SP>
- Specified by:
stateIntAbstraction
in interfaceMutableDeterministic<Integer,I,T,SP,TP>
- Specified by:
stateIntAbstraction
in interfaceSimpleDeterministicAutomaton<I,T>
- Specified by:
stateIntAbstraction
in interfaceUniversalDeterministicAutomaton<Integer,I,T,SP,TP>
- Returns:
- a
SimpleDeterministicAutomaton.StateIntAbstraction
-
powersetView
public DeterministicPowersetView<Integer,I,T> powersetView()
Description copied from interface:TransitionSystem
Retrieves a "powerset view" of this transition system.- Specified by:
powersetView
in interfaceTransitionSystem<I,T,SP>
- Returns:
- a powerset view of this transition system.
-
getLocalInputs
public Collection<I> getLocalInputs(Integer state)
Description copied from interface:StateLocalInput
Returns the collection of input symbols for which a successor state is defined.- Specified by:
getLocalInputs
in interfaceStateLocalInput<I,T>
- Overrides:
getLocalInputs
in classAbstractCompact<I,T,SP,TP>
- Parameters:
state
- the state for which the defined inputs should be returned- Returns:
- the collection of input symbols for which a successor state is defined.
-
-