See also https://en.m.wikipedia.org/wiki/Karnaugh_map for a human-applicable algorithm to minimize logic expressions.
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.