Library
Module
Module type
Parameter
Class
Class type
Functor that creates a structure of set families
type elt = X.t
val hash : t -> int
Hash function
val pp : Format.formatter -> t -> unit
Pretty printer for ZDDs
val empty : t
The empty family: ∅
val is_empty : t -> bool
Tests whether a ZDD is equal to empty
val base : t
The family that contains only the empty set: { ∅ }
val is_base : t -> bool
Tests whether a ZDD is equal to base
val wf : t -> bool
Wellformedness test
singleton [x1;... ; xn]
is the ZDD that represents the set family { { x1, ..., xn } }
Retrieves a set of the set family, if any. The choice of which set of the family is returned is not specified.
Retrieves a set of the set family, if any. The choice of which set of the family is returned is not specified.
Returns the sets that belong to a ZDD, as a list of lists of elements
Returns the sets that belong to a ZDD, as a sequence of lists of elements
val cardinal_generic : ('a -> 'a -> 'a) -> 'a -> 'a -> t -> 'a
cardinal_generic plus zero one t
is the cardinal of the family represented by t
, i.e., how many sets it contains, where plus
is used as (associative commutative) addition and zero
as neutral element and one
for 1
.
val cardinal : t -> int
cardinal t
is the cardinal of the family represented by t
, i.e., how many sets it contains.
val max_cardinal : t -> int
max_cardinal t
returns the maximal cardinal of the sets contained in the family represented by t
. Returns min_int
if the family is empty.
val min_cardinal : t -> int
min_cardinal t
returns the minimal cardinal of the sets contained in the family represented by t
. Returns max_int
if the family is empty.
val nb_nodes : t -> int
Returns the number of nodes that are used to represent the ZDD
s ∈ change x t
iff either x ∈ s
and s ∖ {x} ∈ t
, or x ∉ s
and {x} ∪ s ∈ t
s ∈ disjoint_join t1 t2
iff there exists s1 ∈ t1
and s2 ∈ t2
such that s1 ∩ s2 = ∅
and s = s1 ∪ s2
s ∈ joint_join t1 t2
iff there exists s1 ∈ t1
and s2 ∈ t2
such that s1 ∩ s2 ≠ ∅
and s = s1 ∪ s2
s ∈ delta t1 t2
iff there exists s1 ∈ t1
and s2 ∈ t2
such that s = (s1 \ s2) ∪ (s2 \ s1)
When t2 ≠ ∅
: s ∈ div t1 t2
iff for any s2 ∈ t2
, s ∪ s2 ∈ t1
and s ∩ s2 = ∅
. When t2 = ∅
: div t1 t2 = t1
.
rem t1 t2 = diff t1 (join (div t1 t2) t2)
. The following equation is always satisfied: t1 = union (join (div t1 t2) t2) (rem t1 t2)
. *
s ∈ min_hitting_set t
iff for every s' ∈ t
, s ∩ s' ≠ ∅
, and such that no smaller set than s
satisfies this property (i.e., s
is minimal).
leq_FE_subset t1 t2
iff for every S1 ∈ t1
, there exists S2 ∈ t2
, such that S1 ⊆ S2
leq_FE_superset t1 t2
iff for every S1 ∈ t1
, there exists S2 ∈ t2
, such that S1 ⊇ S2
subst_gen union env t
substitutes in t
the elements x
such that env x = Some sx
with sx
, with the interpretation of the set family t
as a boolean expression in disjunctive normal form, using union
for disjunction. Elements x
such that env x = None
are not modified, and are not removed. subst_gen
performs memoization as soon as its two first arguments union
and env
are given.
subst env t
substitutes in t
the elements x
such that env x = Some sx
with sx
, with the interpretation of the set family t
as a boolean expression in disjunctive normal form. Elements x
such that env x = None
are not modified, and are not removed.
Iterator on the elements that occur in the set family. The elements might be encountered more than once, and the order in which they are encountered is unspecified.
Folder on the elements that occur in the set family. The elements might be encountered more than once, and the order in which they are encountered is unspecified.
Iterator on the list of elements that represent the sets in the families. The sets may occur in an unspecified order. The elements in the lists occur in increasing order.
Folder on the list of elements that represent the sets in the families. The sets may occur in an unspecified order. The elements in the lists occur in increasing order.
val pp_dot : Format.formatter -> t -> unit
Pretty-printer of the representation of the ZDD as a graph in the DOT format. Dashed edges are 0 edges, solid edges are 1 edges. Edges that start with a dot are 0-attributed edges.