suyjuris / obst

Online BDD Simulation Tool
Other
17 stars 1 forks source link

Explanation of numbering & labeling system #2

Open MontyThibault opened 4 years ago

MontyThibault commented 4 years ago

Hi, I've found this project very helpful for my study of binary decision diagrams. I think there can be a few improvements in the numbering and labeling system, but I'm mostly filing this issue just to say that I like the application and give my approval.

  1. Are the numbers intended to be interpreted as like a binary encodings of a truth table, row-by-row? A readme explanation or just a reference to the numbering system would be helpful.

  2. The variable names seem to be assigned in a way that is not consistent with the input formula. In the given screenshot, a formula with four variables displays five variables in the BDD (as if every node gets a new variable). Usually BDD diagrams have consistent variable names row-by-row. (reference attached).

Screen Shot 2020-05-02 at 8 57 47 PM Screen Shot 2020-05-02 at 8 58 33 PM
suyjuris commented 4 years ago

I am glad you like it!

  1. Yes, that is correct. The slightly longer answer is that there is some friction in how BDDs are introduced, either as encodings of logical fomulae with efficient binary operations on them, or as sets of numbers with efficient set operations on them. A logical formula can be viewed as a binary function from the set variable assignments to either true or false. Then you take the assignments mapped to true, which is (once you have fixed on ordering of variables) also a set of binary numbers.

    I agree that it would be good to have that written down in an accessible place, it is on the TODO list now.

  2. Yeah, labelling is hard to get intuitive. Here is a screenshot from the current development version:

    image

    Currently, I do not label the nodes with the level they are on (as is commonly done), but with the set they represent, while constructing a BDD. After construction, the nodes are simply given unique labels so that they can be referred to. It is nice to see the decision labels, so I added them at the side for the next version.

The problem with labelling is mostly that you can mix and match different types of operations. For example, you could create a BDD using a list of numbers, then create one given a formula, and then calculate the union of the two. It does not really make sense to use the boolean variables used in the formula when calculating the union. Right now the nodes have informative names only during construction, where this information exists, and get assigned generic names afterwards.

But if you have any ideas how to improve the labels, I would be very interested in hearing them!