Module de.learnlib.datastructure
Package de.learnlib.datastructure.pta
Class BasePTA<S extends AbstractBasePTAState<S,SP,TP>,SP,TP>
- java.lang.Object
-
- de.learnlib.datastructure.pta.BasePTA<S,SP,TP>
-
- Type Parameters:
S
- state typeSP
- state property typeTP
- transition property type
- All Implemented Interfaces:
Iterable<S>
,net.automatalib.automaton.Automaton<S,Integer,PTATransition<S>>
,net.automatalib.automaton.concept.FiniteRepresentation
,net.automatalib.automaton.concept.InputAlphabetHolder<Integer>
,net.automatalib.automaton.DeterministicAutomaton<S,Integer,PTATransition<S>>
,net.automatalib.automaton.FiniteAlphabetAutomaton<S,Integer,PTATransition<S>>
,net.automatalib.automaton.simple.SimpleAutomaton<S,Integer>
,net.automatalib.automaton.simple.SimpleDeterministicAutomaton<S,Integer>
,net.automatalib.automaton.UniversalAutomaton<S,Integer,PTATransition<S>,SP,TP>
,net.automatalib.automaton.UniversalDeterministicAutomaton<S,Integer,PTATransition<S>,SP,TP>
,net.automatalib.graph.concept.GraphViewable
,net.automatalib.ts.DeterministicTransitionSystem<S,Integer,PTATransition<S>>
,net.automatalib.ts.simple.SimpleDTS<S,Integer>
,net.automatalib.ts.simple.SimpleTS<S,Integer>
,net.automatalib.ts.TransitionSystem<S,Integer,PTATransition<S>>
,net.automatalib.ts.UniversalDTS<S,Integer,PTATransition<S>,SP,TP>
,net.automatalib.ts.UniversalTransitionSystem<S,Integer,PTATransition<S>,SP,TP>
- Direct Known Subclasses:
AbstractBlueFringePTA
public class BasePTA<S extends AbstractBasePTAState<S,SP,TP>,SP,TP> extends Object implements net.automatalib.automaton.UniversalDeterministicAutomaton<S,Integer,PTATransition<S>,SP,TP>, net.automatalib.automaton.FiniteAlphabetAutomaton<S,Integer,PTATransition<S>>
Base class for prefix tree acceptors.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.automatalib.automaton.UniversalDeterministicAutomaton
net.automatalib.automaton.UniversalDeterministicAutomaton.FullIntAbstraction<T extends Object,SP extends Object,TP extends Object>, net.automatalib.automaton.UniversalDeterministicAutomaton.IntAbstraction<T extends Object,SP extends Object,TP extends Object>, net.automatalib.automaton.UniversalDeterministicAutomaton.StateIntAbstraction<I extends Object,T extends Object,SP extends Object,TP extends Object>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSample(net.automatalib.common.smartcollection.IntSeq sample, SP lastProperty)
Adds a sample to the PTA, and sets the property of the last reached (or inserted) state accordingly.void
addSampleWithStateProperties(net.automatalib.common.smartcollection.IntSeq sample, List<? extends SP> lastStateProperties)
void
addSampleWithTransitionProperties(net.automatalib.common.smartcollection.IntSeq sample, List<? extends TP> lastTransitionProperties)
S
getInitialState()
net.automatalib.alphabet.Alphabet<Integer>
getInputAlphabet()
S
getOrCreateState(net.automatalib.common.smartcollection.IntSeq word)
Retrieves the state reached by the given word.S
getRoot()
Retrieves the root of the PTA.SP
getStateProperty(S state)
Collection<S>
getStates()
S
getSuccessor(PTATransition<S> transition)
@Nullable S
getSuccessor(S state, Integer input)
@Nullable PTATransition<S>
getTransition(S state, Integer input)
TP
getTransitionProperty(PTATransition<S> transition)
protected net.automatalib.visualization.VisualizationHelper<S,net.automatalib.automaton.graph.TransitionEdge<Integer,PTATransition<S>>>
getVisualizationHelper()
Iterator<S>
iterator()
net.automatalib.graph.UniversalGraph<S,net.automatalib.automaton.graph.TransitionEdge<Integer,PTATransition<S>>,SP,net.automatalib.automaton.graph.TransitionEdge.Property<Integer,TP>>
transitionGraphView(Collection<? extends Integer> inputs)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.automatalib.ts.DeterministicTransitionSystem
getSuccessors, getTransitions, powersetView
-
Methods inherited from interface net.automatalib.automaton.FiniteAlphabetAutomaton
getTransitions, graphView, transitionGraphView
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface net.automatalib.automaton.simple.SimpleAutomaton
createDynamicStateMapping, createStaticStateMapping, size, stateIDs
-
Methods inherited from interface net.automatalib.ts.simple.SimpleDTS
getInitialStates, getState, getStates, getSuccessor, getSuccessors
-
-
-
-
Constructor Detail
-
BasePTA
public BasePTA(int alphabetSize, S root)
Constructor.- Parameters:
alphabetSize
- the size of the input alphabetroot
- the root state
-
-
Method Detail
-
getRoot
public S getRoot()
Retrieves the root of the PTA.- Returns:
- the root state
-
getInputAlphabet
public net.automatalib.alphabet.Alphabet<Integer> getInputAlphabet()
- Specified by:
getInputAlphabet
in interfacenet.automatalib.automaton.concept.InputAlphabetHolder<S extends AbstractBasePTAState<S,SP,TP>>
-
addSample
public void addSample(net.automatalib.common.smartcollection.IntSeq sample, SP lastProperty)
Adds a sample to the PTA, and sets the property of the last reached (or inserted) state accordingly.- Parameters:
sample
- the word to add to the PTAlastProperty
- the property of the last state to set
-
getOrCreateState
public S getOrCreateState(net.automatalib.common.smartcollection.IntSeq word)
Retrieves the state reached by the given word. If there is no path for the word in the PTA, it will be added to the PTA on-the-fly.- Parameters:
word
- the word- Returns:
- the state reached by this word, which might have been newly created (along with all required predecessor states)
-
addSampleWithStateProperties
public void addSampleWithStateProperties(net.automatalib.common.smartcollection.IntSeq sample, List<? extends SP> lastStateProperties)
-
addSampleWithTransitionProperties
public void addSampleWithTransitionProperties(net.automatalib.common.smartcollection.IntSeq sample, List<? extends TP> lastTransitionProperties)
-
getSuccessor
public S getSuccessor(PTATransition<S> transition)
-
getStates
public Collection<S> getStates()
-
getInitialState
public S getInitialState()
-
getTransition
public @Nullable PTATransition<S> getTransition(S state, Integer input)
-
getStateProperty
public SP getStateProperty(S state)
- Specified by:
getStateProperty
in interfacenet.automatalib.ts.UniversalTransitionSystem<S extends AbstractBasePTAState<S,SP,TP>,Integer,PTATransition<S extends AbstractBasePTAState<S,SP,TP>>,SP,TP>
-
getTransitionProperty
public TP getTransitionProperty(PTATransition<S> transition)
- Specified by:
getTransitionProperty
in interfacenet.automatalib.ts.UniversalTransitionSystem<S extends AbstractBasePTAState<S,SP,TP>,Integer,PTATransition<S extends AbstractBasePTAState<S,SP,TP>>,SP,TP>
-
transitionGraphView
public net.automatalib.graph.UniversalGraph<S,net.automatalib.automaton.graph.TransitionEdge<Integer,PTATransition<S>>,SP,net.automatalib.automaton.graph.TransitionEdge.Property<Integer,TP>> transitionGraphView(Collection<? extends Integer> inputs)
- Specified by:
transitionGraphView
in interfacenet.automatalib.automaton.Automaton<S extends AbstractBasePTAState<S,SP,TP>,SP,TP>
- Specified by:
transitionGraphView
in interfacenet.automatalib.automaton.UniversalAutomaton<S extends AbstractBasePTAState<S,SP,TP>,Integer,PTATransition<S extends AbstractBasePTAState<S,SP,TP>>,SP,TP>
-
getVisualizationHelper
protected net.automatalib.visualization.VisualizationHelper<S,net.automatalib.automaton.graph.TransitionEdge<Integer,PTATransition<S>>> getVisualizationHelper()
-
-