Native implementation of fixed-program finite RAM steps #
The input contains configuration and the complete finite state, including the memory default. All encodings are injective representations of finite data, rather than of the denoted total memory function. Native certificates are assembled directly from arbitrary scalar time/space bounds, fixed tuple manipulation and parameterized sparse-memory scans. No polynomiality premise or selection of polynomial bounds is used.
For each fixed program and register count, the resulting finite native machine works on every encoded input. Constants may depend on that fixed program; this is not an arbitrary-program interpreter. Initialization, iteration, output decoding and charged configuration selection remain separate obligations.
Main definitions #
FiniteState.encoding: binary control label, complete register tuple, default and sparse store.FiniteState.inputEncoding,FiniteState.resultEncoding: explicit step interface.FiniteState.stepCertificate,FiniteState.stepTime,FiniteState.stepSpace: native fixed-program step implementation and its parameterized time and space bounds.FiniteState.opTime,.opSpace,.instrTime,.instrSpace,.dispatchTime,.dispatchSpace: component cost profiles decomposed across operations, instructions, and program dispatch.
Main results #
FiniteState.length_encoding,FiniteState.length_encoding_le: encoded finite-state length formula and upper bound in terms of register count, register word bound, default length, and stored-cell count.FiniteState.step_inO: one finite native machine implementsFiniteState.stepfor all runtime configurations and finite states withinstepTimeandstepSpace.FiniteState.stepTime_eq,FiniteState.stepSpace_eq,FiniteState.dispatchTime_nil,FiniteState.dispatchTime_cons,FiniteState.dispatchSpace_nil,FiniteState.dispatchSpace_cons: public cost recurrences.FiniteState.le_opTime_const,FiniteState.le_opTime_alu,FiniteState.le_opTime_load,FiniteState.le_opTime_store,FiniteState.le_instrTime_op: retention of supplied scalar and sparse-memory resource bounds.
References #
Reuses Christian Reitwiessner's native machine calculus and the certified scalar/sparse-memory
interfaces; finite-state semantics is defined in Simulation.Finite.
Encode all finite state components, including the default and distinct stored bindings.
Exact bit length of an encoded finite state in terms of its four encoded fields.
Expose the state fields with exactly the same encoded word.
Construct the state from its identically encoded field tuple.
Expose a produced state as its nested field tuple without extra asymptotic cost.
Read a fixed register, using the complete tuple input-length guarantee.
Gather a fixed tuple of operand registers, permitting repeated indices.
Update a fixed register and retain all other state fields.
Validate a moved value before updating a fixed register.
Read sparse memory, with the parameterized scan bound and explicit default.
Write sparse memory, with the parameterized scan bound and complete retained state.
Implement one fixed operation from scalar, tuple and sparse-memory certificates.
Validate a fixed continuing label and emit the updated state.
Implement a fixed instruction, charging only the selected outcome branches.
Compare the current binary control label to a fixed label using native word comparison.
Dispatch a fixed program by comparisons, charging each preceding rejected label.
Top-level runtime configuration projection from the step input.
Top-level finite-state projection from the step input.
Top-level operation certificate on the step input encoding.
Top-level instruction certificate on the step input encoding.
Top-level dispatch certificate on the step input encoding.
A native finite machine for a fixed program, uniform in runtime configuration and state.
The certificate's bounds are constructed by sums, selected branches and substitution into the supplied scalar and sparse-memory bounds. Linear tuple manipulation is charged by input length or absorbed by a producer's output-length guarantee. Fixed control-label equality uses the native encoded comparison bound. No polynomial bound is selected by this construction.
Parameterized operation time on the step input encoding.
Parameterized operation space on the step input encoding.
Parameterized instruction time on the step input encoding.
Parameterized instruction space on the step input encoding.
Time charged by comparing the current control label against a fixed instruction offset.
Space charged by comparing the current control label against a fixed instruction offset.
Parameterized dispatch time from instruction offset pc.
Parameterized dispatch space from instruction offset pc.
Parameterized step time, obtained by explicit compositional accounting, not a chosen
polynomial. In particular it retains the time bounds supplied by N and sparse-memory scans.
Parameterized step space, also bounding the encoded output up to constants.
The actual native implementation satisfies the explicitly assembled time and space bounds. The existential machine and constant are outside the quantifier over all configurations/states; they may depend on the fixed program and register count.
Exact decomposition of stepTime into current-label validation and selected branch cost.
Exact decomposition of stepSpace into current-label validation and selected branch cost.
Step time recurrence on a non-empty program.
Step space recurrence on a non-empty program.
Literal operations retain the supplied constant-certificate time bound.
Literal operations retain the supplied constant-certificate space bound.
ALU operations retain the supplied operation-certificate time bound.
ALU operations retain the supplied operation-certificate space bound.
Load operations retain the parameterized sparse-memory read time when the address succeeds.
Load operations retain the parameterized sparse-memory read space when the address succeeds.
Store operations retain the parameterized sparse-memory write time on valid stores.
Store operations retain the parameterized sparse-memory write space on valid stores.
Data instructions retain their operation time bound.
Data instructions retain their operation space bound.