Class Automaton

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class Automaton
    extends Object
    implements Serializable, Cloneable
    Finite-state automaton with regular expression operations.

    Class invariants:

    • An automaton is either represented explicitly (with State and Transition objects) or with a singleton string (expandSingleton()) in case the automaton is known to accept exactly one string. (Implicitly, all states and transitions of an automaton are reachable from its initial state.)
    • Automata are always reduced (see reduce()) and have no transitions to dead states (see removeDeadTransitions()).
    • Automata provided as input to operations are generally assumed to be disjoint.

    See Also:
    Serialized Form
    • Field Detail

      • MINIMIZE_HUFFMAN

        public static final int MINIMIZE_HUFFMAN
        Minimize using Huffman's O(n2) algorithm. This is the standard text-book algorithm.
        See Also:
        Constant Field Values
      • MINIMIZE_BRZOZOWSKI

        public static final int MINIMIZE_BRZOZOWSKI
        Minimize using Brzozowski's O(2n) algorithm. This algorithm uses the reverse-determinize-reverse-determinize trick, which has a bad worst-case behavior but often works very well in practice (even better than Hopcroft's!).
        See Also:
        Constant Field Values
      • MINIMIZE_HOPCROFT

        public static final int MINIMIZE_HOPCROFT
        Minimize using Hopcroft's O(n log n) algorithm.
        See Also:
        Constant Field Values
      • MINIMIZE_VALMARI

        public static final int MINIMIZE_VALMARI
        Minimize using Valmari's O(n + m log m) algorithm.
        See Also:
        Constant Field Values
      • _minimizeAlways

        public static boolean _minimizeAlways
        Minimize always flag.
      • _allowMutation

        public static boolean _allowMutation
        Selects whether operations may modify the input automata (default: false).
      • _minimization

        public static int _minimization
        Selects minimization algorithm (default: MINIMIZE_HOPCROFT).