bcd-optimization#
optimizing a gate level bcm to the end of the earth and back
The canonical repo for this is hosted on tangled over at dunkirk.sh/bcd-optimization
© 2026-present Kieran Klukas
For self-hosted knots, clone URLs may differ based on your setup.
Download tar.gz
- Total cost = AND gate inputs + OR gate inputs
- MaxSAT now optimizes for total cost, not just AND inputs
- Updated default target to 61 (no-sharing baseline)
Results:
No sharing: 61 total (33 AND + 28 OR)
Optimized: 52 total (15 AND + 37 OR)
Savings: 9 gate inputs (15% reduction)
Sharing reduces AND inputs dramatically (33→15) but increases
OR inputs (28→37) since shared terms fan out to more outputs.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Single-literal terms (A, B, B', etc.) don't need AND gates - they're
direct wires from inputs to OR gates, cost = 0 AND inputs
- Multi-literal terms still need AND gates with literal count inputs
- Added CostBreakdown showing AND inputs, OR inputs, and totals
- Updated MaxSAT penalty to only count multi-literal terms
- DOT export now shows single-literal terms as direct wires, not AND gates
New cost breakdown for optimized result:
AND gate inputs: 15 (7 gates)
OR gate inputs: 38 (7 gates)
Total: 53 gate inputs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Input complements (A', B', C', D') are now shown as separate input
nodes rather than through inverter gates, since they're available
for free in the target technology.
- True inputs shown in light blue
- Complement inputs shown in light cyan
- No NOT gates in the diagram
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
optimizing a gate level bcm to the end of the earth and back
The canonical repo for this is hosted on tangled over at dunkirk.sh/bcd-optimization
© 2026-present Kieran Klukas