An implementation of the Quine-McCluskey algorithm
Project description
qm.py
A Python implementation of the Quine McCluskey algorithm.
This implementation of the Quine McCluskey algorithm has no inherent limits (other than the calculation time) on the size of the inputs.
Also, in the limited tests of the author of this module, this implementation is considerably faster than other public Python implementations for non-trivial inputs.
Another unique feature of this implementation is the possibility to use the XOR and XNOR operators, in addition to the normal AND operator, to minimise the terms. This slows down the algorithm, but in some cases the result can be much more compact than a sum of product.
Installation
The recommanded way of installing this package is by using pip
python3 -m pip install quine-mccluskey-tomas789
Note that on Windows you might need to use the py
command instead.
py -m pip install quine-mccluskey-tomas789
There are some othere means of installing the package which are recommanded only in specific cases.
Development build
python3 -m pip install -e .
Build wheel files locally
Make sure you have the latest version of PyPA's build installed:
python3 -m pip install --upgrade build
Now run this command from the same directory where pyproject.toml is located:
python3 -m build
This command should output a lot of text and once completed should generate two files in the dist directory:
dist/
├── quine_mccluskey_tomas789-1.0-py2.py3-none-any.whl
└── quine_mccluskey_tomas789-1.0.tar.gz
Wheel file can then be distributed via your own means and installed using pip
python3 -m pip install dist/quine_mccluskey_tomas789-1.0-py2.py3-none-any.whl
Running tests
Unit tests
The library comes with a basic set of unit tests. They can be executed using pytest
pytest
Fuzz testing
We also have a fuzz testing. It generates random formulas, simplifies them and checks that the result is correct.
➜ quine-mccluskey-tomas789 git:(main) python fuzz.py
Checked 24300 formulas and found 0 errors.
Checked 48400 formulas and found 0 errors.
Checked 72300 formulas and found 0 errors.
Checked 96300 formulas and found 0 errors.
Testing formulas ... ⠋ 0:00:44
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for quine_mccluskey_tomas789-0.2.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9398261c8c0190823b238a0a649cb3227ac0b1f4ad15fcd721c1204266c3aad |
|
MD5 | 3b0a974d17858fb0d1b130ebbe23ecd8 |
|
BLAKE2b-256 | ce8326484da07955ce799ca1017dbe91a79bfe1963035ab984929f6a7e217569 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19f7455cd6fb0821bc138aba23e6fecda164fff99f9d6153ad5f402b60b6bb8f |
|
MD5 | ca4fd32a8c6ed63167c4b1f9e913f448 |
|
BLAKE2b-256 | defd0884fc3d17dae6c7100c3e1fba08cd41fcfd75ed9c53ea63c9d44e08d3ca |
Hashes for quine_mccluskey_tomas789-0.2.4-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26ab855b2c260e4eda497fbd254590d0740042452c2ac10d5925c422d936987f |
|
MD5 | ba3e40a9dbb49de3a758071d4864d6ca |
|
BLAKE2b-256 | c4fbe461172efedfec8009abc10c68aba7e565fa50a7c4b5fe379e1125f032ea |
Hashes for quine_mccluskey_tomas789-0.2.4-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf3d6b03d9c2c16197610d0f3af85a14b5ca62b218d966dd621496e02b5ebc19 |
|
MD5 | bff410c52ace409bb5f0234e62b49f35 |
|
BLAKE2b-256 | 3d798fe58807f378b9ee22e1e28a6b0b6cd9c07807d94b2343cb3ec9f7919b67 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb33dfb6473de41cbfaa8b5df4a24b591eafa5def67aed9bba35e730ee9300ab |
|
MD5 | 91dbcbda755ebc5f02654f061fd486f2 |
|
BLAKE2b-256 | 17c56b5e870330282d79ef37ed90f38a86b2ed063a46be485d3dc14585d86ce6 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b0944d1ed87d7c12862d9df4692c3c8ee84afc0a7233df06dd4f214b5e473a9 |
|
MD5 | df150269a9cd15722f9a5b08a00f949b |
|
BLAKE2b-256 | 47c6105c51824cd7a976c586ee1a97c2507b83041fa0781576e1f5333cd2d238 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90b1f2708267d519da5efc298cc71d69f1ba91ca2b2457c9a2ac077a0e2dbe50 |
|
MD5 | 8457cb02c1a6edf178d7de42ae97761d |
|
BLAKE2b-256 | 66c7c3795a593c20c58e162182309782419404dcbf0fcb415ff432aa28a9dfbd |
Hashes for quine_mccluskey_tomas789-0.2.4-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 979468172cb0f1d20db86036f96b6e4dc9cd077fdb880f2d6be975af10f82288 |
|
MD5 | 5c35caa67cf7fb373d9931f21dc1b8af |
|
BLAKE2b-256 | d5336b8838ecba31c0f8ebc096227ca87fc12f6817a410f562488096e818f06d |
Hashes for quine_mccluskey_tomas789-0.2.4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4d8143ce34ff325f5c4a79c058f2a651ef88125cf851d8ad067d8852b957ab6 |
|
MD5 | a4289e674b30840d4711f165cc2e6c85 |
|
BLAKE2b-256 | 286b0cb525db7d94c2aca4ee3e22ac97e19098510eae3fedd5004fe31c94c85f |
Hashes for quine_mccluskey_tomas789-0.2.4-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 211b65ecb627622e669ae628570f08c965f439ed94eafb30fba069f057d4650e |
|
MD5 | 0892646551c2ad2db715514cc5a6bb51 |
|
BLAKE2b-256 | 9600fafd3e98ce0061c74edc207162e4688d60a66307fef667b9ffa5b44e1633 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 626d2e4cc5d8e4f3f3fc048ab5e9b7b462d40bf65db875bf9830613be2dd4471 |
|
MD5 | c55db24c1cb6e4bf304dfa79adc2d9f9 |
|
BLAKE2b-256 | b491e1e1602bc8f1cc80bb67555706260f73bd3de0636cc31d85a2531e5b263d |
Hashes for quine_mccluskey_tomas789-0.2.4-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ffad6120f1aa603a22a3bd25f399937a3db95d236f362338f7a16df74392754 |
|
MD5 | 5bfd6c69e5708e69bc70a22099652536 |
|
BLAKE2b-256 | d47fe354f85484e81f1c0d2af6f76c2905eec1e6e0ad2f9eac77360f2871e5ec |
Hashes for quine_mccluskey_tomas789-0.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9d18a94577f773b13638a1330ea960eda596226006b195dad872d4ecd7ec0a2 |
|
MD5 | 99e95f330a8200ea1d4c7f7e2dd0df33 |
|
BLAKE2b-256 | 5d7209b8721040f8ba695494172eb4c46336ad113fbed4df43de707a5a4c2ebf |
Hashes for quine_mccluskey_tomas789-0.2.4-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 965057b6aca3006eb2567279aadf31e48395aa7bca7c44a3150de8b7c9102092 |
|
MD5 | 9f0f75bac288f973a5e72832e1cb2e33 |
|
BLAKE2b-256 | f973463ba5c67545ecdea93040edadc0e0c22b79e54ea67ab7b37374a5307af3 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8569c7efbf2aa25dbedc66eb2a78f851e65b3e5d3835d7f3e3162c96339704ee |
|
MD5 | f9586e6c346f6f6252a05bea2580e276 |
|
BLAKE2b-256 | 4e704891111aafde7ebd95256707657263590995840eaf52e19c6762e5bb48ae |
Hashes for quine_mccluskey_tomas789-0.2.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff8a84b6e85285a608f1d0390dca65498f6f971317bbe8945f5bb5758ba57f1b |
|
MD5 | 00acfb9740eae50266db200c29e84257 |
|
BLAKE2b-256 | 43abaccfcebdfdb3c5b53a97fdcfb4e55f7a337f89553ef1509e944c9230229f |
Hashes for quine_mccluskey_tomas789-0.2.4-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2514464bd3106177201885213ee672c014a3f4699a460e08a2fd017099b55341 |
|
MD5 | 5ac9b26fbca16630b71773142c486ec4 |
|
BLAKE2b-256 | e27497bc49359970a371a901cc52b5858e15f38aa4f2e2c615a65fd1c601b757 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e9f4b44d37601c5983f656d7ade461e46a7db29cd193cc80bb849f6d34d7134 |
|
MD5 | 8e7cff0d2cbc53f10c9bcf58d35dc360 |
|
BLAKE2b-256 | 85dc83f81666f576e2e483338a79df2f395547400b2eccb0e28a547bad3110dd |
Hashes for quine_mccluskey_tomas789-0.2.4-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 690072a939ff506c94f8ab2ac3d6134db9fd643e354094dc9376aa2a11801ea9 |
|
MD5 | f063b6b1762e240b55ea306ff202f307 |
|
BLAKE2b-256 | ee86dffca71885b81c2c86265a9512a9dd8789bdd766dbb107a565b9e391b368 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41ae8e6d92c70a092ec4bf10351b5767aadf70fca972d8d7418ed267cca8e22c |
|
MD5 | df58a50d7f6c11b7c973edb595f607e6 |
|
BLAKE2b-256 | 7fbcfcf3e487300af49978184e0d5b1ace6957919a95b6c0443fb7c8a62d943d |
Hashes for quine_mccluskey_tomas789-0.2.4-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6644d58c3edf8c204039cf720215559f51480742b85379ef2a7c0644956526cb |
|
MD5 | 20c7facb55455ea10ade2dc711298785 |
|
BLAKE2b-256 | f51556e9f2ea0e5e52d89bd2ff73d2ea0370fb4ebb34abaf5c38828f1f042f65 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38785377f50495f632090229e4d5553015bdf56698c0be92eb0b07262bc7ca6f |
|
MD5 | d8a0e06d3fc220f3fff9edc6077e7eda |
|
BLAKE2b-256 | c34d14c8c64a6eb83605e9b7549300b35966b99d0a67f93da2db3d3812ae1087 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6ee09d05d959009dc6b8dbd3f990b43baf7becffe8ec02b64ccea06466367a9 |
|
MD5 | 74920fac8edfdad5ff1c2a9a0fa0f684 |
|
BLAKE2b-256 | 99c9f590486fa634ecd783b22de9c6deddf23efe9ee570b908f6ac3abb11bb4d |
Hashes for quine_mccluskey_tomas789-0.2.4-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00dd5709c1ac786b597b08fdb9e0c07273a51e46e86878982900475281651f13 |
|
MD5 | 463aec1d01f45ddab33d2725b3b6c90f |
|
BLAKE2b-256 | 6c49413289f81f546225c19c38bb6096f6543c2a89363ac1ef2447344a99b6d7 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b39cedf827512e4d42a65f8302c140af820d31762598876a3efa171acb039ee |
|
MD5 | e39a488991d9a6f5c259a550511ab627 |
|
BLAKE2b-256 | efa628cabb4b2a4caf880c95dd47c369ce65368acd4ce414bca3fdb0a18cac4d |
Hashes for quine_mccluskey_tomas789-0.2.4-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf87ba62bf9bd569b9fa1b0e0027f357cbb0a0db470aa731222b8c951e918e1f |
|
MD5 | cac9109e6b8ed706aae241733f231036 |
|
BLAKE2b-256 | 8472ed8f0a2e46fb7453e609644b708d4e2b8a04f2389753d0e03587f2706274 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a1b9fef9c4cd2ec9495dd8156e55319a3e73ae1c66bea1683b558ae603a9b5c |
|
MD5 | 1d80213d84ebcd589cd6b4a86079e0f0 |
|
BLAKE2b-256 | cbd5fdebd470359a9c109cf92796b4b23f5589716968863c87501c513aa0877e |
Hashes for quine_mccluskey_tomas789-0.2.4-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed78db8512a09169cd144e4e4d495b86514f375ade1a6c084ef4ff93bfbf78d7 |
|
MD5 | f434f2c1ae5fd790f1f8a81468ac1b25 |
|
BLAKE2b-256 | 75024acc5463cadc12d40a7a58bfddf7f738ac92ddba3c40adb18e56e155597e |
Hashes for quine_mccluskey_tomas789-0.2.4-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17dd18969934663b6af4ee6f6a9ef342dcca8ed04f4bf21a048f83d1f3fb887e |
|
MD5 | f5f341a32f05a3bb9740eecd518c7012 |
|
BLAKE2b-256 | df82ef6b96112c041367f2d0116bd15935295a5678f967f60640b27b993cbab6 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f168b38d0a0e53b769f02ee94dbdfb58d48efa6cdc90f97e7eac6e32df576ed |
|
MD5 | 73b2d5026e3892f7910b6b59ff527ede |
|
BLAKE2b-256 | cd0e2a2fe0d90a19f9b0ac01344f67f0b8aaa3fd4200c340d7ea794037df5417 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d678a3bd3a9ac8c03c92cf00a69cbbc1fb2f259788ed3603a5ff55fb5745de58 |
|
MD5 | 900cf89b167b0d49bc3899f08d2991dc |
|
BLAKE2b-256 | c36d11cdcb53dcf8b83f1b708da1cb8d2c65de45e03824f053b8968ca786966e |
Hashes for quine_mccluskey_tomas789-0.2.4-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c1e74a5557d51fbb513cfc4d24646dc777b409c0987efdc68c70f8f375e0df2 |
|
MD5 | c3d419dcfa9df675e5341455d039a0c6 |
|
BLAKE2b-256 | fb54483fb0b5bb76e3641bc79d68290e3a53defb8b97cf55e832dc5ecc178083 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27c4ee5e9f83423265a84abb44e603a1820aaf72b27a0d7105a3158a3a95638d |
|
MD5 | 94800ccb47a5de22d160a9cf0ccc88c0 |
|
BLAKE2b-256 | 3c41d1314460f4c77737bc5cbe7901e7edd50aac7ae8e84f7bf5d0bedd4ed9d9 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8829b0524c0530c90b956a349620fbb5110da9084cecad56c569798e6de7c85f |
|
MD5 | 75772448ac913361402f271c13dc77e3 |
|
BLAKE2b-256 | 1968f89b533599f84f1215ed01a223fc708392b5fcb0963490b264226e568811 |
Hashes for quine_mccluskey_tomas789-0.2.4-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95d899f9eb4454dc71f83debe1bd1454e52287c0efdf6bff3dcb23a67cac287c |
|
MD5 | a728efdf50f03d9e84b8a72157c2dc75 |
|
BLAKE2b-256 | 6bf2c7ca7f8ddcb339d4089d3b1d4723d7a4fbff458e24c49d08d29d735c5a5b |