Batch compilation of Boolean formulas #
This module exposes finite Boolean-formula combinators and a batch compiler
that turns a list of formulas into appendable raw circuit syntax. Every source
formula is evaluated against the incoming prefix; a final copy phase places
all results in one contiguous block starting at rawBatchOutputBase.
Main definitions and results #
BoolFormula.literal,conjs, anddisjs: small formula constructors.BoolFormula.compileRawOutputs: sequential variable-sized compilation.BoolFormula.compileRawBatch: sequential compilation plus output packing.BoolFormula.length_compileRawBatch: exact gate count.BoolFormula.topologicallyWellFormed_compileRawBatch: backward references.BoolFormula.evalAux?_compileRawBatch: exact packed-output semantics.
Finite conjunction evaluates as Boolean List.all.
Finite disjunction evaluates as Boolean List.any.
Exact tree size of a finite conjunction.
Exact tree size of a finite disjunction.
Sequential compilation emits the sum of the formula tree sizes.
Sequential compilation records exactly one output per formula.
A packed batch emits every formula gate and one final copy per formula.
If every formula variable names an incoming wire, the entire packed batch is topologically well formed.
Batch evaluation preserves the incoming memo array and packs source formula values into a contiguous final block, in source order.