This is a C# console application that evaluates Boolean algebra expressions and generates truth tables for the given input. The program supports a wide range of Boolean operators, allowing users to analyze the behavior of logical expressions.
- Boolean Expression Evaluation: Supports expressions with variables (e.g., A, B, C) and logical operators like
AND,OR,XOR,IMPLIES,EQUALS,NAND, andNOR. - Automatic Variable Extraction: The program automatically identifies and extracts the variables from the entered Boolean expression.
- Truth Table Generation: For each Boolean expression, a truth table is generated, showing all possible combinations of the variables and the corresponding results of the expression.
- Customizable Operators: Easily add or modify operators to extend the functionality.
- AND: Logical AND (
A AND B) - OR: Logical OR (
A OR B) - IMPLIES: Logical implication (
A IMPLIES B) - EQUALS: Logical equivalence (
A EQUALS B) - NAND: Logical NAND (
A NAND B) - NOR: Logical NOR (
A NOR B) - XOR: Logical XOR (
A XOR B)
- Run the program in a C# environment.
- When prompted, enter a Boolean expression such as
A AND B OR C. - The program will automatically extract the variables (
A,B,C) and generate the corresponding truth table.
- Clone this repository to your local machine:
git clone https://github.com/yourusername/BooleanAlgebraEvaluator.git
- Open the solution file in Visual Studio or any other C# compatible IDE.
- Build and run the project.
- .NET Core or .NET Framework
- Visual Studio or any C# compatible IDE
Enter a Boolean Expression (e.g., A AND B OR C): A AND B OR C
| A | B | C | A AND B OR C |
----------------------------
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
This project is a demonstration and should not be considered a robust implementation. It was made solely for experimentation and enjoyment, without any guarantee of performance or quality.