Skip to main content

teachmeqmc

This package contains an implementation of the Quine-McCluskey algorithm and serves to educational purposes.

Its main goal is to produce a LaTeX document with detailed description of the performing of the Quine-McCluskey algorithm for a given input; the input is represented by a complete Disjunctive Normal Form (shortly DNF) which may contain duplicate minterms.

The motivation to write this program was to provide university students with automatically generated examples for better understanding the Quine-McCluskey algorithm and, furthermore, to randomly generate examen tests on this subject together with their detailed solutions to make the corrections of the tests easier.

Installation

Install the package from PyPI utilizing the pip module:

python -m pip install teachmeqmc

Example

A simple program using this package may look like this:

    from teachmeqmc import BooleanFunction

    f = BooleanFunction(4)
    f.addTerm((0, 0, 0, 0))
    f.addTerm((0, 0, 0, 1))
    f.addTerm((0, 0, 1, 0))
    f.addTerm((0, 0, 1, 1))
    f.addTerm((0, 1, 0, 0))
    f.addTerm((1, 1, 0, 0))
    f.addTerm((1, 1, 0, 1))
    f.addTerm((1, 0, 0, 1))
    f.addTerm((1, 0, 0, 1))

    f.performQuineMcCluskey()

    f.show()
    f.saveToTextFile("output.txt")
    f.saveToLaTeXFile("output.tex")

The program first imports the class BooleanFunction. Then it creates a new instance f of the class BooleanFunction which represents a Boolean function (a mapping from {0,1}^n to {0,1}) defined by its complete DNF. The parameter 4 gives the number of the inputs of the Boolean function.

Further, by calling the method addTerm it is defined by which minterms the complete DNF of the Boolean function is given; for example f.addTerm((0, 0, 1, 0)) states that the minterm a'b'cd' shall be a part of the defining complete DNF. Observe that the last two minterms are identical. However, both will be part of the defining complete DNF and in the output report it will be visualised that one of these terms has to be removed.

Then the Quine-McCluskey algorithm is performed; this method does not return anything, instead, it stores the result of the procedure to the attributes of BooleanFunction.

Finally, calling show prints the report on the processing of the Quine-McCluskey algorithm to the terminal output, calling saveToTextFile saves it to a plain text file, and calling saveToLaTeXFile saves it to a LaTeX file which can be further compiled to a PDF file e.g. by pdflatex.

Remark that also single parts of the report may be obtained. For such an output, see the methods of the class BooleanFunction in the form export...ToLaTeX and export...ToText.

Metadata

Release files for teachmeqmc 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for teachmeqmc 0.1.0
File Size Uploaded Provenance Actions
teachmeqmc-0.1.0.tar.gz 33.5 kB Without provenance Details for teachmeqmc-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for teachmeqmc 0.1.0
File Interpreter ABI Platform Actions
teachmeqmc-0.1.0-py3-none-any.whl Python 3 none any Details for teachmeqmc-0.1.0-py3-none-any.whl

Total release size: 70.5 kB

Release files / teachmeqmc-0.1.0.tar.gz

Download URL teachmeqmc-0.1.0.tar.gz
Size 33.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0e43e202d64f705079c577f752cdf0845201cc22a9cd676fd88e89f4390197f5
BLAKE2b-256 checksum
How to use checksums
34cdf39588028326b5fcd21ea39b8e407ca70688a687addc5367b58d709ec29d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

Release files / teachmeqmc-0.1.0-py3-none-any.whl

Download URL teachmeqmc-0.1.0-py3-none-any.whl
Size 37.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
335ae9e87955894d0244f89cd345b8ea256755959ea95f54201fba0a7e6a5d81
BLAKE2b-256 checksum
How to use checksums
7aa77507199ca4e908189457c03c35759bbf467a02482afb1d8cdce6aa1c9e04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

Security for teachmeqmc 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page