-
- Type Parameters:
I- input symbol type
- All Superinterfaces:
Alphabet<I>,ArrayWritable<I>,Collection<I>,Comparator<I>,IntFunction<I>,Iterable<I>,ToIntFunction<I>,VPAlphabet<I>
- All Known Implementing Classes:
DefaultProceduralInputAlphabet
public interface ProceduralInputAlphabet<I> extends VPAlphabet<I>
A specialized version of aVPAlphabetthat is tailored towards procedural systems. Specifically, it only supports asingle return symbol.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.automatalib.alphabet.VPAlphabet
VPAlphabet.SymbolType
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Word<I>expand(Iterable<I> input, Mapping<I,Word<I>> terminatingSequences)Replaces all occurrences ofcall symbolsininputwith an embedded terminating sequence provided byterminatingSequences.default intfindCallIndex(List<I> input, int idx)Returns the index of the call symbol of the procedure currently executing the symbol at posidx.default intfindCallIndex(Word<I> input, int idx)default intfindReturnIndex(List<I> input, int idx)Returns the index of the return symbol of the procedure that is about to execute the symbol at posidx(i.e. before input[idx] has been executed).default intfindReturnIndex(Word<I> input, int idx)Alphabet<I>getProceduralAlphabet()default IgetReturnSymbol()Returns the single return symbol.default Word<I>project(Word<I> input, int idx)Replaces all well-matched occurrences of procedural invocations ininputwith the single respectivecall symbol.default <O> Pair<Word<I>,Word<O>>project(Word<I> input, Word<O> output, int idx)A generalization ofproject(Word, int)which applies the transformation to the input word as well as an output word (in a symbol-wise fashion).-
Methods inherited from interface net.automatalib.alphabet.Alphabet
apply, applyAsInt, asGrowingAlphabetOrThrowException, compare, containsSymbol, getSymbol, getSymbolIndex, translateFrom, writeToArray
-
Methods inherited from interface net.automatalib.common.smartcollection.ArrayWritable
size
-
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface net.automatalib.alphabet.VPAlphabet
callReturnBalance, getCallAlphabet, getCallSymbol, getCallSymbolIndex, getInternalAlphabet, getInternalSymbol, getInternalSymbolIndex, getNumCalls, getNumInternals, getNumReturns, getReturnAlphabet, getReturnSymbol, getReturnSymbolIndex, getSymbolType, isCallMatched, isCallSymbol, isInternalSymbol, isReturnMatched, isReturnSymbol, isWellMatched, longestWellMatchedPrefix, longestWellMatchedSuffix
-
-
-
-
Method Detail
-
getReturnSymbol
default I getReturnSymbol()
Returns the single return symbol.- Returns:
- the single return symbol
-
findCallIndex
default int findCallIndex(Word<I> input, int idx)
- Parameters:
input- the input wordidx- the index of the currently executing symbol for which the call index should be determined.- Returns:
- the index of the respective call symbol or
-1if this index doesn't exist - See Also:
findCallIndex(List, int)
-
findCallIndex
default int findCallIndex(List<I> input, int idx)
Returns the index of the call symbol of the procedure currently executing the symbol at posidx.- Parameters:
input- the input sequenceidx- the index of the currently executing symbol for which the call index should be determined.- Returns:
- the index of the call symbol or
-1if this index doesn't exist oridxhas invalid range
-
findReturnIndex
default int findReturnIndex(Word<I> input, int idx)
- Parameters:
input- the input wordidx- the index of the symbol that is about to be executed by the current procedure for which the return symbol should be determined.- Returns:
- the index of the return symbol or
-1if this index doesn't exist oridxhas invalid range - See Also:
findReturnIndex(List, int)
-
findReturnIndex
default int findReturnIndex(List<I> input, int idx)
Returns the index of the return symbol of the procedure that is about to execute the symbol at posidx(i.e. before input[idx] has been executed).- Parameters:
input- the input sequenceidx- the index of the symbol that is about to be executed by the current procedure for which the return symbol should be determined.- Returns:
- the index of the return symbol or
-1if this index doesn't exist
-
expand
default Word<I> expand(Iterable<I> input, Mapping<I,Word<I>> terminatingSequences)
Replaces all occurrences ofcall symbolsininputwith an embedded terminating sequence provided byterminatingSequences.- Parameters:
input- the input sequence to analyzeterminatingSequences- a mapping of terminating sequence- Returns:
- a transformed word where all occurrences of
calls symbolshave been replaced with embedded terminating sequences.
-
project
default Word<I> project(Word<I> input, int idx)
Replaces all well-matched occurrences of procedural invocations ininputwith the single respectivecall symbol.- Parameters:
input- the input word to analyzeidx- the index frominputwill be analyzed- Returns:
- a transformed word where all well-matched occurrences of procedural invocations have been replaced with
the single respective
call symbols.
-
project
default <O> Pair<Word<I>,Word<O>> project(Word<I> input, Word<O> output, int idx)
A generalization ofproject(Word, int)which applies the transformation to the input word as well as an output word (in a symbol-wise fashion).- Type Parameters:
O- output symbol type- Parameters:
input- the input word to analyzeoutput- the output word to transform as wellidx- the index frominputwill be analyzed- Returns:
- a pair of transformed words where all well-matched occurrences of procedural invocations have been
replaced with the single respective
call symbol/ call symbol output. - See Also:
project(Word, int)
-
-