3.43 restrict : Selection of superset

Format

$obj$.restrict($zdd1$) $\rightarrow $ $zdd2$

Description

For itemsets included in $obj$, select the term as long as $zdd1$ contains at least one itemset.

More precisely, $\alpha _ i$ is the set of items that make up $obj$ where the weight of term $T_ i$ is removed, assuming that $\beta _ j$ represents the same itemsets in $zdd1$, if at least one $j$ satisfy $\alpha _ i \supseteq \beta _ j$, select term $T_ i$ that corresponds to $\alpha _ i$ from $obj$.

In relation, the conditional function $\alpha _ i \supseteq \beta _ j$ is changed to $\alpha _ i \subseteq \beta _ j$ to become permit function.

Example

Example 1: Basic Example

> require 'zdd'
> a=ZDD::itemset("a")
> b=ZDD::itemset("b")
> c=ZDD::itemset("c")
> x=5*a + b*c + 3*b + 2
> x.show
 5 a + b c + 3 b + 2

# Among 4 itemsets a,bc,b,Φ (empty itemset has a weight of 2) in x,  
# 2 itemsets a,b in y included in any of the itemset are a,bc. 
# Therefore terms a,bc are selected from x.
> x.restrict(a+c).show
 5 a + b c

# Among 4 itemsets a,bc,b,Φ in x, 
# itemset z only includes itemset bc.
# Therefore term bc is selected from x.
> x.restrict(b*c).show
 b c

# Among 4 itemsets a,bc,b,Φ in x,  
# all itemsets containing itemset Φ (empty itemsets with weight of 1) is in a set of items.
> x.restrict(1).show
 5 a + b c + 3 b + 2

# Among 4 itemsets a,bc,b,Φ in x, there is no itemset contained in itemset abc.
> x.restrict(a*b*c).show
 0

See Also

permit : Selection of subset