Crate quine_mccluskey

Source
Expand description

Boolean function minimizer based on Quine-McCluskey algorithm.

§Usage

use quine_mccluskey as qmc;

let mut solutions = qmc::minimize(
    &qmc::DEFAULT_VARIABLES[..3],
    &[0, 5],        // minterms
    &[1, 3, 4, 6],  // maxterms
    qmc::SOP,
    false,
    None
)
.unwrap();

assert_eq!(
    solutions.pop().unwrap().to_string(),
    "(A ∧ C) ∨ (~A ∧ ~C)"
);

minimize is sufficient for all use cases. But also check minimize_minterms and minimize_maxterms to see if they are more suitable for your use case.

§Feature flags

  • serde – Derives the [Serialize] and [Deserialize] traits for structs and enums.

Structs§

Variable
A variable as part of a Solution.

Enums§

Error
Error types for bad input and timeout.
Form
The form of a boolean expression.
Solution
A minimized boolean expression.

Statics§

DEFAULT_VARIABLES
All letters of the English alphabet in uppercase.

Functions§

minimize
Minimizes the boolean function represented by the given minterms and maxterms.
minimize_maxterms
Minimizes the boolean function represented by the given maxterms and dont_cares.
minimize_minterms
Minimizes the boolean function represented by the given minterms and dont_cares.