I am trying to understand how the composition of two ROBDDs works.
F1 = (d? false: (c? (a? false: true): false))
F2 = (d? (b? true: (a? false: true)): (c? (b? true: (a? false: true)): true))
I need to find a formula F3
that is obtained by replacing all occurrences of d
by formula F1
in formula F2
.
How do I proceed solving this?
Substitution, composition of BDDs, variable renaming, cofactors, and evaluation are all the same mathematical operation: substitution. You can do the substitution you are interested in using the Python package
dd
as follows:The above creates the output:
and the file
foo.png
shown below. For assignments of Boolean values to the variables:f1_formula
corresponds to the negated BDD at node 7f2_formula
corresponds to the BDD at node 14r
(the composition) corresponds to the BDD at node 11.The "let" method is named after the
LET... IN
construct in TLA+.