Question
There exists tons of software that can minimize a logic circuit by providing a solution using the least amount of logic gates.
What I am interested in, however, is not the total number of gates but the total sum of the weights of each gate. For instance, I want to assign a weight to each logic gate type (ex. AND = 3, NAND = 2, XOR = 6, etc.) and then minimize a given logic circuit with respect to the sum of the weights of all the logic gates.
Example
Suppose we have the following logic gate weights: XOR = 6 ,AND = 3, OR = 3, NAND = 2, NOR = 2, NOT = 1.
We want to minimize the following full adder in terms of total weight. Adding those weights, we have:
$$ 2 \cdot XOR + 2 \cdot AND + 1 \cdot OR \\ = 2 \cdot 6 + 2 \cdot 3 + 1 \cdot 3 \\ = 21 $$

simulate this circuit – Schematic created using CircuitLab
However, a full adder can also be implemented using 9 NAND gates, resulting in a weight of 18, which is preferable regarding the weights above.
Is there any way to conduct such a minimization?
Why do I need this?
I want to create logic circuits using individual BJT transistors. However, each logic gate requires a different number of transistors to function and also results in a vastly different implementation size. This leads me to the conclusion that for my purposes, not all logic gates are the same. Therefore, just the total number of gates is not a good indication of the total size or number of transistors needed for the circuit.
Any other ideas regarding how to tackle this issue?
