Machine-facing encoding of width-five branching programs #
This file defines a deterministic, proof-free bit format for the width-5
permutation branching programs produced by Barrington's theorem. Permutations
are represented by their rank in the computable S₅ enumeration, using seven
bits because |S₅| = 120 < 2^7. Variable indices and the instruction count use
the existing terminated-unary circuit codec.
An instruction is encoded as its variable field followed by two fixed-width permutation fields. A program starts with its instruction count, so exact decoding rejects truncation and trailing garbage.
Number of bits in the canonical rank encoding of an S₅ permutation.
Equations
Instances For
The fixed computable table used to rank and unrank S₅.
Instances For
The canonical table position of a permutation.
Equations
- Complexity.BPCode.Perm5.index permutation = List.idxOf permutation Complexity.BPCode.Perm5.table
Instances For
Encode an S₅ permutation by its seven-bit table position.
Equations
- Complexity.BPCode.Perm5.encode permutation = Complexity.BPCode.Perm5.bitWidth.toBits (Complexity.BPCode.Perm5.index permutation)
Instances For
Decode one fixed-width permutation field and return the unused suffix.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Encode one width-5 instruction as a terminated-unary variable followed
by its two seven-bit permutation ranks.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Decode exactly count instruction prefixes and return the unused suffix.
Equations
Instances For
Canonically encode a width-5 branching program.
Equations
- Complexity.BPCode.Program.encode program = Complexity.CircuitCode.NatCode.encode (List.length program) ++ List.flatMap Complexity.BPCode.Instr.encode program
Instances For
Decode exactly one width-5 branching program. Trailing bits are rejected.