I was going through a licensed guide to represent product families as a bag model in which occurrences are also taken into consideration to come up with a BDD.
I am trying to include the similar steps into my problem. The text says
If we adopt the bag-model, the implementation is similar to the set-model implementation except for handling the duplications of features. ROBDDs do not allow duplications of nodes. To handle the number of occurrences of a feature within the BDD itself, we have devised occurrence levels that encode it. We encode this number binary. For example, if we have a product with 3 features: x, y and z, and the maximum number of occurrences of a feature is seven, then we need three binary bits to encode it. Let the product family W have one product with three x features and six z features and zero y features. Our product family contains a product Pt, represented by the BDD in Figure 3.7. The BDD representing this bag describes the product in a way similar to that in the set model. However, we encode the occurrences in the levels of nodes containing bl, b2 and b3. We read in Figure 3.7 that, if x exists in this product, then we have to select bl and b2, but not b3. This is the binary code 011 representing b3, b2 and bl respectively which carries the occurrence of three for x. Similarly, for y to exist in this product, we get the binary occurrence encoding to be 000 which is 0 occurrences. For z, we get the binary occurrence of 110 which carries the number six.
So by this, for a product family Z = {{(x,3),(y,0),(z,6)}} the corresponding bdd would be ->
for a product Family W = {{(x,3),(y,1),(z,7)}} the BDD would be
But how did he come up with these BDDs, there must be some underlying formula for the BDDs. Could you please help me understand how to arrive at the same formula for a given family so that i can further use it similarly in my other use cases. Thanks.