Class Automaton


  • public final class Automaton
    extends Object
    This class allows us to represent finite automatons that are useful for posting regular constraints. An automaton is composed of an initial state, a finite set of final states and a finite set of transitions.
    • Field Detail

      • startState

        public final String startState
        The start (initial) state of the automaton.
      • transitions

        public final Transition[] transitions
        The set (array) of transitions. Each transition is an object composed of a first state, a symbol (that may be an integer or a string) and a second state that is reached from the first state after reading the symbol.
      • finalStates

        public final String[] finalStates
        The set (array) of final states of the automaton, i.e., accepting stated of the automaton.
    • Constructor Detail

      • Automaton

        public Automaton​(String startState,
                         Transition[] transitions,
                         String... finalStates)
        Constructs an automaton from the specified arguments.
        Parameters:
        startState - the start state of the automaton
        transitions - the set (array) of transitions where each transition is an object composed of a first state, a symbol (that may be an integer or a string) and a second state that is reached from the first state after reading the symbol
        finalStates - the set (array) of final states of the automaton, i.e., accepting stated of the automaton
      • Automaton

        public Automaton​(String startState,
                         Transitions transitions,
                         String... finalStates)
        Constructs an automaton from the specified arguments.
        Parameters:
        startState - the start state of the automaton
        transitions - the object encapsulating the list of transitions where each transition is an object composed of a first state, a symbol (that may be an integer or a string) and a second state that is reached from the first state after reading the symbol
        finalStates - the set (array) of final states of the automaton, i.e., accepting stated of the automaton
      • Automaton

        public Automaton​(String expression)
        Constructs an automaton from the specified regular expression, given as a string.
        Parameters:
        expression - the expression representing a regular expression.
    • Method Detail

      • _isDeterministic

        public boolean _isDeterministic()
      • isDeterministic

        public boolean isDeterministic()