-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples of MDD? #66
Comments
There is a section about MDDs in the documentation: https://github.com/tulip-control/dd/blob/master/doc.md#multi-valued-decision-diagrams-mdd, and a small example in the tests: https://github.com/tulip-control/dd/blob/master/tests/mdd_test.py. The module |
I can follow some of what's happening in |
Yes, for example: import dd.mdd
dvars = dict(x=dict(level=0, len=4), y=dict(level=1, len=2))
m = dd.mdd.MDD(dvars)
u = m.find_or_add(0, 1, -1, 1, 1)
m.incref(u)
m.collect_garbage()
m.dump('example_mdd.pdf') |
I can follow some of what's happening in https://github.com/tulip-control/dd/blob/master/doc.md#multi-valued-decision-diagrams-mdd. Do you have a good reference for understanding how MDDs work? Is there an MDD equivalent of the Bryant paper? |
Please consult the references cited in the docstring of the module Lines 1 to 17 in 24ec9eb
|
Thanks for the references. They both consider functions that are integer to integer, not just integer to binary logic, right? Is mdd also integer to integer or is it integer to binary? And could you comment on the similarities with CUDD's treatment of mdd? |
And a follow-on question if I may: What's the basic building block of the MDD, analogous to the ite(x, A, B) in BDDs? Is there such an operation? |
The class Line 45 in 24ec9eb
Yes, there is a ternary conditional for MDDs: Lines 143 to 144 in 24ec9eb
CUDD's implementation is in C and much more extensive, for algebraic decision diagrams. More details can be found in CUDD's manual (the original link for CUDD is http://vlsi.colorado.edu/~fabio/CUDD/, though this link currently cannot be reached): |
I had some questions regarding the example from the documentation below. I numbered them 1-5 in the comments below.
|
About the questions on the example from the documentation:
About the diagram, the class Lines 149 to 153 in 24ec9eb
If we used |
Following up from above. (5) Doesn't the expression below consider 1 and 0 as leaf nodes?
As to the diagram, yes I would appreciate it if you could confirm its accuracy. I think I understand the edges leaving variable y but I don't understand the two edges leaving the x node. |
About:
|
The MDD diagram in the documentation is correct. The reason is that the reference is negative ( For example, if Considering another path in the diagram, if The minus in
The plotting for MDDs has remained unchanged, while the plotting for BDDs had been updated in commit 5871b7b to show one more node above the top node, in order to show explicitly in the diagram whether the reference to the node (the |
Regarding the explicit assigning of levels, this is different than the BDD treatment, correct? Why is it needed for MDD but not BDD? Thanks, G
|
The high-level interface to BDDs assigns levels automatically, in increasing order. This can be done for MDDs too. At the low-level the levels need to be somehow assigned, for both BDDs and MDDs. A low-level interface is implemented for MDDs. |
Understood. Thank you. |
Is there a variable encoding method in mapping an MDD to a BDD, as described say in [(https://people.engr.tamu.edu/sunilkhatri/projects-web/papers/mvlogic.pdf)], where one-hot encoding is described? |
The implemented mapping is from BDDs to MDDs. The encoding of integer values is the usual binary representation of natural numbers. For signed integer arithmetic with BDDs, please use the package |
Just a comment for what it's worth. In the reference you provided below, they emphasize the MDD to BDD mapping and the CASE operator as the main building block (analogous to the ITE for BDDs). Arvind Srinivasan, Timothy Kam, Sharad Malik, Robert K. Brayton |
My comment above about the implemented mapping refers to the mapping that is implemented in the module |
What's the easiest way to get a Mac to interpret .dot files for producing MDD graphs on Jupyter? Thanks, G |
The Python package Closing this issue, because it does not seem to be an issue of the package |
HI @johnyf Could you include example of defining and manipulating an MDD? Or if there is already documentation , could you direct me please? Could not find it myself.
The text was updated successfully, but these errors were encountered: