How to simplify logical expressions?

I am writing a small calculator of logical expressions (Boolean algebra) You need to file a simplification of the logical expression (example here).

There is a syntactic expression tree (leaves are operands (constants and variables), branches are operations) There is a task to make the simplification of expressions as a person does (with explanations of each step) (example in the attached screenshot). Now there is only an idea to describe all the replacement rules (all sorts of de Morgan's laws and so on similar) and traversing the tree from the bottom to iterate over these rules Simplifying logical expressions

Author: MadRazzle, 2015-12-05

1 answers

I see what you don't have: there is no commutativity, distributivity, and canonicalization of the expression. But idempotence is found early - first, just the commutativity of the operation OR for four operands.
You will also need the constants TRUE and FALSE and the associated laws.
For sky-high expressions of the specified type, you can calculate the truth table by 4 values, build the SDNF on it and simplify it (and it is better to "learn" the table from the "cheat sheet").

 1
Author: Yuri Negometyanov, 2015-12-06 11:54:06