Finite configurations for RAM simulation #
A configuration stores a finite register tuple, a natural control label, an explicit default value, and a distinct-key sparse memory. Its denotation is a generic RAM state. Denotation need not be injective: recording a default-valued cell and omitting that cell have the same semantics.
Dispatch walks a fixed finite program, comparing the current label with fixed instruction positions. Successor labels are fixed by those positions. This decomposition supports a native machine for each fixed program without requiring a uniform interpreter for encoded programs.
Main definitions #
FiniteState: finite configurations with a uniform, explicitly supplied memory default.FiniteState.step: one finite-state step, including every generic RAM check and fault.
Main results #
FiniteState.denote_step: exact one-step refinement, including continuation, halt and fault.
References #
Uses the generic RAM semantics and Mathlib's association-list memory representation.
Finite data from which a total RAM state is interpreted.
- pc : ℕ
Current instruction label.
Fixed finite register tuple.
- default : M.Value
Value returned by an absent memory binding.
- memory : SparseMemory M.Address M.Value
Distinct stored addresses, including explicitly stored default-valued cells.
Instances For
Interpret sparse memory using the supplied default. This map is not required to be injective.
Instances For
Replace one register, preserving control and memory.
Instances For
Replace one memory binding, preserving control, registers and the default.
Instances For
Validate an existing value before moving it into a register.
Instances For
Finite execution of a fixed data instruction. Checked producers include admissibility.
Instances For
Moving a value commutes with interpretation, including invalid moves.
Finite data execution has exactly the generic data semantics, including failure.
The three finite outcomes use ordinary option and sum encodings.
Instances For
Check the continuation label before returning the updated configuration.
Instances For
Execute a fixed instruction with a fixed ordinary successor label.
Instances For
Search fixed instruction positions. The successor is fixed at the matching position.
Instances For
A finite-state step checks the current label before fixed-program dispatch.
Instances For
Dispatch agrees with indexed lookup wherever the current label is at or above the offset.
Exact one-step refinement for arbitrary finite configurations, including all faults. No validity premise on the memory default or the initial registers is hidden in the theorem.