0

A follow up to my earlier post, CUDD C++ Interface for converting Booleans to BDDs and resulting set of minterms (to cutsets).

In the tulip-dd BDD lib., which runs on Python, one can define and read Boolean expressions as strings. That makes the whole I/O process very convenient .

Now, we just saw in the prior post that using the cudd C++ interface we can define a Boolean expression conveniently using a compact math notation such as x1*x2 + x3*x4and how to produce the sum of minterms from that expression. But does cudd also allow us to use strings for the Boolean expressions? I suspect not, and if not, I would have to find a way to convert the string equivalent of the sum product above to the equivalent Boolean: "x1*x2+x3*x4"to x1*x2+x3*x4.

  • This is a close-to-duplicate of https://stackoverflow.com/questions/62987356/cudd-c-interface-a-suggestion-for-reading-the-string-formatted-boolean-expres - Unfortunately, already back then, there was not a very convincing answer. If you are familiar with parser compilers, you should be able to write such a function very quickly yourself. Is all that you want to parse an expression of the sum-of-products form? Do you need braces, negation, etc. support as well? – DCTLib Jul 20 '20 at 07:25
  • ...If all you need is parsing sums of products without braces, then it's relatively easy to build a parser yourself - you just split by the "*", split each of the results parts again by "+" and then parse the literals quite directly. Include stripping all whitespaces to get rid of them, and you are pretty much done already. Just when braces come into play, parsing is a bit more tricky. – DCTLib Jul 20 '20 at 09:09

0 Answers0