Created by: OpenAI Codex
Source: docs/creation/review/09-mov-register-machine-as-relational-seed.md
Status: exploratory model, 2026-11-25. This reframes the relation question around machine-state transitions. It is not an approved STREAM or Assemble specification.
The useful shift
Start not with a list of relation names, but with a state and an instruction that changes it. Let Loc be the set of locations, partitioned into registers, memory locations, and any other architecture-defined regions. A machine state is a valuation:
σ : Loc → Value
For a simple register-to-register move, the meaning is a state transformer:
MOV(d,s)(σ) = σ[d ↦ σ(s)]
Equivalently, the transition σ → σ' must satisfy:
σ'(d) = σ(s)
∀ℓ ≠ d: σ'(ℓ) = σ(ℓ)
This is already relational meaning as mathematics: it relates a source location, a destination location, the old state, and the new state. The equation says what the instruction accomplishes and what it leaves unchanged. An instruction sequence is composition of these state transformers; derivation is replay of the composed transitions.
Real instruction sets define precise operand, width, address, and fault rules. For example, Intel documents MOV as copying the source operand to the destination, with permitted operand classes and size constraints. The specific ISA supplies those rules; the idea of a state transformer does not depend on x86 syntax. (Intel instruction reference)
Where in, is, may, and to enter
The four relations can be recovered as different predicates or updates over this machine state—not four arbitrary payload slots:
in: location belongs to a region
Let R ⊆ Loc be a region such as the register bank, a stack frame, a log segment, or an authority scope. Then:
In(ℓ,R) ⇔ ℓ ∈ R
The region can itself be nested or derived. A memory operand’s effective address may be in a segment or page; a STREAM address may be in a log and segment. Region membership is a relation between a location and a boundary. It is not supplied by MOV alone: the architecture or system defines the regions and address interpretation.
is: a state value satisfies a predicate
For a predicate P over values:
Is(ℓ,P,σ) ⇔ P(σ(ℓ))
After a move, the destination inherits the source’s value under the transition equation, so any value predicate true of the source before the move is true of the destination afterward (assuming compatible width/conversion semantics). This gives a derivation rule, not merely a field called “kind.”
may: transition is enabled by the machine’s rules
An instruction transition is permitted only if its preconditions hold:
May(a, op, σ) ⇔ Guard(a,op,σ) = true
Guard can check operand validity, privilege, bounds, authority, and phase. This connects permission to executable state change: a forbidden transition has no successor state, or produces a defined refusal/fault record. The access-control rules still have to be specified; they do not arise from registers alone.
to: transition targets a location
to identifies the destination of a state update. For MOV, the destination receives a copy and the source remains unchanged. That is crucial: ordinary MOV is copy, not a conserved transfer or ownership move. If STREAM to means a transfer that debits one side and credits another, it needs different semantics, such as a paired delta:
h' = h + q(e_destination - e_source)
So the machine analogy clarifies that destination-ness is general, while conservation is a special operator contract. Confusing them would make to semantically overloaded.
The seed and what it can derive
The minimal seed need not begin with a catalog of named relations. It can begin with:
- a state
σover distinguishable locations; - a boundary/region predicate that says which locations are in scope;
- a transition form
op : State → State(possibly partial, when preconditions fail); - a trace that records the transition and enough context to replay it.
From these, derive:
- containment: location or form belongs to a region (
in); - valuation: the state at a location satisfies a predicate (
is); - admissibility: an actor may perform a transition under a guard (
may); - targeting: a transition writes or projects to a destination (
to); - history: the ordered composition of transitions, with before/after states;
- views: folds or projections of that history.
The operational core is therefore not “a thing plus labels,” but a bounded state plus legal transitions plus replayable trace. In an implementation, the register is the fast current state; the log is the durable transition history from which the register can be rebuilt and checked.
Implication for STREAM and Assemble
This may be a better bridge to Assemble because it describes how a system executes: resolve locations, check the guard, apply one state transition, record its operands/result, then compose the next transition. STREAM already has an append-only journal and derived Register/Books, so the analogy is particularly close to replay and incremental projections. It does not imply that every STREAM fact should imitate a CPU instruction or that its current verb byte should be replaced.
The important design question becomes: what is the smallest abstract machine whose instructions are the irreducible relation operators, and whose state contains only what is necessary to make their transitions deterministic and auditable?
Candidate abstract instruction signatures:
ENTER(region, location) // establish membership/binding
ASSERT(location, predicate, value) // state valuation
AUTHORIZE(principal, transition, scope, expiry)
APPLY(op, operands) // guarded state transition
EMIT(destination, value, mode) // copy, transfer, or derived projection
These names are provisional. A stronger design would reduce them further, perhaps making ENTER, ASSERT, and AUTHORIZE instances of a common guarded write, while preserving their distinct invariants. Whether that reduction works is a proof obligation, not a naming decision.
Limits of the analogy
Registers are already defined by an architecture. They do not explain how the first boundary, location identity, actor, or permission system comes into existence. Nor does MOV derive those concepts; it operates after the machine model has declared them. The analogy gives a clean execution semantics and a way to test derivations, but the bootstrap must still account for the initial state and the rules that make locations addressable.
Likewise, a real CPU’s register file is volatile, bounded, and optimized for execution. A STREAM log is persistent, shared, and evidentiary. The useful correspondence is the state-transition semantics, not a literal equivalence between CPU registers and business records.
Questions for the next derivation
- Is the primitive state a mapping from addresses to marks/values, or a set of relations whose current closure forms the state?
- Does a “mark” create a location, distinguish a location, or write a value into a location? These must not be silently conflated.
- Can
in,is, andmayall be represented as guarded state transitions while retaining their distinct laws? - Should
tomean destination, copy, transfer, or all three as separately typed modes? - Which facts are canonical transition instructions, and which are derived registers/views?
- What is the minimum trace needed so a second implementation computes the identical state and refusal outcomes?
- Can hot telemetry projections update from each transition delta while a full replay remains the correctness oracle?
Working conclusion
The MOV analogy improves the proposal because it turns relation semantics into a transition equation and makes the before/after state explicit. It also sharpens the distinctions: in is region membership, is is a predicate on state, may is a transition guard, and to is a target/update mode; a copy is not automatically a conserved transfer. The relation tree should therefore be derived as the algebra of a small abstract machine, with each node justified by its state effect and laws.