#boolean #bdd #expressions #diagram #decision #binary #manipulating

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

#481 in Math

Download history 1000/week @ 2024-05-29 751/week @ 2024-06-05 763/week @ 2024-06-12 765/week @ 2024-06-19 1071/week @ 2024-06-26 824/week @ 2024-07-03 922/week @ 2024-07-10 639/week @ 2024-07-17 997/week @ 2024-07-24 1093/week @ 2024-07-31 982/week @ 2024-08-07 870/week @ 2024-08-14 605/week @ 2024-08-21 600/week @ 2024-08-28 746/week @ 2024-09-04 655/week @ 2024-09-11

2,724 downloads per month
Used in 20 crates (3 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

~535KB
~11K SLoC