Interface ProceduralInputAlphabet<I>

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 a VPAlphabet that is tailored towards procedural systems. Specifically, it only supports a single return symbol.
  • Method Details

    • getProceduralAlphabet

      Alphabet<I> getProceduralAlphabet()
      Returns the union of call and internal symbols.
      Returns:
      the procedural alphabet
    • getReturnSymbol

      default I getReturnSymbol()
      Returns the single return symbol.
      Returns:
      the single return symbol
    • findCallIndex

      default int findCallIndex(Word<I> input, int idx)
      Convenience method for findCallIndex(List, int) that transforms the given input word into a list.
      Parameters:
      input - the input word
      idx - the index of the currently executing symbol for which the call index should be determined.
      Returns:
      the index of the respective call symbol or -1 if this index doesn't exist
      See Also:
    • findCallIndex

      default int findCallIndex(List<I> input, int idx)
      Returns the index of the call symbol of the procedure currently executing the symbol at pos idx.
      Parameters:
      input - the input sequence
      idx - the index of the currently executing symbol for which the call index should be determined.
      Returns:
      the index of the call symbol or -1 if this index doesn't exist or idx has invalid range
    • findReturnIndex

      default int findReturnIndex(Word<I> input, int idx)
      Convenience method for findReturnIndex(List, int) that transforms the given input word into a list.
      Parameters:
      input - the input word
      idx - 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 -1 if this index doesn't exist or idx has invalid range
      See Also:
    • 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 pos idx (i.e. before input[idx] has been executed).
      Parameters:
      input - the input sequence
      idx - 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 -1 if this index doesn't exist
    • expand

      default Word<I> expand(Iterable<I> input, Mapping<I,Word<I>> terminatingSequences)
      Replaces all occurrences of call symbols in input with an embedded terminating sequence provided by terminatingSequences.
      Parameters:
      input - the input sequence to analyze
      terminatingSequences - a mapping of terminating sequence
      Returns:
      a transformed word where all occurrences of calls symbols have been replaced with embedded terminating sequences.
    • project

      default Word<I> project(Word<I> input, int idx)
      Replaces all well-matched occurrences of procedural invocations in input with the single respective call symbol.
      Parameters:
      input - the input word to analyze
      idx - the index from input will 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 of project(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 analyze
      output - the output word to transform as well
      idx - the index from input will 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: