Documentation

Complexitylib.Interop.Mathlib.TM0.Alphabet.Defs

Marked tape computations over finite input and output alphabets #

The binary simulator parses explicit finite-alphabet codewords before writing source cells. It rejects malformed codes before starting the source. Source execution reuses symbol tracks, and output emission writes complete codewords. Input and output alphabets and their chosen numberings are independent.

structure Complexity.MathlibTM0.AlphabetMachine (Input Output : Type) :

A finite tape machine with marked input symbols and a separate output alphabet.

Instances For
    @[reducible, inline]

    Reuse the existing source simulator; its binary endpoints are never entered.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Complexity.MathlibTM0.AlphabetMachine.inputCells {Input Output : Type} (M : AlphabetMachine Input Output) :
      Bool → List Input → List M.Alphabet

      Source cells for a complete input or an unmarked suffix.

      Equations
      Instances For
        def Complexity.MathlibTM0.AlphabetMachine.OutputsWithin {Input Output : Type} (M : AlphabetMachine Input Output) (input : List Input) (output : List Output) (time : ℕ) :

        A bounded source run specifying every decoded output cell.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          inductive Complexity.MathlibTM0.AlphabetMachine.Phase (inputSize outputSize : ℕ) (Q : Type) :

          Parse a symbol code, rewind, run the existing simulator, or finish a codeword.

          • copy {inputSize outputSize : ℕ} {Q : Type} : Bool → Option (Fin (inputSize + 1)) → Phase inputSize outputSize Q

            none waits for an opening delimiter; some i counts unary index bits.

          • rewind {inputSize outputSize : ℕ} {Q : Type} : Bool → Phase inputSize outputSize Q

            Moving backwards alternates between closing and opening delimiters.

          • source {inputSize outputSize : ℕ} {Q : Type} : Control Q → Phase inputSize outputSize Q

            Existing source execution control; emission is replaced by encoded output.

          • emit {inputSize outputSize : ℕ} {Q : Type} : Fin (outputSize + 1) → Phase inputSize outputSize Q

            Emit the remaining unary index bits and then the closing delimiter.

          Instances For
            @[instance_reducible]
            instance Complexity.MathlibTM0.AlphabetMachine.instFintypePhase {inputSize✝ outputSize✝ : ℕ} {Q✝ : Type} [Fintype Q✝] :
            Fintype (Phase inputSize✝ outputSize✝ Q✝)
            Equations
            • One or more equations did not get rendered due to their size.
            def Complexity.MathlibTM0.AlphabetMachine.pause {k : ℕ} {Q : Type} (state : Option Q) (output : Option Bool) (move : SignType) :

            An action preserving every work tape and head.

            Equations
            Instances For
              noncomputable def Complexity.MathlibTM0.AlphabetMachine.machine {Input Output : Type} (M : AlphabetMachine Input Output) (input : FiniteAlphabetCode Input) (output : FiniteAlphabetCode Output) :

              Parse finite-alphabet inputs, simulate the source, and encode its complete output.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For