Deterministic pushdown automata #
A deterministic pushdown automaton has a finite control and a stack. A move replaces the top
stack symbol by a list of symbols and either reads one input symbol or takes an epsilon
transition. An enabled epsilon transition excludes every input transition for the same control
state and stack top. Acceptance requires a finite run that consumes the input and reaches a
final state. In the model of Hopcroft et al., Sections 6.2 and 6.4, the transition
table associates at most one result to each state, stack top and input label. The two cases of
Option represent no result or one result, and the epsilon_exclusive field enforces the
condition across different labels. The machine type leaves the alphabets and control type
generic. The DCFL predicate imposes finiteness.
Main definitions #
Cslib.Automata.DPDAandDPDA.Configdescribe machines and configurations.DPDA.Movenames the destination state and stack replacement in the transition table.DPDA.step?computes the next configuration, if any, andDPDA.Stepis its graph.- The
Acceptorinstance recognizes words by final state with the whole input consumed.
Main results #
DPDA.step_deterministicgives uniqueness of the successor configuration.DPDA.accepts_iffgives the run characterization of acceptance.
A deterministic pushdown automaton with control states State, input symbols Symbol
and stack symbols Γ. The first symbol in a replacement list becomes the new stack top.
- start : State
Initial control state.
- bottom : Γ
Initial stack symbol.
- accept : Set State
Accepting control states.
A partial transition on a state, stack top and optional input symbol.
- epsilon_exclusive (q : State) (γ : Γ) (a : Symbol) : (self.transition q γ none).isSome = true → self.transition q γ (some a) = none
When an epsilon transition is available, no input transition is available.
Instances For
The control state, unread input and stack contents. The stack top is the head of the list.
An epsilon transition updates the control and stack while preserving all unread input.
An input transition reads the next symbol and updates the control and stack.