Logic is the formal mathematical study of the methods, structure, and validity of mathematical deduction and proof.
According to Wolfram (2002, p. 860),
logic is the most widely discussed formal system since antiquity.
In Hilbert's day, formal logic sought to devise a complete, consistent formulation of mathematics such that propositions could be formally stated and proved using a
small number of symbols with well-defined meanings.
The difficulty of formal logic was demonstrated in the monumental Principia Mathematica
(1925) of Whitehead and Russell's, in which hundreds of pages of symbols were required
before the statement
could be deduced.
The foundations of this program were obliterated in the mid 1930s when Gödel unexpectedly proved a result now known as Gödel's
second incompleteness theorem. This theorem not only showed Hilbert's goal to
be impossible, but also proved to be only the first in a series of deep and counterintuitive
statements about rigor and provability in mathematics.
A very simple form of logic is the study of "truth tables" and digital logic circuits in which one or more outputs depend on
a combination of circuit elements (AND, OR,
NAND, NOR, NOT,
XOR, etc.; "gates") and the input values. In such
a circuit, values at each point can take on values of only true
(1) or false (0). de
Morgan's duality law is a useful principle for the analysis and simplification
of such circuits.
A generalization of this simple type of logic in which possible values are true, false, and "undecided" is called three-valued
logic. A further generalization called fuzzy logic
treats "truth" as a continuous quantity ranging from 0 to 1.