Langlib

Langlib.Automata.FiniteState.Inclusion.DeterministicPushdown

Finite Automata Included in Deterministic Pushdown Automata #

This file proves the inclusion directly on automata. A DFA is simulated by a DPDA whose stack alphabet is Unit: every input transition updates the finite control exactly as the DFA does and replaces the sole stack symbol by itself. An NFA is first determinized by the subset construction and then passed through the same simulation.

Main results #

def DPDA_of_DFA {T : Type} [Fintype T] {Q : Type} [Fintype Q] (M : DFA T Q) :

A DPDA that simulates a DFA while leaving its one-symbol stack unchanged.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem DPDA_of_DFA_reaches {T : Type} [Fintype T] {Q : Type} [Fintype Q] (M : DFA T Q) (q : Q) (w : List T) :
    PDA.Reaches { state := q, input := w, stack := [()] } { state := M.evalFrom q w, input := [], stack := [()] }

    The simulating DPDA can follow every DFA run without changing its stack.

    theorem DPDA_of_DFA_reaches_unique {T : Type} [Fintype T] {Q : Type} [Fintype Q] (M : DFA T Q) (q : Q) (w : List T) (q' : Q) (γ : List Unit) (h : PDA.Reaches { state := q, input := w, stack := [()] } { state := q', input := [], stack := γ }) :
    q' = M.evalFrom q w γ = [()]

    Any accepting run of the simulating DPDA is the corresponding DFA run.

    The stack-ignoring DPDA accepts exactly the language of its source DFA.

    theorem is_DPDA_of_is_DFA {T : Type} [Fintype T] {L : Language T} (hL : is_DFA L) :

    Every language accepted by a DFA is accepted by a DPDA, via DPDA_of_DFA.

    DFA-recognizable languages form a subclass of DPDA-recognizable languages.

    theorem is_DPDA_of_is_NFA {T : Type} [Fintype T] {L : Language T} (hL : is_NFA L) :

    Every language accepted by an NFA is accepted by a DPDA. The construction first uses the finite subset construction and then DPDA_of_DFA.

    NFA-recognizable languages form a subclass of DPDA-recognizable languages.