BinaryDecisionDiagrams Documentation

API

BinaryDecisionDiagrams.Diagram — Type

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
source
Base.:!= — Method

Returns whether the two given boolean functions are not equivalent.

source
Base.:== — Method

Returns whether the two given boolean functions are equivalent.

source
Base.:| — Method

Returns a new reduced Diagram restricted to instantiation X.

source
Base.sign — Method

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

source
BinaryDecisionDiagrams.from_npbc — Method

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.

source
BinaryDecisionDiagrams.load — Method

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.

source
BinaryDecisionDiagrams.print_nf — Method

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 = ['+', '*', '-'])
source
BinaryDecisionDiagrams.save — Method

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.

source
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.

source

Index