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 refinesAbstractCompactfor deterministic automata. This class provides default implementations for several of theMutableDeterministic.FullIntAbstractionconcepts, 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)protectedAbstractCompactDeterministic(Alphabet<I> alphabet, AbstractCompactDeterministic<?,?,?,?> other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddIntInitialState(@Nullable SP property)voidclear()Removes all states and transitions.TcreateTransition(Integer successor, TP properties)MutableDeterministic.FullIntAbstraction<T,SP,TP>fullIntAbstraction(Alphabet<I> alphabet)Retrieves aSimpleDeterministicAutomaton.FullIntAbstractionof this automaton, using the mapping induced by the given alphabet as the abstraction for the input symbols.@Nullable IntegergetInitialState()Retrieves the initial state of this transition system.intgetIntInitialState()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.SPgetStateProperty(Integer state)Retrieves the state property for the given state.IntegergetSuccessor(T transition)Retrieves the successor state of a given transition.@Nullable TgetTransition(int state, I input)Retrieves the outgoing transition for an (abstracted) source state and input symbol, or returnsnullif the automaton has no transition for this state and input.@Nullable TgetTransition(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.voidsetInitialState(int stateId)voidsetInitialState(@Nullable Integer state)Sets the initial state to the given state.voidsetStateProperty(Integer state, SP property)voidsetTransition(int state, I input, int successor, TP property)voidsetTransition(int state, I input, @Nullable T transition)voidsetTransition(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.StateIntAbstractionof 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:MutableDeterministicSets the initial state to the given state. If the current initial state should be unset,nullcan be passed.- Specified by:
setInitialStatein interfaceMutableDeterministic<Integer,I,T,SP,TP>- Parameters:
state- the new initial state, ornull.
-
setInitialState
public void setInitialState(int stateId)
- Specified by:
setInitialStatein interfaceMutableDeterministic.IntAbstraction<I,T,SP>
-
getStateProperty
public SP getStateProperty(Integer state)
Description copied from interface:UniversalTransitionSystemRetrieves the state property for the given state.- Specified by:
getStatePropertyin interfaceUniversalTransitionSystem<Integer,I,T,SP,TP>- Parameters:
state- the state.- Returns:
- the corresponding property.
-
getIntInitialState
public int getIntInitialState()
Description copied from interface:SimpleDeterministicAutomaton.IntAbstractionRetrieves the initial state of the (abstracted) automaton as an integer. If the automaton has no initial state,SimpleDeterministicAutomaton.IntAbstraction.INVALID_STATEis returned.- Specified by:
getIntInitialStatein interfaceSimpleDeterministicAutomaton.IntAbstraction- Returns:
- the integer representing the initial state, or
SimpleDeterministicAutomaton.IntAbstraction.INVALID_STATE.
-
getInitialState
public @Nullable Integer getInitialState()
Description copied from interface:SimpleDTSRetrieves the initial state of this transition system.- Specified by:
getInitialStatein 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.StateIntAbstractionRetrieves the outgoing transition for an (abstracted) source state and input symbol, or returnsnullif the automaton has no transition for this state and input.- Specified by:
getTransitionin 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:DeterministicTransitionSystemRetrieves the transition triggered by the given input symbol.- Specified by:
getTransitionin interfaceDeterministicTransitionSystem<I,T,SP>- Parameters:
state- the source state.input- the input symbol.- Returns:
- the transition triggered by the given input symbol, or
nullif 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:MutableDeterministicSets the transition for the given state and input symbol.- Specified by:
setTransitionin 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:
setTransitionin interfaceMutableDeterministic.StateIntAbstraction<I,T,SP,TP>
-
setTransition
public void setTransition(int state, I input, int successor, TP property)- Specified by:
setTransitionin interfaceMutableDeterministic.StateIntAbstraction<I,T,SP,TP>
-
setStateProperty
public void setStateProperty(Integer state, SP property)
- Specified by:
setStatePropertyin interfaceMutableAutomaton<Integer,I,T,SP,TP>
-
createTransition
public T createTransition(Integer successor, TP properties)
- Specified by:
createTransitionin interfaceMutableAutomaton<Integer,I,T,SP,TP>
-
addIntInitialState
public int addIntInitialState(@Nullable SP property)
- Specified by:
addIntInitialStatein interfaceMutableDeterministic.IntAbstraction<I,T,SP>
-
getSuccessor
public Integer getSuccessor(T transition)
Description copied from interface:TransitionSystemRetrieves the successor state of a given transition.- Specified by:
getSuccessorin interfaceTransitionSystem<I,T,SP>- Parameters:
transition- the transition.- Returns:
- the successor state.
-
clear
public void clear()
Description copied from interface:MutableAutomatonRemoves all states and transitions.
-
fullIntAbstraction
public MutableDeterministic.FullIntAbstraction<T,SP,TP> fullIntAbstraction(Alphabet<I> alphabet)
Description copied from interface:SimpleDeterministicAutomatonRetrieves aSimpleDeterministicAutomaton.FullIntAbstractionof 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:
fullIntAbstractionin interfaceDeterministicAutomaton<I,T,SP>- Specified by:
fullIntAbstractionin interfaceMutableDeterministic<Integer,I,T,SP,TP>- Specified by:
fullIntAbstractionin interfaceSimpleDeterministicAutomaton<I,T>- Specified by:
fullIntAbstractionin 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:SimpleDeterministicAutomatonRetrieves aSimpleDeterministicAutomaton.StateIntAbstractionof this automaton.- Specified by:
stateIntAbstractionin interfaceDeterministicAutomaton<I,T,SP>- Specified by:
stateIntAbstractionin interfaceMutableDeterministic<Integer,I,T,SP,TP>- Specified by:
stateIntAbstractionin interfaceSimpleDeterministicAutomaton<I,T>- Specified by:
stateIntAbstractionin interfaceUniversalDeterministicAutomaton<Integer,I,T,SP,TP>- Returns:
- a
SimpleDeterministicAutomaton.StateIntAbstraction
-
powersetView
public DeterministicPowersetView<Integer,I,T> powersetView()
Description copied from interface:TransitionSystemRetrieves a "powerset view" of this transition system.- Specified by:
powersetViewin interfaceTransitionSystem<I,T,SP>- Returns:
- a powerset view of this transition system.
-
getLocalInputs
public Collection<I> getLocalInputs(Integer state)
Description copied from interface:StateLocalInputReturns the collection of input symbols for which a successor state is defined.- Specified by:
getLocalInputsin interfaceStateLocalInput<I,T>- Overrides:
getLocalInputsin 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.
-
-