P-Automata for DPDA Epsilon Saturation #
This file contains the finite automaton layer and saturation construction for DPDA epsilon phases. The saturated P-automaton relations recognize exactly the stack prefixes whose epsilon phase can reach either a stable configuration or a final control state.
States of a P-automaton: original control states plus one distinguished sink state used by target automata for arbitrary stack suffixes.
Equations
- DPDA.PAutState Q = (Q ⊕ Unit)
Instances For
Embed an original DPDA state as a P-automaton state.
Equations
Instances For
Distinguished target/sink state.
Equations
Instances For
A path through a stack-reading relation. Symbols are read top-to-bottom.
- nil {Q S : Type} {R : PAutState Q → S → PAutState Q → Prop} (p : PAutState Q) : RelPath R p [] p
- cons {Q S : Type} {R : PAutState Q → S → PAutState Q → Prop} {p m r : PAutState Q} {Z : S} {γ : List S} : R p Z m → RelPath R m γ r → RelPath R p (Z :: γ) r
Instances For
The NFA whose transitions are exactly a stack-reading relation.
Equations
- DPDA.relNFA R start accept = { step := fun (p : DPDA.PAutState Q) (Z : S) => {r : DPDA.PAutState Q | R p Z r}, start := {start}, accept := accept }
Instances For
The DFA obtained by subset construction from a stack-reading relation.
Equations
- DPDA.relDFA R start accept = (DPDA.relNFA R start accept).toDFA
Instances For
The relation recognized from an original control state by the relation DFA.
A relation is saturated for the epsilon rules of a DPDA if every pushdown epsilon step can be summarized by a single stack-reading transition.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Base target relation for stopping epsilon phases. A control state with no epsilon transition on the current top symbol is a target; the sink consumes the unexamined suffix.
Equations
- M.stopTargetBase (Sum.inl q) x✝ (Sum.inr PUnit.unit) = (M.epsilon_transition q x✝ = none)
- M.stopTargetBase (Sum.inr PUnit.unit) x✝ (Sum.inr PUnit.unit) = True
- M.stopTargetBase x✝² x✝¹ x✝ = False
Instances For
Empty stack is stable for every control state; after detecting a stable top, the sink accepts the remaining suffix.
Equations
Instances For
Base target relation for epsilon reachability to a final state.
Equations
- M.finalTargetBase (Sum.inl q) x✝ (Sum.inr PUnit.unit) = (q ∈ M.final_states)
- M.finalTargetBase (Sum.inr PUnit.unit) x✝ (Sum.inr PUnit.unit) = True
- M.finalTargetBase x✝² x✝¹ x✝ = False
Instances For
Accepting P-automaton states for final-state epsilon reachability.
Equations
- M.finalTargetAccept (Sum.inl q) = (q ∈ M.final_states)
- M.finalTargetAccept (Sum.inr PUnit.unit) = True
Instances For
A relation preserves a target stack language if one transition consumes one stack symbol while preserving target membership for every suffix.
Equations
- DPDA.RelationPreservesTarget R Target = ∀ {p r : DPDA.PAutState Q} {Z : S}, R p Z r → ∀ (δ : List S), Target r δ → Target p (Z :: δ)
Instances For
Semantic target for stopping: controls represent genuine DPDA configurations; the sink means the target has already been reached and the rest of the stack is ignored.
Equations
- M.stopTarget (Sum.inl q) x✝ = ∃ (cstable : DPDA.EpsilonConf Q S), M.EpsilonStopsAt (q, x✝) cstable
- M.stopTarget (Sum.inr PUnit.unit) x✝ = True
Instances For
Semantic target for final-state epsilon reachability.
Equations
- M.finalTarget (Sum.inl q) x✝ = ∃ (qf : Q) (γf : List S), M.EpsilonReaches (q, x✝) (qf, γf) ∧ qf ∈ M.final_states
- M.finalTarget (Sum.inr PUnit.unit) x✝ = True