Anda di halaman 1dari 11

Article

On Folk Theorems
David itarel
IBM Thomas J Watson Research Center
Yorktowr~ Heights, New York

- - ~ i f e d a are sug\gesied fbr gg a we prefer and wit~ adopt the second approach. Accord-
statement is a folk theorem~ The ideas are t:he~ ingly, in Secdon 3 we pro;sent strong evidence ~o the
illustrated wi~h a detailed example from the theory of effect that a particular theorem about flowcharts is a t~lk
program.mi~g. theorem.
Key Words and Phrases: flowchart, folk theorem,
stn~¢tured pr~gammlng, white-programs
CR Categories: 2,1, 4,2, 5~:N 2. What is a Folk Theorem?

We woutd like the reader m try' and recall the tast


time he received a referee's report in which the referee
1. InmMucdnn dismissed his latest achievement as being % piece of
foNtore which haas been around for ten years," or, Nice-
l;>lkl~)ee: The ~radi~or~ai ~Iiefs, legen& and natively, the last time the reader himself drastically
c~ioms c~rercn~amor~g c o m m o n peopie. reduced a studenfs overflowing enlhusiasm about, a
The Oxfogd gng~isk Dictionary
......
resutt, labetfng it % good try but umS~rtunatety a folk
7;~eorem: A general conclusion which has been proved, theorem2' The high frequency of such rather unhappy
.......Mad, ema~i~::s Dtctiona<y, Van Nes~rand Reinhoid
occasions cedis for extra investigation. What makes a
statement a fokk theorem? What facts prompted the
In view of these quotatior~s one might be tempted m careful reviewer m make his devastating comment, or by
conclude simply than a {blk theorem is a ,general conclu- virtue of what did t;he reader himself dare turn a seI.f-
sion which has been proved and which is a traditional confident student or colleague into a temporarily crushed
belief, ~egend, or custom current among common ~ople. individual?
The purpose of t,his paper is to refine this defimtion Let us quote three more definitions of f d k objects:
somewhaL adapting it to the purposes of the research
community in computer science, Accordingly, we shall f?dk song: A so:ng made and handed down m~eng ~,hecommon people;
fnlk song.s are usually of anowmous anNam:hip and often have many
attempt to provide a reasonable definition o f or, rather,
veirsiot'13.
criteria fbr ~btk theorems, followed by a detailed example
Folk tale {orfMk ~n<v): A aory ~ua|ty of ~ o n y m o u s authorship and
illustrating the ideas, The latter endeavor might take one legeedau at mythical elements, made and handed down orally among
of two ~ : ~ i b t e forms, We could take a piece of ~blklore d~e common pc/opec.
and show thal it is a theorem, or take a theorem and --.. YV~/b~wr~ New g%~rtd D&'gi~e~z~y ~3[fke A n~eica~ Long.age
show that it is ff~lklore. As an example of the first tbrm FeN tune: A N~pula~ story handed dm~,'n~-dly from past generations.
we could have shown that the statement P ~ NP, which ..-,,o-7?~e O.~ford A~,~c~Jd Learners DicgionaO~o f c%gren¢ En~ish
is iblkiore, is also a theorem~ However, since we have
resolved to inUoduce no new technical material in this We wilt not ~ry our hand at providing a similar clear-cut
pxaper~ and moreover, since researchers in our community definition o f a ~blk theorem suited for a dictionary.
seem to be less tamiliar with folklore than with theorems, though ~t is s~mewhat amusing m see whN happens
when the word "theorem" is substituted #or "song" or
Permi:.~km ~o vopy without (¥e nit o;r part of ~,hi~ ma{eria} is "story-" in the aNwe. In parficulan we are certain that
gr~m~ei~p~ovide~l ~ha~~he ~oNe,:~are nor made of disaffected lk~rdirect the (by' now annoyed~ reader wouN require an expN-
¢~m:~er~,l adva,mag~, d~ ACM copyright ~oti~,¢ ~md ~t~e~i~leof the
nation of the phrase -'common people" i~t our comext.
puNica~ioe and ink ease @peal arid ,'a~ice/:, given ~Jha~~p}/mg i~ by
perimi~ioa of ~he A~,~iali~m iSot Ccu~pud~g M~zgi,~ef~y, To copy On closet- inspecuon, however, it seems that there are
o~hef'wiae~ar ~ 0 re'pub/inn, req,,sires a Ne and/or ~g~cifie N:fmk~aiee, three centrM properties which we can abstract from these
A~aNoFs ad/dfe~ a~ of Aagas~ 15: LX HareL ~>ept of Applied
definitions: an(tortuous and age~
Ma~hema~ics~ The Weizman~ lt~ti{~ae of Scie/~c:e, Rehovo~ israel,
Note that these phenomena are a|so implicit in the

379
c~f Volume '23
~he ACM N~mbef 7
4 e 6 n m o n of/}d£~o~: quo:ed s: ~h¢ s:a:":: k~af:e:.uamong
c o m m o n peo[:@" imphe> p,%Aarny. "b<:heA+ }e~:ends
a:~d :;us:os:~s ~ ~nd:ca:es a n o n y tne:.~,s ~::::h w'q::p+ a n d ~'m:.+ : ~::~,:s, b~{CC{:q. +++ :~+>~: :%:' H14:1~1 : hc :>4::: ot+~ )y. :{
d@onaF+ adds. {he d:memo~on o} :H::¢ V:¢ CAM~P{ IH:d +::: $::':i:U+: ::lC{:/h H: {}Wig ~:¢ ~k, ,+, {~
v~ he:: :q, :~g :o da+J,, @e::~e:hr::e:~:~pc<{>,<d {:a>&:: } n
@era f:om @ e :eMma: o{ :ell:rig:ale:.~4rid rag:rig ~,"ng>
:o :ha: of p:o~:::g @eo:en::,: :{ :shou:d h< nosed :h~:~:
neHhe: one <q' {h¢:~: :> :o be t & c n m at', s¢n<: :::(::4:
:,once The p<>p:Aari:) of a thecwen: ::ex:d so: mx<.,~<:rd~,
b~: ¢s~abhshed b) ;: he,ad ~,oun: ,of ~:e~'a:cher~ :h,> hay{:
used {',rquo:ed H. :ho~:h {~::~::h:s£:a:ed m :he :~e::
se<:th2:) s:a:~sdcs can be h d p G i R4:he< :{ usua: b sho::~
::p when o:e ::eat ask:n: ~ hm~dfi.A ofco:}e;:guex whe:h~::
{he s:a:eme~:: + ~nm. WiJ~ ~he "+:w+ he+wd :<>{ne~hmg "+:'c.'~] {(:k ::::'<::<qy we:: b: :cpRv, cd ,..'~¢'~:he :,e:~o a~L~H:
hke :ha+ heR,re" :<x>k on h~ f:H~< :he :x:r:~on que~noned
wi{~ ~s~m::v be ab}e ~o gave :.he <or:w{ :nss~e~ a n d mo:q <on:~p}c:¢~ +u>{~fied .:,~d ~hou{d tw +v~a:-dcd, ,,> par: o+
ofle:a he w{l be a b k ~o ~<x, mDw:y ~{ ,a'i~ha p~.w+f Rx'x :he C::~:::f~ :}Hg a m a : c : : r hl~{o~:a¢1 :n:\ {h~:% ::oco;:::e
Ofkon ~he :heo+'em is qe#~ed by v+~ue of h b<'~s~ ~er y
s:mila~ +x>~nother £a{eme{~: which > he:rag p:o~ed+ This hob{> ~:~ch ~+o, ~:an:p coHeca+n}{
bring:+ +a.s~o :he +R4{,en have many vem:oa::s++phoneme+ }{esc~ ~h:ie :he p~>:>,,au(h-+:£¢ pro{~cr::es +ecru :v ~,
non.. which :s ck+,-se~yre:aRx+ ~o pc~p@ar+:y Sure:y+ w::h ~e<ess.~ws :rid a4~[l~cie::I . t ~ + n d i h o ~ , - ~%.>~' o t~he~w:;s:.:n {0 b<
~he size of our :eseareh comma.bait: k~@'~gwha: ~: as.+sheL
co:::pac{ s:a:ement's of {heovems :end :o be ~e.memb~+red
even by pmop:e no: +aorkmg in {he a d u a : area ++~ +e~ea+~.,h

g++'arn:s<omp+~:e e~eo1h/in+ ~" :s {n::ch more ca:ch}+ amd


ap,~eah:g :~a::::hs EbvK>~5 :go:+:>:~s ce:~n:erpart S:a+Jng A A Folk f'beorem
s:~ch a +heore: i : :his foam ~+e.a::) { a e r i e s ~:,:~pop:+++
h'~ the inkwe£ e:: ma£in g {his ~,x:cnon rcadab:¢ ~br as
~a.:hy aad w+:~+:hh cha:ces of ff,s:b~ecommg a +1ege::d ~
Iaqge a~ a s d eece as po~Abh:+ we h a ~ c o l c a ~ d i:s more
or %,.replya {:elk thee;era The vague~m~+ m a :~::+~em%
+~a~emer+: can th~s g+ve rise ~o more :hart one {legal)
oriented ~ H e + is suc+ngly ~:rg+xJ :o :ega+d as p a n c.q":he
: of +¢+ amd ~ a i : h ~ a m e s t o o + f::m amd mo:e :ext +~se~L However, since :he reade+' wou:d p:esumab~y
wbe:: e ~ h ++:'e:~i<>::equi:es a ~'. ~:ngIy di£b:es:
n<x ~>e ~eadmg ~h~s ]ou:~ai o~/he~waH+ we car~ safe:y
p:re&>£ ('The >cadet > advi:~sd no: {0 coRf~/:se s~c~ {b{k
se,s:u~me :ha: he is {i~miha+' wi~h >sch gee:era: ~e:ms as
ff:eo~erns whh +::a~eme~+ which are ge~e~ic Le.+ sta:e+
e:+ pvo£ram, and ,fl:~k~a:< s a d a b e w~h moee
me~>s thag are e+x de+..ibe~a:e~y m a ~%>>mf:~orn
gpeem~:;~:ed oae:. such air ~'e~g~%qe pee£~aen-:o~,ge< and
w:hkh :maav.+, ~ea.: :he-orem++ {:re given a~ m<+:{.ances+ }ike
~£~te~te+ W+~ho~£ fl.anh¢~ ado, le~ :as row+ re:reduce ~he
"+paralk~ :ime eq~ab spa+so.+~~.e+ e.g, chap~e+ 2 of' {36}.
s~b.~e,c:of th> ~0ik sod.ion+
Thi:+ we do ao~ waa: ~o a.s ~ m g ~>l~+)
A~on}~o~c~ a~:hoe~.h-@ +ho{~/Id also rio{ ~ ~a.kea
comgk':e{y h{e:aHy :~deeA since :he fmrh~ds of ~ime we
are ~a:kinig abs+a: are :o{ e~>~ e a : (see ~'mk:>w),i: {>.:+:>4r~+-¢(?
::he caste tha{ no o++e ka:x>w+ wi:h whom :he thee+era.+ or
+:s rigoro+a::y ~.va:;ed var~+.~,:+rots+on.>, o:ig+r+a:ed R.aghe~.
very start ofan mves~gan<m oith> :heorem Spe¢~fic~A~y
wha: ~enck~~o h a ~ r n {., :ha: :he effbr+ 'in+a>bed m ~+acmg
m < ~ peopk% g~s{ ~eae~.m~ i:~ ~¢:~aHdhu:e :he :heorem ~o
back s~,eh a ~heo~em is f}a: uea+e~ th<a~ %at mw~ved i~
~he ::9"~ paper o f g o h m and Sacopmi {+5} which a p
~\pK:vmg }< ~ > ? g {oT ¢~e ~/ea~: b e h ~ i :he pn~g@q of
g~ta~ed iS %£s )o.~r,ai :~ £~cL ~>ome Of dee p~bhshed
~Jk @eo~em/+ :end to tm +~ha:nded down" :ogethe{ w+:h
~x:vs of +he theorem+ which we men~ion ::~ef+ ate
a::::ib;~ed by :heap :~{ho~s :o {:5:~ ahhot+gh, as we +hal
deep :heo~vm with a iea:ed ~ o f w~:H ::+:+a{b~ non
q~+a:if} a,;+a fo:k :he~>:em)+ Th+ :o{x+~of a 6;Ak ~hec+:em
might axe bmr:ie+] im + m e o ~ + m m kc~+:e r+o+e£ m a +e::e: (:~e~ ~+,s ~ema+~ here d:a+ :h~;~ mad o~het phenomena
{o a a +~dm>:+o+ +or+e+ im a +priva:e c+mm+niva:FmF + h d~ed m CD: se%~el are {0 ~ {a~e~ a5 ~a{he, amm+i~g
is ~ a a l y ~ s i B k , if' <ms i.:+ '+if:rag m p+a: <am h+~+A+ex mgmi >~)ms of ~h+ b e e and k g e n d Of our yO~mg gekL
+{a:e)+++++?++ +:i++ :ho+< ++:+:+{m ks:+: ~ + , e a~:{ by r~o ::veaa+ a:e ~hey m~c.i:~m of ~h+ h
m prm:)+ :ho+gh ++mid++++ +he ~ : > f :+~(h/: ++<~
h,~t+e ++era +1~)m~~}e:e+y ~ +~:+ +h~ +mf~+@dt ' {)++' ~{he
ca:~+~ +,.+~¢h~'x:. ~ x L a s d h-ere is+ where #~e age e l
inwAved~ We witt do o,~r best to convey this spirit to the Boolean variables, their work togeIher with that of Mir-
reader as we go along.) kowska [70] can be interpreted as a complete proof of
P,et~:rmng to o~.~r topic, we note that the theorem our own Theorem. If one prefers symbols over words
proved m the first part of'{~ 5] asserts that, with additior~al and is willing, for the moment, to overlook priorities in
Boolea~~ va~iabtes :~, ever), flowchart is equivatem to a ~avor of documenting proofs appearing in print, one
whib~program {with, in get, oraL more than one occur- might assc~ziate this proof of the Folk Theorem with
re~ce of wNle~de)~ Having proved the first "structt~ring ([|51 V {67] ,,./{24] .,/I251)/'-. ([7O] V [771 '¢ [551),
res~/f' of its kind~ Bohm a~d Jacopini's work has become
immortalized as comaining "the mathematical justifica- where "V" and "A" stand, respectively, %r ~br" and
ticm ti)r strtictured programming," to paraphrase many *'and."
at~thor~ ors the subject. The resulting tmiversal popularity Now, all this soun& like complicated mathematical
of {15], the ~i~ct that due to its rather technical style it is research concerning a rather deep result %r whose proof
apparea.tly more ot~eta cited than read in detail and, of the efforts and partial rose,Its of at least two researchers,
course the similarity of the theorem proved in I15] to working separately and, indeed, in different countries,
the one we are interested in seem to be some of the were needed. The real finn in investigating this Theorem
reasons ~k?rthis common reaction. starts when one realizes that there is a completely differ-
Bohm and Jacopini prove their result by .providing ent, Mmost trivial way of' proving the Theorem and that,
~local" trans%rmations on the various kinds of flow- furthermore, it is with this proof that the names of B6hm
charts possible, leading to the final structured while-%mx, and Jacopini are otlen erroneously associated. This
which involves only sequencing (;), conditionals (if*then- "global" proof, given more rrigorousty in the Appendix,
etseL and iteration (while-do). Put another way, their involves constructing a simple one-loop program which,
proof is by induction on the structure of a flowchart. The starting with the first "box" in the oriNnal flowchart.
Boolean. variables are used to "mark" paths taken by the executes one such box each time around the loop. Upon
computation, m order to remember them later. completing the execution of a box, a variable is set to the
We can point to three subsequent papers in which index of the following box in the original flowchart. (For
similar proofs of the B6hm and Jacopini result appear; a test box, an if-then-else accomplishes this for the two
namely, Mills {67], and Cutik [24, pp. t%t9; 25, pp. 11- possiNe outcomes.) Control then returns to the beginmng
t4]. Indeed, it seems that H.D. Mills who, in his unpub- of the loop. The body of the loop, which is executed until
lished lecture notes, termed the result of[151 "The Struc- the index of the original STOP box is detected, starts
ture Theorem" was one of the driving tbrces beNnd the with a nested set of conditionals which test the value of
glorification of B6hm and Jacopini's result, which he this one new variable and branch to the appropriate box
reproved and discusvsed in highly attended lectures and accordingly. Since any flowchart contains only a finite
seminars in the foBowing years. number of boxes, the new (numerical) variable can be
tt is interesting that prmsely what is needed in order simulated by a finite number of Boolean ones, giving the
to extend this velT proof to one proving our Folk Theo- Theorem.
rem can be %and in Mirkowska's 1972 thesis in Polish It is interesting to note that both the local transfor-
about algorithmic logic [70].~ The "normal form theo- mation of B6hm and Jacopini [l 5] and Mirkowska [701,
rem" of [70] states that with additionN Boolean variables and the aforementioned globM one fail, by their very
(of the kind allowed in [15]) every while-progam is nature, to preserve the structure of the original flowchart.
equivalent to one in which whil~do occurs only once. Ironically, though, they are proofs of a so-called "struc-
The proof, which is also by induction, provides local turing result."
transformations which serve to eliminate nested and But let us continue our investigation, being curious
neighboring while's and m distribute while-do over if- as to whether we ourselves, by virtue of having just
then-else. A sample tr~stbralation appears in the Ap- presented the global proof, are to play a central role in
pendix. To Mirkowska~s proof of what we might call the this little tale. We shall clearly be deprived of this if the
second half of our Theorem, a complete paper by Per- proof has appeared in print earlier~ "'Appeared," did we
kowska [77, p. 441t was devoted two years later. A third say? Yes. it has appeared. But that would seem to be a
exposition of this proof appears in a paper by Krecz~nar rather mild word to associate with the situation we now
[55, pp. 23-24} which deals mainly with interesting but set out to describe.
completely different issues~ Textbooks are a good place to start. And. indeed, if
Thus, we have found that Bohm and Jacopini |15| one browses through the boo.ks published in the general
are not to be det~vched ~¥om our investigation, since area of structured programming, one finds two which
besides being the first to prove a "structuring result" and contain the above proof: McGowan and KeUy in 1975
the first, it seems, to illustrate some of the power of [63, pp. 62-64] and more recently, in 1979. Linger, Mills.
and Witt [60, pp. 118-120l~ A similar scan of books of a
These can take on one o f two distract val~es~ distingms:hable by more theoretical nature reveals two more occurrences of
a test the prcu3~? Greibach's 1975 monograph on program
:~N~t having 170~ ir~ {?o~t o f ~s, we rely here ot~ p~zrse~aI eom-
muaicatio~ wi~h Mirkowska a~d on the refe~mce in [55/. schemes [38, pp. 4.52-4.53] and C|ark and Cowel/'s f976

3St Communkali~r~s JM~ tqS0


of Vole-me 23
lhe ACM Number 7
inm::~daclor?¢ ~x~ {20, pp. 61.~.,63}. t~ is ~:~o~ewonhythan m and S4{eg{az ia I972.- Denmng':, arg~mem cars ~c~.~al~y
all fb~r ca:des~he theorem s~a{ed ~s ~he B o h m and Jaco* made 6re years stretcher by re{Erring ~o ('oo~:~:r!
pmi one {and hence i~ am°ibt~tior~ in [(~31 and {38] 4o It is also wovd~ remarking tha4 m I2, p t49; 3, pp~
{151L bm ~he global pro~:~fmakes ~:~e of only one ~hik,~ 14t. 142] Ashcrofl a~d Mam~a. being imerested m s4rt~c,~
~ and so proves met stronger Folk Theorem, 4urir~g rest~lts which preserve some of the sm~c~re of ~}~e
Since an poimers ~o ~he origin of ~he pr<~~fare given original flowchart, provide m add:~ion a slighdy more
in ~hese references, oar b~~k search has b,ce~ only partly cfficiem vartam of ~hc globat proof:, which they atmbme
suc~e:ssft~i The idea of she global proof seems ~o be atso ~o Cooper, in which whal one might ca//a ~maxima{-
simpk arm pop~flar enough a> have ~ e n es~ar~tiaf~y loop~free'" component of die flowchart (a~ opposed so a
reinvemed by :the autho:cs of ~hese books. Reinvemed, single box} is executed each ~{me amur~d ~he kmp.
that is, if we can find i~ ooc:~arringin prim even earlier. Now. ever, ff we were to end om° s~ory here, there is
Leaping from hooks ~o e~aoste~ers, a reader leafing ~o dnub~ that we could quite sa{~ty ~erm dds reatdt a
through ~he Februa U 1975 i~s~e of S I G P L A N Ne~ces {bik theorem. As i~ ~urns ouL 4hough, ot~r tmle game ~ is
noticvs a two-page paper by Plum {79 pp~ 32-331, m f~r from being over.
whwh the a ~ h o r , terming the use of ~he Bohm aq~d A~ this, poim we vemure o~r opinion that the global
1acnpini {{5] mmh~l *~ma~hema~ica{overkilL" presem:s prooL and he~ce ore Theorem iuseiL is actually roo4ed
a %;imp{e proof of this simpk ~:sutt'---4he global preen{ m {he early work of Jobm vo~ Neumann on ~he structme
abcwe One finds i~ hard {o ~{ieve, though, that 1:4 ~ook of digi~M <x>mpu~ers~ In Sec~io~ 6 of his 1946 (!) joim
Nmos~ rune years fi?r (his observaaon ~o find its way ~o p a ~ r wi~.h B~rks and Odds{inn {18/, ~:he idea of execut-
the printer. ing a p r o g a m on a compmer by means of a Nrge k>op
We rnuN turn, i~ seems, ~o one of compmer science's which cames ou~ an instruction a~ a ~ime is described. A
s.taadard oracles: D, Km~.h~s ~d~oNrty sur~ey p a ~ r program contour is u ~ a ~ e d 1o comaia she addres.~ of die
pubt:iahed m 1974 [52}, k~side:s containi~g much smnu- ~vext ms{ruction befbre returning ~o the sta:r~ of the tonp,
latmg ma4e~ial concerning ~he (non-) vNue of re~satts Admittedly, this is no~ a proof of a theorem, but ~he idea
sach as o~ar T ~ o r e m , coafirrcc~ o:ar s~spicinn by reducing is certainly there, prompting one ~o wonder whether
she ainu years ~o saghdy over one; in {52 po 274t we find C<:~opaefs observation should m:~t be taken simply' as
our sixth ~>ccurrer~ceof{h> prone b ~ here is is a~tdbmed providing an operatimaal semantics %r flowcharts, ralher
primarily ~o *'~he commems made by Cooper m {%7" m than being the pro>of of a theorem.
his terser {221 m ~he editor of ff~is journal Indeed, D~Co As if M1 this were ant enemas.h,this same pnx~f appears
Cooper {22! (eight years, we m ~ h t add, ~ f o r e ~he N 1 n ~ i~ a h u m o r of additional p a n t s , in which its detection
identica{ {79~) notes ~hat ~*a red{radon [thaa~ thai is com~ideraNy harder. In the first, Meyer and Ri~chie
of B6hm and J~oDed} is ~.siNe0" and s ~o I65, Sec~.mn 61, erie can find the idea in a pnyof of the
prove our Folk Theorem ~he globN way. fact {has prim.{dye recursive functions of certain time
And so, we are exp~vsed ~o what seem ~o be the fins,; comNexA~y can be written with :rome fixed depth of
stages i.n ~he evolution of' arm authem~ J!;aik theo~m: As ~x>~nded l~x~ps,. The pro<l{ involves one potentially un-
a reaction ~o ff~e journal pubtica~mn o f a proof of half bnuaded loop {corresponding m our single ~htteMoL ~he
~he theorem, an acqmost ~fiv.iat proof of ~he whole is body of which executes one s:ep of O:e computation a:
ted m a loner m Ihe edkon and many subse-qeen~ a time wida the aid of numerical program counters.
ambers, not ihavmg seen {~heaforemen~med te~er (in- NexL ~he idea can be fb~nd in Norner {t 1] as the
dee& one does not expect them m have stun i 0 then ~'Canonical Program" on page 438~ wNch si:mula~es any
pro>cued ~o remvem ~he proof themselves given ~ machine" rasing a ~×t-stale fh~ction.
Thin situation is enihanced by ~he hallowing addi~maal A third such o4:currence is m Bramerd and l.andwe-
five papers, all o f which p~e~m C'.ca~pefs proof: A.shcrof{ bet {16: pp. 122,-123} where the idea is incorporated iron
and M~naa's t97/ iFtPS p a ~ f on r%rqacing gate's by the prc~f ~ha~ N ~ l e d Marker a{g~mth.ms comptge par-
({2~ p. {48/; see also {3, po 140t),, @~e~imitar b~a~ da/ reoamve Nnc~ions~ TheN, a?~3. numerical program
mdeper, dem I972 paper of Brunn and Steigtitz {17, contours are used.
p. 52l}, Wulf°s 1972 <~c~ again:st {he gore" [87~ pp. 64-- name{her occ~rreace can ~ extracted fVom O~e proof
67]~ Mill's {975 journal version of OReS~r'uc,~re Theorem of m i6 m PraWs 1976 paper on dynamic iogic
I6& p. 45]. and the appendix ~o (~e ~977 paper on retiaNe tgL pp. ~19--t20t in which a ~mversN c~,umer machine
~;~og~am.sof L i n e r arid Mils ~59, pp~ ~3,6-139]. Of these, is simulated by a one-loop regular program whmh em-
.[2, 68, 59t credi~ C o o e r with ~he 1:man{, {{7~ Nves the ploys a numerical program counter.
p r ~ f without cred.i~ bm the ~heo~em ~ga{ed ia Ihe v~aker A most irgeresting and ~uNte ~:xcc~rre:nceof this proof
g6hm arid J versioe, ruth credit m ~hem, and [87] can ~ fo~and in the fifth gaper, Efgnt {32I, also from
in a way kypicai of/he Mkishm:~s o f {he e.i~a.a~ioecr~i;gs /976, which deals wit.h ORe N n ~ g e of m u N e n t u mul~
[ { 5] with ~he ver3io~a~
Similarly tyDcaL by ~:e way, g Defining's, S~ptem~a.r
{975 ¢nmp4aim {27] ag~ou~ Pb~m'~ Febma U t975 N ~ r
t791: " ly dh4s cor~macdor~ was suggested by Br,ano
3gg~
d V~:~h~m~23
~heACN Number 7
tiexit flowcharts. Theorem 3.1 of [32, p. 441 states that Returning to the global proof, the learned reader can
every such flowchart is equivalent to one in the sublan- probably see now where these findings are leading ins.
gt~age analogous to conventional whi|e-programs, but The search for occurrences of this proof in the (obviously
with no additional variables at all! In view of the negative relevant) literature on structured programming and flow-
res~tlts of Knuth and IF/oyd [53], Ashcrot~ and Manna charts led to Cooper's operational version [22], which, in
[2, 31, Peterson, Kasami, and Tokura [78], Indermark turn, served to attract our attention to Burks, Goldstine,
[47], Kosarajt~ I54t, and Kasai {491, from which it follows and von Neumann [t8]. But now we have gradually been.
that Ibr conventional flowcharts this statement is false, lured into considering theorems in algebraic semantics
a care%l reading of glgot's proof becomes necessary. (e.g, 183, 851]) and in recursive function theory (e.g, [16,
The evidence of the fo/kishness of our Theorem is con- 65]), which, at first sight, seem quite unrelated to our
siderably reinik~rced when one discovers that this proof naive flowcharts. And so, there .seems to be no escape
is also essentially the global one in disguise! Boolean from considering the grand common ancestor of all such
variables are cleverly replaced by what are called "trivial results--Kleene's t936 normal Ibrm theorem for partial
schemes" m [321, which we might call "cables," in which recursive functions [5/]!
onty one "wire" of each is connected. Such a cable forces Indeed, Kteene [51, p. 736] (see also Kleene [50, p.
control to proceed to one designated box i)r execution 288] and Rogers [82, pp. 2%30]) showed that every
next time around the loop. Some details and an illustra- partial recursive function f can be described as the
tion can be tbund in the Appendix. application of a primitive recursive function g to pk,
Digging slightly deeper into the earlier papers in where h is primitive recursive and #, the "minimization"
algebraic semantics ti'om which Elgot's paper [32] on operator, acts, in essence, like a while loop. The "body"
structured programming grew, one discovers some inter- of that loop, h, can be loosely described as simulating
esting ti~cts. A normal tbrm result for certain kinds of one step m the computation o f f using coordinates for
operations on certain kinds of uninterpreted algebras the "current value" of the function and the "label" of
occurs in various papers differing quite drastically from the next step. The function g simply isolates the final
one another in notation and terminology. Thus, in a value of the computation by projecting on the appropri-
t973 paper of Elgot [31, pp. 213--..222] (published in 1975) ate coordinate.
we find a theorem about the "normal description of a N o w . Kleene's theorem appears repeatedly m count-
morphism over an iterative theory/' In Wand's 1972 less papers on recursive function theory. However, since
paper [85, p. 335] (published in 1973) we find a normal we did, after all, start out with flowcharts, and since the
tbrm theorem for "/x-clones of operations over a lattice line must be drawn somewhere, we have decided to draw
algebra." I n a 1978 paper by Tiuryn [83, pp. 21-22] we it right here: no attempt shall be made to search for all
find a normal tbrm theorem for "regular polynomials occurrences of Kleene's theorem, and the ones we have
over regular algebras." Finally, it was as early as 1969 mentioned [50, 82] will not qualify as proofs of our
when Bekid [9, pp. 12-151 proved a normal form theorem Theorem.
tbr "definable operations in general algebras." To summarize this part of our tale. the global proof
All these four results can be shown to give use to has been traced down two orthogonal paths, each of
versions of our theorem for the more general case of which has led to a pioneer~J, yon Neumann in his 1946
"multiwire" recursive program schemes (as opposed to work on designing computers [18] and S.C. Kleene in
flowcharts). Without attempting to describe the technical his 1936 work in recursive function theory [51]. Although
details of these papers, which are all far beyond the Cooper [22] provided the first explicit proof of our
scope and intention of this paper, we remark that in our Theorem as stated, we feel it is reasonable to make the
terminology the proofs in Bekid [9] and Elgot [31] are modest assumption that he. as well as M1 subsequent
local and in Tiuryn [831]and Wand [851 global. Further- provers, was either directly or indirectly influenced by
more, the proofs in [9, 31] start with schemes which are [181 and [5l]. Consequently, we assign credits for the
analogous to while-programs, and all four proofs use. global proof of our Theorem to Kleene [51] and Burks.
essentially, the "trivial scheme" mechanism for mimtck- Goldstine, and yon Neumann [18] independently. So, in
ing Boolean variables. These observations make the task fact. the Theorem w a s "known" to Kleene and yon
of fitting these proofs into our framework somewhat Neumann.
easier. Accordingly, our decisions on these were to clas- Again. blurring credits m the interest o f enumeration
sify Bekid [9] and Elgot [31] as additional proofs of the and begging the reader's pardon for inserting an annoy-
Mirkowska part [70] of the local prooll and to add Wand ing self-reference to the present paper [401 in which, no
[85] and Tiuwn [831 to the list of Cooper-like global doubt, the proof appears again. ~ we associate the global
proot~. Nevertheless, as the algebraic approach is so proof of tlhe Theorem with
different fi'om that of most of the other proofs we have
mentioned, we choose to assign priority credit [br the ~"This is the " r e f e m n g m as m a n y of o~te's own papers as possible"
syndrc~me, taken to a new extrerae: a reference to the very paper being
second part of the local proof to Bekid and Mirkowska read! In the a b ~ t c e of any other no~ab{e c~ntr~butions o f the present
independently, although the tbrmer precedes the latter paper, and in view of the amount o f work ~hat went into writing it, we
by three years. cannot resist ~he tempmtkm m claim priority ~or this first~

C~mmunicatmRs July t980


of V o | u m e 23
the ACM Number 7
({51] V {18]} A ({65I V [22] V [li] V {2] V {17{ v OBr story is given a final asd qm~e unexpected
frilkish twist by the e×islerice of a second versi<m of (he
[871 v {as] v {52t v {16] 'v [68] v {, >1 ,,~ Fheorem. ta preparation £)r thi£ we were carefu~ lo
choose ffm adiectiw~ %dditionaF' rather tha~ *~BooleaxF'
{38] V {63] V [32] V {20] V [8l] V [59] V
in its statemem~ In ~l~is version, auxiliary rather ~han
is31 v I@t v {@]). Be<~leaa variables are allowed, which are sm@y ,mew
variables of ~he types used ia ~he origimd flowchart.
As memioaed earlier, statistics are perhaps not cru- Although not guarameed the ability to distinguish a~ wit1
cial tbr ~he classification of a theorem as fbtklore., bu~ between ~wo distinct vahms as in ~he Boolean version,
they are impassive never~hebess. The version of the we are able ¢o freeze currem values m new variables, a~d
Theorem we have talked abom so far ~ has essemiatty by re{esting them la{er are able ~o "~remember" the
~wo pr(×~£s. Of ~he h>cal proof we have &rand 4 A 5 outcome. (See the sample traasforma,qo~ ia ~he Apww.
~>ccurrences {four of the first pa~% five of the second~ dix.)
norie of both) and of the gIobal proof 2 A 20. While it is The reader is ~rged to Uy his hand at proving this
nor d e a r whether 4 A 5 shmdd evaluate ~o 4, 5.9. or 20~ version, which is apparemty harder thar~ the first, tn face,
~here are certainly m ~ ~occurrences. we are not aware of asy sirigle global proof of it. Curi-
tn *he process of exposing these f%~ctswe have also ously (or should we say, lblkishlyL a fhll proof of this
~burid numerous references to the 7 h e o ~ m or its Bohm version does not seem to be available in a~y single paper
and Jacopini part~ which do nut comaia prri~xg~ mainly and. as we shall see. cart be found only by juxtaposing
in connection with the issue of sm~aured programming three papers (published, incidemally, o~ ~hree diflerem
For a sample of fifty see Arsac {1~ p. 3I~ Baker coatmems .... ).
{4, p. 991, Baker and KosarNu {A p~ 555], Banachowski In 197 t, Cooper [23, pp. 47.....49] arid Engeler {33, pp.
{& p. {15], Baaachowski e~ al. {7, p. 22], Bates 93--.941 isdeperidentty pointed om that any flowchar~ can
{8, p. 1%], Benson {10, pp~ 145-N6], Blorim arid Tiadell be pm iri~o a ~*bkyck fbrm," which is basically a I reelike
{i2. p. 27~], Boehm {13. p. t13{, Bohl [|4, p. t40], flowchart in which branches are allowed to bend back-
Chandra {19, p. 1] Cohen and Levi {2l, pp. 26% 225], war& but to ancestors orily b~ the same year, Ashcrofl
Cutik {26, p. 54], Dermmg {27, p. 10; 28, p. 216]. D~kstra and Manna showed that riot any flowchart in ~his form
{29, p. 148], Donaldson 130~ p. 531, Engelfrie~ {34~ p. there is an equivalent while-program with additional
2C~t, Fischer and Fischer {35, p. 461t, Goodman and auxiliary variables. {This result is stated in {2, p. t48 t,
Hedemiemi [37 pp. I9-2@, Hard {39, p. 89], Hard, relying on a pr<×~f appearing in a preceding technical
Norvg, R o o d arid To D l, p. 2 I81, Hopkir~s {~, p. 59 I, report The full proof appears in their final version {3,
Hugbms [45, p. 591, Hughes arid Michtom {~, p. 611, pp~ 135-t38], and also., with reference to [21, in Grei-
Jensen arid Toriies lath, ppo 228~ 236}, Kasai {49, p. 1771, bach's m o n o g a p h {38, pp. 4.534.5.4].} Being unimter..
Knuth and F I w d {53, p. 31], Kosaraju {54, po 252I. es~ed m mining the smmture of Ihe original program,
Leavenworth [56, p. 55], Ledgard and Marcx~tU {57, p. Ashcrofl sad Manna make no attempt to push their
6321, Lee and Chang {58, p. 65], Martin I6t, p. 51~ vechnN~es arty further~
McGowan I62, p. 25], MiIler and Liridame<xt {~, p. However~ m a paper published m t972, Hirose and
561, MiIls {69, p. 901, Myers ~71~ p~ tl0; 72. p. 5], N a z i Oya {42, p p 369-370; 43, pp, 65--681, apparently wi~hom
and Shaeidermari [73~ pp. 13-~4]~ Neety {74, p. 120], having seen f21, lay down the final brick by proving tha,
NichoHs {75, pp. 4C~9-410f Partch {76, p. 12S21 Peterson, eve©, whibe-program can be mmsfbrmed irito orie with
Kasami, arid Tokura {78, p~ 51 l{, Prather {80, pp, t:59, a single , using auxiliary variables. (In [43], fl~e
70f Van Ge|der {84, pp. 3, 5], Wise, Friedmam Shapiro, pr(yof starts from arbitrary flowcharts but the part leading
and Wand {86, p. ~ / ] , Yourdon [g8, pp. |46-147; 89, p ~o whik-programs is rather skeichy compared to [2],
107], Yo~rdori and Coristamir~e i90, p. 66], and Zdkow~ whereas the transfbrma~Lion ~o single white4to fbrm is
itz. Shaw, and Gannoa ~9I, p. 60!. de'ta:il~J .arid precise}
Maay Of"~he~ references c~ontain interesting relevam Att three comp~oaents of ~;his proof are '%col," Le,
material, but iri order ~o keep this irivesfigafion f%om p r ~ g d by iriductioa ori the sm,~c~ure of ~he program A
get{trig ou~ of" haad we wilt aot describe ~hem aN, Let us s-ample transfbrmation fl~om {42] appears iri the Ap~a..
just remark thai Bohl {14] infbrms as that B o h m and dix. Here, ~oo, e:n~meratio~ {m¢~t~l~ difDarent versio~ss
Jacopini {~5] was '~mi~ially p~btb~hed in Italian ia 1%5," of" the same paper) Nves ([23] V [33]) A ([2] V [381} A
~42I.
~hat Cohera and Levi {2 ! {extend fl~e Theorem *o parallel
programs, a.~d that Pray.her [gO[ proves a similar resuh ~ Arid ~} our folk ~ate er~ds arid barri~g ~r~expected
fbr Tuft:rig maclhines, comp~ica~mn~, our Folk Theor~'ri has good chances of
livisg happily ever aflen We have {0m~d ~ha~ it has two
versior~s, the ~rs~ of which has two differem pr<~:~£~,o~e
of ~hese ~sentiNty going back m the cave-dwelling days
af Kkeene (1936} a~d ",'on No,mann (1946} The e~.xli~s
are ilk~s~rated ia Figure l, Besides over fifty refere~ce~

{be ACM Num~:~ 7


{B~,ib,m a~d ~ac~,pif~i) {Beki~ / Mirkowska)

(K~¢cf~ / ~B~rk:~ GcdJs~me and yon Neum~mS)


flowch~rt ........................................................................................................................................................................................................................... ~ singqe ~hi~e4o

(Enge{e~ / ( ~ p e r } (A*hc*oti and Ma*ma) {Hir{x~e and O?'a)


~oc;d prcu.~f flowchar~ ................................................................ ~bk~& -l'orm .......................................................................... * ~hile-pr~ygram~ ................................................. "*single w h i t ~

to the Theorem or its parts, we have found (4 A 5) + (2 outgoing edge and test nodes have two, labeled 1 and 0.
A 2(;)) + (2 A 2 A l) printed occurrences of its proof; '~ There is one START node with no incoming edges and
which evaluates to 27, 36, or 64, depending, respectively, one outgoing edge, and at least one STOP node with no
upon whether "A" is interpreted as "max", " + ' , or outgoing edges. An interpretation I of a flowchart F
" × ' . These proof!s, which span forty-four years, also consists of a set of domains, an appropriate association
span the complete spectrum of recognized scientific lit- of domains with the variables of F, and an appropriate
erature: textbooks, monographs, survey articles, journal association of f~nctions and predicates over various
papers, conference proceedings, newsletters, theses, tech- cross-products of the domains with the fimction and
nical reports, lecture notes, letters to editors, and self- predicate symbols of F. Given an interpretatmn I and
referemial folk tales~ initiM values for the variables appearing in F, the way in
Quile a fblk theorem, it seems. which F proceeds to compute its values is straightforward
and is assumed to be known m the reader. Denote by' F~
the lunction, associating with each set of input vMues for
4. The Future F its output values, or a special "undefined" symbol if F
We have postulated the appropriately adapted prop- does not terminate. Also, let ash(F) and test(F) be the
erties of popularity, age, and anonymous authorship as sets of assignments and tests appearing in F.
criteria fbr determining if a statement is a tblk theorem, Next, we define an appropriate set ofwMle-programs,
and have illustrated by exhibiting a theorem:, the folkish- relative to sets of assignments and tests A and T. Define
hess of which seems to be beyond doubt. WH(A, T) as the least set such that:
As lbr the ff~ture, we envision three possible direc- (1) AC WH(A, T)
tions for further research: (2) if W~, V¢~ E WH(A, T) and P E T, then
(1) Compiling an encyclopedic list of folk theorems in (i) (W~; W~) E WH(A, T),
computer sdence. (it) ff P then W:1 else W~. E WH(A, T), and
(2) Investigating the related concepts of folk definition (iii) while P do W~ E WH(A, T).
andfi)lk technique (that is, proof=technique)~ Again, given an appropriate interpretation and initial
(3) Showing that folk facts such as P # NiP are fotk values for the variables appearing in a while-program W,
theorems~ the standard method of defining the computation of" W
is assumed to be knowm We use Wi simila@ as with
5. Appetldix flowcharts. Let WHdA, T) be the set of those elements
of WH(A, T) which contain at most one occurrence of
First, some definitions. Aflowehart is a finite directed wMie-do,
graph with nodes l a d l e d either with an assignment of Now. to be able to rigorously state the Boolean
the tbrm x ~- f(~/7) for vafiaNe x, function symbol t: and version of our Theorem. we let
vector of variables j~ or with a test which is a Boolean- Basra F) = ash(F) U { p~ ~- true. p~ ~-. r i s e }. I ~ t < w.
combination of e×pressions of the fom~ p ( f ) fi:~rpredicate
symbol p and vector j~\ Assignment nodes have one and

we would greatly appreciate poimer~ te ~ho~se¢~t~r~aces of preo£~ Btest ~ the set of Boolean combinations of tests m test(Fj
we might ha;'e mitred ia our ignor~nce~ia oui' haste, or e~herw~se, and expressions of the tbrm p~?. for t ~ i < ~.

Commurficafi~ns J u l y ~980
of V o l t , m e 23
the ACM Nu,mbe~ 7
Fig. 2. Cooper's Global Proof.

/ /

[ --true,n 1)~ [B--false(n+l~

Fig. 3. Elgot'sProof.

where pl, p2 . . . are new variables and F is an arbitrary In order to illustrate the B6hm and Jacopini [15] A
flowchart. An interpretation is called nice if the pi range Mirkowska [70] "local" proof, we provide one of the
over the domain (true, false} and the test pi? is true (i.e., transformations of Mirkowska [70]:
evaluates to 1) iff the value of pi is true. Denote the set
while Pl do (Wg while P2 do W2)
of nice interpretations by NICE. Then the Boolean ver-
sion o f our Folk Theorem states:
(*) (VF) (3W E WH, (Basn(F), Btest(F)))
"pl ~-- Px"; pz ~-- false; while (pl V p2) do (if p2 then W2 else W1; "p2
(VI ~ NICE) (F, = WO. ~- e2"; ','pi "~- Pi"),
386 Communications , July 1980
of Volume 23
the ACM Number 7
where, e.go "'p: .......
P " >4ands tbr tf P~ ¢hen p~ ........tn, e As aa ilh>{ration of the {[331 ,./ {231) /' ([2~ V [38]) A
else p: ..... false {42] proof of tbi.~ver~don+ we provide the ~rans%rmafion
of Iliro e ~nd Oya {42] analogow, ~o that of Mirkowe, ka
(~.×~per':, global proof I22] proceeds a/~ tbllows: (}ive~
[70] given a~xvee:
a llowcharl {;~ denote the axs,ignmen: r~odes of F in m:'ne
arbitral T, b:a~ fixed order by o,,'n . . . . a ; < , and the test
node> s~mda:'ly by rose,,, . . . . to.re..... Think of alt {he
S T O P taxies a~ b~:ing n:m:bered rn + ]. }"or each I :~; a
5 n te~ ne.~¢(i) be she ~::bscrip: cor:'esponding So the ~ ....f; g P~ th¢:t~ Wi; ~hlfe ¢J4~}{ P~ ~:h~g~W e~*~ iii .....2 if P~
node adjaceru So ax< (by it5 outgoing edge) and f'or each {hera W~+
~ + t ~:: i ~ m let wue(i) and/}d.~e(i) be she ~ubscrip:~s
correG~onding ~o {he node:~, adjacent So to.< (by the i and where k is the vector o f aI{ va:lable:~ appearing in the
0 outgoing edges, respectively). Let i~ be ~he s:.~v;cript original F,/~ is a vector of new variable:< and P~ is ~he
corresp,.,r}di::g :o the node a<:tjacem So she S T A R T node, result of sub:stimting she ~/s for ~he x% in P Here° fbr
As:tutor now thin a new variable B rar~ges over file set clarity, the clause else 2 +.--.-2 has b<ve~ omit~e,d.
{l, 2 .... m + 1}, and that we have assignments g ...... i
and tests g +~ i? fbr each i in that so< with the meaning Received tW7% ~evi,~d a n d accepted 2gJ0
obvious, is should be clear that B can be replaced by
[ log m ] + I Boolean vafiable:~ encoding the val:~e o f B, Acknow[edgmems We are hTdebted ~0 N Pippenge~-
with B ~...-i and B = i? being replaced by the appropriate t\;',r helpful discussions aN?ut ffAk theorems i~ getters]
sequences of m<signments and conjunctions o f te~:~ and about the one described in Section 3 m par~ic~ta~
The white.-program W G:: W H d B a x n ( F l , Bge':g{F)) Ak~:~,, thaeks go to M.I the people we have pestered
which is equivalent to F in the sense of (~), is Nve~ recently with questions aba:mt folk (~eorerms and trans-
{using :he obvious translation into wbile-lbrm) by the lations l¥om flowcharts to ~bt|e's; m a y this. work help
flowchart in Figure 2, erase the p~?sded lc~oks we often saw o~ their facee~ as a
To illustrate Elgofs proof' {32]. we will ::or provide a rea~flL
rigorous definition of his multiwire flowchart.s, but :rust
that the reader will be able to gather aa much as is R
L A : ~ J. U~ t:m~ge de pr%ramma::~n ~msasb~ch,eme.a~. Re~'.
aee;ded from the folIowiag. For positive integers j and p
where j :~ p, the 'errtrial scheme j / ' o f [32] is simNy she
"'cable" of width p wish all but :he j'th compvment ~o "wbi~e- p~cVg~am~~a ICgbe~: ~rg~: 7L }97L pp. ~47,-i52,
disconnected:
ak Baker~8.5;. An algorithm 1:orsm~ae~nng~%weEam.J. ACM 2~
: i+: j j+: p (;Jan. ]977), 9$-,{20.
5. Baker.B.S. amJ Kes~r~ju, SR. A e v m ~ n ~ m of m~al;~k*:~¢~
break ~ d ~mx{~a{emerds..st A CM 26, ~ {3~ty ~¢d%,55S.-Pg%.
6. B oL {~v~Bgm~oa~o(peo~r~m of ipmg.~'am~by

V. ganachow.kL L.,e~ at,, Ar~i~ttgx~e~ion~o a~{~g~q~.bm};h~g~< 1~


Paw~ak_ Ed&..Ba>ac'hC:r Pabhcat,on&Wz¢~awoPv/[a:a&{977
Elgofs pr(x)f is illustrated by the muldwire flowchar~ of 2L_a~}
& {{a:{es~L1 ~ h ,g;c for ~:onwcl proWam ¢ievek~pmen~. P h D {h...
Figure 3 in it, e 4 . nex~(i)~,,+.~, which follows a..~'~, is a Cornet1 umv.. ~ag ~:479
cable o f width m + t in which control, so to s~ak~ may 9, B.ek~£.H DefiaaNe aWvta~i~m~m geee~a~aAcge;bt~,End~l~e
only flow through the next(i)~{h wire, which is ~himatety
I~t4t~ ~e+OS~
cormected to a:rm,.,,.~, as expected in other words, I{}, gvm~O~. J P. S~r~ac.Ba::ed proS;staining teghm~a~e~. Pr~z [E.EE
Co.owr's variable B g ~ h a N wired ~ rote Ne muRiwire Syrup o a (.;~'e@gf_ :5<fftm~re R e { ~ a N R B ~ New Y o ~ . Apr~ 1973~ p~
cable,5 o f Elgot% program.
I L B~wr~e< {). },;kwecB:&:~machine& BIZ ~0 [970h 4 ~ - 4 4 2
In order to .scale the second version of ~he Theorem Ilk Bhxm~. S.L... arid t i n d e i [ R A/gebra~c a ~ J g,eaph ~.e,~re,~,e
rigorously, we let An<re(F) be the set of a~ignments of ~aa~ae~e~w:<a~m:m o f ~4fuc,~zed ~,eme;s.
she fbrm x +- f(f), where x and the componems o f fi
come from the union of {,J,, ua . . . . } and the se{ of
variables appearing in F. Here ~he u~ are eew va.riabte~, A@d-i:m#-WeMe) Reading, M~,,~ o pp. ~03--/28
and f i~ a function symbot a p ~ a f i : n g m F. Aees~jF) is
{2i~ N J. ~V78
defined as the sol of Bc~Jean combiaatkm~; o f ~ g s of ~he
%rm N / a , fbr y as above and p i.n F The % t ~ l i a r y "
version of the Folk Theorem s, ate~:
{**) (VF) (SW e WH~{Aasn(F), A t ~ ( F ) ) ASPcaWib~ ~#d ShT~mNew Y{~k, ~&~74

(YI)(F, ,~ W 0.

ef V~m~e 23
~.b~ACM N~mb~ "r
18. Burks, A.W., Goldstine, H.H., and von Neumann, J. Preliminary 50. Kleene, S.C. Introduction to Metamathematics. Van Nostrand
discussion of the logical design of an electronic computing Co., New York, 1952.
instrument, 1946. In J. yon Neumann, Collected Works, Vol. V, A.H. 51. Kleene, S.C. General recursive functions of natural numbers.
Taub, Ed., MacMillan, New York, 1963, pp. 34-79. Math. Annalen 112 (1936), 727-742.
19. Chandra, A.K. Degrees of translatability and canonical forms in 52. Knuth, D.E. Structured programming with go to statements.
program schemas. Proc. 6th ACM(SIGACT) Syrup, on Theory of Comptng. Surv. 6, 4 (Dec. 1974), 261-301.
Comptng., 1974, pp. 1-12. 53. Knuth, D.E., and Floyd, R.W. Notes on avoiding "go to"
20. Clark, K., and Cowell, D. Programs, Machines. and Computations: statements. Inform. Processing Letters' 1, (t971), 23-3 i.
An Introduction to the Theory of Computing. McGraw-Hill, New 54. Kosaraju, S.R. Analysis of structured programs. Z of Comptr.
York, 1976. and Syst. Sciences 9, (1974), 232-255.
21. Cohen, A.T., and Levi, L.S. Structured flowcharts for 55. Kreczmar, A. Effectivity problems of algorithmic logic. In Annal.
multiprocessiug. Comptr. Languages 3, 4 (1978), 209-226. Soc. Math. Pol. Series IV," b)mdamenta lnformaticae l, 1 (1977), 19-
22. Cooper, D.C. B6hm and Jacopini's reduction of flow charts. 32.
Comm. ACM 10, 8 (Aug. 1967), 463,473. 56. Leavenworth, B.M. Programming with(out) the goto. SIGPLAN
23. Cooper, D.C. Programs for mechanical program verification. Notices (ACM) 7, 11 (Nov. 1972), 54-58; Proc. ACM Ann. Conf.,
Machine Intell. 6, Edinburgh Univ. Press, 1971, pp. 43-59. Boston, 1972.
24. Culik, K. Structured algorithms and structured programming. 57. Ledgard, H.F., and Marcotty, M. A genealogy of control
Rep. CS-79-40, Dept. ofComptr. Sci., Penn. State Univ., Aug. 1979. structures. Comm. ACM 18, 11 (Nov. 1975), 629-639.
25. Culik, K. Entry strong components and their applications (in 58. Lee, R.C,T., and Chang, S,K. Structured programming and
computer science). Rep. TR Nov. 79-01, Dept. of Comptr. Sci., automatic program synthesis. SIGPLAN Notices (ACM) 9, 4 (April
Wayne State Univ., Nov. 1979. 1974), 60-70; Proc. Syrup. on Very High Level Languages, Santa
26. Culik, K. What is a flowchart loop and about structured Monica, Calif., March 1974.
programming. SIGPLAN Notices (ACM) 15, 1 (Jan. 1980), 45-57. 59. Linger, R.C., and Mills, H.D. On the development of large
27. Denning, P.J. Comments on mathematical overkill. SIGPLAN reliable programs. In Current Trends in Programming Methodology,
Notices (ACM) 10, 9 (Sept. 1975), 10-11. Vol. 1, R.T. Yeh, Ed., Prentice-Hall, Englewood, Cliffs, N.J., 1977,
28. Denning, P.J. Two misconceptions about structured pp. 120-139.
programming. Proc. Ann. ACM Conf., Minneapolis, Minn., Oct. 60. Linger, R.C., Mills, H.D., and Witt, B.I. Structured Programming."
1975, pp. 214-215. Theory and Practice. Addison-Wesley, Reading, Mass., 1979.
29. Dijkstra, E,W. Go to statement considered harmful. Comm. 61. Martin, J.J. The "natural" set of basic control structures.
A C M 11, 3 (March 1968), 147-148. SIGPLAN Notices (ACM) 8, 12 (Dec. 1973), 5-14.
30. Donaldson, J.R. Structured programming. Datamation 19, 12 62. McGowan, C. Structured programming: A review of some
(Dec. 1973), 52-54. practical concepts. Computer 8, 6 (1975) 25-30.
31. Elgot, C.C. Monodic computation and iterative algebraic 63. McGowan, C.L., and Kelly, J,R. Top-Down Structured
theories. In Logic Colloquium '73, North-Holland Pub. Co., Programming Techniques. Petrocelli/Charter, New York, 1975.
Amsterdam, 1975, pp. 175-230. 64. Merton, R.K. On the Shoulders of Giants: A Shandean Postscript.
32. Elgot, C.C. Structured programming with and without go to Harcourt, Brace and World, New York, 1965.
statements. IEEE Trans. Software Eng. SE-2, 1 (March 1976), 41-54. 65. Meyer, A.R., and Ritchie, D.M. The complexity of loop
33. Engeler, E. Structure and meaning of elementary programs. Proc. programs. IBM Res. Rep. RC-1817, 1966.
Syrup. Semantics of Algorithmic Languages, Lecture Notes in Math., 66. Miller, E.F., Jr., and Lindamood, G.E. Structured programming:
Vol. 188, Springer-Verlag, New York, 1971, pp. 89-101. Top-down approach. Datamation 19, 12 (Dec. 1973), 55-57.
34. Engelfriet, J. Simple Program Schemes and b~rmal Languages. 67. Mills, H.D. Mathematical foundations for structured
Lecture Notes in Comptr. Sci., Vol. 20, Springer-Verlag, New York, programming. IBM rep. FSC 72-6012, Fed. Syst. Div., Gaithersburg,
1974. Md., 1972.
35. Fischer, B., and Fischer, H. Structured Programming in P L / I and 68. Mills, H.D. The new math of computer programming. Comm.
PL/C. Marcel Dekker, Inc., New York and Basel, 1976. ACM 18, 1 (Jan. 1975), 43-48.
36. Goldschlager, L.M. Synchronous parallel computation. Ph.D. th., 69. Mills, H.D. How to write correct programs and know it. Proc.
TR- 114, Univ. of Toronto, Dec. 1977. IEEE Tutorial on Structured Programming, Washington, D.C., Sept.
37. Goodman, S.E., and Hedetniemi, S.T. Introduction to the Design 1975, pp. 84-91.
and Analysis of Algorithms. McGraw-Hill, New York, 1977. 70. Mirkowska, G. Algorithmic logic and its applications. Doctoral
38. Greibach, S.A. Theory of Program Structures: Schemes, diss., Univ. of Warsaw, 1972 (In Polish).
Semantics, Verification. Lecture Notes in Comptr. Sci., Vol. 36, 71. Myers, G.J. Reliable Software through Composite Design. Van
Springer-Verlag, New York, 1975. Nostrand Reinhold Co., New York, 1975.
39. Harel, D. And/or programs: A new approach to structured 72. Myers, G.J. Composite~Structured Design. Van Nostrand
programming. Proc. IEEE Specifications for Reliable Software Conf., Reinhold Co., New York, 1978.
Cambridge, Mass., April 1979, pp. 80-90. 73. Nassi, I., and Shneiderman, B. Flowchart techniques for
40. Harel, D. On folk theorems. Comm. ACM 23, 7 (July 1980). structured programming. SIGPLAN Notices (ACM) 8, 8 (Aug. 1973),
41. Harel, D., Norvig, P., Rood, J., and To, T. A universal 12-26.
flowcharter. In Proc. A I A A / I E E E / A C M / N A S A Comptrs. in 74. Neely, P.M. On program control structure. Proc. Ann. ACM
Aerospace Conf. II, Los Angeles, Calif., Oct. 1979, pp. Conf., Atlanta, Ga., 1973, pp. 119-125.
218-224. 75. Nicholls, J.E. The Structure and Design of Programming
42. Hirose, K., and Oya, M. Some results in general theory of flow Languages. Addison-Wesley, Reading, Mass., 1975.
charts. Proc. of the First USA-Japan Comptr. Conf., Sponsored by 76. Partch, B. Improved technology for application development
AFIPS, Tokyo, Japan, Oct. 1972, pp. 367-37l. management overview. Proc. SHARE XLI, Miami, Florida, Aug.
43. Hirose, K., and Oya, M. General theory of flow charts. Comment. 1973, pp. 1281-1300.
Math. Univ. St. Pauli, XXI-2 (1972), 55-71. 77. Perkowska, E. Theorem on the normal form of a program. Bull.
44. Hopkins, M.E. A case for goto. SIGPLAN Notices (ACM) 7, 11 Acad. Pol. Sci., Ser. Sci. Math. Astr. Phys. 22, 4 (1974), 439-442.
(Nov. 1972), 59-62; Proc. ACM Ann. Conf., Boston, 1972. 78. Peterson, W.W., Kasami, T., and Tokura, N. On the capabilities
45. Hughes, J.K. P L / I Structured Programming. John Wiley and of while, repeat, and exit statements. Comm. ACM 16, 8 (Aug. 1973),
Sons, New York, 1973. 503-512.
46. Hughes, J.K., and Michtom, J.I. A Structured Approach to 79. Plum, T. W-S. Mathematical overkill and the structure theorem.
Programming. Prentice-Hall, Englewood Cliffs, N.J., 1977. SIGPLAN Notices (ACM) 10, 2 (Feb. 1975), 32-33.
47. Indermark, K. On a class of schematic languages. Technical rep. 80. Prather, R.E. Structured Turing machines. Inform. and Control
82, Inst. for Res. and Programming, Gesellschaft fur Mathematik und 35 (1977), 159-171.
Datenverarbeitung mbH, Bonn, Germany, Nov. I974. 81. Pratt, V.R. Semantical considerations on Floyd-Hoare logic.
48. Jensen, R.W., and Tonics, C.C; Software Engineering. Prentice- Proe. 17th Syrup. on Foundations of Comptr. Sci., Houston, Texas,
Hail, Engelwood Cliffs, N.J., 1979. Oct. 1976, pp. 109-129.
49. Kasai, T. Translatability of flowcharts into while programs. Z of 82. Rogers, H., Jr. Theory of Reeursive Functions and Effective
Comptr. and Syst. Sciences 9, 2 (Oct. 1974), 177-195. Computability. McGraw-Hill, New York, 1967.

388 Communications July 1980


of Volume 23
the ACM Number 7
KL { i ~ p ~ ] fa~ed poiv~s at@ a~gebr;~, w~*,h mih~imly king

i~> N ( r~p{* g<~, Pch';;h A<:a~d ~,fSci, i97g

V<YTL 2 !2
g~, W~ld, M A <:~f~cge~¢ aipr~ach ta~ b,,~r;~c{recur'sire dcfinhion3 Mann emem Science/ D, F, S ha a rio
H~>liam:lP~b Co~Am~e~dam, ~97? p p 331 3 4 1
Operations Research Edhor
g~ W~:/.:. {) S, F m q ~ ar~ i) P Sha?~rc,, S < , and Wand, M
g o , ~ e a ~ > v 0 l u e d k x p ::~::'tS V~75L431 4 5 i
87. W~A~ W A A Ca~< aga~ns~ @¢ p>~,:~ SI(]PIAN Nogice~' {A(M} 7o
Gamma Variate
1/ {Nov 1~)72),61 M< }>f>< ACM Aw< C o n f ;Bose{m, !972~
gag. Y~ urd<,~< ~,', levk~*N~e~ %tPe<~ge~um5.w~cmre a~d Deq.gtfn
P~eB~cedlall. Er~glewood Ctift%, N.J, t<&eS,
Gene Fa/ors
gJ)o Y'ou~'don E ,4fae~a~i#~ggke ,%'~r~.~ctur<'d7%'eh*uqmq. Scco~@ ed{{ior~,
Yovafdor'~ Pre:~< New 'Yo~k, :~29 {[ irsI edigiom How iv &f:a~age
with Increased Shape
S~rue~red Pr~Nr~mm*~g, 1~76}

l"~md,;~mee*t,A~<fie D~v*pf~ewo/' Compuge~ P~og~'ae.end Sy:~wm.~


Parameter Range
RC.H, Cheng and G,M, Feast
S¢~a'¢~ee Ft~:,Vt**~','mR amt De,~4gs. Pren~ice-}lalL Englewocd ( ~ift%, University o(Wates Ins@urn of Science
N J,, I~?79
and Technology

devdoped gamma ge~erator:s are compact.,


nasty p r o g r a m ~ , and ~ e m s s a saifnrm stoned over
the operathg range, t~t are o a b ~vNtd for a > 1. A
tran~ormation of variable together with a technique
suggested by" Kinder.man and Monakan of generating
random ,eariates u~ing the ratio of mniform variates are
cnmbiaed to produce a fatuity of generators r a i d far all
a > l / n where n is an arbitrary integer. Thus if s ks
greater than uNty, variates with a tess than unity can
be sam#ed. The cases n = 2 and n = 4 are considered
explicitly aeM are shown to retain the feaVares of
compactness, ease ~f and u~fform sDeed.
Key Words aud P h r a ~ gamma variates~ r m n ~
numbers, simulation
CR Categories: 5~5, 8,t

1, Introduction

Since the publication of the review paper of A~ki.nson


and Pearce {2], there have appeared a large number o f
gamma variate generators covering the case ~ > I where
~ is the shape parameter. One of the more noteworthy
methods is based on the generat technique of generating
random varia~es using the ratio of uniform variates
proposed originally by Kindermaa and Monahan {6].
Kinderman and Mona.ban [7] and Cheng and Feast [5]
;have suggested Mgorithms using this technique to gen-
erate gamma variates, The ~brme~ paper also comains
some sound criteria for the choice of an optima1 alg{~
Pem~i<'m h'~ copy wtho~t~ fee a ] ~ p ~ i ~
gra~te~ p~x~vided that ~.hec,epies are not made or d~tr/ba~e~ &~ dh'e¢~

~NU~ UK~

Cornm~m~c~mB~s h d ) igN)

~*e ACM Nu.r~*be~' 7

Anda mungkin juga menyukai