Documentation

Complexitylib.Models.RandomAccessMachine.Simulation.TMConfig.Sparse.ABI.Internal.Resources

Resource bounds for the public sparse-simulator ABI -- proof internals #

The simulation core uses StepEnvelope. During the backward input copy only the writable value scratch register can temporarily exceed the core word bound; MarshalEnvelope records that exception while retaining the same finite index support. The first captured-position repair reloads that scratch register from the sparse data region, returning to the core envelope before simulation.

structure Complexity.RAM.TMConfig.Sparse.MarshalEnvelope {n : } (tm : TM n) (bound valueLimit : ) (store : Structured.Store) :

Temporary marshalling envelope. Every register except valueReg already fits the core word bound; the value scratch may use the larger valueLimit.

Instances For
    theorem Complexity.RAM.TMConfig.Sparse.MarshalEnvelope.storeEnvelope {n : } {tm : TM n} {bound valueLimit : } {store : Structured.Store} (henvelope : MarshalEnvelope tm bound valueLimit store) :
    Structured.Internal.StoreEnvelope (registerBound n (bound + 1)) valueLimit store
    theorem Complexity.RAM.TMConfig.Sparse.StepEnvelope.toMarshalEnvelope {n : } {tm : TM n} {bound valueLimit : } {store : Structured.Store} (henvelope : StepEnvelope tm bound store) (hlimit : wordBound tm bound valueLimit) :
    MarshalEnvelope tm bound valueLimit store
    theorem Complexity.RAM.TMConfig.Sparse.decisionTimeBound_mono_steps_internal {n : } (tm : TM n) (inputLength : ) {steps larger : } (hle : steps larger) :
    decisionTimeBound tm inputLength steps decisionTimeBound tm inputLength larger

    The backward-copy loop has an exact source-step count, linear logarithmic cost, and a finite sparse-store envelope.

    theorem Complexity.RAM.TMConfig.Sparse.extractVerdict_measured_internal {n : } {tm : TM n} {bound : } {halted : Complexity.Cfg n tm.Q} {store : Structured.Store} (hrepresents : Represents tm halted store) (henvelope : StepEnvelope tm bound store) :

    The verdict extractor stays in the core envelope and has the standard four-width-per-basic-instruction cost bound.

    theorem Complexity.RAM.TMConfig.Sparse.repairCaptured_measured_internal {n : } {tm : TM n} {bound valueLimit : } {captured : List ( × )} {store : Structured.Store} (hentries : entrycaptured, entry.1 bound + 1 entry.2 1) (hnonempty : captured []) (henvelope : MarshalEnvelope tm bound valueLimit store) (hwordLimit : wordBound tm bound valueLimit) :
    ∃ (final : Structured.Store) (steps : ), Structured.Internal.MeasuredRuns (repairCaptured n captured) store final steps (captured.length * (27 * (bitlen valueLimit + 1))) (Structured.Internal.envelopeSpace (registerBound n (bound + 1)) valueLimit) final = repairStore n captured store StepEnvelope tm bound final

    A selected capture-tree leaf carries the public input through copy, repair, and initialization within one concrete resource envelope.

    The full public-input marshaller has a concrete resource certificate and hands the simulation core an exact sparse representation.

    theorem Complexity.RAM.TMConfig.Sparse.decisionProgram_measured_internal {n : } {tm : TM n} {steps : } {x : List Bool} {halted : Complexity.Cfg n tm.Q} (hreach : tm.reachesIn steps (tm.initCfg x) halted) (hhalted : tm.halted halted) :
    ∃ (final : Structured.Store) (sourceSteps : ), Structured.Internal.MeasuredRuns (decisionProgram tm) (initRegs x) final sourceSteps (decisionTimeBound tm x.length steps) (spaceBound tm (marshalBound n x.length + steps)) final stateReg = symbolCode (halted.output.cells 1) - 1

    End-to-end public-ABI execution with concrete time and space bounds.

    theorem Complexity.RAM.TMConfig.Sparse.compiledDecision_resourceBound_internal {n : } {tm : TM n} {steps : } {x : List Bool} {halted : Complexity.Cfg n tm.Q} (hreach : tm.reachesIn steps (tm.initCfg x) halted) (hhalted : tm.halted halted) :
    ∃ (final : Structured.Store) (sourceSteps : ) (cost : ) (space : ), Structured.Exec (decisionProgram tm) (initRegs x) final sourceSteps cost space cost decisionTimeBound tm x.length steps space spaceBound tm (marshalBound n x.length + steps) run (compiledDecision tm) sourceSteps (initCfg x) = { pc := (decisionProgram tm).codeSize, regs := final } Halted (compiledDecision tm) (run (compiledDecision tm) sourceSteps (initCfg x)) logTimeUpto (compiledDecision tm) sourceSteps (initCfg x) = cost spaceUpto (compiledDecision tm) sourceSteps (initCfg x) = space final stateReg = symbolCode (halted.output.cells 1) - 1

    Concrete compiled-RAM transfer of the end-to-end resource certificate.