Arithmetic access to the canonical structure encoding #
Base-card tuple indices and prefix sums give exactly the bit positions defined
by the original site enumeration. The equalities include arbitrary relation
arities, nullary relations, and the one-hot blocks for distinguished constants.
Consequently the arithmetic addresses recover the encoded relation and constant
bits, without changing the wire format.
Fixed-width base expansion recovers the tuple coordinates; scanning the numeric
indices reproduces the encoder's tuple enumeration exactly.
Each extracted coordinate is a base-card digit, including at cardinality zero.
A tuple of valid coordinates has an index inside its relation truth table.
Every extracted coordinate lies in a positive-cardinality universe.
Arithmetic relation addresses equal the existing enumeration-based positions.
Arithmetic constant addresses equal the existing one-hot positions.
Reading the arithmetic relation address returns the corresponding relation bit.
Reading the arithmetic constant address tests equality with the distinguished element.