I'm trying to implement a very very fast boolean expression engine. I'm using it to represent states in very large state spaces, so I need it to handle as many operations per second as possible. At the very base of this engine is a sum of products. I am running up against an issue optimizing the NOT operator though. For example, if I have a sum of products with N minterms where each minterm has around M variables, then trying to invert that would create M^N minterms which would then be simplified using the espresso algorithm. I can speed it up a little and save some memory if I run the espresso algorithm intermittently during the inverse operation, but that's not enough. I doubt I am the first person to run into this problem, and I have tried doing the research, but I can't seem to find an efficient way to do this.
Can anybody point me in the right direction?