Chapter 3
Logic Machines
171
3.1 Introduction
• The popular conception of the computer is one
of a giant calculator, a machine that can carry
out millions of arithmetic operations at
lightning-fast speeds. But if this were all that
computers are, they would be unable to do
most of the tasks they are commonly assigned.
• They could not sort or organize data, as they do
each time we do word processing or use a
database; they could not even carry out
complex computations, because these involve
making nonarithmetic decisions, e.g., deciding
when to stop one arithmetic process and begin
another.
172
• Computers are powerful because they are able
to carry out long and complex sequences of
logical as well as arithmetical operations and
modify these sequences according to
information presented to them, without any
direct human intervention(干涉). Without the
ability to make logical decisions, computers
would have nothing more than an uncontrolled,
raw arithmetic power, which would make them
only slightly more useful than simple adding
machines.
173
• The computer was not the first calculating
technology able to make logical decisions.
Many punched-card systems, relay (继电器式
计算器), and electronic calculators of the 1930s
and early 1940s had rudimentary (基本的)
logical capabilities. But there is an even earlier
stream of development, beginning around 1800,
having as its central purpose the construction
of machines capable of making logical decisions.
174
• This chapter traces the history of these
machines built to solve problems of Aristotelian
and symbolic logic, and shows how their
development fits into a much older tradition of
automata-devices and machines built to mimic
(模仿) mental and physical aspects of
human behavior.
• This chapter also traces the growing
understanding prior to the Second World War
of the relationship between logic and the theory
of computing, which is the foundation for
computer science today.
175
3.2 The Automata Tradition
• The automata tradition extends back into antiquity
(古代). In the Hellenistic(希腊) period
complex mechanisms were constructed to give the
appearance of human animation (活泼). For
example, around 200 B.C., Heron of Alexandria
constructed a theater in which the god Dionysius
would emerge and spray wine from his staff while
the Bacchants(酒神) danced in his honor. These
Hellenistic mechanisms were powered in many
different ways: by falling water, sand, or mustard
(芥菜)seeds; heat; atmospheric pressure; and in
one case by a primitive steam engine.
176
The Great Civic Clocks
• The great civic(市民) clocks constructed in
major European cities, beginning in the thirteenth
century, also are part of this tradition. Human and
other figures ornamenting (装饰) the clocks
became animated at the tolling (敲钟)of certain
hours. For example, from the clock at Strasbourg
(法国城市) the three Magi(祭司) emerged
and a cock crowed each day at dawn. Over time, in
the late Middle Ages and the Renaissance(文艺复
兴), these clockwork automata became more
elaborate and were built separately from the civic
clocks.
177
Modeled Mental Process
• Most of these automata modeled physical
rather than mental processes. Of the latter
variety were several attempts to construct
talking automata and perhaps more
importantly van Kempelen‘s 1769 chess player,
which though fraudulent(欺诈) (hiding a
man inside the player) engendered(产生) a
seventy-year debate over the possibility of
mechanizing human thought processes.
1769,我国处于清朝乾隆年间,国内无大事。
178
The Automata On the Continent
• But the number of automata of this type on the
Continent were few, especially in comparison to
the number developed in England, where
craftsmanship(技能) was not nearly so
advanced. There are probably many reasons to
explain why this is so, but one may have been
philosophical rather than technological.
Cartesian (笛卡尔信徒)philosophy colored
every aspect of Continental thought throughout
the eighteenth century.
179
Descartes’s Dualism(二元论)
• Perhaps influenced by the elaborate
clockwork automata of his time,
Descartes (笛卡尔)philosophy
explained even the most complex physical
processes of the universe in terms of
clocklike mechanisms. But the
maintained a strict mind-body dualism,
denying that mental processes can be
explained in mechanical terms.
180
Descartes’s Dualism
• This rationalist(理性主义) dualism was
questioned, e.g.,by Julien de La Mettrie in
Man the Machine (1748) and by Baron
d‘Holbach in System of Nature (1770) as well
as by the discussions surrounding van
Kempelen’s automaton, but the influence of
Descartes‘ world view should not be
underestimated(低估).
1748,1770,我国处于清朝乾隆年间,国内无大
事。
181
3.3 The Development of Logic and Its
Mechanization
• Another line of development, sometimes
closely intertwined(纠缠) with the
automata tradition, was the effort to
mechanize logic, historically regarded as
the most central of the rational processes.
182
Ramon Lull's Ars Magna
• The Spanish theologian (神学家) Raymond
Lull (1235-1315) used geometrical diagrams
and primitive logical devices to try to
demonstrate the truths of Christianity . He
believed that each domain of knowledge
involves a finite number of basic principles, so
that by enumerating the permutations(排列)
of these basic principles in pairs, triples, and
larger combinations a list of the basic building
blocks for theological discourse could be
assembled.
1235-1315,我国处于南宋末至元朝初。
183
184
• Although these devices did not really
offer labor savings or additional logical
power, Lull‘s “great art” was admired by
many Renaissance(文艺复兴) clerics
(牧师)and commented on by such
noted scholars as Nicholas of Cusa,
Athanasius Kircher (who is notable(著
名) for his interest in automata, e.g., his
plans for building a talking head), and
Wilhelm Gottfried Leibniz.
185
Algebraic-Logical Synthesis
• Leibniz was enamored(倾心) with the power
that algebraic symbolism and method had
added to geometry during the previous century.
In his De Arte Combinatoria (1666) and in
later fragmentary works he described an
"algebraic-logical synthesis" by which one
could reason mechanically in all fields as one
could reason in algebra. The first step was to
devise a universal language, his "universal
characteristic," for expressing thoughts in an
unambiguous, symbolic way."
1666,我国处于清朝康熙年间,国内无大事。
186
Algebraic-Logical Synthesis
• Leibniz experimented with various linguistic
schemes, e.g., representing primitive ideas by
prime numbers and complex ideas by the
product of these numbers. He also moved
towards an algebra of logic by implicitly giving
logical interpretations to the algebraic
operators and relations +, x, -, =. But he never
achieved substantial results, and this work
became widely known only in the twentieth
century when his fragmentary writings were
first published.
187
Algebrization of Logic
• The algebrization of logic, primarily the
work of Augustus de Morgan (1806-1871)
and George Boole (1815-1864), was
important to the transformation of
Aristotelian logic into modem logic and to
the introduction of logic machines in the
automation of logical reasoning.
188
Augustus de Morgan’s Formal Logic
• In his Formal Logic (1847) the British
mathematician de Morgan began the
algebrization process. He introduced
quantification into logic. By using algebraic
variables to represent the numbers of members
of classes mentioned in a syllogism, e.g., there
are a A's and b B's, he could strengthen a
conclusion like "Some A's are B's" to "At least
k A's are B's," where k is an algebraic
expression involving a, b, and other variables
that appeared in the premises.
1847,我国处于清朝道光年间,国内无大事。
189
George Boole’s Formal Logic
• In his Mathematical Analysis of Logic (1847)
and An Investigation of the Laws of Thought
(1854) the Irish professor of mathematics Boole
rigorized logic by introducing algebraic
symbolism and method. He let x, y, z represent
classes, X, Y, Z individual members, 1 the
universal class, 0 the null (empty) class, xy the
intersections of classes x and y, x + y the union
of (disjoint) classes x and y, and 1 - x the
complement of class x. He then presented in
symbolic form, as the axioms of his logic. His
axioms include, for example:
1854,我国处于清朝咸丰年间,太平军在江西
湖口大败湘军水师,曾国藩投湘江未遂。
190
Others
• These first efforts to reform Aristotelian logic
were continued in the late nineteenth and early
twentieth centuries by Charles Saunders Peirce,
Gottlob Frege, Guiseppe Peano, Bertrand
Russell, Alfred North Whitehead, and others.
Their efforts further stimulated the
mechanization of logic because machines could
conduct or abet(教唆) the algebraic
manipulation that now represented logical
reasoning.
191
3.4 Logic Machines
• The first logic machine, the Stanhope
Demonstrator, appeared prior to the
algebrization of logic. Charles, third Earl
(伯爵)of Stanhope, (1753- 1816) was a
politician and inventor of independent
means. His scientific abilities were
recognized early, leading to his joining
into the Royal Society of London at the
age of nineteen.
1753-1816,我国处于清朝乾隆至嘉庆年间。
192
The First Logic Machine
• Stanhope invented a microscopic lens, a
hand printing press, a tuner for musical
instruments, an improved system of canal
locks, and an arithmetical calculating
machine, as well as a theory of electricity.
193
The First Logic Machine
• Stanhope‘s Demonstrator, refined over a thirty-year
span, is a device able to solve mechanically
traditional syllogisms, numerical syllogisms, and
elementary probability problems. It consists of a 4“ x
4.5” x 0.75“ mahogany block with a brass(黄铜) top,
having carved out of it a window 1” x 1” x 0.5”. Slots
were grooved(开槽) in three sides of the block to
allow transparent red and gray slides to enter and
cover a portion of the window. On the brass face,
along three sides of the window, integer calibrations
from zero to ten were marked.
194
195
Demonstrator’s Limitations
• It could not be extended to syllogisms(三
段论) involving more than two premises
or to probability problems with more
than two events (always assumed to be
independent of one another). Any of the
problems it could handle were solved
easily and quickly without the aid of the
machine.
196
Alfred Smee’s Electro-Biology
• Alfred Smee (1818- 1877), senior surgeon
to the Royal General Dispensary(皇家总
医院). Also a Fellow of the Royal Society,
he published a series of books on a field
he called "electro-biology," the relation
of electricity to the vital functions of the
human body.
1818- 1877,我国处于清朝嘉庆至光绪年间。
197
Alfred Smee’s Electro-Biology
• Stimulated by the lectures of Herbert
Mayo on the physiology of the brain, his
laboratory work under John Fredenc
Daniell (inventor of the Daniell battery),
and the prevailing(主流) theory of
Luigi Galvani on the effect of electrical
stimulation on nerves and muscles, Smee
determined to study how the functions of
the brain are related to the electrical
stimulation of the nervous system.
198
Process of Thought Adapted to Words
and Language
• In 1851, Smee published his most important book,
Process of Thought Adapted to Words and
Language, which, he stated, "is a deduction from
the general system of Electro-biology." He planned
to produce an artificial system of reasoning based
upon natural principles, one that processes ideas in
the same way that the human nervous system
processes them.
1851,我国处于清朝咸丰元年,太平军克永
安,封王建制。
199
Process of Thought Adapted to Words
and Language
• Little was known about the brain in 1850, and there
were no good tools for its study. Smee had to rely on
speculation(思考) rather than experimentation
to gain his understanding of human thinking. The
outcome of these speculations was to be
demonstrated in his electro-biological machine.
1850,我国处于清朝道光三十年,旻宁卒,
奕欣继位,改元咸丰;太平天国金田起义开始。
200
Smee’s Theory
• According to his theory, each idea is determined
by the presence or absence of certain properties
(redness, roundness, etc.), and each property is
represented in the brain by the electrical
stimulation of a nerve fiber(神经元). Thus, for
Smee, an idea consists of a collection of electrically
stimulated nerve fibers. One might envision(想
象) Smee building an elaborate
electromechanical machine with artificial nerve
fibers and cortex(皮质). But consistent with the
technology of 1850, the machines Smee conceived
were entirely mechanical.
201
Relation Machine
• His Relational Machine, so called because it
represented the relationship between the various
properties that comprise an idea, was intended to
represent one thought, idea, or mental image at a
time. One version of it was constructed from a large
piece of sheet metal, repeatedly divided into halves by
metal hinges(铰链). Half of the metal would
represent the presence, the other the absence, of a
property. The metal flaps(折叠), representing
absent properties, would be folded out of sight until
all that remained was a piece of metal representing
the collection of properties that formed the idea.
202
The Second Relation Machine
• Smee designed a second machine to compare
ideas. This Differential Machine consisted of
two Relational Machines linked together by an
interface able to compare the properties
represented by each Relational Machine and
then to judge whether the ideas agree, probably
agree, possibly agree, or disagree.
Representation of ideas and judgments about
them, the tasks his machines were designed to
do, comprised the entire rational thinking
faculty for Smee.
203
Appraisement
• Smee was confident his machines could model
human thought. Although Smee may have
built small scale models of his machine (even
this is doubtful), he realized that his hope for
a machine that could represent the natural
processes of thought and judgment was
beyond his reach. Nevertheless, his books
were popular in mid-nineteenth-century
Britain and spread his conviction(确信) of
the possibility of mechanized thought.
204
William Stanley Jevons’s Login Piano
• Stanhope's work inspired William Stanley Jevons to
construct his "logic piano," the best known logic
machine of the nineteenth century. Jevons (1835-1882)
was professor of logic and political economy at Owens
College, Manchester, and later at University College,
London.
• His research in logic was encouraged by his teacher,
Augustus de Morgan. Today, Jevons is perhaps best
known for his unfortunate theory of the correlation
(相关性) between sunspots and economic cycles.
205
Logic Piano
• In his 1869 logic textbook, Substitution of Similars,
Jevons announced the construction of the logic
piano. It was the culmination (顶点)of a long
series of inventions and aids to the calculation of
syllogisms: logical alphabet, logical slate(石板),
logical stamp, and logical abacus-all tools to write
quickly the lines of a truth table in a logical
argument.
1869,我国处于清朝同治八年,国内无大事。
206
Logic Piano
• The logic piano was a box approximately three
feet high. A faceplate (面板)above the
keyboard displayed the entries of the truth
table. Like a piano, the keyboard had blackand-
white keys, but here they were used for
entering premises. As the keys were struck, rods
would mechanically remove from the face of the
piano the truth-table entries inconsistent with
the premises entered on the keys.
• As propositions were entered on the keyboard,
representing additional premises that must be
satisfied simultaneously(同时地), other
inconsistent entries would disappear from the
face.
207
208
Limitations
• The machine was limited to solving
problems involving four or fewer
propositions, although these could easily
be handled manually.
• As the philosopher Francis Bradley
pointed out, the action of the logic piano
did not result in a conclusion stated in the
form of a proposition, but only in the
truth table entries consistent with the
conclusion.
209
Limitations
• As his adversary(敌手) John Venn
noted, the logic piano has no practical
purpose, for there are no circumstances
in which difficult syllogisms arise or in
which syllogisms must be resolved
repeatedly enough to justify
mechanization of the process. Jevons
countered(反击) that it was a
convenience to his personal work and
useful in his logic classes.
210
Venn diagrams
• Diagramming of logical arguments has a
long history. In the Middle Ages
diagrams were devised for remembering
various forms of the Aristotelian
syllogism. In the seventeenth and
eighteenth centuries, the mathematicians
Gottfried W. Leibniz, Leonhard Euler,
and J. H. Lambert all had developed
systems for diagramming logic.
211
Venn diagrams
• The first practical system of diagramming
was announced by Venn in an 1880 article in
Phi Zosophica Z Magazine. It described his
method of Venn diagrams, which is only a
slight variation on the method of intersecting
circles still taught in schools today.
1880,我国处于清朝光绪六年,左宗棠创办兰
州机器织呢局,并开工投产;李鸿章奏办天津北
洋水师学堂﹑南北洋电报局。
212
Allen Marquand's logic machine
• After studying at Johns Hopkins University with C. S .
Pierce, Allen Marquand (1853-1924) was appointed
tutor of logic at the College of New Jersey, as Princeto
University was then called.
• Marquand improved upon Jevon‘s logic piano. He
constructed a crude version in 1881, and a Princeton
colleague, Charles Rockwood, followed the next year
with a more elaborate version. It measured 12“ x 8” x
6“ and used a mechanical action.
1881,我国处于清朝光绪七年,曾纪泽与沙俄
签订《中俄改订条约》。
213
Allen Marquand's logic machine
• Marquand proposed a third version that
would have changed the action of the
machine from mechanical to
electromechanical, but difficulties with
the new electrical technology prevented
him from advancing beyond building a
prototype from a hotel annunciator(报警
器).
215
Allen Marquand's logic machine
• Marquand's machine was designed for
syllogisms involving four propositions.
The front of the machine displayed
pointers representing the sixteen possible
logical combinations. The pointers would
turn to indicate the consistency or
inconsistency of the logical combinations
with the premises.
216
Allen Marquand's logic machine
• Marquand improved upon Jevons’
keyboard for entering premises, opening the
possibility of constructing a machine
capable of handling many more
propositions . However, both machines were
limited in the complexity of argument they
could handle, and both produced only
logical combinations consistent with the
concluding proposition rather than the
proposition itself。
217
The First Electrical Logic Machine
• In 1936 Benjamin Burack, a psychologist
at Roosevelt College in Chicago,
constructed the first electrical logic
machine. It was packaged in a small
suitcase and powered by batteries. The
bottom of the case contained wooden
blocks representing propositions.
1936,西安事变。
218
The First Electrical Logic Machine
• These blocks held metal contacts, and when the
blocks were moved to certain positions, circuits
would be activated showing whether a syllogism was
valid or which of seven categories of fallacies (谬论)
occurred. Burack's machine offered little advantage
over manual checking and was generally unknown
until it was described in the literature in 1947.
1947,我国处于民国三十六年,国民政府公布
《中华民国宪法》,刘邓大军强渡黄河﹐揭开人民解
放军战略进攻序幕, 《中国人民解放军宣言》发表。
219
220
Beginning to Program on Computers
• After the Second World War, it became
apparent that general-purpose stored-program
computers could achieve the same results as
any of these special-purpose logic machines.
Subsequently, all major logic machines have
been programmed on computers. The first such
effort was made by Hao Wang in 1960. He
programmed an IBM 704 computer to test the
first 220 theorems of the propositional calculus
as presented in Bertrand Russell and Alfred
North Whitehead's Principia Mathernatica.
221
Beginning to Program on Computers
• The process was completed in less than
three minutes, at least a thousand times
faster than could be done manually. Since
1950 a number of computers have been
programmed to act as logic machines.
They have been used either to try to
discover new logical results or to
investigate the general principles by
which computers can be used to prove
theorems.
222
3.5 Logic and Computing
• The logic machines described here did not have
any practical significance. They did not provide
meaningful control of the daily information
flow in the factory or business office, nor did
they enable scientists to solve problems they
could not otherwise easily solve by hand.
Although logic machines were occasionally
used as didactic(启发式) aids, their chief
importance was theoretical. They demonstrated
that logical processes could be mechanized.
223
• Thus, it should come as no surprise that
their principal role in modern computing
is also theoretical. The existence of logic
machines reinforced the relationship
between logic and computing, and helped
to set the context in which two theoretical
papers of the 1930s were written, papers
that provided the underpinning for the
modern theory of computing.
224
Claude Shannon’s Paper
• In a 1938 paper based upon his master's thesis at MIT,
Claude Shannon demonstrated how relay and switching
circuits could be expressed in the logical symbolism of
the propositional calculus, and vice versa.
• Similar circuit interpretations can be given for the
logical connectives not, and (not both), exclusive or, and
equivalence . This isomorphism(同构) between
propositional calculus and relay and switching circuits
became a powerful new design tool.
1938,我国处于民国二十七年,蒋介石任国民党总
裁;台儿庄战役,中国军队大捷;毛泽东发表《论持久
战》;国立西南联合大学命名;花园口决堤; 国民政府
公布《抗战建国纲领》;武汉撤守,长沙大火;滇缅公
路完成;汪精卫逃出重庆﹐叛变投敌。
225
Examples
• Some examples of the correspondence he
discovered are:
• logic circuit
true closed
false open
and serial
or (inclusive) parallel
226
The Impact
• Inspired by Shannon's paper, Burkhardt
and Kalin employed it in the design of
their special-purpose electrical logic
machine.
• Hundreds of papers followed Shannon's,
building this fundamental isomorphism
between logic and computing into a
theory of switching circuits and a
practical design methodology.
227
The Impact
• A more important application was to
electrical circuit design for computers.
Complex circuits could be more readily
simplified by simplifying the
corresponding Boolean expression; and
in many cases it was easier for a circuit
designer to express his design in a logical
expression and only later translate that
into a circuit design.
228
Alan Turing's “On Computable Numbers”
• The other important theoretical paper of the
1930s was Alan Turing's “On Computable
Numbers” ( 1936). Turing characterized which
functions or, as he equivalently considered, which
numbers in mathematics, are effectively
computable.
1936,西安事变。
229
• By this he understood functions that can
be computed in a mechanical fashion by a
well-defined algorithm that requires no
human intervention during the course of
the computation.
• Turing’s paper was one of the original
contributions to the area known as
recursive function theory.
230
Turing machines
• Turing phrased his characterization in terms of
theoretical machines, known today as Turing
machines.
• He defined a mathematical function to be
effectively computable just in case it could be
calculated by one of his machines and
demonstrated that one of his machines, the
Universal Turing Machine, was able to
simulate any of his other machines.
• By Turing’s criteria, a mathematical function is
effectively computable if and only if it can be
computed by the Universal Turing machine.
231
• A Turing machine consists of an infinite tape,
broken into cells, and a mechanical device
capable of scanning the tape and performing a
few basic read and write operations. At any
moment, depending on the internal state of the
machine and the symbol in the cell being
scanned, the machine may move the tape one
square left or right, or print or erase a symbol
in the scanned cell. Function arguments are
entered as a coded sequence of 0s and ls on
consecutive cells.
232
• Function values are read off as another
coded sequence of 0s and 1s when the
machine completes its activity. If the
activity never ceases, the function is not
effectively computable for that argument.
The universal machine represents
essentially a function of two variables,
one being the number of a particular
Turing machine it is to simulate and the
other being the function argument.
233
The Importance
• The importance of the Universal Turing
Machine to computer science becomes clear
once it is recognized that it is a theoretical
model of a digital, stored-program computer.
• Instructions programming the operation of the
machine, as well as data, are entered on the
tape. The tape serves the dual function of
input-output medium and memory-similar to
magnetic tape in computers (which is used,
however, only as a secondary storage medium).
234
The Importance
• Information is stored, processed, and
transferred digitally. Central processing takes
place at the read-write mechanism, which is
able to carry out logical and arithmetic
operations on the scanned cell and those
adjacent to it-whether they represent
instructions, input data, or intermediate results.
• Many programming features, like conditional
and unconditional branching and recursive
loops, have their Turing machine equivalents.
235
Appraisement
• Just as Shannon’s paper served as the
starting point for the theory of switching
and relay circuits, Turing’s paper opened
the field of automata theory-the
theoretical study of the computing
capabilities of well-defined information
processing automata.
236
Appraisement
• Turing’s methods, and the methods of
recursive function theory more generally, were
also employed in another area of theoretical
computer science, the theory of complexity.
• This field considers the complexity of
information-processing problems in terms of
the amount of time, cost, storage space, or
other computational resources that are
required to compute a solution to the problem.
Turing had demonstrated the existence of a
class of problems too complex for solution by
his machines.
237
Overview
• It has been a long and sometimes tenuous line
of development from the logic machines of
Stanhope and Jevons to modem computer
science theory. But today logic is the
foundation for automata theory, switching
theory, and other theoretical areas of computer
study; and the computer is a tool much more
capable of logical processing than any of the
special-purpose machines of the past.