public final class SpecialOperations
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Automaton |
compress(Automaton a,
java.lang.String set,
char c,
org.processmining.framework.plugin.ProMCanceller canceller)
Returns an automaton that accepts the compressed language of the given
automaton.
|
static java.lang.String |
getCommonPrefix(Automaton a)
Returns the longest string that is a prefix of all accepted strings and
visits each state at most once.
|
static java.util.Set<java.lang.String> |
getFiniteStrings(Automaton a)
Returns the set of accepted strings, assuming this automaton has a finite
language.
|
static java.util.Set<java.lang.String> |
getFiniteStrings(Automaton a,
int limit)
Returns the set of accepted strings, assuming that at most
limit strings are accepted. |
static java.util.Set<java.lang.String> |
getStrings(Automaton a,
int length)
Returns the set of accepted strings of the given length.
|
static Automaton |
hexCases(Automaton a,
org.processmining.framework.plugin.ProMCanceller canceller)
Constructs automaton that accepts the same strings as the given automaton
but ignores upper/lower case of A-F.
|
static Automaton |
homomorph(Automaton a,
char[] source,
char[] dest,
org.processmining.framework.plugin.ProMCanceller canceller)
Returns an automaton accepting the homomorphic image of the given
automaton using the given function.
|
static boolean |
isFinite(Automaton a)
Returns true if the language of this automaton is finite.
|
static Automaton |
overlap(Automaton a1,
Automaton a2,
org.processmining.framework.plugin.ProMCanceller canceller)
Returns an automaton that accepts the overlap of strings that in more
than one way can be split into a left part being accepted by
a1 and a right part being accepted by a2 . |
static void |
prefixClose(Automaton a,
org.processmining.framework.plugin.ProMCanceller canceller)
Prefix closes the given automaton.
|
static Automaton |
projectChars(Automaton a,
java.util.Set<java.lang.Character> chars,
org.processmining.framework.plugin.ProMCanceller canceller)
Returns an automaton with projected alphabet.
|
static Automaton |
replaceWhitespace(Automaton a,
org.processmining.framework.plugin.ProMCanceller canceller)
Constructs automaton that accepts 0x20, 0x9, 0xa, and 0xd in place of
each 0x20 transition in the given automaton.
|
static java.util.Set<State> |
reverse(Automaton a)
Reverses the language of the given (non-singleton) automaton while
returning the set of new initial states.
|
static Automaton |
singleChars(Automaton a,
org.processmining.framework.plugin.ProMCanceller canceller)
Returns an automaton that accepts the single chars that occur in strings
that are accepted by the given automaton.
|
static Automaton |
subst(Automaton a,
char c,
java.lang.String s,
org.processmining.framework.plugin.ProMCanceller canceller)
Returns an automaton where all transitions of the given char are replaced
by a string.
|
static Automaton |
subst(Automaton a,
java.util.Map<java.lang.Character,java.util.Set<java.lang.Character>> map,
org.processmining.framework.plugin.ProMCanceller canceller)
Returns an automaton where all transition labels have been substituted.
|
static Automaton |
trim(Automaton a,
java.lang.String set,
char c,
org.processmining.framework.plugin.ProMCanceller canceller)
Returns an automaton that accepts the trimmed language of the given
automaton.
|
public static java.util.Set<State> reverse(Automaton a)
public static Automaton overlap(Automaton a1, Automaton a2, org.processmining.framework.plugin.ProMCanceller canceller)
a1
and a right part being accepted by a2
.canceller
- public static Automaton singleChars(Automaton a, org.processmining.framework.plugin.ProMCanceller canceller)
canceller
- public static Automaton trim(Automaton a, java.lang.String set, char c, org.processmining.framework.plugin.ProMCanceller canceller)
c
character is allowed in the original automaton, one or
more set
characters are allowed in the new automaton. 2) The
automaton is prefixed and postfixed with any number of set
characters.set
- set of characters to be trimmedc
- canonical trim character (assumed to be in set
)canceller
- public static Automaton compress(Automaton a, java.lang.String set, char c, org.processmining.framework.plugin.ProMCanceller canceller)
c
character is allowed in the original
automaton, one or more set
characters are allowed in the new
automaton.set
- set of characters to be compressedc
- canonical compress character (assumed to be in
set
)canceller
- public static Automaton subst(Automaton a, java.util.Map<java.lang.Character,java.util.Set<java.lang.Character>> map, org.processmining.framework.plugin.ProMCanceller canceller)
Each transition labeled c
is changed to a set of
transitions, one for each character in map(c)
. If
map(c)
is null, then the transition is unchanged.
map
- map from characters to sets of characters (where characters
are Character
objects)canceller
- public static Automaton subst(Automaton a, char c, java.lang.String s, org.processmining.framework.plugin.ProMCanceller canceller)
c
- chars
- stringcanceller
- public static Automaton homomorph(Automaton a, char[] source, char[] dest, org.processmining.framework.plugin.ProMCanceller canceller)
This method maps each transition label to a new value.
source
and dest
are assumed to be arrays of
same length, and source
must be sorted in increasing order
and contain no duplicates. source
defines the starting
points of char intervals, and the corresponding entries in
dest
define the starting points of corresponding new
intervals.
canceller
- public static Automaton projectChars(Automaton a, java.util.Set<java.lang.Character> chars, org.processmining.framework.plugin.ProMCanceller canceller)
Character
). If null
is in the set, it
abbreviates the intervals u0000-uDFFF and uF900-uFFFF (i.e., the
non-private code points). It is assumed that all other characters from
chars
are in the interval uE000-uF8FF.canceller
- public static boolean isFinite(Automaton a)
public static java.util.Set<java.lang.String> getStrings(Automaton a, int length)
public static java.util.Set<java.lang.String> getFiniteStrings(Automaton a)
public static java.util.Set<java.lang.String> getFiniteStrings(Automaton a, int limit)
limit
strings are accepted. If more than limit
strings are accepted, null is returned. If limit
<0, then
this methods works like getFiniteStrings(Automaton)
.public static java.lang.String getCommonPrefix(Automaton a)
public static void prefixClose(Automaton a, org.processmining.framework.plugin.ProMCanceller canceller)
canceller
- public static Automaton hexCases(Automaton a, org.processmining.framework.plugin.ProMCanceller canceller)
a
- automatoncanceller
- public static Automaton replaceWhitespace(Automaton a, org.processmining.framework.plugin.ProMCanceller canceller)
a
- automatoncanceller
-