Class PushdownAutomaton<S,A,G>

java.lang.Object
org.episteme.core.mathematics.discrete.PushdownAutomaton<S,A,G>

public class PushdownAutomaton<S,A,G> extends Object
Pushdown Automaton (PDA).

A PDA is defined by M = (Q, Σ, Γ, δ, q₀, Z₀, F) where:

  • Q is a finite set of states
  • Σ is the input alphabet
  • Γ is the stack alphabet
  • δ: Q × (Σ ∪ {ε}) × Γ → P(Q × Γ*) is the transition function
  • qâ‚€ ∈ Q is the initial state
  • Zâ‚€ ∈ Γ is the initial stack symbol
  • F ⊆ Q is the set of accepting states

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • PushdownAutomaton

      public PushdownAutomaton(S initialState, G initialStackSymbol)
  • Method Details

    • addState

      public void addState(S state, boolean isAccepting)
    • addTransition

      public void addTransition(S fromState, A input, G stackTop, S toState, List<G> push)
    • accepts

      public boolean accepts(List<A> input)
      Simulates the PDA on the given input. Uses Depth-First Search to explore non-deterministic paths.
      Parameters:
      input - sequence of symbols
      Returns:
      true if accepted