Documentation

Complexitylib.Classes.P.Cobham.Internal.Reorder

Dropping the third component of a triple — proof internals #

Cobham.reorder turns pair A (pair B C) into pair A B: copy the leading block verbatim, then decode the next block's payload. It is the one machine the comp constructor needs, via Cobham.pairFn_mem_FP.

Main results #

Drop the third component of a right-nested triple. Copy doubled payload bits verbatim until the [false, true] separator, then decode the next block's payload (fstBlock). On a valid triple this satisfies reorder (pair A (pair B C)) = pair A B (reorder_pair_pair). The incremental recursion (writing before knowing validity) is what the reorderTM scanner computes; it is total and needs no sub-machines.

Equations
Instances For

    Control states of reorderTM: skip the marker; phase 1 (rcopyA/rcopyBf/ rcopyBt) copies doubled pairs verbatim until the separator; phase 2 (rdecA/rdecBf/rdecBt) decodes the next block's payload; then halt.

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

      The reorder transducer computing reorder: copy the leading block verbatim (phase 1) up to and including the [false,true] separator, then decode and emit the payload of the following block (phase 2).

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

        reorder is polynomial-time, via the reorderTM scanner.