Deterministic Pushdown Automata (DPDAs) #
This file introduces deterministic pushdown automata (DPDAs).
The embedding of DPDAs into nondeterministic PDAs lives in
Langlib.Automata.DeterministicPushdown.Inclusion.Pushdown.
The notion of a total DPDA (DPDA.IsTotal) lives in
Langlib.Automata.DeterministicPushdown.Basics.Total.
Complement-closure results live in
Langlib.Automata.DeterministicPushdown.ClosureProperties.Complement.
A Deterministic Pushdown Automaton (DPDA) over state type Q,
input alphabet T, and stack alphabet S.
The key difference from a (nondeterministic) PDA is that the transition functions
return Option values instead of Set values, enforcing at most one transition
per configuration. The no_mixed field additionally requires that ε-transitions
and input-reading transitions are mutually exclusive for each (state, stack-top) pair.
Determinism guarantee. Given a configuration (q, a :: w, Z :: γ):
- If
M.epsilon_transition q Z = some (p, β), then the unique possible move is to go to(p, a :: w, β ++ γ)(theno_mixedcondition ensures no input-reading transition is available). - Otherwise, if
M.transition q a Z = some (p, β), the unique possible move is(p, w, β ++ γ). - If neither transition is defined, the machine is stuck (halts).
- initial_state : Q
Initial state
- start_symbol : S
Initial stack symbol
- final_states : Set Q
Set of accepting (final) states
Transition on reading input symbol
awith stack topZ. Returnssome (p, β)wherepis the new state andβreplacesZon the stack, ornoneif no transition is defined.ε-transition (no input consumed) with stack top
Z. Returnssome (p, β)wherepis the new state andβreplacesZon the stack, ornoneif no transition is defined.- no_mixed (q : Q) (Z : S) : self.epsilon_transition q Z ≠ none → ∀ (a : T), self.transition q a Z = none
Determinism constraint: if an ε-transition is defined for
(q, Z), then no input-reading transition is defined for(q, a, Z)for any input symbola.
Instances For
Embed a DPDA into the nondeterministic PDA framework by converting each Option
transition to the corresponding singleton or empty set.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Language accepted by a DPDA via final-state acceptance:
a word w is accepted iff the DPDA, starting from its initial configuration,
can reach a configuration with empty input and an accepting state
(with any remaining stack contents).
Equations
Instances For
The class of DPDA-recognizable languages.