Package dk.brics.automaton
Class ShuffleOperations
- java.lang.Object
-
- dk.brics.automaton.ShuffleOperations
-
public final class ShuffleOperations extends java.lang.ObjectAutomata operations involving shuffling.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classShuffleOperations.ShuffleConfiguration
-
Field Summary
Fields Modifier and Type Field Description private static charLOW_SURROGATE_BEGINprivate static charLOW_SURROGATE_END
-
Constructor Summary
Constructors Modifier Constructor Description privateShuffleOperations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidadd(java.lang.Character suspend_shuffle, java.lang.Character resume_shuffle, java.util.LinkedList<ShuffleOperations.ShuffleConfiguration> pending, java.util.Set<ShuffleOperations.ShuffleConfiguration> visited, ShuffleOperations.ShuffleConfiguration c, int i1, Transition t1, Transition t2, char min, char max)private static Transition[]allowedTransitions(Transition[] ts, boolean nolow)Returns the given transitions, excluding low surrogates ifnolowis set.private static java.lang.StringgetShortestExample(State s, boolean nolow)Returns a shortest string accepted from the given state, not starting with a low surrogate ifnolowis set, or null if none exists.static Automatonshuffle(Automaton a1, Automaton a2)Returns an automaton that accepts the shuffle (interleaving) of the languages of the given automata.static java.lang.StringshuffleSubsetOf(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 bycabut not bya.
-
-
-
Field Detail
-
LOW_SURROGATE_BEGIN
private static final char LOW_SURROGATE_BEGIN
- See Also:
- Constant Field Values
-
LOW_SURROGATE_END
private static final char LOW_SURROGATE_END
- See Also:
- Constant Field Values
-
-
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 bycabut not bya. If no such string exists, null is returned. As a side-effect,ais 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
ais already deterministic).
-
allowedTransitions
private static Transition[] allowedTransitions(Transition[] ts, boolean nolow)
Returns the given transitions, excluding low surrogates ifnolowis 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 ifnolowis set, or null if none exists.
-
add
private static void add(java.lang.Character suspend_shuffle, java.lang.Character resume_shuffle, java.util.LinkedList<ShuffleOperations.ShuffleConfiguration> pending, java.util.Set<ShuffleOperations.ShuffleConfiguration> visited, ShuffleOperations.ShuffleConfiguration c, int i1, Transition t1, Transition t2, char min, char max)
-
-