Class SBAs


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

      • computeTerminatingSequences

        public static <I> Map<I,​Word<I>> computeTerminatingSequences​(SBA<?,​I> sba,
                                                                           ProceduralInputAlphabet<I> alphabet)
        Computes for a given SBA a 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
        Parameters:
        sba - the SBA to analyze
        alphabet - the ProceduralInputAlphabet whose symbols should be used for determining 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> Map<I,​Word<I>> computeAccessSequences​(SBA<?,​I> sba,
                                                                      ProceduralInputAlphabet<I> alphabet,
                                                                      Map<I,​Word<I>> terminatingSequences)
        Computes for a given SBA a set of access sequences using the given alphabet. An access sequence (for procedure p) transfers an SBA 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
        Parameters:
        sba - the SBA to analyze
        alphabet - the ProceduralInputAlphabet whose symbols should be used for determining the access and return sequences
        terminatingSequences - a Map of call symbols to terminating sequences used to expand nested invocations in access sequences
        Returns:
        A pair of maps from procedures (restricted to the call symbols of the given alphabet) to the access/return sequences. These maps may be partial as some procedures may not have well-defined access/terminating sequences for the given alphabet.
      • isValid

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

        A procedure is considered prefix-closed iff any continuation of a rejected word is rejected as well.

        A procedure is considered return-closed iff any continuation beyond the return symbol is rejected.

        A procedure is considered call-closed iff any continuation beyond a non-terminating call symbol is rejected.

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

        public static <I> @Nullable Word<I> findSeparatingWord​(SBA<?,​I> sba1,
                                                               SBA<?,​I> sba2,
                                                               ProceduralInputAlphabet<I> alphabet)
        Computes a separating word for the two given SBAs, if existent. A separating word is a Word such that one SBA behaves different from the other.
        Type Parameters:
        I - input symbol type
        Parameters:
        sba1 - the first SBA
        sba2 - the second SBA
        alphabet - the ProceduralInputAlphabet whose symbols should be considered for computing the separating word
        Returns:
        a separating word, if existent, null otherwise.
      • reduce

        public static <I> SPA<?,​I> reduce​(SBA<?,​I> sba,
                                                ProceduralInputAlphabet<I> alphabet)
        Reduces a given SBA to its well-matched language restricted to the symbols of the given ProceduralInputAlphabet. The reduced SBA only accepts a Word iff it is (minimally) well-matched and accepted by the original SBA as well.
        Type Parameters:
        I - input symbol type
        Parameters:
        sba - the SBA to reduce
        alphabet - the ProceduralInputAlphabet whose symbols should be considered for reduction
        Returns:
        the reduced SBA in form of an SPA