Ruddy
Ruddy is a minimalistic, high-performance Rust library for (reduced and ordered) binary decision diagrams (BDDs), which are a compact representation of Boolean functions.
The name
Ruddyis a blend ofBuDDy(one of the first widely used BDD libraries) andRust. However,Ruddyis not affiliated with the developers ofBuDDyin any formal way. The name is meant merely as a tribute.
Features
Most popular BDD implementations use a shared representation, where all BDD nodes are stored in a single pool managed by a manager. This allows graphs shared between BDDs to be stored only once in memory. An alternative is the split representation, where each BDD owns its nodes (e.g., as an array).
When BDDs do not meaningfully share nodes, split representations can be faster and more memory-efficient. Ruddy implements both representations, letting users choose what works best for their use case.
Currently, Ruddy supports the following features:
- Binary logical operators (conjunction, xor, ...) and negation.
- Existential and universal quantification, also combined with a binary operator (also called relational product).
- Satisfying valuations and paths iterators along with methods to count them.
- Export to DOT.
- Conversion between split and shared BDDs.
- Binary and text (de)serialization of split BDDs.
Usage
An example of using the Ruddy split implementation:
use Bdd;
use VariableId;
The same example, using the shared implementation:
use BddManager;
use VariableId;
More complex examples can be found in the examples folder.