Minimizing Logic Expressions
lab.whitequark.org
lab.whitequark.org
There are numerous, specialized bi/tri/quad boolean logic prime implicant optimization algorithms for combinational logic and expressions like QM and MQM.
Specifically, I created an instruction mapping on a 7b opcode space such that the decode logic for the critical paths was short (eg, branch decode). It took multiple sheets of paper, a few tries, and a couple of days, but it wasn't too bad.
I would love to unleash a bruteforce optimization on it.
Practically you probably care more about the number of transistors than the number of gates.
(apply
(then ctx-solver-simplify propagate-values
(par-then
(repeat
(or-else
split-clause
skip))
propagate-ineqs)))
Works pretty well for my problem (simplifying the branch condition paths for entering a given basic-block in a symbolic-execution system down to something human-readable), and best of all, it has no corner-cases requiring manual human teaching. (It's the ctx-solver-simplify bit that gets you most of that; it's a pretty powerful engine.)This is called technology mapping and logic minimizers (like Espresso) do it all the time.
Just think of it: who defines what the basic logic modules on your netlist _are_ ? What if your only module is a XOR gate?
There is also a paper by E. V. Dubrova et al. about finding optimal AND-OR-XOR expressions which has extensive comparisons with Espresso.