|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectICFA
This class implements incomplete codeterministic finite automata (ICFA).
It is used mainly as a companion to the class IDFA. The
method reverse applied to an IDFA produces an
ICFA and conversely.
| Field Summary | |
Alphabet |
alphabet
The alphabet. |
PairIntQueue[] |
edges
The set of edges going out of a state. |
java.util.Set |
initial
The initial set of states. |
int |
nbLetters
|
int |
nbStates
The number of states. |
int |
terminal
The terminal state. |
| Constructor Summary | |
ICFA()
|
|
ICFA(int n)
|
|
ICFA(int n,
Alphabet a)
|
|
| Method Summary | |
void |
addEdge(int p,
char a,
int q)
|
void |
addEdge(int p,
int a,
int q)
|
void |
addEdgeFast(int p,
int a,
int q)
|
static ICFA |
ex()
|
java.util.LinkedList |
explore(java.util.LinkedList t,
int p,
IDFA b)
Implements the function Explore(t, s, b) of Section 1.3.3 which returns the list of sets of half edges realizing the determinization of the NFA. |
int |
explore2(java.util.HashMap t,
java.util.Set s,
int nn,
IDFA b)
The same as explore but with an implementation of the
set of states of the resulting DFA via a HashMap. |
java.util.LinkedList |
exploreBis(java.util.LinkedList t,
java.util.Set s,
int p,
IDFA b)
The same as explore but with a transmission of the
index of the set s in the list t. |
static void |
main(java.lang.String[] args)
|
java.util.Set[] |
next(java.util.Set s)
Computes a set transition in an ICFA as an array of sets indexed by the letters. |
IDFA |
reverse()
Computes the deterministic automaton (IDFA) obtained by reversing the edges of a codeterministic automaton (ICFA). |
IDFA |
toIDFA(int Nmax)
Implements the determinization algorithm. |
IDFA |
toIDFA2(int Nmax)
The same as toIDFA but with an implementation of the
set of states of the resulting IDFA via a HashMap.
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public int nbStates
public int nbLetters
public PairIntQueue[] edges
public java.util.Set initial
public int terminal
public Alphabet alphabet
| Constructor Detail |
public ICFA()
public ICFA(int n)
public ICFA(int n,
Alphabet a)
| Method Detail |
public void addEdge(int p,
char a,
int q)
public void addEdge(int p,
int a,
int q)
public void addEdgeFast(int p,
int a,
int q)
public java.lang.String toString()
public static ICFA ex()
public java.util.Set[] next(java.util.Set s)
O(e log(n)) for an NFA with e
edges and n
states. Indeed, the set s has O(n) elements
and each insertion costs time log(n) using a TreeSet
to represent the sets s and next(s, c).
s - the original set of states
public java.util.LinkedList explore(java.util.LinkedList t,
int p,
IDFA b)
s of t
with order p.
t - a linked list of sets of states (implemented as TreeSet).p - the order of the starting set.b - the resulting DFA.
b.
public java.util.LinkedList exploreBis(java.util.LinkedList t,
java.util.Set s,
int p,
IDFA b)
explore but with a transmission of the
index of the set s in the list t.
public int explore2(java.util.HashMap t,
java.util.Set s,
int nn,
IDFA b)
explore but with an implementation of the
set of states of the resulting DFA via a HashMap.
public IDFA toIDFA2(int Nmax)
toIDFA but with an implementation of the
set of states of the resulting IDFA via a HashMap.
The keys are the sets of half-edges (with the method hashCode
overridden in the class HalfEdge) and the value is the name
of the state. Assuming constant time performance for the functions
get andput, the complexity is O(m n log(n))
on an NFA of size n resulting in a IDFA
with m states.
public IDFA reverse()
O(e)
on an ICFA with e edges.
public IDFA toIDFA(int Nmax)
NFAtoDFA of Section 1.3.3.
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||