2.2 Items Declaration

Use ZDD::symbol method to define an individual item. Use one method to define one item. The order of items declaration is important and corresponds to the ZDD tree structure from root level. Items not declared in the proper order significantly affects how ZDD structure is generated and the resulting size of the tree structure. The example below shows a declaration of four items "a","b","c","d". If the item order is not important, users can skip the symbol declaration function and use the itemset function described in the next section.

> ZDD::symbol("a")
> ZDD::symbol("b")
> ZDD::symbol("c")
> ZDD::symbol("d")

Only items used are declared as symbols, next, the itemsets consisting of defined items will create the ZDD object.

It is possible to create a ZDD object with the ZDD::itemset method to enumerate space delimited item names as itemsets. In the following, the ZDD object is expressed as itemset "abc" consisting of items "a", "b", "c" which is set as Ruby variable a. The content in the object is displayed in valued sum of products format using the show method.

> x=ZDD::itemset("a b c")
> x.show
 a b c

In the following, itemset consisting of 1 item is constructed, it will be used in the later section. Although the item name and the Ruby variable are both named as a, note that these two are totally different,

> a=ZDD::itemset("a")
> b=ZDD::itemset("b")
> c=ZDD::itemset("c")
> d=ZDD::itemset("d")
> a.show
 a