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§

Enums§

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

Statics§

Functions§

  • Minimizes the boolean function represented by the given minterms and maxterms.
  • Minimizes the boolean function represented by the given maxterms and dont_cares.
  • Minimizes the boolean function represented by the given minterms and dont_cares.