Documentation

Complexitylib.Models.TuringMachine.Subroutines.BinaryAdd.Defs

Canonical binary addition — definitions #

This module defines binary addition from the reusable canonical count-up loop. The source tape is the preserved loop limit, the destination is incremented once per source value, and a distinct scratch counter records loop progress. After the loop, the scratch tape is cleared back to canonical zero.

def Complexity.TM.binaryAddLoopTM {n : } (srcIdx dstIdx counterIdx : Fin n) :
TM n

Add the preserved canonical binary source into the destination, leaving the scratch counter equal to the source at loop exit.

Equations
Instances For
    def Complexity.TM.binaryAddIntoTM {n : } (srcIdx dstIdx counterIdx : Fin n) :
    TM n

    Add the preserved canonical binary source into the destination, then restore the scratch counter to canonical zero.

    Equations
    Instances For
      def Complexity.TM.binaryAddLoopTime (srcValue dstValue : ) :

      Exact running time of the count-up loop used for binary addition.

      Equations
      Instances For
        def Complexity.TM.binaryAddTime (srcValue dstValue : ) :

        Time bound for binary addition, including the composition seam and scratch clearing.

        Equations
        Instances For
          def Complexity.TM.binaryAddLoopSpace (initialSpace srcValue dstValue : ) :

          Honest all-prefix space bound for the addition loop. It depends on the binary widths of the source and largest destination value, not on total loop runtime.

          Equations
          Instances For
            def Complexity.TM.binaryAddSpace (initialSpace srcValue dstValue : ) :

            All-prefix space bound for addition followed by scratch clearing.

            Equations
            Instances For