Class SPMMs


  • public final class SPMMs
    extends Object
    Operations on SPMMs.
    • Method Detail

      • computeTerminatingSequences

        public static <I,​O> Map<I,​Word<I>> computeTerminatingSequences​(SPMM<?,​I,​?,​O> spmm,
                                                                                   ProceduralInputAlphabet<I> alphabet)
        Computes for a given SPMM the set of terminating sequences using the given alphabet. Terminating sequences transfer a procedure from its initial state to a returnable state. This method furthermore checks that the hierarchy of calls is well-defined, i.e. it only includes procedural invocations p for determining a terminating sequence if p has a valid terminating sequence itself.
        Type Parameters:
        I - input symbol type
        O - output symbol type
        Parameters:
        spmm - the SPMM to analyze
        alphabet - the ProceduralInputAlphabet whose symbols should be used for computing the terminating sequences
        Returns:
        A map from procedures (restricted to the call symbols of the given alphabet) to the terminating sequences. This map may be partial as some procedures may not have a well-defined terminating sequence for the given alphabet.
      • computeAccessSequences

        public static <I,​O> Map<I,​Word<I>> computeAccessSequences​(SPMM<?,​I,​?,​O> spmm,
                                                                              ProceduralInputAlphabet<I> alphabet,
                                                                              Map<I,​Word<I>> terminatingSequences)
        Computes for a given SPMM a set of access sequences using the SPMM alphabet. An access sequence (for procedure p) transfers an SPMM from its initial state to a state that is able to successfully execute a run of p. This method furthermore checks that potentially nested calls are well-defined, i.e. it only includes procedural invocations p for determining access sequences if p has a valid terminating sequence and therefore can be expanded correctly.
        Type Parameters:
        I - input symbol type
        O - output symbol type
        Parameters:
        spmm - the SPMM to analyze
        alphabet - the ProceduralInputAlphabet whose symbols should be used for computing the access sequences
        terminatingSequences - a Map of call symbols to terminating sequences used to expand nested invocations in access sequences
        Returns:
        A map from procedures (restricted to the call symbols of the given alphabet) to the access sequences. This map may be partial as some procedures may not have well-defined access sequences for the given alphabet.
      • isValid

        public static <I,​O> boolean isValid​(SPMM<?,​I,​?,​O> spmm,
                                                  ProceduralInputAlphabet<I> alphabet)
        Checks whether the given SPMM is valid with respect to the given ProceduralInputAlphabet, i.e., whether its procedures are error-closed, return-closed, and call-closed.

        A procedure is considered error-closed iff any transition that emits an error output transitions the procedure into a sink state that continues to output the error output.

        A procedure is considered return-closed iff the return symbol transitions the procedure into a sink state that continues to output the error output.

        A procedure is considered call-closed iff any transition labeled with a non-terminating call symbol transitions the procedure into a sink state that continues to output the error output.

        Type Parameters:
        I - input symbol type
        O - output symbol type
        Parameters:
        spmm - the SPMM to analyze
        alphabet - the ProceduralInputAlphabet whose symbols should be used for checking validity
        Returns:
        true if spmm is valid, false otherwise.
      • findSeparatingWord

        public static <I,​O> @Nullable Word<I> findSeparatingWord​(SPMM<?,​I,​?,​O> spmm1,
                                                                       SPMM<?,​I,​?,​O> spmm2,
                                                                       ProceduralInputAlphabet<I> alphabet)
        Computes a separating word for the two given SPMMs, if existent. A separating word is a Word such that one SPMM behaves different from the other.
        Type Parameters:
        I - input symbol type
        O - output symbol type
        Parameters:
        spmm1 - the first SPMM
        spmm2 - the second SPMM
        alphabet - the ProceduralInputAlphabet whose symbols should be used for computing the separating word
        Returns:
        a separating word, if existent, null otherwise.