Totalization Construction #
This file defines the analyzed DPDA totalizer A from a RegularEpsilonAnalysis A
of M and proves it is an equivalent deciding presentation of the original
final-state DPDA.
The totalizer has finite control TotalState Q (init, sim q b, drain), where
the boolean b records whether M would accept if the input ended at the current
stack, recomputed from the stored stack summaries (AnnotatedStack). On each input
symbol it follows M's input transition where one exists; at a stack top whose
forced epsilon phase diverges (stopsFromSummary false) or where M has no move it
goes to the rejecting drain state and consumes the rest of the input. Its epsilon
transitions replay only stopping epsilon phases of M.
The two correctness results are totalizer_decides (totalizer_total for totality
and totalizer_final_consistent for acceptance consistency) and
totalizer_acceptsByFinalState_eq_original (same language).
Finite control states of the totalized DPDA. The boolean in sim records
whether the original machine would accept if the input ended at the current stack.
- init {Q : Type} : TotalState Q
- sim {Q : Type} : Q → Bool → TotalState Q
- drain {Q : Type} : TotalState Q
Instances For
Equations
- DPDA.instDecidableEqTotalState.decEq DPDA.TotalState.init DPDA.TotalState.init = isTrue ⋯
- DPDA.instDecidableEqTotalState.decEq DPDA.TotalState.init (DPDA.TotalState.sim a a_1) = isFalse ⋯
- DPDA.instDecidableEqTotalState.decEq DPDA.TotalState.init DPDA.TotalState.drain = isFalse ⋯
- DPDA.instDecidableEqTotalState.decEq (DPDA.TotalState.sim a a_1) DPDA.TotalState.init = isFalse ⋯
- DPDA.instDecidableEqTotalState.decEq (DPDA.TotalState.sim a a_1) (DPDA.TotalState.sim b b_1) = if h : a = b then h ▸ if h : a_1 = b_1 then h ▸ isTrue ⋯ else isFalse ⋯ else isFalse ⋯
- DPDA.instDecidableEqTotalState.decEq (DPDA.TotalState.sim a a_1) DPDA.TotalState.drain = isFalse ⋯
- DPDA.instDecidableEqTotalState.decEq DPDA.TotalState.drain DPDA.TotalState.init = isFalse ⋯
- DPDA.instDecidableEqTotalState.decEq DPDA.TotalState.drain (DPDA.TotalState.sim a a_1) = isFalse ⋯
- DPDA.instDecidableEqTotalState.decEq DPDA.TotalState.drain DPDA.TotalState.drain = isTrue ⋯
Instances For
Equations
- DPDA.instFintypeTotalState = Fintype.ofEquiv (Unit ⊕ (_ : Q✝) × Bool ⊕ Unit) (DPDA.TotalState.proxyTypeEquiv Q✝)
Replacement block for an original stack update above a known suffix summary.
Equations
- DPDA.annotatedReplacement A below β = DPDA.annotateAbove A below β
Instances For
Initial stack expansion: install the original start symbol above the permanent bottom.
Equations
Instances For
Equations
Instances For
Equations
Instances For
The finite-control state corresponding to an original state and a resulting stack summary.
Equations
- DPDA.simState A q summary = DPDA.TotalState.sim q (DPDA.acceptBit A q summary)
Instances For
The analyzed totalizer. It follows terminating epsilon phases of M, treats
divergent epsilon phases as stable decision points, and drains any remaining input
to a rejecting state when the original computation cannot consume the next symbol.
Equations
- One or more equations did not get rendered due to their size.