Skip to content

fbool

fbool is a compact toolkit for studying Boolean functions from Rust and Python. It helps you move from a truth table to structure: partitions, entanglement, entropy, sensitivity, spectra, frontier graphs, certificates, and exact 5-variable circuit data.

Learn the model

Start with truth tables, restrictions, partitions, and the way fbool turns them into metrics.

Open the mental model

Use the APIs

Use the Rust crate or the Python binding with the same conceptual workflow.

Open the guide

Compare Rust and Python

Switch between matching examples with language tabs.

Rust/Python guide

Run tools

Use the CLI for repeatable metric runs and the experiment binaries for research pipelines.

CLI guide

The short version

use fbool::entanglement::{Entanglement, Entropy};
use fbool::fvalue::FValue;

let f = FValue::majority(4);

println!("{}", f.entanglement());
println!("{}", f.minmax_entanglement());
println!("{}", f.entropy());
from fbool import FBool

f = FBool.majority(4)

print(f.entanglement())
print(f.entropy())
print(f.spectral_entropy())

What lives where

fbool/                 Rust library crate published to crates.io
fbool-cli/             command-line interface
fbool-py/              Python extension module
fbool-experiments/     research binaries and analysis workflows

The old standalone optimal5 crate is now integrated into fbool and enabled by default.

Choose a path

Read Mental model, then use the Metrics map as a guide to what each metric measures.

Open the guide and switch between Rust and Python examples as needed.

Use fbool-cli for focused metric runs and fbool-experiments for larger research jobs.