Documentation

Complexitylib.Models.RandomAccessMachine.Simulation.RegisterStore.DenseOverlay.Defs

Dense public input with a sparse mutable overlay -- definitions #

The ordinary sparse snapshot eagerly materializes every nonzero public-input register. That representation is convenient but occupies Theta(n log n) cells before the RAM executes a step. This module separates the immutable input bank from the mutable register overlay.

An overlay entry (address, tag) represents the actual value tag - 1. Because every stored tag is positive, an absent address is distinguishable from an explicit write of zero (tag = 1). Absent reads fall through to the dense public-input ABI RAM.initRegs input.

@[reducible, inline]

Mutable tagged entries layered over the immutable public-input bank.

Equations
Instances For
    def Complexity.RAM.RegisterStore.DenseOverlay.read (input : List Bool) (overlay : Store) (address : ) :

    Read through the sparse tagged overlay, falling back to the public input.

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

      Record an explicit mutable value. The positive tag preserves written zero.

      Equations
      Instances For
        @[reducible, inline]

        A valid overlay has unique addresses and positive tags.

        Equations
        Instances For

          Register zero is materialized in every concrete overlay. This lets the dense-input lookup specialize its fallback path to positive input addresses.

          Equations
          Instances For

            Decode the dense-input/overlay pair to a total RAM register file.

            Equations
            Instances For

              A finite mutable overlay plus program counter. The immutable input remains on the Turing input tape and is not duplicated in this snapshot.

              • pc :

                Current RAM program counter.

              • overlay : Store

                Sparse positive-tag overlay.

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

                  Decode one dense-overlay snapshot against its immutable public input.

                  Equations
                  Instances For

                    Reuse the checked sparse snapshot codec for the tagged mutable overlay.

                    Equations
                    Instances For

                      The initial mutable overlay materializes only R₀ = input.length; all input bits remain in the read-only dense bank. The stored positive tag is input.length + 1.

                      Equations
                      Instances For

                        Instruction selected by the current program counter.

                        Equations
                        Instances For

                          Execute one RAM instruction against the decoded input/overlay register file, recording the result as a positive tag.

                          Equations
                          Instances For

                            Execute the instruction selected by the current program counter.

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

                              Fuel-bounded dense-overlay execution, stopping once halted.

                              Equations
                              Instances For