Interface Automaton

All Known Implementing Classes:
AbstractAutomaton, DFA, ENFA, NFA

public interface Automaton
Base interface for all types of Automata (DFA, NFA, ENFA).
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    accepts(String input)
    The main method that checks whether the input string belongs to the language recognized by the automaton L(M).
    execute(String input)
    Processes the input string and returns a detailed execution trace.
    Retrieves all the accepting (final) states of the automaton.
    Retrieves the starting state of the automaton.
    Retrieves all the states within the automaton.
  • Method Details

    • getStates

      Set<State> getStates()
      Retrieves all the states within the automaton.
      Returns:
      A set containing all states.
    • getInitialState

      State getInitialState()
      Retrieves the starting state of the automaton.
      Returns:
      The initial state.
    • getFinalStates

      Set<State> getFinalStates()
      Retrieves all the accepting (final) states of the automaton.
      Returns:
      A set containing all final states.
    • execute

      ExecutionTrace execute(String input)
      Processes the input string and returns a detailed execution trace.
      Parameters:
      input - The string to be evaluated.
      Returns:
      An ExecutionTrace detailing the entire state traversal.
    • accepts

      default boolean accepts(String input)
      The main method that checks whether the input string belongs to the language recognized by the automaton L(M).
      Parameters:
      input - The string to be evaluated.
      Returns:
      true if the string is accepted, false otherwise.