The qm package

[maintain]
Warnings:

Ported to Haskell from the Python qm Package (http://pypi.python.org/pypi/qm) and the improved qm (including Petrick's method) by George Prekas (http://github.com/prekageo/optistate).


[Skip to ReadMe]

Properties

Version0.1.0.0
Dependenciesbase (==4.8.*), containers (==0.5.*), transformers (>=0.4.2.0) [details]
LicenseMIT
AuthorRobert Dick, Pat Maupin, George Prekas, Martin Finke
Maintainermartin@basteln.local
CategoryLogic
Home pagehttps://github.com/martinfinke/qm
Source repositorythis: git clone https://github.com/martinfinke/qm(tag stable)
UploadedThu May 28 15:04:36 UTC 2015 by basteln

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for qm-0.1.0.0

The Quine-McCluskey Algorithm in Haskell

Ported to Haskell from the Python qm Package and the improved qm (including Petrick's method) by George Prekas.

Installation

From GitHub

git clone https://github.com/martinfinke/qm

From Hackage

cabal install qm

Installing Dependencies

cabal install --only-dependencies --enable-tests

Running the Tests

cabal test

Usage

Note: When showing terms, leading zeros are dropped. So 0-10 is shown as -10.

Set of Primes

Finding the set of all primes:

import Qm
let terms = Set.fromList $ map getTerm $ map fromString [
        "0010", "0101", "0110", "1011", "1100", "1110", "1111"
        ]
compute_primes terms -- fromList [-10, 101, -110, 1-11, 11-0, 111-]

Minimum Cover

Find the minimum cover for a list of minterms:

import Qm
let terms = map getTerm $ map fromString [
        "0010", "0101", "0110", "1011", "1100", "1110", "1111"
        ]
qm terms [] [] -- [-10,101,1-11,11-0]

License

See LICENSE file.