Class ENFA

All Implemented Interfaces:
Automaton

public class ENFA extends AbstractAutomaton
Non-Deterministic Finite Automaton with Epsilon Transitions (ε-NFA).
  • Method Details

    • epsilonClosure

      public Set<State> epsilonClosure(Set<State> startStates)
      Computes the ε-closure of a set of states. (All states reachable without consuming any input).
      Parameters:
      startStates - The initial set of states.
      Returns:
      The ε-closure set of states.
    • accepts

      public boolean accepts(String input)
      Fast-path evaluation of an input string bypassing ExecutionTrace generation. Overrides the default method to minimize memory allocation and maximize performance.
      Parameters:
      input - The string to be evaluated.
      Returns:
      true if the string is accepted, false otherwise.
    • execute

      public ExecutionTrace execute(String input)
      Description copied from interface: Automaton
      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.
    • getTransitionTable

      public Map<State, Map<Character, Set<State>>> getTransitionTable()
      Retrieves the internal transition table of the ENFA.
      Returns:
      The transition table.