Class DFA

java.lang.Object
  extended byDFA
Direct Known Subclasses:
DFT, InfoDFA

public class DFA
extends java.lang.Object

This class implements deterministic complete finite automata. The transition function is represented by a double array next[][]. The set of terminal states is given by a partition of the set of states (class Partition). A state q is terminal if terminal.blockName[p]=1 (the default value is 0).


Constructor Summary
DFA(int n, Alphabet a)
          creates a DFA with n states and alphabet a.
DFA(int n, int k)
          creates a DFA with n states and k letters.
 
Method Summary
static void main(java.lang.String[] args)
           
static DFA minimize(DFA a, Minimizer m)
          Minimizes the automaton using the method m.
 DFA minimize(Minimizer m)
           
 int next(int p, java.lang.String w)
          returns the state reached from state p after reading the word w.
 DFA quotient(int[] c)
          Returns the quotient of the DFA by the partition c
 DFA quotient(Partition p)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DFA

public DFA(int n,
           int k)
creates a DFA with n states and k letters.


DFA

public DFA(int n,
           Alphabet a)
creates a DFA with n states and alphabet a.

Method Detail

next

public int next(int p,
                java.lang.String w)
returns the state reached from state p after reading the word w.

Parameters:
p - starting state
w - input word (w is not null
Returns:
state reached

minimize

public static DFA minimize(DFA a,
                           Minimizer m)
                    throws java.lang.Exception
Minimizes the automaton using the method m.

Throws:
java.lang.Exception

minimize

public DFA minimize(Minimizer m)
             throws java.lang.Exception
Throws:
java.lang.Exception

quotient

public DFA quotient(int[] c)
Returns the quotient of the DFA by the partition c

Parameters:
c - a partition of the state set compatible with the DFA
Returns:
the new DFA.

quotient

public DFA quotient(Partition p)

toString

public java.lang.String toString()

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception