Class ShuffleOperations


  • public final class ShuffleOperations
    extends java.lang.Object
    Automata operations involving shuffling.
    • Constructor Detail

      • ShuffleOperations

        private ShuffleOperations()
    • Method Detail

      • shuffle

        public static Automaton shuffle​(Automaton a1,
                                        Automaton a2)
        Returns an automaton that accepts the shuffle (interleaving) of the languages of the given automata. As a side-effect, both automata are determinized, if not already deterministic. Never modifies the input automata languages.

        Complexity: quadratic in number of states (if already deterministic).

        Author:
        Torben Ruby <ruby@daimi.au.dk>
      • shuffleSubsetOf

        public static java.lang.String shuffleSubsetOf​(java.util.Collection<Automaton> ca,
                                                       Automaton a,
                                                       java.lang.Character suspend_shuffle,
                                                       java.lang.Character resume_shuffle)
        Returns a string that is an interleaving of strings that are accepted by ca but not by a. If no such string exists, null is returned. As a side-effect, a is determinized, if not already deterministic. Only interleavings that respect the suspend/resume markers (two BMP private code points) are considered if the markers are non-null. Also, interleavings never split surrogate pairs (a high surrogate immediately followed by a low surrogate in the same string).

        Complexity: proportional to the product of the numbers of states (if a is already deterministic).

      • allowedTransitions

        private static Transition[] allowedTransitions​(Transition[] ts,
                                                       boolean nolow)
        Returns the given transitions, excluding low surrogates if nolow is set.
      • getShortestExample

        private static java.lang.String getShortestExample​(State s,
                                                           boolean nolow)
        Returns a shortest string accepted from the given state, not starting with a low surrogate if nolow is set, or null if none exists.