Understanding De Morgan's Laws to Simplify Propositions
Yesterday, I watched a conference talk about Formal Logic, where De Morgan’s Laws were discussed. Wikipedia provides a very good explanation of the laws in-depth. Essentially, they are transformation rules that allow you to simplify certain propositions. Whilst programming, predicate logic of this form appears very frequently. It is very useful to know how you can rewrite a predicate to better describe its intent.
// Negation of conjunction
(!a && !b) == !(a || b);
// Negation of disjunction
(!a || !b) == !(a && b);