Skip to content

Latest commit

 

History

History
31 lines (18 loc) · 2.42 KB

File metadata and controls

31 lines (18 loc) · 2.42 KB

Evaluator-For-Boolean-Expression

Boolean algebra is a type of algebra that is created by operating the binary system. In the year 1854, George Boole, an English mathematician, proposed this algebra. This is a variant of Aristotle’s propositional logic that uses the symbols 0 and 1, or True and False. Boolean algebra is concerned with binary variables and logic operations.A Boolean expression is an expression that produces a Boolean value when evaluated, true or false, the only way to express a Boolean value. Whereas boolean variables are variables that store Boolean numbers. P + Q = R is a Boolean phrase in which P, Q, R are Boolean variables that can only store two values: 0 and 1. The computer performs all operations using binary 0 and 1 as the computer understands machine language (0/1). Boolean logic, named after George Boole, is a type of algebra in which all values are reduced to one of two possibilities: 1 or 0. To effectively comprehend Boolean logic, we must first comprehend the rules of Boolean logic, as well as the truth table and logic gates..




How to run it

[1] The program will be downloaded first by clicking on the green "Code" button and selecting "Downlad as ZIP" or you can copy the source code directly from the ** main.py ** file to an IDE (such as ** PyCharm **) or text editor (such as ** Visual Studio Code **; in this case, you will need to install extensions that allow Python code to run). This program takes an expression as an argument and returns its abstract syntax using binary trees.

[2] Input requirements: This program takes as its argument the abstract syntax returned by the program: [https://github.com/Emanuel181/Tema_LC_Transformare_In_Sintaxa_Abstracta]; you can copy-paste; And the initial, raw expression.

You have to use this conventions:
0 (For False)
1 (For True)

Avoiding conventions leads to errors

[ EXAMPLES ]

Screenshot 2021-12-18 191434

Screenshot 2021-12-18 191529