Code: The Hidden Language of Computer Hardware and Software
by
Charles Petzold
Published 28 Sep 1999
He unselfishly encouraged Boole and helped him along the way, and is today sadly almost forgotten except for his famous laws. De Morgan's Laws are most simply expressed this way: A and B are two Boolean operands. In the first expression, they're inverted and then combined with the Boolean AND operator. This is the same as combining the two operands with the Boolean OR operator and then inverting the result (which is the NOR). In the second expression, the two operands are inverted and then combined with the Boolean OR operator. This is the same as combining the operands with the Boolean AND operator and then inverting (which is the NAND). De Morgan's Laws are an important tool for simplifying Boolean expressions and hence, for simplifying circuits.
…
An AND gate with two inverted inputs does exactly the same thing as a NOR gate: The output is 1 only if both inputs are 0. Similarly, an OR gate with the two inputs inverted is equivalent to a NAND gate: The output is 0 only if both inputs are 1. These two pairs of equivalent circuits represent an electrical implementation of De Morgan's Laws. Augustus De Morgan was another Victorianera mathematician, nine years older than Boole, whose book Formal Logic was published in 1847, the very same day (the story goes) as Boole's The Mathematical Analysis of Logic. Indeed, Boole had been inspired to investigate logic by a very public feud that was being waged between De Morgan and another British mathematician involving accusations of plagiarism.
RDF Database Systems: Triples Storage and SPARQL Query Processing
by
Olivier Cure
and
Guillaume Blin
Published 10 Dec 2014
Otherwise, if an empty clause cannot be produced, the theorem is false. After step 1, our axiom set is ¬A ∨ B ∨ C, A ∨ C ∨ D, ¬A ∨ ¬B, ¬(C ∨ D). Note that the “,” symbol denotes a logical conjunction. Our first three axioms are already satisfying the form required by step 2 and the transformation of the last one results in ¬C ∧ ¬D, (using de Morgan's laws) which amounts to two new axioms with our representation: ¬C and ¬D. Our new axiom set is thus ¬A ∨ B ∨ C, A ∨ C ∨ D, ¬A ∨ ¬B, ¬C, ¬D. Applying step 3, after five deductions, we obtain the empty clause symbol (h), which means that the theorem is proved (see Figure 8.4). The resolution principle yields a sound and refutation complete inference algorithm for knowledge bases expressed in conjunctive normal form.
The Art of SQL
by
Stephane Faroult
and
Peter Robson
Published 2 Mar 2006
Either we keep the group by: select customer_id from orders where order_date < add_months(sysdate, -1) and amount > 0 group by customer_id or we notice that group by is no longer required to compute any aggregate and replace it with a distinct that in this case performs the same task of sorting and eliminating duplicates: select distinct customer_id from orders where order_date < add_months(sysdate, -1) and amount > 0 Placing the condition in the where clause allows unwanted rows to be filtered at an earlier stage, and therefore more effectively. Important Aggregate as little data as you can. * * * [*] The India-born Augustus de Morgan (1806–1871) was a British mathematician who contributed to many areas of mathematics, but most significantly to the field of logic. The de Morgan laws state that the complement of the intersection of any number of sets equals the union of their complements and that the complement of the union of any number of sets equals the intersection of their complements. If you remember that SQL is about sets, and that negating a condition returns the complement of the result set returned by the initial condition (if you have no null values), you'll understand why these laws are particularly useful to the SQL practitioner.