Proof-carrying program compaction #
Programs are rebuilt from left to right. A source gate is either copied to the
new program or identified with an existing wire. The constructors hide all
dependent Fin transport and preserve the complete source trace.
A semantics-preserving rebuilding of a program with no additional gates.
- gateCount : ℕ
Number of gates in the rebuilt program.
Rebuilt program.
- wireMap : Wire.Renaming n g self.gateCount
Translation of every source wire to its representative.
- trace_eq (input : Fin n → U) (wire : Wire n g) : self.result.trace interpretation input (self.wireMap.apply wire) = source.trace interpretation input wire
Every translated wire computes its original value.
The rebuilt program has no more gates than the source.
- cost_le (operationCost : Algebraic.OperationCost σ) : cost operationCost self.result ≤ cost operationCost source
Compaction does not increase any nonnegative operation cost.
Instances For
A semantics-preserving circuit compaction that does not increase cost.
- result : Circuit σ n m
Rebuilt circuit.
- eval_eq (input : Fin n → U) : self.result.eval interpretation input = source.eval interpretation input
Pointwise semantic preservation.
The rebuilt circuit has no more internal gates than the source.
- cost_le (operationCost : Algebraic.OperationCost σ) : self.result.cost operationCost ≤ source.cost operationCost
Compaction does not increase any nonnegative operation cost.
Instances For
Number of internal gates in the rebuilt circuit.
Instances For
The empty program compacts to itself.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Evaluation of a line is preserved after mapping it through a compaction.
Retain the new last source gate in the rebuilt program.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Replace the new last source gate by an existing rebuilt wire.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Lift a program compaction to a circuit by renaming its output wires.
Equations
- One or more equations did not get rendered due to their size.
Instances For
View a compaction as a certified identity-substitution reduction.