BinaryDecisionDiagrams Documentation

API

BinaryDecisionDiagrams.DiagramType

A Binary Decision Diagram.

  • index: the vertex variable (-1 if terminal vertex
  • low: low child vertex of BDD (undef if terminal vertex)
  • high: high child vertex of BDD (undef if terminal vertex)
  • value: terminal boolean value
  • id: unique identifier
Base.:!=Method

Returns whether the two given boolean functions are not equivalent.

Base.:==Method

Returns whether the two given boolean functions are equivalent.

Base.:|Method

Returns a new reduced Diagram restricted to instantiation X.

Base.:⊻Method

Returns a xor of the given boolean functions.

Base.hashMethod

Returns a unique hash for the whole BDD.

Base.signMethod

Returns 0 if x is not a literal; else returns the literal's sign.

Base.sizeMethod

Returns the number of nodes in the BDD graph.

Base.stringMethod

Return string representation of Diagram α.

BinaryDecisionDiagrams.apply_stepMethod

Recursively computes α ⊕ β. If the result was already computed as an intermediate result, return the cached result in T.

BinaryDecisionDiagrams.forgetMethod

Returns the resulting BDD after applying the forget operation. Equivalent to $\phi|_x \vee \phi|_{\neg x}$.

BinaryDecisionDiagrams.from_npbcMethod

Translates a cardinality constraint in normal pseudo-boolean constraint form into a BDD.

Since cardinality constraints correspond to having coefficients set to one, we ignore the C's.

Argument L corresponds to the vector of literals to be chosen from; b is how many literals in L are selected.

See Eén and Sörensson 2006.

BinaryDecisionDiagrams.lit_valMethod

Returns whether a variable x appears as a positive literal in α, given that α is a conjunction of literals.

BinaryDecisionDiagrams.loadMethod

Loads a BDD from given file.

Supported file formats:

  • CNF (.cnf);
  • DNF (.dnf);
  • BDD (.bdd).

To load as any of these file formats, simply set the filename with the desired extension.

Keyword arguments are passed down to the open function.

BinaryDecisionDiagrams.normal_formMethod

Runs a BFS on the mapping of parents, starting from either a ⊤ (true) or ⊥ (false) in order to find the corresponding CNF or DNF encoding.

BinaryDecisionDiagrams.print_nfMethod

Pretty print BDD as a normal form (CNF or DNF).

Caution: may exponentially explode.

Alternatively, pretty prints using the given glyphs (default , and ¬).

ϕ = (1 ∧ ¬2) ∨ (2 ∧ 3)
print_nf(α; out = false)
ϕ = (1 ∧ ¬2) ∨ (2 ∧ 3)
print_nf(α; out = false, which = "dnf", glyphs = ['+', '*', '-'])
BinaryDecisionDiagrams.reduce!Method

Reduce a Diagram rooted at α inplace, removing duplicate nodes and redundant sub-trees. Returns canonical representation of α.

BinaryDecisionDiagrams.saveMethod

Saves a BDD as a file.

Supported file formats:

  • CNF (.cnf);
  • DNF (.dnf);
  • BDD (.bdd).

To save as any of these file formats, simply set the filename with the desired extension.

Keyword arguments are passed down to the open function.

BinaryDecisionDiagrams.shannon!Method

Performs Shannon's Decomposition on the Diagram α, given a set of variables to isolate. Any decomposition that results in a ⊥ is discarded.

Index