Documentation

Complexitylib.Models.TuringMachine.Subroutines.BinaryEq.Defs

Binary work-tape equality — definitions #

TM.binaryEqTM compares two canonical binary strings and writes the Boolean result on a third work tape. Unlike the legacy output-oriented comparator, it preserves the public output tape and every unrelated work tape.

The binary comparator scans until the first mismatch or simultaneous termination, then halts immediately.

Instances For
    structure Complexity.TM.BinaryEqDistinct {n : } (lhsIdx rhsIdx resultIdx : Fin n) :

    Pairwise distinct work tapes used by binaryEqTM.

    • lhs_rhs : lhsIdx rhsIdx
    • lhs_result : lhsIdx resultIdx
    • rhs_result : rhsIdx resultIdx
    Instances For
      def Complexity.TM.binaryEqTM {n : } (lhsIdx rhsIdx resultIdx : Fin n) :
      TM n

      Compare canonical binary strings on lhsIdx and rhsIdx, writing one to resultIdx exactly when they agree. The compared heads advance together over matching bits; all tape contents are preserved except the single result cell.

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

        Linear scan bound for binary equality.

        Equations
        Instances For