You can use the Python package dd
for working with BDDs using either the Python or CUDD backends (disclaimer: I'm dd
's author). Example:
import dd.autoref as _bdd # to use CUDD, replace `dd.bdd` with `dd.cudd`
bdd = _bdd.BDD()
bdd.declare('a', 'b', 'c')
u = bdd.add_expr(r'a \/ (b /\ ~ c)')
The syntax is described in the documentation. If you prefer writing a | (b & ~ c)
, that works too. The pure Python backend is installed with pip install dd
.
You can also plot using dot
(assuming GraphViz is installed):
bdd.dump('bdd_graph.pdf')
The method BDD.dump
is described here.
About DDcal's message
grep -ilr "util_pipefork" ./*
says that the error you reported from DDcal seems to be coming from the following lines:
/* Set up bidirectional pipe to/from dot. */
/* A unidirectional pipe should suffice. We'll try it some day. */
retval = util_pipefork(args,&toCommand,&fromCommand,&pid);
if (retval == 0) {
(void) fprintf(stderr,"Panic: util_pipefork returned 0!\n");
exit(2);
}
So, you need to install GraphViz, and make sure that its executables (in particular dot
) are in the runtime environment's $PATH
.