See also logic.

Boolean lattice or boolean algebra

A boolean lattice is a lattice which has a greatest element and a least element , and complementation for every element: and .
2 neutrale elemente (eines bezüglich infimum und eines bezüglich supremum)

All possible functions for two inputs and a single output:

The column headers are the values of , the values are .
For 2 variables, 1 output:

NNF (negation normal form): Negations only in front of variables.
Literal: Variable or its negation.
CNF (conjunctive normal form): AND of ORs of literals .
DNF (disjunctive normal form): OR of ANDs of literals .

→ It’s DNF & CNF (it always is both if there is just a single operation).

CCNF (canonical CNF): OR of ANDs of literals, where each AND contains all variables.
CDNF (canonical DNF): AND of ORs of literals, where each OR contains all variables.
Maxterm: OR of all literals to make a 0 for a given input.
Minterm: AND of all literals to make a 1 for a given input.

EXAMPLE


Here we just choose max/minterm such that we have the least negations.

Why are they called max / minterm?


Rearrange to CNF / DNF

(1) Replace any symbols by :



(2) Iterate the following until no more changes:

(De Morgan)
(De Morgan)
(3) Iterate the following until no more changes:
(Distributive)

If then else (ITE) notation

if (a == true) then b else c
e.g. boolean operators:




Shannon decomposition

Let (function with inputs and a boolean output: )
The cofactor of on is where is set to :

The cofactor of of on is where is set to :

The shannon decomposition is then:

Which can also be written as:
This can be useful for simplifying boolean expressions, since you can pick any particular , set it to , , and then only have to look at the corresponding cofactors which might be far simpler.

Binary decision diagrams (BDDs)

A BDD is a directed acyclic graph where each node represents a boolean variable, and the edges represent the value of that variable. The terminal nodes are the output values. The graph is reduced by merging nodes that have the same children and by removing nodes whose edges all point to the same child.
The DNF is then the set of paths from the root to the terminal nodes that evaluate to 1. The CNF is the set of paths that evaluate to 0, with the truth values negated (to preserve the end result of the equation).

Beads

A bead is the truth values lined up from bottom to top. For this would be , the first block corresponds to the first variable being true, the second one to it being false (like shannon decomposition).
If we have the same values on the left as on the right side it’s called a square, e.g. .
Beads have the form of , with being a word of length .
If the two words are the same in the tree, we can merge. If they contain only 1s or only 0s, we collapse it to pointing to only 1 or 0.

center
The values of the nodes are the function results (not the variable values). Edges are based on the function formula.
The order of variables makes a big difference in this method.
What’s nice is that you can easily chain the beads.

The majority function ( half true) is quite simple as a BDD

center