Parsalimi / Truth-Table

The Truth Table Generator project emerged from my coursework in the Basics of Mathematical Science at IAU SRB.
MIT License
0 stars 0 forks source link

Truth Table Generator

Example 1 Example

This project was developed as part of my coursework for the “Basics of Mathematical Science” course at IAU SRB. Inspired by the fundamental concepts of logic and Boolean algebra, I created this truth table generator from scratch, without relying on any external modules or libraries. The goal was to deepen my understanding of logical operations, truth values, and the systematic representation of logical expressions. This is a simple yet powerful Truth Table Generator that can handle complex logical expressions. It supports various logical operators such as → (implication), ↔ (equivalence), ∧ (conjunction), ∨ (disjunction), and ~ (negation). The tool also automatically detects and handles parentheses in the input expression.

Features

Installation

Follow these steps to set up the project:

  1. Clone the repository
    git clone https://github.com/Parsalimi/Truth-Table.git
  2. Open directory
    cd Truth-Table
  3. Install the dependencies
    pip install -r requirements.txt
  4. Run
    python main.py

Usage

Example

Suppose you want to generate a truth table for the expression (p∧q)→p. Here's how you can do it:

  1. Run the script.
  2. Enter the expression as (p∧q)→p.
  3. The script will generate the truth table, displaying the results like this:
p q p∧q (p∧q)→p
T T T T
T F F F
F T F T
F F F T

License

This project is licensed under the MIT License