FTL Practice ;)
Disjunctive normal form (DNF) - in Boolean logic is a normal form in which a Boolean formula has the form of a disjunction of conjunctions of literals. The formula of Any Boolean can be given in DNF.[1] To do this, you can use the law of double negation, De Morgan's law, and the law of distributivity. wiki
DNF solves the problem of simplifying logical functions. But a function can have many DNFs.
Let us denote the length of the DNF
The minimum DNF has the shortest length
A Boolean function can be uniquely specified by its number and number of variables.
There are Boolean functions of
- Convert the function number to double form and pad leading zeros to length
$2^n$ . This line will be a column of function values. - Construct a table with all conjunctions.
- Cross out lines with value 0 in a column F
- In each column, cross out all sets that are numerically the same as those already crossed out.
- Use the law of absorption on the remaining sets.
- let's sort through all the DNFs from the remaining sets
-
Clone the repo
git clone https://github.com/LKolinko/DNFMinimizer
-
Use cmake
cd ./DNFMinimizer cmake . cmake --build ./
-
Launch and enjoy :)
./dnf_minimizer