"What I cannot create, I do not understand."
— Richard Feynman
There is a particular kind of exhaustion that comes from staring at a Boolean expression at 4 AM, trying to figure out where you went wrong in your Karnaugh map, and wondering if the answer key is wrong or if you are.
Anyone who has taken a Digital Logic Design course knows this quiet, grinding confusion.
That feeling is exactly where this story begins.
Where It All Started
Mantiq didn’t start as a startup pitch or a polished product plan. It began as a small spark called Logic++, a Boolean expression simplifier built by my friend Muhammad bin Shahzad during our very first semester of Programming Fundamentals at SEECS, NUST, in 2025.
It was a first-semester project: simple in scope and built under deadline pressure. But it proved something important: a Boolean expression could be typed in, processed, and simplified right on a screen.
Instead of letting that idea stay a class submission, I took it and asked a much bigger question: What if this wasn’t just a simplifier, but an entire workbench? What if a student could type one expression and instantly see the simplified form, the step-by-step proof, the Karnaugh map, the truth table, a live circuit diagram, and clean Verilog code?
That question turned a semester assignment into Mantiq.
Building Something That Respects The Learner
If you’ve ever used a tool that gives you an answer without showing you how it got there, you know how hollow that feels. You copy the result, pass the assignment, and learn nothing.
Mantiq exists to reject that shortcut entirely.
My philosophy is simple: Mantiq exists to make Boolean logic easier to see and understand. It would have been easy to build something that just spits out final answers. Instead, every law used in the algebraic proof (absorption, distribution, De Morgan's) is laid out so a learner can actually follow the reasoning.
What Mantiq Actually Does
Type in an expression like A'BC + AB'C + ABC', or generate a fresh Karnaugh map with KMAP(6), and Mantiq goes to work instantly. Here is what I packed into that single input bar:
- Boolean Simplification: Uses the Quine-McCluskey method for minimal Sum of Products (SOP) or Product of Sums (POS) forms—never an approximation.
- Step-by-Step Algebraic Proofs: Clickable rules that show the before-and-after state of every applied law.
- Live Circuit Simulation: Gate-level diagrams are drawn automatically. Flip the inputs and watch the outputs respond in real-time.
- Circuit Recognizer: An internal database that maps minterm patterns to known textbook circuits (like Odd Parity Generators or XOR gates) and explains how they work.
- Karnaugh Maps: 2 to 6 variables, auto-grouped and color-coded.
- Verilog Export: Generate clean, ready-to-use gate-level or dataflow HDL code in one click.
The Technical Backbone
Underneath the clean interface sits a serious engineering effort.
The core logic engine is written in C++ and compiled to WebAssembly (WASM). This means the actual heavy computation (tokenizing expressions, running minimizations, evaluating truth tables) happens at near-native speed directly in the browser.
I run that engine inside a dedicated Web Worker, completely separate from the main UI thread. The interface stays completely smooth while the app crunches through a six-variable K-map. I also built the whole thing as a Progressive Web App (PWA), meaning it can be installed and used completely offline: a crucial feature for students studying the night before an exam without reliable internet.
Built On Trust, Not Data Collection
While WolframAlpha limits simplification behind freemium models and Logisim lacks K-maps and full algebraic proofs, Mantiq handles everything in one place. Completely free.
More importantly, in a time when almost every free tool harvests user data, Mantiq does not. There are no accounts, no server dependencies, and no form submissions. Your expressions are processed on your device, and they stay there.
The People Who Made This Possible
This began as a classroom project and grew into something far larger. Along the way, a small circle of batchmates showed up to brainstorm, test, and support the effort with me:
- Muhammad bin Shahzad
- Muhammad Talha
- Abdul-Rafay Mughal
- Hamza Ahmed
- Muhammad Faizan Ali
There was no funding round or incubator. Just a group of students who cared enough about getting something right to keep refining it long after the assignment had been graded.
Where Mantiq Stands Today
Mantiq now sits at version 2.0.0, open-source, and licensed under MIT. My tagline for the project captures its entire purpose: Turn Your Logic Into Life.
If you have ever fought with a Boolean expression at midnight, I think you already understand exactly why this matters to me.
Try Mantiq live here: Mantiq - Turn Your Logic Into Life (https://mantiq.usamagulzar.dev)
I’d love to hear your thoughts, feedback, or bug reports in the comments below!
Top comments (0)