Documentation

Complexitylib.Circuits.Encoding.Machine.Core.Defs

Streaming serialized-circuit evaluator core #

This file defines the finite controller that evaluates an already-staged tagged circuit code. The code tape is parsed once from left to right. The wire tape begins with the primary input and receives one appended Boolean value per gate. Unary references walk that memo tape directly, while the third work tape stores and consumes the declared unary gate count.

The local TapeAction layer packages the one-sided-tape safety obligation with each head action. Consequently evalFamilyCoreTM satisfies TM.δ_right_of_start structurally rather than through a large case proof.

One tape-head action together with its left-end safety proof.

  • write : Γw

    Writable symbol emitted at the current head.

  • dir : Dir3

    Direction taken after the write.

  • rightOfStart : head = Γ.startself.dir = Dir3.right

    The action moves right whenever it reads the left-end marker.

Instances For

    Preserve the scanned cell and keep an off-marker head stationary.

    Equations
    Instances For

      Preserve the scanned cell and move right.

      Equations
      Instances For

        Preserve the scanned cell and move left, bouncing right at .

        Equations
        Instances For

          Write a symbol and move right.

          Equations
          Instances For

            Write a symbol and keep an off-marker head stationary.

            Equations
            Instances For

              Finite phases of the fused tagged-code parser and memoized evaluator.

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

                    Named actions for the three evaluator work tapes and the output tape.

                    Instances For

                      Change only the controller phase and install TapeAction.preserve on every tape. This is exact tape preservation when the framed heads are off the left marker.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        def Complexity.CircuitCode.Machine.CoreAction.workWrite {wHeads : Fin workTapeCountΓ} {oHead : Γ} (action : CoreAction wHeads oHead) (i : Fin workTapeCount) :

                        Project the writable symbol for a named work tape.

                        Equations
                        Instances For
                          def Complexity.CircuitCode.Machine.CoreAction.workDir {wHeads : Fin workTapeCountΓ} {oHead : Γ} (action : CoreAction wHeads oHead) (i : Fin workTapeCount) :

                          Project the direction for a named work tape.

                          Equations
                          Instances For
                            theorem Complexity.CircuitCode.Machine.CoreAction.workDir_rightOfStart {wHeads : Fin workTapeCountΓ} {oHead : Γ} (action : CoreAction wHeads oHead) (i : Fin workTapeCount) :
                            wHeads i = Γ.startaction.workDir i = Dir3.right

                            Every projected work action moves right when its head reads .

                            Boolean AND/OR selected by the serialized operation bit.

                            Equations
                            Instances For

                              Halt with an explicit rejecting write, installing TapeAction.preserve on the work tapes.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Complexity.CircuitCode.Machine.CoreAction.finish (answer : Bool) (wHeads : Fin workTapeCountΓ) (oHead : Γ) :
                                CoreAction wHeads oHead

                                Halt with the supplied Boolean write, installing TapeAction.preserve on the work tapes.

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

                                  Move the code head right and install TapeAction.preserve on every other tape.

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

                                    Move the wire head right and install TapeAction.preserve on every other tape.

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

                                      Read one Boolean code symbol, moving right on success and rejecting any non-Boolean symbol.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        def Complexity.CircuitCode.Machine.coreAction (phase : CorePhase) (wHeads : Fin workTapeCountΓ) (oHead : Γ) :
                                        CoreAction wHeads oHead

                                        One finite-control action of the streaming evaluator.

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

                                          Streaming evaluator for a valid outer pair after validPairStageTM.

                                          The core itself remains total: malformed tagged codes and invalid references write zero and halt.

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

                                            Uniform quadratic time budget for evaluating a staged tagged-family code. The arguments are the serialized code length and primary-input length.

                                            Equations
                                            Instances For
                                              def Complexity.CircuitCode.Machine.FamilyCorePre (codeBits inputBits : List Bool) (initialInput inp : Tape) (work : Fin workTapeCountTape) (out : Tape) :

                                              Staged tapes expected by the serialized-family evaluator core. The input tape is threaded as an explicit frame while the code and primary-input work tapes are parked at their append frontiers and the counter tape is fresh.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                def Complexity.CircuitCode.Machine.FamilyCorePost (codeBits inputBits : List Bool) (initialInput inp : Tape) (_work : Fin workTapeCountTape) (out : Tape) :

                                                Halted defaulted-verdict contract for the serialized-family evaluator core. Malformed codes and successful false evaluations both write zero. The terminal work tapes are intentionally unconstrained because rejecting parses halt at different code, memo, and counter cursor positions.

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

                                                  Total serialized-family evaluator: validate and stage the outer pair, then run the streaming core only on the valid branch.

                                                  Equations
                                                  Instances For

                                                    Concrete end-to-end time budget for validating, staging, and evaluating a serialized circuit-family input of length n.

                                                    Equations
                                                    Instances For

                                                      Halted end-to-end contract for the serialized-family evaluator. The input cells retain the original encoding and the output carries the defaulted paired evaluation verdict with its canonical head and left-marker invariant. Terminal work tapes are intentionally unconstrained across valid and rejecting branches.

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