Documentation

Complexitylib.Models.TuringMachine.Experimental.BinaryRoutine.Defs

Proof-carrying binary stream routines -- definitions #

A binary routine operates on a vector of natural numbers represented by canonical rewound Nat.bits tapes. It may update that pure vector and append a value-dependent word to an output accumulator. A value-level precondition supports honest partial leaves such as positive predecessor and zero-scratch copying without weakening the canonical state model.

@[reducible, inline]

Pure values represented by all work tapes of a binary routine.

Equations
Instances For

    Canonical rewound tape representation of one natural number.

    Equations
    Instances For

      Canonical work-tape vector corresponding to values.

      Equations
      Instances For
        def Complexity.BinaryRoutine.CanonicalPred {n : } (inp₀ : Tape) (values : BinaryValues n) (ys : List Bool) :

        A fixed parked input, canonical binary work vector, and append accumulator.

        Equations
        Instances For
          structure Complexity.BinaryRoutine (n : ) :

          A concrete streaming machine paired with its pure value effect, emitted word, domain, and explicit time/all-prefix-space bounds.

          • machine : TM n

            Concrete machine implementing the routine.

          • requires : BinaryValues nProp

            Pure value-level domain on which the routine contract holds.

          • effect : BinaryValues nBinaryValues n

            Exact pure work-vector effect.

          • emitted : BinaryValues nList Bool

            Exact word appended from each starting value vector.

          • timeBound : BinaryValues n

            Time bound from each starting value vector.

          • spaceBound : BinaryValues n

            All-prefix auxiliary-space bound from an initial work budget.

          Instances For
            structure Complexity.BinaryRoutine.Sound {n : } (routine : BinaryRoutine n) :

            Soundness of a proof-carrying routine on every canonical state in its value-level domain. The input tape is fixed and parked for each invocation; initialSpace ≥ 1 covers the canonical work heads at cell one.

            Instances For

              Append a fixed word without changing the binary work vector.

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

                Empty fixed-word emission is the canonical routine identity.

                Equations
                Instances For

                  Sequential composition, including the concrete seqTM seam step.

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

                    Replace a routine's public pure precondition while preserving its concrete machine, effect, emitted word, and resource bounds exactly. Soundness requires the replacement precondition to imply the original one.

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

                      Increment one canonical binary work value.

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

                        Decrement one positive canonical binary work value.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Complexity.BinaryRoutine.binaryCopy {n : } (srcIdx dstIdx counterIdx : Fin n) :

                          Copy one canonical binary value into another using a zero scratch counter.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            def Complexity.BinaryRoutine.emitRawGateStep {n : } (op : AndOrOp) (negated₀ negated₁ : Bool) (emitCounterIdx availableIdx input₀Idx input₁Idx : Fin n) :

                            Emit one raw gate and advance the first-unused-wire value.

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