Documentation

Complexitylib.Interop.Mathlib.TM0.Alphabet.Internal.Emission

Emitting finite-alphabet codewords #

Reading a source letter emits its opening delimiter. Finite control then emits its unary index and closing delimiter. A complete output costs exactly its binary encoded length plus one final halting transition.

Output emission from the represented source tape.

Instances For
    structure Complexity.MathlibTM0.AlphabetMachine.Pending {Input Output : Type} (M : AlphabetMachine Input Output) (ci : FiniteAlphabetCode Input) (co : FiniteAlphabetCode Output) {w : List Bool} (n : Fin (co.size + 1)) (tape : Turing.Tape M.simulatorSource.binary.Alphabet) (emitted : List Bool) (d : Turing.Cfg (Fintype.card M.simulatorSource.binary.Alphabet) Bool (Phase ci.size co.size M.State) w) :

    A symbol's opening delimiter has been emitted; its index and closing delimiter remain.

    Instances For
      theorem Complexity.MathlibTM0.AlphabetMachine.pending_run {Input Output : Type} (M : AlphabetMachine Input Output) (ci : FiniteAlphabetCode Input) (co : FiniteAlphabetCode Output) (n : ℕ) (hn : n < co.size + 1) {w : List Bool} {tape : Turing.Tape M.simulatorSource.binary.Alphabet} {emitted : List Bool} {d : Turing.Cfg (Fintype.card M.simulatorSource.binary.Alphabet) Bool (Phase ci.size co.size M.State) w} (h : M.Pending ci co ⟨n, hn⟩ tape emitted d) :
      theorem Complexity.MathlibTM0.AlphabetMachine.Emitting.start {Input Output : Type} (M : AlphabetMachine Input Output) (ci : FiniteAlphabetCode Input) (co : FiniteAlphabetCode Output) {w : List Bool} {tape : Turing.Tape M.simulatorSource.binary.Alphabet} {emitted : List Bool} {d : Turing.Cfg (Fintype.card M.simulatorSource.binary.Alphabet) Bool (Phase ci.size co.size M.State) w} (h : M.Emitting ci co tape emitted d) (a : Output) (ha : M.readSymbol (MarkedMachine.Symbol.value tape.head) = some a) :
      theorem Complexity.MathlibTM0.AlphabetMachine.Emitting.run {Input Output : Type} (M : AlphabetMachine Input Output) (ci : FiniteAlphabetCode Input) (co : FiniteAlphabetCode Output) {w : List Bool} (output : List Output) {tape : Turing.Tape M.simulatorSource.binary.Alphabet} {emitted : List Bool} {d : Turing.Cfg (Fintype.card M.simulatorSource.binary.Alphabet) Bool (Phase ci.size co.size M.State) w} (h : M.Emitting ci co tape emitted d) (ho : ∀ (j : ℕ), M.readSymbol (MarkedMachine.Symbol.value (tape.nth ↑j)) = output[j]?) :
      (Turing.MultiTapeTM.runFrom d ((co.encode output).length + 1)).state = none ∧ (Turing.MultiTapeTM.runFrom d ((co.encode output).length + 1)).output = emitted ++ co.encode output