|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectRMinimizer
Minimization of an acyclic trim automaton in linear time.
This algorithm, due to D. Revuz, minimizes an acyclic automaton in time
O(q + n + e), where
q = size of alphabet
n = number of states
e = number of edges.
| Field Summary | |
static int[] |
g2l
An array used for conversion from global to local of names in signatures. |
static int[] |
l2g
An array used for conversion from local to global of names in signatures. |
static boolean |
verbose
|
| Constructor Summary | |
RMinimizer()
|
|
| Method Summary | |
int |
addStateMin(int p,
int nn,
int[] num,
IDFA a,
IDFA b)
Adds the state nn to the automaton b
(the minimal automaton in construction) as the class of state p
in the original automaton a. |
IntQueue |
bucketSort(int k,
IntQueue[] bucket,
IntQueue[] lap,
int[][] s,
IntQueue d)
Realizes the bucket sort of the queue of integers d according
to the value of column k in the array of signatures s. |
void |
computeSignatures(int[] som,
int[][] sig,
int[] num,
IntQueue shl,
IDFA a)
Computes the array of signatures of a list shl of states. |
boolean |
equalsig(int[] a,
int[] b)
Returns true if the arrays a and b are equal. |
int |
g2l(int[][] sig,
int[][] sil)
Transforms the global arry of signatures into a local one. |
IntQueue[] |
letterPositions(IntQueue[] pdl,
int J,
int K)
Returns the array of lists of letters at a position. |
DFA |
minimize(DFA a)
|
DFT |
minimize(DFT a)
|
IDFA |
minimize(IDFA a)
The method called to minimize an acyclic trim automaton. |
IntQueue[] |
positionLetters(int[][] s,
int J)
Returns the array list of positions of letters. |
IntQueue |
radixSort(int[][] s,
int J)
Lexicographic sort of the array s. |
int |
renumberStates(int[] e,
int[][] sil,
int nn,
int[] num,
IDFA a,
IDFA b)
Adds states to the minimal automaton in construction b. |
void |
resetg2l(int J)
Reinitializes the arrays g2l and l2g |
IntQueue[] |
triParHauteur(int[] h,
IDFA a)
Returns the array sh of queues such that sh[r]
is the queue of states at heigth r. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static boolean verbose
public static int[] g2l
public static int[] l2g
| Constructor Detail |
public RMinimizer()
| Method Detail |
public int g2l(int[][] sig,
int[][] sil)
sig - the global array of signatures of size N
by K>/code>.sil - the local array of signatures.
- Returns:
- the number of distinct letters appearing.
public void resetg2l(int J)
g2l and l2g
public IntQueue radixSort(int[][] s,
int J)
s. Complexity O(NK).
J - the number of letters appearing (they run from 0 to J - 1).
We have J <= N K.s - a K by N array.
public IntQueue bucketSort(int k,
IntQueue[] bucket,
IntQueue[] lap,
int[][] s,
IntQueue d)
d according
to the value of column k in the array of signatures s.
k - the column indexbucket - the array of bucketslap - the array of lists of letters by positions - the array of signaturesd - the list to be sorted
public IntQueue[] positionLetters(int[][] s,
int J)
s - the array of signatures.J - the size of the returned array.
pdl of lists of positions of letters.
pdl[c] is the list of indices k such that s[n][k] = c
for some index n.
public IntQueue[] letterPositions(IntQueue[] pdl,
int J,
int K)
pdl - the array of lists of positions of letters.J - the size of pdl.K - the size of the result.
lap of lists of letters at a position.
lap[k] is the list of letters c such that s[n][k] = c
for some index n.
public int addStateMin(int p,
int nn,
int[] num,
IDFA a,
IDFA b)
nn to the automaton b
(the minimal automaton in construction) as the class of state p
in the original automaton a.
p - a state of a.nn - a state of bnum - the array of class numbers
nn + 1.
public int renumberStates(int[] e,
int[][] sil,
int nn,
int[] num,
IDFA a,
IDFA b)
b.
e - the array of states of asil - the array of signaturesnn - the current number of states of bnum - the array of class numbers
b.
public void computeSignatures(int[] som,
int[][] sig,
int[] num,
IntQueue shl,
IDFA a)
shl of states.
som - the array of names of states. som[i] is the name of the
i-th state.sig - the array of signatures.num - the array of class numbersshl - the list of states
public boolean equalsig(int[] a,
int[] b)
a and b are equal.
public IntQueue[] triParHauteur(int[] h,
IDFA a)
sh of queues such that sh[r]
is the queue of states at heigth r.
h - the array of heigths
public IDFA minimize(IDFA a)
throws java.lang.Exception
minimize in interface Minimizerjava.lang.Exception
public DFA minimize(DFA a)
throws java.lang.Exception
minimize in interface Minimizerjava.lang.Exception
public DFT minimize(DFT a)
throws java.lang.Exception
minimize in interface Minimizerjava.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||