Documentation

Complexitylib.Circuits.BarringtonCodeGenerator

Bitstring-level Barrington code generator #

barringtonCompileCode is the exact total function targeted by the remaining uniformity proof. On a canonical postfix formula code it emits the canonical code of barringtonCompile formula barringtonTargetBase; malformed inputs map to the empty string.

This module proves the complete extensional specification independently of a machine implementation: output decoding recovers the executable program, its evaluation matches the source formula, and its instruction count is at most 4 ^ depth. The next layer must realize this particular function in FL.

Main results #

theorem Complexity.formula_variable_le_code_length (formula : BoolFormula) (index : ) (hindex : index formula.vars) :
index (FormulaCode.encode formula).length

Every variable referenced by a formula is at most its canonical code length.

@[simp]

On canonical formula input, the generator emits exactly the canonical encoding of the executable Barrington compiler's result.

Decoding generated code recovers the executable compiler's program.

Exact generated-code length on canonical formula input.

Serialized generated output is bounded by the Barrington instruction bound times the source-code length needed for each terminated-unary variable field.

Bitstring-level constructive Barrington theorem. Generated code decodes to a program with exact formula semantics through the fixed nonidentity target cycle and instruction count at most 4 ^ depth.