Langlib

Langlib.Automata.DeterministicPushdown.Totalization

DPDA Totalization for Deterministic Context-Free Languages #

This module is the public import point for the totalization construction used by unconditional complement closure of deterministic context-free languages.

The implementation is split into:

The headline result, assembled here from those pieces, is DPDA.exists_equivalent_total: every DPDA has an equivalent total DPDA.

theorem DPDA.exists_equivalent_total {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] (M : DPDA Q T S) :
∃ (Q' : Type) (S' : Type) (x : Fintype Q') (x_1 : Fintype S') (M' : DPDA Q' T S'), M'.IsTotal M'.acceptsByFinalState = M.acceptsByFinalState

DPDA totalization. Every DPDA has an equivalent total DPDA: a DPDA that decides every input (DPDA.IsTotal) and recognizes the same language by final-state acceptance.

The witness is the analyzed totalizer of a regular epsilon analysis, which every finite DPDA admits (DPDA.hasRegularEpsilonAnalysis); totalizer_decides gives totality and totalizer_acceptsByFinalState_eq_original gives language equality.