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.
Instances For
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.
Instances For
Construct the state from its identically encoded field tuple.
Instances For
Expose a produced state as its nested field tuple without extra asymptotic cost.
Instances For
Read a fixed register, using the complete tuple input-length guarantee.
Instances For
Gather a fixed tuple of operand registers, permitting repeated indices.
Instances For
Update a fixed register and retain all other state fields.
Instances For
Validate a moved value before updating a fixed register.
Instances For
Read sparse memory, with the parameterized scan bound and explicit default.
Instances For
Write sparse memory, with the parameterized scan bound and complete retained state.
Instances For
Implement one fixed operation from scalar, tuple and sparse-memory certificates.
Instances For
Validate a fixed continuing label and emit the updated state.
Instances For
Implement a fixed instruction, charging only the selected outcome branches.
Instances For
Compare the current binary control label to a fixed label using native word comparison.
Instances For
Dispatch a fixed program by comparisons, charging each preceding rejected label.
Instances For
Top-level runtime configuration projection from the step input.
Instances For
Top-level finite-state projection from the step input.
Instances For
Top-level operation certificate on the step input encoding.
Instances For
Top-level instruction certificate on the step input encoding.
Instances For
Top-level dispatch certificate on the step input encoding.
Instances For
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.
Instances For
Parameterized operation time on the step input encoding.
Instances For
Parameterized operation space on the step input encoding.
Instances For
Parameterized instruction time on the step input encoding.
Instances For
Parameterized instruction space on the step input encoding.
Instances For
Time charged by comparing the current control label against a fixed instruction offset.
Instances For
Space charged by comparing the current control label against a fixed instruction offset.
Instances For
Parameterized dispatch time from instruction offset pc.
Instances For
Parameterized dispatch space from instruction offset pc.
Instances For
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.
Instances For
Parameterized step space, also bounding the encoded output up to constants.
Instances For
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.