Arithmetic addresses in structure encodings #
The encoder varies the first tuple coordinate fastest. Its tuple index is thus
the little-endian base-card numeral of the coordinates. Relation addresses add
the unary header and the lengths of earlier relation tables. Constant addresses
skip all relation tables and then the preceding one-hot blocks.
Coordinates are natural numbers in these computations; the correctness theorems
specialize to coordinates in Fin card. This interface permits direct use of
polynomial-time unary arithmetic without enumerating the tuple universe.
tupleDigits also decodes a numeric index to its fixed-width coordinates, for
writing truth tables in the same order.
Little-endian base-card index, matching the first-coordinate-fastest tuple order.
Equations
- Complexity.DescriptiveComplexity.tupleIndex card x_2 = 0
- Complexity.DescriptiveComplexity.tupleIndex card args = args 0 + card * Complexity.DescriptiveComplexity.tupleIndex card fun (i : Fin n) => args i.succ
Instances For
Recover the fixed-width little-endian base-card coordinates of a tuple index.
Equations
- Complexity.DescriptiveComplexity.tupleDigits card 0 x✝ = Fin.elim0
- Complexity.DescriptiveComplexity.tupleDigits card k.succ x✝ = Fin.cons (x✝ % card) (Complexity.DescriptiveComplexity.tupleDigits card k (x✝ / card))
Instances For
Arithmetic position of a relation-table bit in the full structure encoding.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Arithmetic position of a constant's one-hot bit in the full structure encoding.