Package de.learnlib.algorithm.ttt.base
Class AbstractTTTHypothesis<S extends TTTState<I,D>,I,D,T>
- java.lang.Object
-
- de.learnlib.algorithm.ttt.base.AbstractTTTHypothesis<S,I,D,T>
-
- Type Parameters:
S
- state class typeI
- input symbol typeD
- output domain typeT
- transition type
- All Implemented Interfaces:
Iterable<S>
,SupportsGrowingAlphabet<I>
,Automaton<S,I,T>
,FiniteRepresentation
,InputAlphabetHolder<I>
,DeterministicAutomaton<S,I,T>
,DeterministicAutomaton.FullIntAbstraction<T>
,DeterministicAutomaton.IntAbstraction<T>
,FiniteAlphabetAutomaton<S,I,T>
,SimpleAutomaton<S,I>
,SimpleDeterministicAutomaton<S,I>
,SimpleDeterministicAutomaton.FullIntAbstraction
,SimpleDeterministicAutomaton.IntAbstraction
,GraphViewable
,DeterministicTransitionSystem<S,I,T>
,SimpleDTS<S,I>
,SimpleTS<S,I>
,TransitionSystem<S,I,T>
- Direct Known Subclasses:
TTTHypothesisDFA
,TTTHypothesisMealy
,TTTHypothesisMoore
public abstract class AbstractTTTHypothesis<S extends TTTState<I,D>,I,D,T> extends Object implements DeterministicAutomaton<S,I,T>, FiniteAlphabetAutomaton<S,I,T>, DeterministicAutomaton.FullIntAbstraction<T>, SupportsGrowingAlphabet<I>
Hypothesis DFA for theTTT algorithm
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
AbstractTTTHypothesis.GraphView
static class
AbstractTTTHypothesis.TTTEdge<I,D>
-
Nested classes/interfaces inherited from interface net.automatalib.automaton.DeterministicAutomaton
DeterministicAutomaton.FullIntAbstraction<T extends Object>, DeterministicAutomaton.IntAbstraction<T extends Object>, DeterministicAutomaton.StateIntAbstraction<I extends Object,T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description protected List<S>
states
-
Fields inherited from interface net.automatalib.automaton.simple.SimpleDeterministicAutomaton.IntAbstraction
INVALID_STATE
-
-
Constructor Summary
Constructors Constructor Description AbstractTTTHypothesis(Alphabet<I> alphabet)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addAlphabetSymbol(I symbol)
S
createState(TTTTransition<I,D> parent)
DeterministicAutomaton.FullIntAbstraction<T>
fullIntAbstraction(Alphabet<I> alphabet)
S
getInitialState()
Alphabet<I>
getInputAlphabet()
TTTTransition<I,D>
getInternalTransition(TTTState<I,D> state, int input)
TTTTransition<I,D>
getInternalTransition(TTTState<I,D> state, I input)
Retrieves the internal transition (i.e., theTTTTransition
object) for a given state and input.int
getIntInitialState()
int
getIntSuccessor(T trans)
Collection<S>
getStates()
T
getTransition(int stateId, int symIdx)
@Nullable T
getTransition(S state, I input)
AbstractTTTHypothesis.GraphView
graphView()
S
initialize()
Initializes the automaton, adding an initial state.boolean
isInitialized()
Checks whether this automaton was initialized (i.e.,initialize()
has been called).protected abstract T
mapTransition(TTTTransition<I,D> internalTransition)
protected abstract S
newState(int alphabetSize, TTTTransition<I,D> parent, int id)
int
numInputs()
int
size()
-
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.Automaton
transitionGraphView
-
Methods inherited from interface net.automatalib.automaton.DeterministicAutomaton
fullIntAbstraction, stateIntAbstraction
-
Methods inherited from interface net.automatalib.automaton.DeterministicAutomaton.FullIntAbstraction
getSuccessor
-
Methods inherited from interface net.automatalib.ts.DeterministicTransitionSystem
getSuccessor, getSuccessors, getTransitions
-
Methods inherited from interface net.automatalib.automaton.FiniteAlphabetAutomaton
getTransitions, transitionGraphView
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface net.automatalib.automaton.simple.SimpleAutomaton
createDynamicStateMapping, createStaticStateMapping, iterator, stateIDs
-
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.ts.TransitionSystem
getSuccessor, powersetView
-
-
-
-
Method Detail
-
getInitialState
public S getInitialState()
-
getTransition
public T getTransition(int stateId, int symIdx)
- Specified by:
getTransition
in interfaceDeterministicAutomaton.FullIntAbstraction<S extends TTTState<I,D>>
-
getTransition
public @Nullable T getTransition(S state, I input)
- Specified by:
getTransition
in interfaceDeterministicTransitionSystem<S extends TTTState<I,D>,I,D>
-
getInternalTransition
public TTTTransition<I,D> getInternalTransition(TTTState<I,D> state, I input)
Retrieves the internal transition (i.e., theTTTTransition
object) for a given state and input. This method is required since theDFA
interface requires the return value ofgetTransition(TTTState, Object)
to refer to the successor state directly.- Parameters:
state
- the source stateinput
- the input symbol triggering the transition- Returns:
- the transition object
-
getInternalTransition
public TTTTransition<I,D> getInternalTransition(TTTState<I,D> state, int input)
-
mapTransition
protected abstract T mapTransition(TTTTransition<I,D> internalTransition)
-
initialize
public S initialize()
Initializes the automaton, adding an initial state. Whether the initial state is accepting needs to be known at this point.- Returns:
- the initial state of this newly initialized automaton
-
isInitialized
public boolean isInitialized()
Checks whether this automaton was initialized (i.e.,initialize()
has been called).- Returns:
true
if this automaton was initialized,false
otherwise.
-
createState
public S createState(TTTTransition<I,D> parent)
-
newState
protected abstract S newState(int alphabetSize, TTTTransition<I,D> parent, int id)
-
getInputAlphabet
public Alphabet<I> getInputAlphabet()
- Specified by:
getInputAlphabet
in interfaceInputAlphabetHolder<S extends TTTState<I,D>>
-
graphView
public AbstractTTTHypothesis.GraphView graphView()
- Specified by:
graphView
in interfaceFiniteAlphabetAutomaton<S extends TTTState<I,D>,I,D>
- Specified by:
graphView
in interfaceGraphViewable
-
getIntInitialState
public int getIntInitialState()
- Specified by:
getIntInitialState
in interfaceSimpleDeterministicAutomaton.IntAbstraction
-
numInputs
public int numInputs()
- Specified by:
numInputs
in interfaceSimpleDeterministicAutomaton.FullIntAbstraction
-
getIntSuccessor
public int getIntSuccessor(T trans)
- Specified by:
getIntSuccessor
in interfaceDeterministicAutomaton.IntAbstraction<S extends TTTState<I,D>>
-
fullIntAbstraction
public DeterministicAutomaton.FullIntAbstraction<T> fullIntAbstraction(Alphabet<I> alphabet)
- Specified by:
fullIntAbstraction
in interfaceDeterministicAutomaton<S extends TTTState<I,D>,I,D>
- Specified by:
fullIntAbstraction
in interfaceSimpleDeterministicAutomaton<S extends TTTState<I,D>,I>
-
addAlphabetSymbol
public void addAlphabetSymbol(I symbol)
- Specified by:
addAlphabetSymbol
in interfaceSupportsGrowingAlphabet<S extends TTTState<I,D>>
-
getStates
public Collection<S> getStates()
-
size
public int size()
- Specified by:
size
in interfaceFiniteRepresentation
- Specified by:
size
in interfaceSimpleAutomaton<S extends TTTState<I,D>,I>
-
-