Crate bex

Source
Expand description

A crate for working with boolean expressions.

Re-exports§

pub use crate::base::Base;
pub use crate::base::GraphViz;
pub use crate::nid::NID;
pub use crate::nid::I;
pub use crate::nid::O;
pub use crate::fun::Fun;
pub use crate::reg::Reg;
pub use crate::bdd::BddBase;

Modules§

anf
Structure for representing algebraic normal form (xor of ands).
apl
Helper routines inspired by the APL family of programming languages.
ast
Abstract syntax trees (simple logic combinators).
base
Standard trait for databases of boolean expressions.
bdd
A module for efficient implementation of binary decision diagrams.
cur
Cursors (register + stack and scope) for navigating vhl-graphs (Bdd, Anf, etc)
fun
The ‘Fun’ trait for dealing with boolean Functions
int
Helpers for working with arrays of bit structures as if they were integers.
io
binary io for hashmap<String,NID> and typed vectors
naf
nid
Node IDs (shared by various Base implementations)
ops
Tools for constructing boolean expressions using NIDs as logical operations.
reg
Registers – arbitrarily large arrays of bits.
simp
Simplification rules for simple boolean operations.
solve
Solve ast-based expressions by converting to another form.
swap
Swap Solver This solver attempts to optimize the BDD concept for substitution solving. It adjusts the input variable ordering by swapping adjacent inputs until the one to be replaced next is at the top of the BDD. The actual replacement work at each step then only involves the top three rows.
swarm
mini-framework for multicore programming.
vhl
(Var, Hi, Lo) triples
vhl_swarm
VHL Swarm
vid
Variable IDs (used interally by Base implementations)
wip
Generic Work-in-progress support, used by e.g. [VhlSwarm].

Macros§

expr
Macro for building complex expressions in a Base. example: expr![base, (x & y) | (y ^ z)]
inherit
This macro makes it easy to define decorators for Base implementations. Define your decorator as a struct with type parameter T:Base and member base: T, then use this macro to implement the functions you don’t want to manually decorate.
vid_map
Macro to make a substitution map for eval. example: use vid::named::{x0, x1}; vid_map![x0:I, x1:O]