#boolean #bdd #expression #diagram #binary #decision #evaluating

boolean_expression

A library for manipulating and evaluating Boolean expressions and BDDs

17 releases

Uses old Rust 2015

0.4.4 Mar 16, 2021
0.4.1 Jul 15, 2020
0.3.10 Jan 19, 2020
0.3.9 Sep 30, 2019
0.3.0 May 17, 2016

#608 in Math

Download history 808/week @ 2024-07-20 993/week @ 2024-07-27 1060/week @ 2024-08-03 926/week @ 2024-08-10 766/week @ 2024-08-17 581/week @ 2024-08-24 710/week @ 2024-08-31 766/week @ 2024-09-07 688/week @ 2024-09-14 804/week @ 2024-09-21 887/week @ 2024-09-28 633/week @ 2024-10-05 688/week @ 2024-10-12 781/week @ 2024-10-19 827/week @ 2024-10-26 1079/week @ 2024-11-02

3,454 downloads per month
Used in 21 crates (4 directly)

MIT license

82KB
2K SLoC

boolean_expression: a small Rust crate for Boolean expressions and BDDs

Rust

This crate provides for the manipulation and evaluation of Boolean expressions and Binary Decision Diagrams (BDDs), the construction of BDDs from Boolean expressions, and the construction of Boolean expressions from BDDs (via a simple cubelist-based minimization algorithm). It also has a very simple identity-based Boolean expression simplifier, though the cubelist-based minimizer is more effective.

boolean_expression is Copyright (c) 2016 by Chris Fallin <cfallin@c1f.net> and is released under the MIT license. See LICENSE for details.

Documentation: here

Crates.io: here


lib.rs:

boolean_expression expression manipulation / BDD library

This crate provides for the manipulation and evaluation of Boolean expressions and Binary Decision Diagrams (BDDs), and the construction of BDDs from Boolean expressions. It can also simplify Boolean expressions via either a set of rules such as DeMorgan's Law (see Expr::simplify_via_laws()), or via a roundtrip through a BDD and a cubelist-based term reduction (see Expr::simplify_via_bdd()). The latter is more powerful, but also more expensive.

The main pieces of interest are:

  • Expr, an AST enum for expression simple AND / OR / NOT-based expressions.
  • BDD, a Binary Decision Diagram implementation.
  • CubeList, a low-level datatype with support for cubelist manipulation (used when converting BDD functions to expressions).

Dependencies

~530KB
~11K SLoC