A Boolean simplification and inference library that integrates K-Map simplification and logical inference.
Project description
by
Overview
StanLogic is a Python package dedicated to Boolean expression simplification and logical reasoning. It provides computational tools that bridge mathematical formalism and algorithmic implementation for digital logic, electronics, and computer science education.
The project aims to serve as a pedagogical and research tool, offering students, educators, and developers a clear computational framework for analyzing and minimizing Boolean logic.
Research Background
StanLogic is part of an ongoing research initiative by Stan's Technologies, focused on computational models in logic, electronics, and algorithm design. The motivation behind this work is to create open-source computational models that can aid teaching, research, and local problem-solving in Africa and beyond.
This project demonstrates how algorithmic engineering can make mathematical and electronic concepts tangible through simulation and software. The goal is to advance computational literacy by showing how complex logic principles can be represented in executable form.
Modules within the Package
-
KMapSolver – A module for deriving minimal SOP (Sum of Products) and POS (Product of Sums) expressions for 2, 3, and 4-variable Karnaugh Maps.
-
Supports don’t-care conditions.
-
Uses efficient bitmask operations for implicant filtering and coverage analysis.
-
Outputs minimal Boolean expressions with human-readable and symbolic formats.
-
Future modules will include additional logic simplifiers, expression parsers, and symbolic verification tools.
Documentation and Test Files
- Documentation can be found here: kmapsolver.md
- Test files can be found here: kmapsolver tests
The documentation provides extensive guides on the thought processes behind the costruction of the algorithm, key optimizations, and future research directions.
The test files show how the methods within the algorithm may be used, as well as benchmark test cases against SymPy, and the corresponding output
Repository Structure
StanLogic
│
├── docs
│ └── kmapsolver.md /* Documentation for kmap solver */
│
├── images
│ ├── St_logo_dark.png
│ ├── St_logo_light-tp.png
│ └── St_logo_light.png
│
├── prototypes /* Base prototypes to understand development thought process */
│ ├── kmap_solver_prototype.py
│ └── kmapsolver.py
│
├── src
│ └── stanlogic
│ ├── init.py
│ └── kmapsolver.py /* Source code for kmap solver */
├── tests
│ └── KMapSolver /* Test files for kmap solver */
│ ├── outputs /* Outputs for test results save here */
│ ├── benchmark_results.csv
│ └── benchmark_results.pdf
│ ├── benchmark_test.py
│ ├── k_map_demo.py
│ ├── tbk_test2var.py
│ ├── tbk_test3var.py
│ └── tbk_test4var.py
└── README.md
How to Use
Clone the repository and install locally:
git clone https://github.com/Stanislus29/stangorithms.git
cd StanLogic/src
pip install -e .
Citation
If you use StanLogic in your research, teaching, or software, please cite it as follows:
Plain Text:
Somtochukwu Stanislus Emeka-Onwuneme. StanLogic: A Python Package for Boolean Simplification and Logic Computation. Stan's Technologies, 2025. GitHub Repository.
BibTeX:
@software{stanlogic2025,
author = {Somtochukwu Stanislus Emeka-Onwuneme},
title = {StanLogic: A Python Package for Boolean Simplification and Logic Computation},
year = {2025},
institution = {Stan's Technologies},
url = {https://github.com/Stanislus29/stangorithms/tree/main/StanLogic}
}
Licence
This project is dual-licensed under AGPL - 3.0, and a commercial license
You are free to use, modify, and distribute this code for educational and research purposes only. Commercial use requires explicit permission from Somtochukwu Emeka-Onwuneme (Stan's Technologies).
For inquiries regarding collaboration, research use, or licensing, contact:
Email: stanstechnologies@gmail.com
Institution: Stan's Technologies, Ghana
Acknowledgments
This project was built as part of a broader initiative to develop computational educational tools in logic and mathematics. The author acknowledges the open-source community for inspiring reproducible research and educational innovation.
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 Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stanlogic-1.1.1.tar.gz.
File metadata
- Download URL: stanlogic-1.1.1.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d199907e3c74b52a38547306a752cf018f6c02216e48c0fafe90da2d1cd765f9
|
|
| MD5 |
fac6a2cb09227c07339f438599f0ec69
|
|
| BLAKE2b-256 |
563eb8451ac0b71828152c9bbb088d7c353eb9401df72c7f56561d012d90356a
|
File details
Details for the file stanlogic-1.1.1-py3-none-any.whl.
File metadata
- Download URL: stanlogic-1.1.1-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb01e249cee50731276cc396aacf5e61ab8d422a258fa1b811245b044a98189a
|
|
| MD5 |
846f293f30cad6295d31adf94a967dd6
|
|
| BLAKE2b-256 |
c272cac96a54e3416947037f5db4fd36ddf827a49417c62151bb8bd61f7948f0
|