#boolean #bdd #expressions #manipulating #evaluating #diagram #decision

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

#484 in Math

Download history 704/week @ 2023-11-29 729/week @ 2023-12-06 740/week @ 2023-12-13 674/week @ 2023-12-20 733/week @ 2023-12-27 957/week @ 2024-01-03 943/week @ 2024-01-10 1015/week @ 2024-01-17 1007/week @ 2024-01-24 910/week @ 2024-01-31 1090/week @ 2024-02-07 989/week @ 2024-02-14 1175/week @ 2024-02-21 815/week @ 2024-02-28 965/week @ 2024-03-06 542/week @ 2024-03-13

3,639 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

~520KB
~10K SLoC