Package net.automatalib.automaton.base
Class AbstractCompactSimpleDeterministic<I,SP>
- java.lang.Object
-
- net.automatalib.automaton.base.AbstractCompact<I,T,SP,TP>
-
- net.automatalib.automaton.base.AbstractCompactDeterministic<I,Integer,SP,Void>
-
- net.automatalib.automaton.base.AbstractCompactSimpleDeterministic<I,SP>
-
- Type Parameters:
I
- input symbol typeSP
- state property type
- All Implemented Interfaces:
Iterable<Integer>
,SupportsGrowingAlphabet<I>
,Automaton<Integer,I,Integer>
,FiniteRepresentation
,InputAlphabetHolder<I>
,StateIDs<Integer>
,StateLocalInput<Integer,I>
,DeterministicAutomaton<Integer,I,Integer>
,DeterministicAutomaton.FullIntAbstraction<Integer>
,DeterministicAutomaton.IntAbstraction<Integer>
,DeterministicAutomaton.StateIntAbstraction<I,Integer>
,FiniteAlphabetAutomaton<Integer,I,Integer>
,MutableAutomaton<Integer,I,Integer,SP,Void>
,MutableDeterministic<Integer,I,Integer,SP,Void>
,MutableDeterministic.FullIntAbstraction<Integer,SP,Void>
,MutableDeterministic.IntAbstraction<Integer,SP,Void>
,MutableDeterministic.StateIntAbstraction<I,Integer,SP,Void>
,SimpleAutomaton<Integer,I>
,SimpleDeterministicAutomaton<Integer,I>
,SimpleDeterministicAutomaton.FullIntAbstraction
,SimpleDeterministicAutomaton.IntAbstraction
,SimpleDeterministicAutomaton.StateIntAbstraction<I>
,UniversalAutomaton<Integer,I,Integer,SP,Void>
,UniversalDeterministicAutomaton<Integer,I,Integer,SP,Void>
,UniversalDeterministicAutomaton.FullIntAbstraction<Integer,SP,Void>
,UniversalDeterministicAutomaton.IntAbstraction<Integer,SP,Void>
,UniversalDeterministicAutomaton.StateIntAbstraction<I,Integer,SP,Void>
,UniversalFiniteAlphabetAutomaton<Integer,I,Integer,SP,Void>
,GraphViewable
,DeterministicTransitionSystem<Integer,I,Integer>
,SimpleDTS<Integer,I>
,SimpleTS<Integer,I>
,TransitionSystem<Integer,I,Integer>
,UniversalDTS<Integer,I,Integer,SP,Void>
,UniversalTransitionSystem<Integer,I,Integer,SP,Void>
- Direct Known Subclasses:
CompactDFA
,UniversalCompactSimpleDet
public abstract class AbstractCompactSimpleDeterministic<I,SP> extends AbstractCompactDeterministic<I,Integer,SP,Void>
Abstract super class that refinesAbstractCompactDeterministic
for transition-property-less automata. As a result, transitions may be represented as integers (where a transition object effectively is the successor).Provides further default implementations for
MutableDeterministic.FullIntAbstraction
concepts.
-
-
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 Modifier and Type Field Description protected int[]
transitions
-
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 AbstractCompactSimpleDeterministic(Alphabet<I> alphabet, int stateCapacity, float resizeFactor)
protected
AbstractCompactSimpleDeterministic(Alphabet<I> alphabet, AbstractCompactSimpleDeterministic<?,SP> other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Removes all states and transitions.Integer
createTransition(int successor, Void property)
int
getIntSuccessor(Integer transition)
Retrieves the (abstracted) successor of a transition object.@Nullable Integer
getState(Iterable<? extends I> input)
Retrieves the state reachable by the given sequence of input symbols from the initial state.@Nullable Integer
getSuccessor(Integer state, Iterable<? extends I> input)
Retrieves the successor state reachable by the given sequence of input symbols.@Nullable Integer
getTransition(int state, int input)
Retrieves the outgoing transition for an (abstracted) source state and (abstracted) input symbol, or returnsnull
if the automaton has no transition for this state and input.Void
getTransitionProperty(Integer transition)
Retrieves the transition property for the given state.void
removeAllTransitions(Integer state)
void
setTransition(int state, int inputIdx, int succ)
void
setTransition(int state, int input, int successor, Void property)
void
setTransition(int state, int input, @Nullable Integer transition)
void
setTransitionProperty(Integer transition, Void property)
protected void
updateTransitionStorage(AbstractCompact.Payload payload)
Implementing classes should override this method in order to react to changes to the layout of their array-based transition data, e.g. due to calls toMutableAutomaton.addState()
orAbstractCompact.addAlphabetSymbol(Object)
.-
Methods inherited from class net.automatalib.automaton.base.AbstractCompactDeterministic
addIntInitialState, createTransition, fullIntAbstraction, getInitialState, getIntInitialState, getLocalInputs, getStateProperty, getSuccessor, getTransition, getTransition, powersetView, setInitialState, setInitialState, setStateProperty, setTransition, setTransition, setTransition, stateIntAbstraction
-
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
-
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
-
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
-
Methods inherited from interface net.automatalib.automaton.MutableDeterministic
addTransition, fullIntAbstraction, removeAllTransitions, removeTransition, setInitial, setTransition, setTransitions
-
Methods inherited from interface net.automatalib.automaton.MutableDeterministic.IntAbstraction
addIntInitialState, addIntState, addIntState, setStateProperty
-
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, getStates, 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
-
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
-
-
-
-
Constructor Detail
-
AbstractCompactSimpleDeterministic
public AbstractCompactSimpleDeterministic(Alphabet<I> alphabet, int stateCapacity, float resizeFactor)
-
AbstractCompactSimpleDeterministic
protected AbstractCompactSimpleDeterministic(Alphabet<I> alphabet, AbstractCompactSimpleDeterministic<?,SP> other)
-
-
Method Detail
-
getState
public @Nullable Integer getState(Iterable<? extends I> input)
Description copied from interface:SimpleDTS
Retrieves the state reachable by the given sequence of input symbols from the initial state.- Parameters:
input
- the input word.- Returns:
- the state reachable by the given input word, or
null
if no state is reachable by this word. - See Also:
SimpleTS.getStates(Iterable)
-
getSuccessor
public @Nullable Integer getSuccessor(Integer state, Iterable<? extends I> input)
Description copied from interface:SimpleDTS
Retrieves the successor state reachable by the given sequence of input symbols.- Parameters:
state
- the source state.input
- the input symbol.- Returns:
- the successor state reachable by the given sequence of input symbols, or
null
if no state is reachable by this symbol. - See Also:
SimpleTS.getSuccessors(Object, Iterable)
-
getTransition
public @Nullable Integer getTransition(int state, int input)
Description copied from interface:DeterministicAutomaton.FullIntAbstraction
Retrieves the outgoing transition for an (abstracted) source state and (abstracted) input symbol, or returnsnull
if the automaton has no transition for this state and input.- Parameters:
state
- the integer representing the source stateinput
- the integer representing the input symbol- Returns:
- the outgoing transition, or
null
-
updateTransitionStorage
protected void updateTransitionStorage(AbstractCompact.Payload payload)
Description copied from class:AbstractCompact
Implementing classes should override this method in order to react to changes to the layout of their array-based transition data, e.g. due to calls toMutableAutomaton.addState()
orAbstractCompact.addAlphabetSymbol(Object)
.Subclasses may use one of the
AbstractCompact.updateTransitionStorage(Object[], IntFunction, Object, Payload)
... methods to conveniently delegate this task to this base class. This leaves subclasses only with the task to invoke the provided update methods for each of their local array storages.- Overrides:
updateTransitionStorage
in classAbstractCompact<I,Integer,SP,Void>
- Parameters:
payload
- the payload containing the necessary information for the update operation. This object must be passed as-is to theAbstractCompact.updateTransitionStorage(Object[], IntFunction, Object, Payload)
... methods.
-
removeAllTransitions
public void removeAllTransitions(Integer state)
-
setTransition
public void setTransition(int state, int input, int successor, Void property)
-
setTransition
public void setTransition(int state, int inputIdx, int succ)
-
getTransitionProperty
public Void getTransitionProperty(Integer transition)
Description copied from interface:UniversalTransitionSystem
Retrieves the transition property for the given state.- Parameters:
transition
- the transition.- Returns:
- the corresponding property.
-
clear
public void clear()
Description copied from interface:MutableAutomaton
Removes all states and transitions.
-
getIntSuccessor
public int getIntSuccessor(Integer transition)
Description copied from interface:DeterministicAutomaton.IntAbstraction
Retrieves the (abstracted) successor of a transition object.- Parameters:
transition
- the transition object- Returns:
- the integer representing the successor of the given transition
-
-