|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.ObjectdRegAut.FA
public class FA
Deterministic finite state automaton. [Martin, Def. 2.11]
| Field Summary | |
|---|---|
Set<State> |
accept
Accept states (A). |
Alphabet |
alphabet
The automaton alphabet ( ). |
State |
initial
Initial state (q0). |
Set<State> |
states
Set of State objects (Q). |
Map<StateSymbolPair,State> |
transitions
Transition function ( ). |
| Constructor Summary | |
|---|---|
FA()
Constructs an uninitialized FA. |
|
FA(Alphabet a)
Constructs a new FA consisting of one reject state. |
|
| Method Summary | |
|---|---|
boolean |
accepts(String s)
Runs the given string on this automaton. |
FA |
checkWellDefined()
Checks that this automaton is well-defined. |
Object |
clone()
Clones this automaton. |
FA |
complement()
Constructs a new automaton that accepts the complement of the language of this automaton. |
State |
delta(State q,
char c)
Looks up transition in transition function. |
State |
deltaStar(State q,
String s)
Performs transitions in extended transition function. |
boolean |
equals(Object obj)
Checks whether the language of this automaton is equal to the language of the given automaton. |
Set<State> |
findReachableStates()
Finds the set of states that are reachable from the initial state. |
String |
getAShortestExample()
Returns a shortest string that is accepted by this automaton. |
int |
getNumberOfStates()
Returns number of states in this automaton. |
int |
hashCode()
Computes hash code for this object. |
FA |
intersection(FA f)
Constructs a new automaton whose language is the intersection of the language of this automaton and the language of the given automaton. |
boolean |
isEmpty()
Checks whether the language of this automaton is empty. |
boolean |
isFinite()
Checks whether the language of this automaton is finite. |
FA |
minimize()
Constructs a new minimal automaton with the same language as this automaton. |
FA |
minus(FA f)
Constructs a new automaton whose language is equal to the language of this automaton minus the language of the given automaton. |
FA |
removeUnreachableStates()
Constructs a new automaton with the same language as this automaton but without unreachable states. |
void |
setTransition(State q,
char c,
State p)
Sets a transition in the transition function. |
boolean |
subsetOf(FA f)
Checks whether the language of this automaton is a subset of the language of the given automaton. |
String |
toDot()
Returns Graphviz Dot representation of this automaton. |
NFA |
toNFA()
Converts this FA into an equivalent NFA. |
RegExp |
toRegExp()
Converts this automaton into an equivalent RegExp regular expression. |
FA |
union(FA f)
Constructs a new automaton whose language is the union of the language of this automaton and the language of the given automaton. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public Set<State> accept
states.
public Alphabet alphabet
).
public State initial
states.
public Set<State> states
State objects (Q).
public Map<StateSymbolPair,State> transitions
).
This is a map from pairs of states and alphabet symbols to states
(
:
Q
Q).
| Constructor Detail |
|---|
public FA()
public FA(Alphabet a)
a - automaton alphabet| Method Detail |
|---|
public boolean accepts(String s)
throws IllegalArgumentException
s - a string
IllegalArgumentException - if a symbol in s is not in the alphabet
public FA checkWellDefined()
throws AutomatonNotWellDefinedException
AutomatonNotWellDefinedException - if this automaton is not well-definedpublic Object clone()
clone in class Objectpublic FA complement()
public State delta(State q,
char c)
throws IllegalArgumentException
(q,c)
IllegalArgumentException - if c is not in the alphabet
public State deltaStar(State q,
String s)
throws IllegalArgumentException
*(q,s)
IllegalArgumentException - if a symbol in s is not in the alphabetpublic boolean equals(Object obj)
equals in class Objectpublic Set<State> findReachableStates()
public String getAShortestExample()
public int getNumberOfStates()
public int hashCode()
equals(Object) is implemented, hashCode must also be there.)
hashCode in class Object
public FA intersection(FA f)
throws IllegalArgumentException
IllegalArgumentException - if the alphabets of f and this automaton are not the samepublic boolean isEmpty()
public boolean isFinite()
public FA minimize()
public FA minus(FA f)
throws IllegalArgumentException
IllegalArgumentException - if the alphabets of f and this automaton are not the samepublic FA removeUnreachableStates()
public void setTransition(State q,
char c,
State p)
(q,c)=p
public boolean subsetOf(FA f)
public String toDot()
public NFA toNFA()
NFA.
Note: this is trivial since an FA is just a special kind of NFA, except for the different representation.
public RegExp toRegExp()
RegExp regular expression. [Martin, Th. 3.30]
public FA union(FA f)
throws IllegalArgumentException
IllegalArgumentException - if the alphabets of f and this automaton are not the sameNFA.union(dRegAut.NFA)
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||