Sammet - Programming Languages - History and Fundamentals
Sammet - Programming Languages - History and Fundamentals
a-2 &A-3
AESOP. AIMACO
ALGY
ALGOL
AMBIT
ALTRAN
AMTRAN
APL
An imated Movie
APL/360 APT
BACAIC BASEBALL
BUGSYS C—10
BASIC
CLP COBOL
CLIP
COGO COLASL
COGENT
COLINGO COMIT
Commercial Translator
Computer Compiler
CORAL CORC
Computer Design
Culler—Fried DAS
ces
DIALOG | DIAMAG
DATA-TEXT DEACON
DSL/90 DYANA
DIMATE DOCUS
DYSAC English
DYNAMO n NA zo
Extended ALGOL
FLAP
FACT TRAN
473L Query ALGOL aay GECOM
GPl
FORMAC For a
mul Kler er- May
FSL
FORTRANSIT Graphic
pss |} GRAE informatt
on Algebra
d
ICES IDS \6 Laning
JOVIAL
JOSS
JEAN E. SAMMET
PRENTICE-HALL, INC.
ENGLEWOOD CLIFFS, N. J.
Concept of the tower of BABEL to represent a large set
of programming languages is due to the Communications
of the ACM, a publication of the Association for Com-
puting Machinery, Inc. The illustration appears on the
front endpaper.
Gen. XI
PREFACE
vi
PREFACE Vii
ming languages. Most of the language descriptions are based on the outline
and concepts established in those two chapters, and so a careful reading of
Chapters II and III is required in order to understand the rest of the book.
This admittedly has the disadvantage of not necessarily being the best way
to describe a specific language, but has the advantage of providing some
consistency throughout the discussions. However, some of the flavor and
style of the individual language descriptions have been allowed to creep in,
and serve as a preview of what would be encountered in a more detailed
study. In a very few instances, minor inexact statements have been made
because the accurate language description would require details beyond the
scope of this book.
The remaining chapters and sections are relatively independent, and
in most cases a specific language description can be read without knowledge
of any other languages. Chapter IV deals with languages used primarily for
numerical scientific problems. Chapter V discusses those used for business
data processing. Chapter VI discusses the list and string processing languages,
and Chapter VII describes languages used for doing formal algebraic mani-
pulation. Chapter VIII describes languages which can be effectively used in
more than one of the areas covered in the preceding four chapters. Sample
programs for most of the languages in Chapters IV through VIII have been
included; they are meant solely to illustrate the syntactic style of the lan-
guages, and they are not guaranteed to be either correct or efficient. A few
problems have been coded in several different languages to provide an easy
comparison.
Chapter IX describes about 50 languages which are used in more
specialized application areas. Because greater specific knowledge of those
areas is needed to appreciate the languages, the discussions are very brief
and superficial. The criteria for judging these languages is less stringent
than those used for languages in preceding chapters, so that some of the
languages included are not conceptually very different from older ones which
were deliberately omitted, and they do not necessarily satisfy all the defining
characteristics of Chapter I. The criteria have been reduced to make clear
the great need for specialized languages.
Chapter X discusses a few significant unimplemented concepts. Finally,
Chapter XI contains the author’s personal views on future long range
developments in programming languages.
The philosophy and arrangement of references 1s described in Appendix
A, which also contains a list of authors of included citations. The beginning
of this Appendix should be read before looking at any of the reference lists.
Appendix B contains a list of each language described in this book, the
meaning of its acronym, a very brief description, and the one or two best
references for it.
The book outline was constructed with great care and is shown com-
PREFACE 1X
While these ideas may appear confusing here, it is hoped that the type
styles will be clear in the text. However, the really careful reader will find
that my scheme breaks down in many minor places, and it is left as an
exercise for the reader to find the actual places and to propose a solution.
The subject of programming languages 1s quite controversial and even
includes debate on what should be included or excluded. Therefore, this
book reflects the author’s personal opinions to a much larger extent than
would a book on a more stable or well defined area. It should be clearly
understood that the specific views expressed in the text, and the implied
views represented by the selection and arrangement of the languages, are
solely those of the author.
Jean E. Sammet
Cambridge, Massachusetts
ACKNOWLEDGMENTS
As stated in the preface, every effort has been made to ensure that the lan-
guage descriptions are accurate and not misleading. In order to accomplish this,
virtually every individual language writeup was sent to one or more experts
in that particular language. Because a large majority of these people spent
significant time in reviewing more than one draft and making constructive
comments, it seems appropriate to list the names of the languages or sections
with the individuals who commented on them, and to take this opportunity
to express my deep thanks. It must be emphasized that any errors, omissions,
or misleading statements in the text are completely and solely my respon-
sibility, and not those of the people listed here. They are also not necessarily
in agreement with the views I have expressed about various aspects of the
language or its contributions to the technology.
xi
Xii ACKNOWLEDGMENTS
and general points. Other people too numerous to cite individually, including
students in various courses who saw successive drafts, made constructive
suggestions On various sections.
Each sample program not taken from a printed source was coded by
a person with much experience in the language, although no guarantees
of either correctness or efficiency are made. I am grateful to the following
people for the coding of one or more of the sample programs: J. Andrada,
F. Bequaert, J. Bennett, C. Engelman, H. J. Gawlik, E.C. Haines, W.
Harrison, M. H. Halstead, K. Knowlton, T. Kurtz, C. Mooers, M. Perstein,
B. Raphael.
Most of the material used in figures and sample programs came from
publications of the Association for Computing Machinery, Inc., the Inter-
national Business Machines Corporation, and various Proceedings of the
AFIPS Joint Computer Conferences. I particularly appreciate the coopera-
tion of these organizations, as well as all others who permitted the use of
copyrighted material.
My appreciation to the IBM Corporation—specifically the Systems
Development Division and the Federal Systems Division—is unbounded,
both for providing me with the majority of the time I used for preparing
this book, and for supplying all the typing support, as well as the computer
time and telephone lines for the use of ATS (Administrative Terminal
System) which was used for typing and correcting most of the drafts. J am
specifically very grateful for the continued support and encouragement of
my managers, Nathaniel Rochester and Joel D. Aron.
Last but not least, a devoted crew of typists struggled with my manu-
script and having to learn an unfamiliar system of typing and correcting
(namely, ATS). They include Josephine Auterio, Margaret Mahoney, Carrie
Jo Clausen, and Dorothy Pearlman. The last two did a Herculean task
in helping prepare the initial reference lists. Finally, my secretaries Beatrice
Roffman and Carolyn Willet cheerfully coped not only with the book typing
but with a myriad of other chores as well.
CONTENTS
GENERAL
INTRODUCTION
anh
1. Machine Language Programming
NN NO
UWWwW
2. Symbolic Assembly Language Programming
. Early Development of Better Tools
3.1. Specific needs to be met
3.2. Brief history of early efforts
. Definition of Programming Languages
CO
4.1. Definition problem
O00COO
4.2. Defining characteristics
1. Machine code knowledge is unnecessary
2. Potential for conversion to other computers
3. Instruction explosion
4. Problem-oriented notation
4.3. Basic terminology
1. Source program
. Object program
WN
. Compiler
. Interpreter
&
. Automatic coding
Mm
6. Automatic programming
4.4. Difference between programming language and application
package 13
. Advantages and Disadvantages of Higher Level Languages 14
5.1. Advantages 14
. Ease of learning 14
—
. Ease of debugging 15
WY
. Ease of conversion 16
Nan
XiV
CONTENTS XV
5.2. Disadvantages 17
1. Advantages do not always exist 17
2. Time required for compiling 17
3. Inefficient object code 18
4. Difficulties in debugging without learning machine language 18
5. Inability of the language to express all needed operations 18
5.3. Overall evaluation 19
. Classifications of Programming Languages and Proposed Definitions 19
6.1. Procedure-oriented language 19
6.2. Nonprocedural language 20
6.3. Problem-oriented language 21
6.4. Application-oriented language 21
6.5. Special purpose language 21
6.6. Problem-defining language 21
6.7. Problem-describing language 22
6.8. Problem-solving language 22
6.9. Reference language 22
6.10. Publication language 22
6.11. Hardware language 23
7. Factors in Choice of a Language 23
7.1. Suitability of language for problem area and projected users 23
7.2. Availability on desired computer 24
7.3. History and evaluation of previous use 25
7.4. Efficiency of language implementation 25
7.5. Compatibility and growth potential 25
7.6. Functional (= nontechnical characteristics) 26
7.7. Technical characteristics 26
References 26
FUNCTIONAL CHARACTERISTICS
OF PROGRAMMING LANGUAGES 30
TECHNICAL CHARACTERISTICS
OF PROGRAMMING LANGUAGES 65
.
Operators 66
kh wWN
67
NO
.
Commands
.
Declarations 67
.
Compiler directives 68
.
Delimiters 68
7. Program structure 68
2. Form of Language 68
2.1. Character set 69
2.2. Types of basic elements (= tokens) 70
1. System-defined 70
2. User-defined and restrictions 71
CONTENTS
3. Structure of Program 82
3.1. Types of subunits 83
. Nonexecutable: declarations and compiler directives 83
—
. Comments 86
HN
. Character
. Complex 93
. Formal (= algebraic) 94
String 94
. List of pointer 94
. Hierarchical 94
. Others 95
10. Combinations of variable and constant types 95
4.2. Accessible data units 95
1. Hardware data units 95
2. Language data units 97
4.3. Types of arithmetic 97
1. Integer, fixed point, mixed number 98
2. Floating point 98
3. Rational 98
XVili CONTENTS
. Complex numbers 99
. Double or multiple precision
CONN
99
. Logical 99
. Other 100
. Higher level data units 100
4.4. Rules on creation and evaluation of arithmetic and logical
expressions 100
1. Intermingling rules 100
2. Conversion rules 101
3. Precision and computation rules for various modes 102
4. Precedence and sequencing rules 102
4.5. Scope of data 103
. Executable Statement Types 104
5.1. Assignment 104
1. Methods of specifying computation 105
2. Conversion rules for results 105
5.2. Alphanumeric data handling 106
1. Editing statements 106
2. Conversion statements 106
3. Sorting statements 106
5.3. Sequence control and decision making 107
1. Control transfer statements 107
2. Conditional statements 108
3. Loop control statements 109
4. Error condition statements 110
5.4. Symbolic data handling 111
1. Algebraic expression manipulation statements 111
2. List-handling statements 111
3. String-handling statements 112
4. Pattern-handling statements 112
5.5. Interaction with operating system and/or equipment 112
1. Input/output statements 113
2. Library reference statements 113
3. Debugging statements 114
4. Storage and segmentation allocation statements 114
5. Operating system and machine feature statements 115
5.6. Others 115
. Declarations and Nonexecutable Statements 115
6.1. Data description 116
6.2. File description 117
6.3. Format description 118
6.4. Storage allocation 118
6.5. Environment or operating system descriptions 119
6.6. Procedure, subroutine, function declarations 119
6.7. Compiler directives 119
6.8. Others 120
. Structure of Language and Compiler Interaction 120
7.1. Self-modification of programs 120
7.2. Self-extension of the language 121
7.3. Ability to write the compiler for a language in that language 121
CONTENTS XIX
=
. LISP 2 (cross-reference only) 195
Rh WN
. AED (cross-reference only) 195
CON
. SFD-ALGOL (cross-reference only) 195
NUM. SIMULA (cross-reference only) 195
. DIAMAG 195
GPL 195
. Extended ALGOL 196
. Languages Motivated by ALGOL 58 196
5.1. NELIAC 197
5.2. MAD 205
5.3. JOVIAL (cross-reference only) 215
. On-Line Systems 215
6.1. Introductory remarks 215
6.2. JOSS 217
6.3. QUIKTRAN 226
6.4. BASIC 229
6.5. CPS 232
6.6. MAP 240
6.7. Lincoln Reckoner 245
6.8. APL/360 and PAT 247
6.9. Culler-Fried System 253
6.10. DIALOG 255
6.11. AMTRAN 258
. Languages with Fairly Natural Mathematical Notation 264
7.1. Introductory remarks 264
7.2. COLASL 265
7.3. MADCAP 271
7.4. MIRFAC 281
7.5. Klerer-May system 284
. Miscellaneous 294
8.1. CORC 294
8.2. OMNITAB 296
8.3. More nonprocedural languages 299
References 300
3. COBOL 330
3.1. History of COBOL 330
3.2. Functional characteristics of COBOL 334
3.3. Technical characteristics of COBOL 345
3.4. Significant contribution to technology 375
4. File Handling 376
4.1. Extensions of COBOL 376
1. IDS 376
4.2. General (cross-reference only) 376
References 377
VI STRING AND
PROCESSING
LIST
LANGUAGES 382
Vill MULTIPURPOSE
LANGUAGES 523
[ SPECIALIZED
LANGUAGES 603
LDT 621
WwW
622
An
CLIP 635
TMG 636
COGENT 638
META 5 638
TRANDIR 640
FSL 641
. AED (cross-reference only) 641
2.6. Mi scellaneous 642
. Matrix computations: Matrix Compiler 642
mPwWN=
GPSS 653
. SIMSCRIPT 655
Mh
. SOL 656
XxivV CONTENTS
6. MILITRAN 657
7. SIMULA 657
8. OPS 660
3.2. Query 662
1. Introduction 662
2. COLINGO and C-10 664
3. 473L Query 665
4. ADAM 667
5. BASEBALL 668
6. DEACON 668
7. Protosynthex 669
8. AESOP 670
3.3. Graphic and on-line display languages 674
1. GRAF 674
2. PENCIL 677
3. Graphic 677
4. DOCUS 678
5. AESOP (cross-reference only) 678
3.4. Computer-aided design 678
1. General 678
2. AED 680
3.5. Text editing and processing 684
3.6. Control languages for on-line and operating systems 687
References 693
xX SIGNIFICANT
UNIMPLEMENTED CONCEPTS 707
Xi FUTURE LONG-RANGE
DEVELOPMENTS 722
1. Introduction 722
2. Theory-Oriented Category 723
2.1. Language definition, translation, and creation 723
2.2. Next major conceptual step 725
2.3. Nonprocedural languages 726
2.4. Problem-describing languages 726
2.5. Use of mathematical concepts 727
CONTENTS XXV
BIBLIOGRAPHY ARRANGEMENTS
AND AUTHOR LIST 738
LANGUAGE
SUMMARY 753
CHAPTER |
CHAPTER Il
CHAPTER lil
CHAPTER IV
XxVvi
LIST OF FIGURES AND SAMPLE PROGRAMS XxVvii
CHAPTER V
CHAPTER VI
CHAPTER VII
CHAPTER VIII
CHAPTER IX
CHAPTER X
CHAPTER Xi
SAMPLE PROGRAMS
ALGOL 60 178
ALTRAN 502
AMBIT 455
AMTRAN 259
APL/360 248
BASIC 230
COBOL 336-337
COLASL (Fig. I[V-22) 268
COMIT II 418
CPS 233
FLAP 507
FORMAC (PL/I-FORMAC) 477
Formula ALGOL 583
FORTRAN 151
IPL-V 392
JOSS II 218
JOVIAL 528
Klerer-May System 285
L6 401
LISP 1.5 407
LISP 2 591
MAD 207
MADCAP 272
MAP (Fig. IV-17) 243
MATHLAB 68 499
MIRFAC 282
NELIAC 199
OMNITAB 297
PL/I 544-545
PL/I-FORMAC 477
Proposal Writing Language (Fig. IV-11) 172
QUIKTRAN 227
SNOBOL3 437
Symbolic Mathematical Laboratory 315
TRAC 449
TREET 458
I GENERAL INTRODUCTION
1
2 GENERAL INTRODUCTION
Every computer has a specific set of instructions which it can execute once
the instruction is placed into the appropriate part of the machine. The actual
set of symbols which the hardware can interpret for execution is the direct
machine language. Since most computers are designed so that their storage
locations and registers contain binary characters (i.e., bits), the most com-
mon machine language 1s actually binary. Thus the sequence
011011 O00000 000000 000000 000001 000000
might mean place the contents of storage location 64 in the accumulator. To
write one instruction, let alone many of them, in this form is clearly imprac-
tical, and this was recognized very rapidly in the early days of computers.
A partial step to alleviate this problem involved the use of mnemonic codes
to represent the instruction, while the rest of the information was left in
binary. Thus, the sequence
CLA 000000 000000 000000 000001 000000
might have the same meaning as the binary string given earlier. While this
was a partial improvement, it was still far from easy to write even one in-
struction correctly. The next step forward came when the numbers (repre-
senting the storage locations or registers in the computer) were allowed to be
written in decimal form. Thus the sequence CLA 0 0 0 O 64 might have
the same meaning as the earlier strings.
The border line between machine language and symbolic assembly
language is not well defined. Some people would choose to refer to the
format given just above as assembly language. At the present time, it is not
worth debating the merits of either view.
justifiable because one person was interested in saving space and therefore
wrote as short a subroutine as he could, while somebody else wanted to
save as much time as possible and therefore removed loops even at the
expense of using more storage locations. In another case, people had
differing requirements for precision, and this caused another whole set of
routines to be developed with varying degrees of precision. However,
eventually the individual effectiveness of a particular program became less
important and was subjugated to the overall effectiveness of a group of
programmers. Thus there developed the need for effective library facilities
and, in particular, library routines—many of them parameterized—that
could be invoked very easily by a programmer.
Another area where a need rapidly became apparent was in routines
which differed not in concept but only in specific cases or which had many
input parameters, not all of which were numbers. The best example of this
was the early sort routines, which used the same techniques but differed
in the coding because the key might be in the first word of the record or the
fifth or the ninth, and the key might be three characters long or eight, etc.
The early work of F. Holberton [HF54] in developing sort generators for
UNIVAC had a significant impact on this type of problem because she pro-
vided a set of routines which would partially write themselves once given
the necessary input parameters.
Programmers not only wanted the ability to use other people’s code,
but they wanted the capability of easily bringing together small sections
of a program. One of the earliest and most significant efforts along these
lines was the development of the subroutine library for the EDSAC as
represented and described by Wilkes, Wheeler, and Gill [WI51].
Finally, there was an increasing demand for being able to write short-
hands of various kinds. Once people had written sequences of code, they
were interested in finding a shorthand way to write the same or similar in-
formation, and calling the material from the library was not always appro-
priate. In addition, people wanted better and better notation, where they
implicitly defined “better” as “more natural”.
All these needs were attacked by different people in different ways.
In my opinion, Dr. Grace Hopper probably did as much as any other single
person to sell many of these concepts from an administrative and manage-
ment, as well as a technical, point of view. See, for example, Hopper [HP55].
One of the first meetings held to discuss the subject that was then called
automatic programming was sponsored by the Office of Naval Research in
May, 1954 and reported in [DN54]. At that time, a number of interesting
systems were described, some of which are covered in later sections.
Probably the most significant ideas that were mentioned at that early meeting
and that are not covered in this book are the concept of code generation
discussed by Holberton, the editing generator of Waite and Elmore, the
1.3. EARLY DEVELOPMENT OF BETTER TOOLS 5
702 AUTOCODER
ASSEMBLY
SCRIPT
6
Computer In ACM Library Do Not Have
FERUT TRANSCODE
ILLIAC ILLIAC
LGP-30 ERFPI
JAZ
SPEED
MIDAC EASIAC
MAGIC
LARC K5
SAIL
FERRANTI AUTOCODING
MERCURY MAC (NORWAY)
FERRANTI AUTOCODE
PEGASUS
$ GENERAL INTRODUCTION
Since the first characteristic states that the user need not know the
details of the particular computer on which his program is to be run, it
follows that a programming language must have some significant amount
10. GENERAL INTRODUCTION
3. Instruction Explosion
4. Problem-Oriented Notation
CLA C
MPY D
ADD B
STO A
1. Source Program
2. Object Program
3. Compiler
4. Interpreter
5. Automatic Coding
In the very early stages of work in this area, the phrase automatic
programming was used to mean the process of writing the program in some
higher level language. As time went on, it became clear that this encoding
was only part of the entire process of programming since there were phases
of analysis, documentation, debugging, testing, etc. Hence, the term
automatic coding began to apply to the portion of the overall programming
effort that related specifically and only to the process of actually writing
the source program and having it translated to a form where it could be
run on a computer.
6. Automatic Programming
In the past few years there has been an increasing number of special
application packages developed. One of the earliest and most significant of
these was the work done on linear programming. More recent areas involve
type composition [IBOOf], demand deposit accounting [IB00e], traffic control
[IB66c], inventory management [IB00] and [IBOOd]. However, it is impor-
tant to realize that an application package and a programming language
are not the same. An application package tends to be a set of routines which
are heavily parameterized, so that an individual user can supply the specific
information which is needed for his particular direct usage. The information
is often supplied through tables or filling in a form. File formats are usually
specified by the application package. In some cases the execution sequence
of the routines is predetermined, e.g., student scheduling [IB66j]. In others,
the user decides which routines he needs and what the sequence should be,
e.g., bill of material processing [I1B66k]. In the latter situation, the user some-
times has to write a control program in an assembly or higher level language
to set up and call the necessary routines. A programming language, on the
other hand, provides flexibility in the way in which information is conveyed
14 GENERAL INTRODUCTION
and, more importantly, provides the tools with which the subroutines or
packages can be built-up. An application package is limited to use in a
narrow area. A programming language usually involves a wider potential
range of applications, although the languages discussed in Chapter IX are
designed for very specific—and sometimes quite narrow—applications.
1.5.1. ADVANTAGES
1. Ease of Learning
CLA A
ADD B (Calculate A+B)
SUB C (Calculate A+B—C)
TRN ALPHA (Transfer control to ALPHA if A+B—C
is less than O, 1.e., if C is greater than A+B)
JMP BETA (Transfer control to BETA)
The other half of the advantage is the ease of understanding the program
once it is written. These two aspects reflect the differences between actually
writing the program and trying to understand an already existing program
(either one’s own or, more likely, someone else’s). The higher level language
is clearly easier to read and understand, as seen from the example above.
In addition, the complexities of today’s large computers make it very
difficult to learn to program them at all, let alone effectively.
3. Ease of Debugging
the source program will generally be physically shorter. Since the number of
errors is roughly proportional to the length of the program, obviously there
will be fewer errors. In some cases it might turn out that the program
written in the higher level language was actually longer if measured by the
number of characters actually written. (This happened in the example given
on p. 15.) However, the program is easier to debug because the notation
is so much more natural; more attention can be paid to the logic of the
program with less worry about the details of the machine code. For example,
although there might be more characters involved in writing READ NEXT
RECORD FROM TAPE ALPHA than in REDABC, ALPHA, the former is easier
to understand, particularly when there may be a whole sequence of six-letter
instructions which differ by at most one letter.
5. Ease of Conversion
1.5.2. DISADVANTAGES
There is a subtle point that the advantages stated above do not always
exist in specific cases, and a person might be worse off; however, this would
only tend to arise in a comparison of a complex and powerful programming
language versus a simple assembly language. Thus the programming lan-
guage might be extremely difficult and hard to learn; and unless proper
attention is paid to the compiler and other facets of the overall system, the
other advantages may not themselves accrue. Fortunately, this seldom
occurs.
If a person does not know machine code, and the compiler does not
provide the proper type of diagnostics and debugging tools, the program
may actually be harder to debug than an assembly language program which
the user understands. A person who must look at an octal memory dump
will have a lot more trouble debugging his high level source program than
he would if he had written it in assembly language. Thus a compiler which
does not provide proper attention to this aspect may greatly reduce the
advantages of a higher level language or cause them to disappear entirely.
In spite of the fact that higher level languages have been with us for
over 10 years, there has been relatively little quantitative or qualitative
analysis of their advantages and disadvantages. One very small study is given
by Shaw [SH66] and some information is given by Nelson et al. [NE65].
In spite of this paucity of definitive information, the current milieu
calls for the use of higher level languages. People who use assembly code
are—if not in an actual minority—considered somewhat archaic or old-fash-
ioned. The fact that there is a tremendous proliferation of languages (as
witnessed by all those described, plus others not even mentioned, in this
book) indicates that we have not yet solved the problem of knowing what
is really needed by the user. Some comments about possible future direc-
tions are given in Chapter XI. However, the net overall evaluation appears
to be that higher level languages have proved their worth and are definitely
here to stay.
here is that these are definitely executable operations, and the sequencing
is already specified by the user. FORTRAN, COBOL, and PL/I are examples.
The term nonprocedural language has been bandied about for years
without any attempt to define it. It is my firm contention that a definition
is not really possible because nonprocedural is actually a relative term mean-
ing that decreasing numbers of specific sequential steps need be provided
by the user as the state of the art improves. The closer the user can come to
stating his problem without specifying the steps for solving it, the more
nonprocedural is the language. Furthermore, there can be an ordered
sequence of steps, each of which is “somewhat nonprocedural,” or a set of
executable operations whose sequence is not specified by the user. Both cases
contribute to “more nonproceduralness”. Thus, before the existence of such
languages as FORTRAN, the statement
Y=A+Bx*xC—
F/G
Assuming that a decision has been made not to use assembly language (see,
e.g., Shaw [SH66]), there is currently no scientific, or even logical, way to
choose the best programming language for a particular situation. Part of
the difficulty stems from the fact that the situation itself is usually defined
poorly, and potential for change in the application area is a factor which
must be taken into consideration. It is definitely not the purpose of this book
to provide all the information needed by a potential user to choose the
programming language most suited for his purposes. However, it is one of
the purposes to supply some of this information and to indicate the factors
which should be considered. The reader is cautioned to be very careful in
applying the items discussed in this section to a particular case. Not all factors
are relevant in all situations, nor are they all equally important. In virtually
all cases, no single language will be ideal for a particular application, let
alone for a particular installation, and probably not for an entire company.
An increasing amount of work is being done to develop some fairly
specific methods for evaluating languages and their compilers. Scientific
evaluations have seldom been made, and documented even less often, and
the few attempts to date seem to be without any quantitative measurements.
Questionnaires and comparisons have been developed by Shaw [SH62] and
Budd [QH66]; although the latter pertains only to FORTRAN and COBOL,
it is quite detailed for those languages. General discussions are given by
Haverty [HV64], Chapin [CZ65], and Schwartz [SC65]. A number of un-
published papers on evaluations for specific military applications also exist.
Some of the terms and/or concepts used below are defined and discussed
in some detail in Chapters II and III, particularly the former.
The most obvious question which must be asked (and which is also
raised in Section II.7.1) 1s whether there is an implementation of the language
on the desired computer (configuration). It is obviously useless to decide
on a superb language for a particular application and then find there is no
way to obtain running programs. Of course in some cases the language may
be deemed so worthwhile that a particular installation would choose to
finance a compiler if there was not one existing already.
If there is a compiler available, then a particular point to watch out for
is the exact computer configuration which it requires. It does not help to
find an excellent language and an efficient compiler if the latter requires
twice as much memory capacity as the installation possesses. Again, in this
case, if other factors warrant it, then there might be justification for obtain-
ing the extra memory.
1.7. FACTORS IN CHOICE OF A LANGUAGE 25
Once the user has found what he considers a suitable language and
there is a compiler available on his computer, then he should consider the
history of usage of this language. He should investigate such items as the
reactions of previous users, users’ views on its applicability in actual practice,
the efficiency of the implementation (see Section I.7.4.), its potential for
expansion into other (and probably unforeseen) application areas, ease or
difficulty of training and effectiveness of documentation, and problems of
conversion and compatibility. In short, he should consider the language
based on the practical experience of others with regard to the factors in
Chapter II.
REFERENCES
30
Il.2. PROPERTIES OF LANGUAGES 31
with choosing the best language for his problem or his installation is strongly
advised to consider not only the stated objectives but the frame of reference
for the terminology. This can usually be achieved by considering the techni-
cal features in the language.
A B C D
procedure-oriented problem-defining hardware problem-oriented
nonprocedural problem-describing publication application-oriented
problem-solving reference special purpose
is put out, so that the program becomes easily understandable to a wide varie-
ty of people. (This has actually been done by developing the Rapidwrite
system for COBOL—see Humby [HY62], [H Y63].)
In the case of a language designed for use by a professional programmer,
a major characteristic is to provide maximum capability. In other words,
the programming language can and should aim at relieving the professional
programmer of many annoying details but still provide him with great flexi-
bility. Thus, for example, he should have some very nice way of stating the
beginning and ending points of loops and the increment to be used, but
he may want a large number of ways of specifying or controlling the loops
(e.g., incrementing or decrementing, varying several parameters in one state-
ment). In the case of the nonprofessional programmer, he may be satisfied
with one relatively simple way of handling this particular facility. Similarly,
the professional programmer will almost always want to be able to get at
the machine code. No programming language to date has been designed
so well that the professional programmer has been completely satisfied with
it; there are always things that he wants to do that seem to require resorting
to machine code. This facility does not generally interest the nonprofessional
programmer.
One other feature in considering this distinction between the profes-
sional and the nonprofessional programmer is in the type of debugging aids
that are made available. These are discussed in somewhat more detail in
Sections [1.5.5.3 and III.7.5, but it should be pointed out here that a pro-
gramming language which requires a nonprofessional programmer to under-
stand machine language in order to debug his higher level language
program is not much help. Only if the debugging can take place at the source
language level is he really aided. On the other hand, in very tricky cases
the professional programmer may want the ability to get memory dumps
and to examine contents of index registers. This is particularly true if the
language does not provide really good debugging aids.
In attempting to aim a language at a nonprofessional programmer,
one can give strong arguments for making the language as natural as possible.
In other words, if the user is concerned only with solving the problem, he
will presumably prefer to communicate with the computer in the language
which is most natural to him. He is not necessarily concerned with all the fine
points that the professional programmer wishes to be able to control. The
issue of what is meant by natural and how much is desirable and feasible
is a hotly debated one. (See Sammet [SM66b], Halpern [HL66], and Dijkstra
[DJ63] for further discussions of this point.)
An issue of vital concern to the nonprofessional is the amount of
“nonlanguage” material he must learn. Since the compilers are usually
part of an operating or time-sharing system, the user can seldom just “write
his program”. He ts often required to worry about such things as control
36 FUNCTIONAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
cards, form of his object deck, etc. A discussion of these problems is beyond
the scope of this book.
have usually come up with new and better hardware. There has been a great
deal of misinformation and misunderstanding on what is meant by compat-
ibility and what types of conversions are possible and meaningful. It is
the purpose of this section to try to clarify these issues.
1. Machine Independence
The first type of compatibility that people are concerned with is compat-
ibility across machines, i.e., how dependent on a particular machine or class
of machines Is a given programming language. Clearly, if the programming
language makes reference to hardware that is unique to a given machine
(e.g., sense lights, backward-reading tapes, and discs), then there is no hope
that a program written in this language can be directly handled on a machine
without these features, unless they are simulated; this is usually prohibitive in
cost. Similarly, if the language—as a language—makes particular use of the
fact that the machine 1s fixed word length versus variable word length, binary
versus decimal, or has a particular number of bits or characters per word, then
again there is no chance of having the program directly transferable to anoth-
er machine. A partial solution to this problem is to allow the user to state
in his program the precision he requires. (This is done in PL/I.) However,
this 1s a double-edged sword because the user may pay a heavy penalty
for the inefficiency caused by a precision which is grossly disparate from the
word size, e.g., specifying 11-digit precision on a computer with 10 decimal
digits per word. If the user is aware of these factors, he can make a more
intelligent choice.
Clearly if a language makes use of the hardware characteristics of a
specific computer, programs cannot possibly be directly compatible, i.e.,
directly usable on another machine. There might be exceptions to this but they
would depend on very clever programming on the part of the compilers,
and this has not yet been done. The true definition of machine compatibility
is the ability to take a deck of cards, or whatever other input media is used,
insert it into a different type of computer (1.e., not one “in the same family”),
and have the program run and produce the same answers. Anything less
than that capability is a partial or pseudo type of compatibility. We have not
yet achieved this facility for the languages, let alone for the extra information
required by the operating system.
Two of the machine features which tend to “ruin” compatibility most
are word size and collating sequence; actually both of these could be cor-
rected by the compiler—but at prohibitive cost. The word size affects the
precision and sometimes even the actual results of numeric calculations
38 FUNCTIONAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
because numbers are usually stored in one or two machine words. Thus,
unless the actual number of characters (or bits) to be used is specified (and
implemented by the compiler), the arithmetic results will differ from machine
to machine whenever the word lengths are different. In many cases this does
not have a practical bad effect, but the potentiality is certainly there. In
the case of the collating sequence, the situation is actually worse because
incorrect results are easily obtained as a result of branches which operate
differently. If the collating sequence on one computer places letters before
numbers, but this is reversed on another machine, then any test of data based
on this sequencing information will produce opposite results in going from
one machine to another. Again, this could be corrected by having the lan-
guage specify the collating sequence and require the compiler to turn out
the correct code, but nobody has yet been willing to do this because of the
tremendous cost at object time.
Other facets of the data base problem, such as wordmarks, fixed versus
variable length words, and general record layouts, cause incompatibility.
This difficulty exists independently of the language characteristics.
2. Compiler Independence
ferent views of what is meant. On top of that, neither person may even
recognize that an alternative view is possible, until it is pointed out to him.
This causes the compilers to be incompatible in the sense that two different
compilers may accept the same source statement and not only produce
different object code but, more importantly, cause the source programs to
produce different results. Unfortunately there is no way around this incompat-
ibility until better means of defining languages are developed. It is because
of this problem that many people have taken the view that the only complete
definition of a language is a compiler for the language. My personal view
is that this is so impractical that I prefer the unpleasant alternative of admit-
ting that we do not yet know how to define programming languages rigorous-
ly.
1. Based on Compatibility
The term S/FT stands for Share Jnternal FORTRAN Translator and
was first used in connection with the program to go from FORTRAN II
to FORTRAN IV on the 709/90/94 (see Allen, Moore, and Rogoway
[AX63]). In the development of FORTRAN IV, great attempts were made
to make FORTRAN II a proper subset of FORTRAN IV. However, there
were cases in which this was not possible, either because it would place too
great a restriction on the new version of the language or, in other cases,
because people had taken strong advantage of what the compilers of
FORTRAN II would do and these nonlanguage facilities were not applicable
to the larger and newer compilers. The term sift became used fairly generally
to refer to the partial translation of one higher level language to another
one which is fairly similar. This normally means the automatic conversion
of equivalent language elements and flagging the others for manual conver-
sion. This is a type of conversion, which again is dependent for its ease on
the amount of sifting which can be done. A particular illustration—namely,
of ALTAC to FORTRAN II—is described by Olsen [OL65].
In the worst case, one may be faced with the problem of trying to have
one language, which has been implemented for a particular machine, trans-
lated into the form of another language for another machine. It is of course
assumed that such a translation will preserve the high level characteristics
of the original program and will not cause severe degradation of the even-
tually resulting object code. An almost useless translation (from an effici-
ency viewpoint) occurs when a less powerful language is translated on a
statement-by-statement basis to a more powerful one. This has actually
occurred in translating from powerful assembly programs (Autocoder)
2 See Datamation, Vol. 12, No. 6 (June, 1966) for several papers on this subject.
11.5. STANDARDIZATION 43
11.5. STANDARDIZATION
One of the key factors in the definition and use of a programming language
is the role played by standardization. The purpose of this section is to de-
scribe the purposes and problems in standardizing programming languages
and the procedures that are involved and to give a brief status report. More
details about the latter are shown in the individual language descriptions.
II.5.1. PURPOSES
II.5.2. PROBLEMS
1. Conceptual Problems
The first conceptual problem is one of timing; 1.e., when should stan-
dardization of a language take place. Unless this is given careful considera-
tion, it is likely to come too soon or too late. If it 1s too soon, then the
standardization is premature; it is not clear what is needed, and there is a risk
of standardizing on a number of things that really are not very good. On the
other hand, if standardization is delayed too long, then there are dialects—
admittedly some of them very minor changes—and this in turn creates a num-
ber of vested interests which are reluctant to accept a standard which
deviates from their particular version.
A second conceptual problem is the risk of stifling progress. Somehow
the standardization process must avoid eliminating or preventing technical
progress. This is extremely difficult because there is no easy way of coping
with new and bright ideas if they come in after the standard is established,
or even while it is in the process of being established. An excellent example
of this arose in one subcommittee meeting which suggested a somewhat bet-
ter method for handling the proposed revised ASCII code. Unfortunately,
too much work had already been done by too many people to permit the
change, even though several groups agreed it was an improvement.
2. Technical Problems
3. Procedural Problems
X3.4.7. Machine tool control. This group was actually the latest
formed; it did not come into existence until the latter part of 1964. It is con-
cerned with the development of standards for machine tool control.
The main work of X3.4 has been in deciding what languages to try to
standardize and then actually attempting to do it. Because the maintenance
and definition are different for each language, the procedures need to be dif-
ferent.
Once X3.4 has created a proposed draft standard, it is submitted to the
parent body, X3, which arranges for its publication and wide distribution.
A period of approximately 6 months is then allowed for commentary by any
person or organization whatsoever. Following (and sometimes during)
this period, a ballot is taken according to USASI rules and procedures and,
based on that ballot, either the proposed standard is sent back to the commit-
tee for rework or it is submitted to the Information Processing Systems
Standards Board (IPSSB) for its determination that the proper procedures
were used and a consensus really exists. In almost all cases, IPSSB provides
final approval of the standard. (There is a still higher group, but it is seldom
needed.) Once the standard becomes promulgated, it is then recognized
as an American standard. Again it must be emphasized that adherence to
this standard is completely voluntary on the part of any organization. Experi-
ence to date has shown that such standards do play a very significant role
in the activities of computer manufacturers.
tend to be ignored or misunderstood but they play a vital role in the overall
consideration of the language.
11.6.1. ADMINISTRATIVE
satisfy the objectives? The second is: Were the objectives worthwhile? The
first question is a very good one if it is applied honestly, and the prime cri-
terion of a good language is whether it achieves the goals specified for it.
The question about worthiness of objectives is a dangerous one. Using the
earlier analogy, a device good for crossing an ocean may be a silly idea to
someone who has no interest in moving off dry land. Too many criticisms
of programming languages tend to be made by people who have no knowl-
edge of, or interest in, the problem area; they insist that the objective is bad
when in reality they do not understand or care about it.
was true with the question of who designed the language, the maintenance
is sometimes done by an interorganization group and sometimes within
a single organization. However, when the maintenance of the language is
divorced from the implementation, a certain amount of chaos is likely to
arise. This occurs because the implementors usually need an immediate deci-
sion on what a particular point means; those who are maintaining the lan-
guage may not be ready to meet that week to answer the question; yet coding
must continue. Similarly, people who are pressing for improvements and/or
extensions to the language are apt to find a very responsive chord in the
maintenance group, but an unresponsive chord in the implementation group.
The latter will certainly resist improvements to the language if it invalidates
their compilers. Thus, if the maintainers of the language are significantly
separated from the implementers, they may make changes and/or decisions
and/or improvements which seriously affect the implementation. Even
if the two groups coincide, the thorniest of all the administrative problems
is to decide when to allow the language to be significantly improved, at the
cost of much compiler rewriting.
11.6.2. TECHNICAL
The technical issues in language definition are, of course, the very heart
of determining what the language actually is, 1.e., what its specifications are.
These issues are often mixed up with the notation (metalanguage) of the
definition, i.e., the actual way in which the language definition is written down
on one hand, and the questions of the rigorousness of the definition of the
syntax, semantics, and pragmatics on the other hand. In my opinion, too
much of the discussion of the actual features and qualities of a language
centers around the way in which the language is defined. While obviously
a poor and unrigorous definition makes it difficult if not impossible to deter-
mine what the language specifications really are, it should be kept in mind
that the language and the means of defining the language are not the same
thing. It is for this reason that the discussion of the technical methods of lan-
guage definition are included in this chapter, even though they are definitely
technical and this chapter is purportedly concerned with nontechnical charac-
teristics of programming languages. I would go even further and say that
many of the nontechnical problems exist because the computing community
has not yet solved satisfactorily the technical problems of defining program-
ming languages rigorously.
were largely the subject matter of the 1964 IFIP working conference, whose
proceedings appear in Steel [ST66a].
By syntax we mean a rigorous statement of what sequences of charac-
ters are considered correct in the language and, ultimately, what character
sequences constitute a (syntactically) legal program. Thus, the syntax could
specify that the sequence A + B is legal; whereas the sequences +AB or
A+B are not allowed. On the other hand, a different language might say
that the second or third (or both) of these was legal; whereas the first was not.
In any case, the syntax simply specifies the legitimate strings in the language.
The meaning of the string is determined by the semantics. Thus, for example,
the string A + B might mean addition if A and B were numbers; whereas
it might mean union if A and B were sets or logical conjunction if A and B
were truth values. Clearly, a single legal string can have a great many mean-
ings; the collection of all these meanings for each legal string is called the
semantics of the language. The pragmatics is the relationship of these strings
and their meanings to the user. Thus, the user himself must understand and
appreciate what is meant by arithmetic, set union, and logical conjunction.
Furthermore, there must be agreement between his intended use of a string
of symbols and its actual semantic interpretation by a compiler.
The following statements appear to be true: (1) There is sometimes a
hazy line between what is syntax and what is semantics; e.g., the rule that
the number of subscripts on a variable in FORTRAN must agree with the
information in the DIMENSION statement can be considered both syntactic
and semantic, although it is primarily syntactic. (2) There is no notation yet
developed which will express completely unambiguously all the syntax of a
programming language, even if there were agreement on what was purely
syntax. (3) Little work has been done on formalizing semantics, although
the work of the IBM groups in Hursley, England and Vienna, Austria has
made a good start on PL/I (see the reference lists at the end of this chapter
and Chapter VIII for numerous reports). (4) Nothing has been done about
formalizing pragmatics. Thus, the problem of rigorously defining a lan-
guage—assuming there is an intuitive idea of what the language should
be—is one in which a large amount of technical work needs to be done.
However, significant work in providing formal notation for syntax has been
done and has helped the language definition problem enormously. See Floyd’s
survey [FL64] and the other items in the list of references at the end of the
chapter.
2. Formalized Notation
but very little work has been done for the semantics; hence, the latter will
therefore not be discussed at all.
A complete discussion of the formalized notations used for describing
programming languages is beyond the scope of this book. However, the basic
principles can be stated rather simply. This whole area is the major interface
point between artificial languages and the work of linguists concerned with
natural languages. Further details can be found in the references in Floyd’s
paper [FL64].
To define a language, some language must be used for writing the defini-
tions. This latter is called a metalanguage. It is a general term which can
include any formal notation or even English itself. Metalanguage is a relative
term since it is itself a language which must be defined, and that requires
a metametalanguage. For the languages discussed in this book, we need only
be concerned about the single level of metalanguage.
The first, and still the most significant, contribution made in this area
was by John Backus in his paper [BS60] describing IAL (later called
ALGOL). After an informal description of the proposed language, Backus
states (page 129) “There must exist a precise description of those sequences
of symbols which constitute legal IAL programs... . For every legal program
there must be a precise description of its ‘meaning’, the process or transforma-
tion which it describes, if any ....” The second part of this objective has not
yet been carried out completely and successfully, although significant work
is well underway. The prime elements of the metalanguage are the concepts
of a metalinguistic formula or expression composed of metalinguistic vari-
ables (whose values are strings of symbols), a metalinguistic equivalence
symbol, and metalinguistic connectives. The metalinguistic variable (which
is also called a syntactic unit) normally has mnemonic meaning, although
this is not required; thus integer is a metalinguistic variable whose values
are the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9. (Angular brackets < > are a com-
monly used notation for syntactic units.) The most important connectives
are or, concatenation (i.e., adjoining two strings to make one string), choice,
and optional. Not all these connectives are used in each metalanguage;
it is largely a matter of (1) personal choice and (2) structure of the language
being defined, as to which combinations are used. The concepts of recursion
within definitions and repetition of syntactic units are also widely used;
these are illustrated later.
The most common (although by no means the only) combinations of
symbols are those which have been used for the ALGOL 60 report (Naur
[NA60] or [NA63]) and for the COBOL report [US65].* In the former, com-
monly referred to as BNF for Backus Normal Form or Backus-Naur Form,
the metalinguistic symbols and their meanings are
3Citations are given in the reference lists at the ends of Chapters IV and V, respectively.
54. FUNCTIONAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
Symbol Meaning
[= equivalence
< > surround metalinguistic variable
juxtaposition concatenation
| or
In the COBOL report,
Symbol Meaning
small letters metalinguistic variable
juxtaposition concatenation
{ } choice
[ ] optional
upper-case letters optional fixed words in language
upper-case letters underlined required fixed words in language
repeat previous syntactic unit
<digit> := O0]1]/2/3]4/5161718]9
The first line specifies that a metalinguistic variable called digit is one of the
characters 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9. The second line illustrates recursion
as part of the definition because it says that an <integer> is either a <digit>,
or an <integer> followed by a <digit>. A negative integer would be defined
by saying
<negint> := —<integer>
Note that there is no limit stated on the number of digits allowed. From
the definition of negative integer, examples are
—32— —3—2
( (A
*))) *C
QE) QE))
() *)))ABCDE)ABCDE)
The following are not legitimate values for <ab>:
A A)
A( ABC)
((* *(
)x JE
Using the “COBOL metalanguage,” consider the following abstract
example:
where integer has the expected meaning, bibble represents a letter, bull
represents a digit, and the three dots ... indicate repetition of the immedi-
ately preceding syntactic unit, namely, bull, 1.e., digits. Note that it is the
syntactic unit which is repeated, not necessarily the individual value of the
unit. Then the following are legitimate values for the metalinguistic expres-
sion above (which is not actually given a name):
3K5 9KC3333
5B3259 AKAB
2KL 2B
Since the K is not underlined, it 1s optional. Note that in the first case it is
impossible to tell whether the K has come from the specific K, or from bibble.
In the last case, the B can be from either the bibble or from the AB. A lan-
guage with the characteristic that its strings can be broken apart in only one
way is called uniquely deconcatenable, and the example above defines a lan-
guage which is not uniquely deconcatenable.
56 FUNCTIONAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
7
and the second as
ES}
<partial> := <integer> K <bibble> <bull> | <integer> K <bibble> |
<integer> K AB <bull> | <integer> K AB |
<integer> K B <bull> | <integer> <bibble> <bull> |
<integer> <bibble> | <integer> AB <bull> |
<integer> AB| <integer> B <bull> | <integer> B
<integer> KB
ABC...2Z
012...9
The question left unanswered by this definition is whether more than one
period and/or hyphen can appear in a name. Thus, it is not clear whether
or not A.B.C.D and A.B — C are legal names.
II.6. TYPES AND METHODS OF LANGUAGE DEFINITION 57
The most obvious question for a prospective user is whether the language
has been implemented for his computer. The answers can range from yes
IL.7. EVALUATION BASED ON USE 59
to in process now to never will be. Part of the evaluation of a language is its
availability and usage on one or more machines. If it has been widely imple-
mented, then there is more accumulated experience for both users and im-
plementers. There is also strong indication that the language has been used
successfully. If it has been available only on large machines and now is to
be used on a small computer for the first time, then certain new problems
will arise.
As discussed below, the usefulness of the language must be judged
independently of the compilers which implement it.
11.7.4. ADVANTAGES
Only after a language has been in use for a while can its advantages
be ascertained. The first thing to determine is whether or not it met its objec-
tives. If so, then the language can be considered to be successful. (The ques-
tion of whether the objectives were worthwhile is a separate issue and should
not be combined with the evaluation of the language.) However, there are
two other possible advantages which might exist. The first is that the language
may exceed its objectives by being useful for areas which were not originally
intended or by being particularly easy to implement or to learn (if these
were not part of the original objectives). A second advantage may occur if the
language has certain special features which turn out to be very valuable and
can be used in other areas. The concept of list processing is a good illustra-
tion of this; the basic list processing languages (IPL-V and LISP—see Chap-
ter VI) showed the value of list processing so successfully that it became
important for inclusion in newer languages (e.g., PL/I).
The most important thing to realize is that the full advantages (see Sec-
tion J.5.1) of a language cannot be determined without actually using it on
a computer. This is not true about the disadvantages, which can often be
found before going near a computer. Those advantages which can be ascer-
tained without actually using a machine are the ease in learning, ease in
coding in, documentation it provides, and ease in transferring a program
from one person to the next.
II.7.5. DISADVANTAGES
Only after the language has been in use for a considerable period of time
can one determine what mistakes have been made. These mistakes might
be in the actual design objectives, in the sense that they were either too nar-
row or too broad and, therefore, incapable of achievement; or the mistakes
might be involved with the relationship between the language and the imple-
mentation; or it may be that the language was not suitably designed to meet
its objectives. Again, all these factors can be determined only after actual
uSage.
REFERENCES
H.1.—ll.3.
11.5. STANDARDIZATION
[AT64] Alt, F. L., “The Standardization of Programming Languages”, Proc.
ACM 19th Nat’l Conf. 1964, pp. B.2-1—B.2-6.
[GS67] Goodstat, P. B., “Standards in Data Processing”, Data Processing
Magazine, Vol. 9, No. 3 (Mar., 1967), pp. 22-25.
[ST67] Steel, T. B., Jr., “Standards for Computers and Information Process-
ing”, Advances in Computers, Vol. 8 (F.L. Alt and M. Rubinoff, eds.),
Academic Press, New York, 1967, pp. 103-52.
[AL67] Alber, K., Syntactical Description of PL[I Text and Its Translation into
Abstract Normal Form, IBM Corp., TR 25.074, Vienna Lab., Vienna,
Austria (Apr., 1967).
[AN66] Allen, C. D. et al., An Abstract Interpreter of PL/I, IBM Corp., TN
3004, Hursley, England (Nov., 1966).
[BA67] Bandat, K., On the Formal Definition of PL/I, IBM Corp., TR 25.073,
Vienna Lab. (Mar., 1967).
[BC66] Beech, D. et al., Concrete Syntax of PL/I, IBM Corp., TN 3001, Hursley,
England (Nov., 1966).
[BC66a] Beech, D., Nicholls, J. E., and Rowe, R., A PL/I Translator, IBM Corp.,
TN 3003, Hursley, England (Oct., 1966).
[BC67] Beech, D. et al., Abstract Syntax of PL/I, IBM Corp., TN 3002 (Version
2), Hursley, England (May, 1967).
[BS60] Backus, J. W., “The Syntax and Semantics of the Proposed International
Algebraic Language of the Zurich ACM-GAMM Conference”, Proc.
Ist Internat’] Conf. Information Processing, UNESCO, Paris, 1959,
R. Oldenbourg, Munich and Butterworth, London, 1960, pp. 125-32.
[BU65] Burkhardt, W. H., “Metalanguage and Syntax Specification”, Comm.
ACM, Vol. 8, No. 5 (May, 1965), pp. 304-305.
[BX62] Brooker, R. A. and Morris, D., “A General Translation Program for
Phrase Structure Languages”, J. ACM, Vol. 9, No. 1 (Jan., 1962), pp.
1-10.
REFERENCES 63
[CH64] Cheatham, T. E., Jr. and Sattley, K., “Syntax Directed Compiling”,
Proc. SJCC, Vol. 25 (1964), pp. 31-57. (Also in [RO67].)
[FL64] Floyd, R. W., “The Syntax of Programming Languages—A Survey”,
IEEE Trans. Elec. Comp., Vol. EC-13 (Aug., 1964), pp. 346-53. (Also
in [RO67].)
[GC60] Glennie, A. E., On the Syntax Machine and the Construction of a Uni-
versal Compiler, Tech. Report No. 2, Carnegie Inst. Tech. Computation
Center (AD-240512) (July, 1960).
[GO61] Gorn, S., “Some Basic Terminology Connected With Mechanical
Languages and Their Processors”, Comm. ACM, Vol. 4, No. 8 (Aug.,
1961), pp. 336-39.
[GO6la] Gorn, S., “Specification Languages for Mechanical Languages and
Their Processors, A Baker’s Dozen”, Comm. ACM, Vol. 4, No. 12
(Dec., 1961), pp. 532-42.
[1B62] IBM 1620 FORTRAN (Reference Manual), IBM Corp., C26-5619-0,
Data Processing Division, White Plains, N.Y. (1962).
[1B64a] IBM Operating System/360: FORTRAN IV, IBM Corp., C28-6515-2,
Data Processing Division, White Plains, N.Y. (1964).
[1B66] FORMAL DEFINITION OF PL/I, IBM Corp., TR 25.071, Vienna
Lab., Vienna, Austria (Dec., 1966).
(IB66h] IBM 7090/7094 IBSYS Operating System-Version 13: FORTRAN IV
Language, IBM Corp., C28-6390-3, Data Processing Division, White
Plains, N.Y. (Apr., 1966).
[IR61] Irons, E. T., “A Syntax Directed Compiler for ALGOL 60”, Comm.
ACM, Vol. 4, No. 1 (Jan., 1961), pp. 51-55. (Also in [RO67].)
[1V64] Iverson, K. E., “A Method of Syntax Specification”, Comm. ACM,
Vol. 7, No. 10 (Oct., 1964), pp. 588-89.
[LW64] Landweber, P. S., “Decision Problems of Phrase-Structure Gram-
mars”, [EEE Trans. Elec. Comp., Vol. EC-13, No. 4 (Aug., 1964), pp.
354-62.
[MT61] COMIT Programmers’ Reference Manual, M.1.T. Research Lab. of
Electronics and the Computation Center, Cambridge, Mass. (Nov.,
1961).
[PU67]} Pursey, G., Concrete Syntax of Subset PL/I, IBM Corp., TN 3005,
Hursley, England (Feb., 1967).
[RT 66] Rochester, N., “A Formalization of Two Dimensional Syntax Descrip-
tion”, Formal Language Description Languages for Computer Program-
ming (Proc. of the IFIP Working Conference on Formal Language
Description Languages). (T. B. Steel, Jr., ed.), North-Holland Publishing
Co., Amsterdam, 1966, pp. 124-38.
[SM6la] Sammet, J. E., A Definition of the COBOL 61 Procedure Division Using
ALGOL 60 Metalinguistics. Summary in Preprints of 16th Nat’l Meeting
of the ACM (Sept., 1961), pp. 5B-1 (1)-(4).
[ST66a] Steel, T. B., Jr. (ed.), Formal Language Description Languages for
Computer Programming (Proceedings of the IFIP Working Conference
on Formal Language Description Languages). North-Holland Publish-
ing Co., Amsterdam, 1966.
64 FUNCTIONAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
III.1.1. INTRODUCTION
65
66 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
2. Operators
written between variables; when they are, then the notation is called infix;
when they appear before or after the variables, the notation is called prefix
or postfix (=suffix), respectively.
3. Commands
4. Declarations
Under Section III.1.2.1 it was pointed out that data elements had to
be described so that the system would know on what it was working. One
technique of providing this information is through the use of explicit decla-
rations. These declarations do not cause action to be taken directly at object
time, but rather they supply information to the compiler. One simple but
common illustration is the controlling of arithmetic precision by including
somewhere in the program an indication that double-precision arithmetic is
to be performed on certain variables. Declarations can take the form of
separate statements; they can be associated with the commands themselves,
or they can simply be associated with a description of the variable. For
example, one could write
DOUBLE PRECISION X, Y, Z
or
Z = X + Y (DOUBLE)
or
done and leave it to the compiler to figure out how to do it, e.g., some of the
pattern-matching statements in COMIT and SNOBOL. Further discussion
on declarations is given in Section III.3.1.1.
Declarations are a special case of a more general concept called compiler
directives, but they are sufficiently important to warrant this separate dis-
cussion.
5. Compiler Directives
The parts of the language which are directly associated with executable
object code are the commands and the data. There are numerous cases,
however, in which it is not possible for the compiler to translate such material
without having more information. This latter is normally supplied through
compiler directives, of which the declarations described above are a special
case. Other types of information which might be supplied to a compiler
relate to the environment in which the system is being used, to specific input/
output facilities, or to efficiency criteria, etc.
6. Delimiters
The delimiters are a part of the language which serves only the syntactic
purpose of helping define the various other parts of the language. The
delimiters might include such things as punctuation marks, blanks, or even
key words. They can be token separators (e.g., + in A+B) or terminators
for larger units (e.g., .in GO TO ALPHA.). This is discussed further in Section
III.2.4.2.
7. Program Structure
Assuming that the language contains the six elements discussed above,
there must be a meaningful way of combining these to produce some desired
action. The way in which this is done is the program structure. This concept
involves the rules needed for combining sets of commands and the data on
which they operate. It also provides rules for building larger programs from
smaller ones. This is discussed in more detail in Section IITI.3.
There is a difference between the form of the language and the form of the
program written in the language; the latter is discussed in Section III.3. The
form of the language can be considered to consist of the following major
constituents: (1) The character set, (2) the basic elements (=tokens), (3) iden-
11.2. FORM OF LANGUAGE 69
tifier definition, and (4) definition and usage of other basic elements. The
identifier definition is logically a part of the general usage of the basic
elements, but it has been shown as a separate topic because of its importance.
+ — x f/f )(.,
$ = ' © blank
The word tokens is used to refer to the basic elements in the language.
In this context, the elements are atomic, 1.e., they have no possible further
subdivisions. The definition of token depends on the language; in one case
it might be a single character, while in another it could be a sequence of
characters surrounded by spaces. While the types of tokens and many
specific ones are system-defined, some individual instances of tokens (e-g.,
names) can be user-defined. In the latter case, there are restrictions imposed
by the system.
1. System- Defined
The system tokens are the graphic operators, the key words, and the
graphic punctuation symbols. The graphic operators are those characters
Ill.2. FORM OF LANGUAGE 71
which are in the character set for the language and which have a defined
semantic meaning as an operator. The most common occurrences of these are
the +, —, *, and / signs. For those character sets containing them, the
>, <, =, and combinations of them are normally used to designate the
relational operators. The key words are those which have fixed meaning in
the language. They may be used as commands, operators, compiler directives,
delimiters, or punctuation. Finally, the punctuation characters are defined
by the system from among the available graphics. The punctuation characters
(whether individual graphics or key words) serve as delimiters.
There are categories of tokens which the user defines (or, more precisely,
creates in his program) within the restrictions imposed upon him by the
language designer. The most important of these are the identifiers, but the
existence of constants, literals, and comments also must be discussed.
For any program, the concepts of data and variables exist in some form.
As mentioned earlier, the data may consist of numerical quantities, alpha-
betic quantities, strings of characters, or anything else permitted by the
language. This data, however, must be able to be referred to in some general
way. This is done by giving it a name, and the name is more rigorously called
an identifier. Similarly, the concept of a variable—i.e., a quantity whose value
changes during the program—exists, and it must be named or identified. There
is a significant difference between an identifier and the item it is naming.
The identifier may refer primarily to a storage location or to a whole hier-
archy of data elements or to a formal variable which never receives any value.
It may also refer to elements of the program structure. Possible ways of
defining such identifiers are discussed in Section III.2.3.
Most programs require the use of some fixed quantities during the
course of the computation. The quantities are most usually numbers, although
they can also be logical, or character string, constants. A constant is one of
the user-defined basic elements in a programming language. In this case,
the term user-defined means that the programmer decides which values to use.
However, he is bound by the restrictions of the language, which may allow
some kinds of constants but not others. For example, he might be able to use
fixed point numbers but not floating point numbers. He might be allowed
numeric constants but not logical constants. The most common restrictions
are on the size of the constants; these rules tend to reflect the computer(s)
on which the programming language is expected to be used. The presence or
absence of a decimal point is significant in some languages, i.e., 2. is not
necessarily treated the same as 21n 2. + 2 * A.
A special type of constant is known as a /iteral. A number of cases arise
72 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
in which one wishes to use the string ABC to mean a data name (1.e., an
identifier for an element of data). In this case it simply represents a location
somewhere which contains information which is desired. On the other hand
there are many times when one wishes to use the string ABC to mean exactly
itself. This latter usage is the meaning of the word literal. In other words, a
literal is a string of characters which represents itself and not something else.
Thus there is a difference between the number 23 and the /iteral 23; the latter
has no numeric significance. The problem in the language design arises in
specifying the means of identifying literals. This is discussed in Section
111.2.4.6.
Since one of the advantages of a programming language is to provide
better documentation of the task being performed, it is essential that there
be a means of providing comments in the program. Comments are one of the
possible types of user-defined tokens. Most programming languages provide
a method by which the user can intersperse comments into his program.
These must have appropriate flagging so that the compiler will not attempt
to translate them. :
1. Types of Identifiers
There are two major types of identifiers: Data names and program unit
labels. The former can be individual data elements or records or files or
aggregates of data. The latter are more commonly called statement names
or statement labels, but these terms are misleading because the language may
not have statements or it may be able to name several different parts of the
program. A program unit label may itself be treated as data in certain types
of commands and may also be used to identify nonexecutable parts of the
program (e.g., declarations).
2. Formation Rules
A language can contain key words which are merely character strings
having a specific meaning in the language. Some, all, or none of these may
be defined as reserved words, which are forbidden for use as either data names
and/or statement labels, or their beginnings. For example, FORTRAN has
no reserved words, although it does have key words (e.g., DO, DIMENSION).
On the other hand, all the key words in COBOL (e.g., PERFORM, RECORD,
READ) are reserved words and cannot be used as either data names or
statement labels. Most key words in PL/I are not reserved. The advantage of
refusing to allow the programmer to use key words for naming variables or
statements is that the scanning of the source program becomes considerably
easier. The disadvantage of disallowing reserved words for the use of the
programmer is that he must always have in front of him a list of these
reserved words and make sure that he does not use them. Furthermore, if
he is choosing a language for use in an existing installation, he must make
sure that the words he has already used for his files do not conflict with
reserved words in the language. In some cases, there 1s even a more severe
restriction which says that a data name or statement label cannot start with
any letters which coincide with one of the reserved words. It can become
even more confusing when, as in the case of COBOL, reserved words vary
74 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
from division to division (see Section V.3) and the user must keep this in
mind. In PL/I there are built-in function names which have specialized
rules. This is one of the characteristics that is very significant as far as imple-
mentation efficiency 1s concerned, but it is at the expense of the user’s
convenience.
Some reserved words may be used as noise words (see Section II1.2.4.5).
A) NAME—AND—ADDRESS
B) NAME
C) ADDRESS
D) STREET
E) AREA
F) CITY
G) STATE
H) ZIPCODE
This is really a representation of the tree and data layout shown in Figure
III-1. In another file, we might also have a data item called AREA, and the
problem becomes one of specifying which occurrence of the name (and
corresponding data) is meant. The technique which is used for this is nor-
mally called qualification. By this is meant the usage of enough names in the
hierarchy to uniquely identify the desired data name. In a fairly common
case, suppose that the NAME—AND—ADDRESS data item appears in both an
76 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
Address
[— IN ~
Area
eee
fr" oN
Name Address
Street Area
INPUT file and an OUTPUT file. Then in order to uniquely identify which was
meant, it would be necessary to say NAME—AND—ADDRESS IN INPUT. Simi-
larly, if the AREA was used as a data name in several items, it would be
necessary to use some higher level name to identify it. For example, if AREA
also appeared in a data element called SALES—RECORD, then the user would
write AREA IN SALES—RECORD or AREA IN NAME—AND—ADDRESS to iden-
tify the one he wanted. The actual notation used to specify this qualification
differs in each language. These additional names can be attached at the
beginning or the end of the relevant data name and are then called prefixes
or suffixes, respectively. Various notational devices which are used to indi-
cate these are periods, hyphens, specific key words (e.g., IN as used above),
etc. A variety of rules can be used for the identification, ranging from the
most severe which says all names up to and including the topmost one which
gives uniqueness must be shown, to the most liberal which says you need only
show enough to make it clear to the compiler which piece of data you are
referencing.
Various combinations of subscripting and qualification are permitted
in those languages which allow both individually.
IlI.2. FORM OF LANGUAGE 77
1. Operators
The operators in a language are one of the two categories which can
cause things to be done (the other being the commands). Operators provide
means of combining or relating data types; hence they can be defined as
connectives for variables. Thus, for arithmetic quantities, the ordinary arith-
metic operations are essential and the relational operators, such as GREATER
THAN and EQUAL TO, are fairly standard in any language which permits
comparison of arithmetic quantities. (Note that the use of relational operators
with arithmetic variables does not yield an arithmetic result.) Operators are
also defined for nonarithmetic data types. For example, Boolean (i.e.,
logical) variables are often combined by logical operators such as AND, NOT,
and OR; while DIFFERENTIATION is an operation performed on formal expres-
sions. It 1s important to note that operators may be represented by symbols,
such as + and =, or by any legal combination of other characters in the
language, e.g., PLUS and EQUALS. As mentioned before, it would certainly
be possible to attach nonnormal meanings to operators but this would be of
value only when the normal meanings were not needed at all. In some cases,
normal operator functions are actually represented as commands; e.g., instead
of writing A + B, one writes ADD A TO B. In the first case, the + 1s
considered an operator, while in the second the ADD is considered a com-
mand. However, the distinction between operators and commands is not
clear-cut. The former tend to indicate actions which need to be performed,
while the latter specify actions which must be performed. Thus, A + B
implies that an addition will take place while ADD A TO B requires it to
take place. There are counterexamples to both these conceptual definitions.
2. Delimiters
some unit in the program, or the beginning and end of a literal. In some
cases the delimiter exists as a concept rather than a specific entity since the
termination of one element might be determined only by the beginning of
another, e.g., the end of a paragraph in COBOL is identified by the occurrence
of the beginning of another paragraph.
the sense that the semicolon is used for an end of statement mark, while the
period is not used for punctuation. The reason for the latter is that the actual
period mark is required in numbers, e.g., 3.14159. In some cases where a
significant difference exists between 2. and 2 there is a problem if 2. appears
at the end of the unit that the period terminates. Since obviously a period
should be used with numbers, great care must be given to the syntactic rules
for embedding periods in the language.
Other punctuation marks are sometimes used for more specialized pur-
poses; the most prevalent is the use of parentheses in mathematical formulas
where the normal rules of mathematical notation apply. Problems arise, how-
ever, when parentheses are also used to designate subscripts (which is done in
almost all languages) and also to represent functions. It is not obvious
whether F(I) represents the function F with the parameter |, the variable F
with the subscript !, or even the variable F multiplied by the variable |.
4. Significance of Blanks
The term noise words refers to character strings which can be inserted
or omitted in a program at the user’s option without changing the meaning
of the program. There are several different rules which can be established
within this general principle. For example, the most flexible rule (it is not
used in any language in this book except COLASL—see Section IV.7.2) is
that between any two fixed words there can be any number of arbitrary words.
The prime difficulty with such a general rule is the difficulty (or potential
impossibility) of distinguishing noise words from legitimate names. A much
more restricted (but far more reasonable) rule which does exist is that certain
80 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
fixed words may be present or absent in certain fixed places; this was done
in COBOL, for the express purpose of improving readability. For example,
in the sentence READ PAYROLL RECORD INTO INPUT—AREA, the word
RECORD is a noise word and can be omitted. Between these extremes there
are a number of possibilities.
Noise words are often key words. They can also be reserved words so
that the programmer is restricted from using them as identifiers.
6. Literals
There are several ways in which to consider the amount of form required
in a particular programming language. The word form in this case means
111.2. FORM OF LANGUAGE 81
both the way in which legitimate sequences of characters are placed on the
input media and the philosophy associated with the types of sequences which
are used.
Physical input can be in one or two dimensions. The latter means that
syntactic significance is given to more than one physical line simultaneously,
e.g., the use of subscripts and/or superscripts as in A,°. Because the most
common input media for program preparation are punched cards and paper
tape, all programming languages using that type of standard hardware have
a one-dimensional string form as input.' (Note that since paper tape is pre-
pared through the use of a typewriter, the direct use of a regular keyboard
does not change the basic principles involved.) There are languages, however,
which permit two-dimensional input through the use of special hardware;
they are described in Section IV.7.
Once we assume a single dimension, then the primary distinction 1s
between fixed format and a continuous string. The term fixed format is a
relative one since programming languages vary in their requirements. They
run the gamut from a continuous string (e.g., PL/I) to some requirements
about card columns (e.g., FORTRAN).
Since many of the earlier programming languages assumed the use of
punched cards for input, it is quite natural that they took some advantage of
the fixed columns to represent specific items. The advantage to using fixed
columns is that the compiler need not scan every single character to find the
one that is wanted. Thus, if there is a requirement that a statement label
should start in a particular column, it is not necessary to continue scanning
until you find something that looks like the beginning of a statement label.
In the case of higher level languages, information often extends over more
than one card. For that reason, it is convenient to permit early columns in
the card to contain some kind of symbol to indicate that the current card is
a continuation of a previous one. Space can then be left for specific commands
or, more likely, for a label, followed by specific commands and the operands.
One of the significant differences between the format on a punch card for a
higher level language and for an assembly program is that the latter usually
has a fairly restricted amount of space and format allowed for the operands,
whereas the higher level language usually permits them to be written con-
tinuously following the command.
Assuming continuous string input (which of course can be punched on
cards), it is necessary to scan every character to reach any future one, and the
meaning of symbols can only be determined from context. Thus, the string
' The MAC-360 system which appeared too late for a thorough discussion is an
exception to this. See Section IV.7.6
82 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
2. Conceptual Form
involves a similar type of discussion, but from the point of view of units and
subunits of a program. In other words, merely a long list of syntactically
correct character sequences is not going to necessarily produce a meaningful
program, and all languages have types of subunits which must be combined
properly. For that reason, this section discusses in some detail the types of
subunits that are permitted and their characteristics. The characteristics are
mentioned briefly where appropriate with the subunit description, with a
full discussion given in Section III.3.2.
The smallest executable unit (SEU) is a general name for what is usually
a single command and its operands. There must always be a clear-cut way
84 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
of determining its end, either through the use of a special symbol or through
the syntax of the command. A SEU might be something of the form
Y = 3
or
Z=AxX+B
or of the form
The most common word used for SEU’s is statement. A sequence of these
statements can be used to make up a program. Note that the SEU cannot
necessarily be given a name. Furthermore, SEU does not refer to the smallest
unit for which the compiler turns out code since in the executable unit
Y = A x X + Bit is necessary for the computer to do two arithmetic oper-
ations and a store operation.
There are a number of different types of commands which can be used
as SEU’s, and these are discussed in Section III.5.
One SEU by itself will not accomplish very much, unless it is being used
in an on-line desk calculator system (e.g., QUIKTRAN). Hence it 1s neces-
sary to be able to group these together in a way which permits assigning a
name for identification and cross-reference purposes and which permits them
to be treated as a single unit in other ways. There are a number of ways of
doing this; for example, in ALGOL there are blocks, in COBOL there are
paragraphs and sections, and in PL/I there are several other levels of com-
bining. The use of the same term, e.g., block or compound statement, in dif-
ferent languages does not mean that they are defined or used the same way
since there is no standardization at all for these ideas. A block, however,
is the name usually given to a sequence of executable units which can be
treated as a single nameable executable unit. That is, it can be referenced
from a control transfer statement; it can be used as a single statement in the
range of a loop; or it can be used as a single statement wherever a single
statement is valid in the language. A block normally has some kind of
designator to indicate its beginning and end; the words BEGIN and END are,
in fact, often used. A block often contains declarations about the variables
used in the block. The main function of a block is to permit the handling as
a unit of a number of individual statements. The word block is sometimes
UI.3. STRUCTURE OF PROGRAM 85
used for other items and, conversely, is not always used for the concept
above.
It is also possible to combine SEU’s to create a subunit which has fewer
properties than those normally associated with a block, e.g., a sentence in
COBOL. In such a case, the ability to name the subunit is usually the first
characteristic to be eliminated.
4. Loops
It was discovered many years ago that it was inefficient and very diffi-
cult to check out a very large number of statements as a single unit. Further-
more, it was very wasteful to have many people writing the same routines
over and over again, and this occurred very frequently with commonly
needed computations, e.g., finding sin x or finding the roots of a polynomial.
Thus was born the idea of a subroutine, which is simply a self-contained set
of statements to perform a particular task. Although some subroutines are
independent of the values of any input parameters, most are written to
perform their task for the particularly supplied value(s). Thus, a subroutine
may have zero, one, or many input values and one or many results. (It could
conceivably have none, but this usually would be indicated by an error
condition, which is a form of result.) Most large programs are built up from
a series of subroutines.
86 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
Z SIN(B)
Y=AtZx*C
6. Comments
compiler. This is most often done by specifying some delimiter(s) for the
beginning (and end) of the comments. When the compiler encounters these
flags, it knows that it should ignore the following material until the beginning
of the next subunit which requires compiler action. This permits the user to
write anything which will be helpful to him or others.
The liberal use of comments, together with the problem-oriented nota-
tion should supply most of the documentation for a particular program.
some other mechanisms. If this were not done, then the compiler would have
to scan and translate statements of which it had no knowledge.
One of the key types of languages which users like to be able to inter-
mingle with their higher level language programs is machine language. At
the very minimum they wish to insert machine-language subroutines which
already exist; even more importantly, they would like to be able to include
machine instructions in the midst of the higher level language code. (This is
particularly important for small sections which should be coded as efficiently
as possible.) However, there is a significant difference between being able to
invoke a machine language subroutine which already exists, and the inclusion
of machine language in line. The former requires the user to make sure that
the interface of information about variables is handled properly, whereas
the latter requires the compiler to do it. Relatively few languages include
this facility (which is really a requirement on the compiler). The earliest (and
in fact the only) publicly available Janguage to require this facility in great
generality was MATH-MATIC [RR60]. (A version of FORTRAN with
this facility, namely FORTRAN III, was distributed for use on the 704.)
The facility to invoke a subroutine which has been coded in another
language is definitely not considered an instance of being able to include
another language.
meaningful for each type of subunit; with the description of each character-
istic, the units it applies to are indicated.
1. Methods of Delimiting
2. Recursive
then subroutine XYZ will be said to be recursive if CALL XYZ, (parameter list)
can appear within the XYZ subroutine itself or in another routine which ts
invoked from XYZ, although normally with a different set of parameters.
This particular characteristic is extremely important because some problems
require this kind of capability and others are stated most easily by using
90 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
itself to find the value of N!. Note that writing SQRT(SQRT(X)) is not an
example of recursion, because the normal ways of writing square root rou-
tines do not require the routine to call itself. The term recursive is applied
only to those subunits for which there are parameters involved. Thus, func-
tions, subroutines, and procedures can be considered as being recursive.
A=4
R=S +1]
Assume that the subroutine is invoked by writing CALL INC (S, R), where
S and R represent the input and output parameters, respectively. Then
A=3
CALL INC (A + 1, B)
will give B the value 5 in the call by value case, and the value 6 in the call by
name case. The reason for this is that in the call by value, the expression
A + 1 is computed (yielding 4) before entering the subroutine, and so
B = 4 + 1 = 5. However, in the call by name case, the subroutine actu-
ally becomes
A=4
R=A+1+4+1
Hence the result is 6. In both these cases, the original value of A prior to
invoking the subroutine (namely 3) is preserved.
Any reader who studies this matter further and then wants to test his
understanding of the concepts should see Weil [WL65].
To show the call by location case, suppose the subroutine 1s called
ADDONE and has a single formal parameter R used for both input and
output, and it has the body
Then if we write
A=3
CALL ADDONE (A)
92 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
the result is that the value of A has been reset to 4. The same thing happens
in the call by name case. However, in call by value, the assignment of the
result is only to the formal parameter R and there is no change in A.
4. Embedding
The key features of a programming language are the types of data it can
handle and the ways in which it can operate on that data. The major aspects
are the specific types and characteristics of data variables, the types of data
units either in the machine or in the language which are available relative to
the commands in the language, the types of arithmetic which are permitted,
111.4. DATA TYPES AND UNITS AND COMPUTATIONS WITH THEM 93
how expressions are created and evaluated, and how data elements are
defined relative to the whole program. This section discusses all these poinis.
1. Arithmetic
The first and most obvious type of data variable is the real (i.e., not
complex) arithmetic, sometimes called numeric. The data name represents a
number; therefore, to say that A + B = C where A and B are numbers
means that C will be a number. The types of arithmetic that can be performed,
however, are discussed in Section IT1.4.3.
Every programming language has rules about the size of constants and
the ways in which they can be written in the program. These will not be
described for each language.
2. Logical (= Boolean)
The second most common type of data variable is the logical (= Boolean)
variable; this is simply a variable which can take on only two values, normally
designated as true or false. These are usually represented in the machine by
0 and 1, 0 and non-0, or any other two distinct numbers. Boolean variables
are usually the direct or indirect operand of an /F clause; see Section III.5.3.2.
3. Character
A character data type is really one which is nonnumeric. The two most
important special cases of character data types are alphanumeric (where the
data consists of letters and/or numbers) and bit (where the only elements are
0 and 1). The former is usually introduced into languages which are con-
cerned with handling data processing applications to provide a data type that
excludes characters other than letters and numbers.
4. Complex
5. Formal (= Algebraic)
A type of data variable is the formal or algebraic which stands only for
itself or for an expression, such as Z or A? + B?, where these are not
numeric. A formal data variable has no value in either the numeric or logical
sense. The operations performed on it are usually those related either to
string handling, or more usually to formal mathematics or algebraic manipu-
lation. Languages emphasizing this data type are discussed in Chapter VII.
6. String
Strings and lists are types of data variables which represent similar but
somewhat different concepts. A string 1s a type of data variable that consists
of one or more characters concatenated, and it will be operated on as such,
e.g., ABC or JOHN Y. DOE. Depending on the intended purpose, either the
individual characters have meaning and the whole unit does not or vice versa.
Among the operations to be performed on strings are concatenation, decon-
catenation, and replacement. The special case in which the string consists
only of bits is significant because this can usually be interpreted as some
type of logical variable and operated on accordingly.
7. List or Pointer
8. Hierarchical
this is not essential to the concept. For example, the complete identification
of a person in a payroll file might consist of his name, address, and social
security number. In this case, some of the subordinate data variables are
alphabetic, while others are purely numeric.
The operations performed on hierarchical data variables are usually
limited to movements within storage and to operation on the subunits that
is appropriate to their type.
9. Others
The main issue is which of the subunits of data which exist in a particular
computer are accessible to some or all the commands in a programming lan-
guage. The criteria for inclusion or exclusion usually involve implementation,
efficiency, and compatibility. If it were not for these problems, it would not
matter whether a variable occupied a single bit, a character, or a full word.
96 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
2. Floating Point
Floating point numbers are used to eliminate the need for scaling
and/or to provide for the use of a wide range of numbers. Through the use
of the so-called scientific notation, both large and small numbers can be
contained in a single word (although with some loss of precision in the
fractional part). This is done through the use of an exponent and mantissa;
thus, the number 3.14159 is represented as 0.314159 x 10, or 31.4159 x 107°.
Depending on the machine, there are differing ways of representing floating
point numbers, but they all reduce to separating the number into two parts,
one representing an exponent of a fixed quantity (usually 2 or 10, depending
on whether the machine is binary or decimal) and the other representing
the decimal part of the number. The programming language itself does not
usually distinguish between the actual representation; this is handled by the
compiler in translating to machine code.
3. Rational
means the ability to take two numbers of the form A/B and C/D and add
them to produce the result (AD + BC)/BD. The need for this arises particu-
larly in scientific problems, where one wishes to do very precise arithmetic
of this kind. For example, in most implementations of programming lan-
guages, if one computes 1 + 4 in fixed point or integer mode, the result
may well be 0 or 1, depending on whether the language specifies or the
compiler chooses to truncate or round up the result. In floating point form,
the result would clearly be 0.66667, whereas the real answer that is desired
is 2. Since no machine known to me has this capability built into the hard-
ware, it must be supplied by the compiler.
4. Complex Numbers
6. Logical
7. Other
1. Intermingling Rules
2. Conversion Rules
Once it has been determined what types of data variables can be inter-
mingled, it is necessary to determine what kinds of rules are involved in
such intermingling. Conversely, in order to say it is legal to add an integer
and a floating point number or an arithmetic and a Boolean variable, it is
necessary to specify the rules used to determine the result. Thus, if one adds
3 and 2.5, the answer could be either 5, 5.5, or 6, depending on whether one
wanted an integer value rounded up or down, a floating point value, or a
fixed point noninteger. Normally when floating point and integer numbers
are added, the result is floating point because the precision from the integer
calculation has already been lost and the floating point number itself may
be too large to fit into an integer format. (It is often, but not always, true
that if variables of a single type, such as floating point or logical, are com-
bined, then the result would be of the same type.)
If one tries to add arithmetic and logical variables, then there is another
problem because it is hard to define what variable type the results should
be. As indicated earlier, logical variables normally take on one of two
specific machine values; therefore, it is certainly possible to produce a
number as the result of adding an arithmetic and Boolean data variable;
however, this is a fairly meaningless number. Interestingly enough, use of
this concept with arithmetic multiplication can be both meaningful and
useful if the values 0 and 1 are used to represent the logical variables
internally. If A is an arithmetic variable and L is a logical variable, then
A x L will be either O or A, depending on the truth value of L.
Other conversion rules are not so obvious. For example, if one tries
to add a logical and a formal variable, what is the result? Similarly, com-
bining strings and other types of variables produce very many questions.
There are numerous rules of thumb and arbitrary guidelines but no very
definitive way of determining what the result should be, aside from the
wishes of the language designers. In cases where one mode includes another,
there is usually automatic conversion to the more general case, e.g.,
integer c rational c floating point, or arithmetic < formal.
102 = TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
Once it has been established what variable types can be combined and
what type of variable will be produced as a result, there are still a number
of rules which must be specified. Unless the rules are carefully defined, each
compiler will produce a different answer for variables of differing kinds.
Thus, if we have A = B + C * D + E / F, where B is single-precision
fixed, C is double-precision floating point, D is a logical variable with a
numerical representation, and E and F are rational numbers, there must be
precision rules as to how to do the arithmetic. The language with the most
flexibility on this point is PL/I; it therefore has the most complicated rules.
the PL/I manual [IB66b] since these are the main languages in which this is
an issue.
The two main components of a programming language are the data types
and the executable statements permitted. Depending on the view of the
person involved, one of these can be considered the main facet of the
language and the other the secondary, or they can be considered equally
important. The view that the data types allowed are the major factor is
expressed by Perlis [PR65]. I hold the alternative view—namely that the
most important factor of a programming language is the list of commands
that it can perform. Probably the most reasonable view is that this is a
“chicken and egg” situation and both components are equally necessary.
This section provides a categorization of the multiplicity of executable
statement types which are relatively commonly used. Obviously, all lan-
guages omit certain specific ones. The exact details are discussed under the
individual languages.
Executable statements are sometimes referred to as imperatives as con-
trasted with the declaratives which supply information about data or aspects
of the program.
11.5.1. ASSIGNMENT
the string 4527 is, but the string A3+,45 is not unless some special inter-
pretation is given, which of course can be done.
1. Editing Statements
The term editing covers a number of areas and applies primarily to the
preparation of data for use outside the computer. In the simplest case,
it may involve actions as basic as zero suppression or insertion of dollar
signs where needed. This type of editing involves primarily a single variable
or piece of data. At the other extreme, we can consider report generation
as a form of editing. In this case, many pieces of data are being examined,
possibly changed in format, and moved around to prepare them in a par-
ticular form relative to a printed page. Even arithmetic computation may
be involved for the purpose of obtaining totals on a report.
Depending on the language, the various facets of editing may be called
into play by a direct command; more often editing is accomplished through
the implicit invocation of the necessary routines through another command
and/or through data descriptions.
2. Conversion Statements
3. Sorting Statements
cess is that the user may wish to perform actions on his files either before
the sorting takes place or after, or both. If there is a sorting command
as an integral part of the language, then the other mechanisms of the
language can be used prior to and after the execution of the sort command.
This concept is really the reverse of the situation where some sort generators
permit hand-coded routines to be included in the sort package.
For each language there is a normal flow of control which specifies what
the next executable unit is. This is usually, but definitely not always (e.g.,
COMIT), the next statement in sequence. Naturally there must be a way
of changing this normal flow of control.
The simplest type of control transfer is the unconditional jump, in which
the next statement to be executed is specifically named rather than auto-
matically being the next one in sequence. The conditional jump is based
on some choice or test being made. The conditional jump statement is really
just the simplest type of conditional statement, normally consisting only
of a test and a new location to transfer control to, e.g., IF A > B GO TO
ALPHA; if the condition is not satisfied, then the next statement in sequence
is executed. The invocation of a subroutine is a special type of control
transfer which provides an unconditional jump and also some type of
automatic return jump to the next executable unit in sequence after the
subroutine call.
There are also switch-control statements which the programmer can
use to cause control to transfer to one of a number of possibilities depending
on existing or prior conditions. The choices can be made in elementary or
complex ways, depending on the language, but all have the objective of
specifying (at object time) the place to which control should be transferred.
The most common is the computed GOTO, which usually is of the form
108 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
GOTO (Si, S2,---, Sn), J where the value of J designates which § is used
(e.g., J = 2 means control is transferred to S,).
2. Conditional Statements
permits the user to state a variety of conditions and actions in one sentence.
Obviously, rules of matching clauses, precedence, and existence of key words
must all be specified very carefully. A discussion of this problem and existing
and proposed solutions is given by Abrahams [AH66].
The situation in which a conditional statement can appear as part of
an expression was discussed in Section III.3.2.4 in connection with
embedding.
There are two major types of error condition statements which can be
included in programming languages. One refers to the errors which may be
caused by the data or committed by the programmer (and which he can
test for), and the other involves errors which may be committed by the
hardware (although in theory this never happens). Some of the types of
errors which the programmer might make or be responsible for correcting
are such things as overflow when it is not expected, trying to store a number
in a field which is too small to contain it, incorrect data, or getting into
a loop and not getting out. In some languages, direct testing statements can
be written at the place in the program the user thinks an error might occur.
In other cases, he may provide somewhere in his program a command that
says “if such an error occurs, then do the following”. In this latter
situation, the generated code will cause an automatic interruption of the
normal sequence and transfer control to the “corrective action” that the
programmer has specified. In still other cases, the programmer may simply
request that a flag be set when some condition occurs, and he retains the
option of testing for it whenever he feels it is necessary.
There are certain machine errors which could occur (most notably
11.5. EXECUTABLE STATEMENT Types III
in the input/output area) for which the programmer would like to test
or provide corrective action. In some languages he can do this directly,
although usually this is a function of the compiler and/or the operating
system.
It was shown in Section II1.4.1.5 that one of the possible types of data
variables was a formal (= algebraic) one, which in turn leads to the pos-
sibility of algebraic expressions. Therefore, it is necessary to have certain
kinds of statements for the manipulation of formulas and/or expressions.
Among the most common of these manipulations are the abilities to sub-
stitute for a particular variable either another expression or a number, to
differentiate, and to apply the distributive law to remove parentheses.
Other types of statements which might be desired are the abilities to match
expressions, integrate, to find the greatest common divisor of two expres-
sions, etc. From a purely syntactic view, these facilities can be provided
in a number of ways, e.g., as statements, as functions, or through inter-
pretation of the data description. Thus, writing Y = (A—B)*(A+B) will
have a very different meaning if A, B, and Y are formal variables rather than
numbers and no new command is needed. On the other hand, differentiation
requires a specific executable concept to be named; it might be defined as a
function, an operator, or a command. The methods of handling these facili-
ties depend highly on the personal taste of the language designers. (See
Chapter VII.)
2. List-Handling Statements
3. String-Handling Statements
4. Pattern-Handling Statements
Some languages provide the ability to scan a string of text for patterns.
This is extremely valuable in a wide variety of applications such as language
translation, formula manipulation, and even compilation itself. The most
common type of statement is one which specifies a pattern to be found
and then demands some action to be taken after finding the pattern. Thus,
a Statement might require that all occurrences of the pattern AB2CD (where
2 represents any arbitrary string) be replaced by the string THEN. Pattern-
handling statements tend to be intermingled with string-handling statements
because the normal reason for searching for a particular pattern is to do
something to it or with it after it has been found.
program logic and it differs from whatever symbol is used to indicate the
physical end of the program as input to the compiler.
1. Input/Output Statements
tation significantly is whether or not the library routines are stored in their
original (i.e., higher level language coded) form or in a translated form.
(In the latter case, sometimes programs originally written in assembly lan-
guage can be included in the library.) Depending upon these and other
factors, the subroutines may be brought in at compile or object time.
There is also a need for library facilities for languages with complicated
data descriptions. These facilities may be provided in the same way as for
the subroutines.
3. Debugging Statements
indicate what things must be saved and what can be disposed of, etc. While
these statements appear in some mathematical or data processing pro-
gramming languages, they are absolutely essential to any list processing
language. In some of the latter there are commands which provide control
of the garbage collection (i.e., handling of the free list).
Information about overlays and program segments which can be stored
individually is usually provided through declarations rather than as execut-
able commands.
IIT.5.6. OTHERS
There are statements in some languages which do not fall into any of
these categories, but they are not general enough to warrant discussion here.
describe or declare information about data items, files, data formats, storage
allocation, and the hardware or operating system environment.
Section IEI.4 discussed a wide variety of data types and sizes which are
used in programming languages and a number of different ways of operating
upon the data. In order for each executable command to perform its task,
it must have all the information about the data which Is logically required.
Thus, for example, if numbers are stored in binary and are to have arith-
metic performed upon them, the machine instructions needed will be rather
different than if the numbers are stored in a character form. The primary
method for doing this 1s to supply data declarations or descriptions which
provide all the needed characteristics of the data. Thus, numeric data for
mathematical problems will normally be characterized as being fixed or
floating point; real or complex; single, double, or multiple precision; etc.
With the exception of the precision, the amount of space occupied by each
type of data is usually considered standard for a particular language or at
least for a specific compiler. On the other hand, business applications
require data which has more widely varying characteristics. In the first place,
it is both alphabetic and numeric, and different parts require different sizes
and internal formats. For example, a person’s name in a payroll file may
take a large number of characters, whereas a mark to indicate whether the
person is male or female is clearly going to take the smallest possible unit
which can be represented in the machine. Because of the need for this wide
variety of type and size of data, it is essential that the compiler find out
just how the data is being stored so that the appropriate machine language
commands can be generated to handle it. All this information must be
provided in the data description declarations either directly or indirectly.
In a few cases the compiler will make a determination. In addition, it is
characteristic of business as well as other types of applications that the
data is usually in some type of hierarchical form. Again a payroll file is an
excellent illustration because one can consider that a person’s address
consists of a street location, followed by a town, a state, and a zip code.
Clearly, the entire address consists of all four of those items, whereas one
might be concerned with only the zip code, the state and zip code, the
town, or almost any other combination of these fields. For that reason,
it is essential that the compiler knows what type of hierarchy has been used
for the data so that it knows what machine instructions to generate.
Languages containing strings, lists, and/or arrays whose size is deter-
mined at object time must contain enough descriptions to permit com-
pilation.
III.6. DECLARATIONS AND NONEXECUTABLE STATEMENTS 117
One of the key problems with regard to any complex data description
is whether the information is being described in its internal representation
(for a particular computer) or whether it is being described as it appears
in a logical fashion on some external media. Thus, if the identification
number for a person in a large organization is six characters, this is quite
independent of the internal representation; the question of whether it is
stored internally in character or binary form is essential information for
the compiler but irrelevant for the user. Various compromises for this issue
have been devised and will be described in the relevant languages.
One interesting philosophical point in creating the data declarations is
where and how they are to be grouped. The earliest viewpoint—exemplified
by FORTRAN—is that all data with a given characteristic should be shown
together, e.g., DOUBLE PRECISION X, Y, Z and REAL X, Y, Z. A more
recent view—exemplified by PL/I—is that all the declarations for a particular
variable could be shown together, e.g., X, DOUBLE PRECISION, REAL, Y,
DOUBLE PRECISION, REAL. (This is not the actual notation for PL/I or any
other language.) This matter appears to be based considerably on personal
taste and implementation techniques.
The requirement for data declarations is double-edged, in the sense
that, applied as stated above, every variable would need to have a com-
plete set of descriptions associated with it. Thus, each variable in a mathe-
matical problem would have to be defined as being SINGLE or DOUBLE
PRECISION, REAL or FLOATING, etc. This is undesirable because it requires
far too much writing on the part of the user. Hence, the concept of default
declarations has existed for some time (although there is a counterargument
which says that errors are prevented by requiring the complete information
to be written by the user). The concept simply means that associated with
certain types of variables are certain characteristics, and these will be auto-
matically assumed by the compiler unless some other information is specif-
ically supplied. An early illustration of this is the fact that in FORTRAN
any variable beginning with one of the letters 1, J, K,L, M, N was automat-
ically assumed to be an integer unless it was specifically declared as floating
point.
In order to put out data, the user may definitely wish to have control
over the format in which it appears. For example, if he wishes numbers to
appear in three columns, he must be able to have a way of specifying this.
Similarly, if he is using the computer to write a payroll check, it is essential
that the amount is placed onto the right part on the check or else the check
will be invalid. Thus, there needs to be a number of statements to the com-
piler which actually describe the format of the data which is to be put out.
Similarly, information which is on some external media may have a format
which the compiler must know about in order to be able to interpret the
information coming in. When this formatting of output data is carried to
a very high degree of complexity, it actually becomes a report generator.
Format descriptions often supply page and line controls, as well as
the information necessary to permit the editing and converting discussed
in Section II.5.2.
The details of the format descriptions available in each language will
not be given as they require far too much space.
the object code that is turned out; another is sheer logical necessity, in the
sense that the compiler cannot obtain the information any other way;
a third is to cause action not to take place, as with comment statements
included in a source program. These directives generally pertain to action
that the compiler is to take when a certain situation is encountered at com-
pilation time or to produce code to take care of these situations if they
exist at execution time. One example of a compiler directive is some kind
of a flag indicating that a macro is about to be used and must be handled
separately. Another is an indication that the next part of the source program
is written in another language.
III.6.8. OTHERS
Since most languages are never quite as good as their designers intend
them to be, there is always a desire on the part of the user to extend the
language in a number of directions. These directions include the definition
of new terminology in a program at the user’s option, the need to extend
capabilities—both data types and commands—and the wish to be able to
abbreviate frequently used program strings. Note that there is a significant
difference between the mere existence of a subroutine and an actual (although
temporary because it lasts only for the program involved) extension of the
language. The latter allows considerable user control over the format of
what is written, whereas the subroutine does not. Subroutines which provide
additional facilities (e.g., matrix-handling operations) are not considered
language extensions if they are invoked through the normal subroutine
calling mechanism.
The degree to which a language can be extended within the framework
of the language itself, without having the compiler modified, is a measure
of the self-extendability of the language. The most common way of handling
this is through macros, which can be similar to those used in assembly
programs. The only languages which attempted to provide any capabilities
along these lines are COBOL and PL/I, and only the (macro) facility in PL/I
has been implemented. (There was a DEFINE verb in COBOL for a long time
but it was never implemented and was finally removed from the language.)
A very simple type of self-extension occurs in languages which permit the
user to name and define functions in a source program and use them in
expressions as if they were system-defined. Most languages used for scien-
tific problems have this capability.
Several suggestions for ways to provide macro facilities have been
proposed but not necessarily implemented; see, e.g., the references at the
end of the chapter. One of the earliest discussions of this subject was given
by Mcllroy [ML60].’?
2 The interest in macros and/or self-extension of higher level languages has grown
significantly during the time period in which this book was written. The concept is more
important and further developed than the brief discussion here would seem to indicate.
122 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
other words, if the compiler scans the object code produced to eliminate
redundant instructions, then computer (compilation) time will be needed
to accomplish this task.
There do not seem to be any language facilities which can be used to
make the compilation process more efficient and simultaneously cause
production of efficient object code. The converse is not true. Specific features
which provide information to make it possible for a compiler to create
efficient object code often require additional compilation time. An early
example of an attempt at this was the FREQUENCY statement in the first
FORTRAN (see [IB56] in Section IV.3); it was later dropped because it was
found not to be worth the trouble it cost. In other cases there is no particular
language feature provided but the compiler attempts to produce very good
object code from specific parts of the language. The best examples of this
are storage allocation and lcop control. These obviously require compila-
tion time.
As mentioned before, the greater the size, flexibility, and power of the
language, the harder it will be to compile. From this, one might draw the
conclusion that it would help the implementation to impose more restric-
tions. Unfortunately, this does not always work, particularly if the restric-
tions are imposed on top of some features providing great generality.
For example, a language that permits names of any length causes certain
problems in table design; this difficulty is compounded if the language says
that certain types of names, e.g., statement labels, must be no more than
six characters long. The generality causes a problem with the storage alloca-
tion at compile time but the restriction tends to slow down the scanning and
processing because it involves a special case. A second problem arises from
this type of situation if the compiler actually checks to make sure that the
restriction is obeyed. (See Section III.7.5 for a discussion of error checking
at compilation time.)
In many situations, restrictions permit more rapid compilation. For
example, difficulties in scanning individual sequences of characters can be
greatly reduced by putting restrictions on naming conventions. If a language
is designed so that a data name can contain only alphabetic characters,
then the compilation may be much more efficient than if the name can
contain any characters. Even if one wants to permit numbers as part of
the data name, then the restriction of saying that the first character must
be a letter helps the compiler because when it encounters a digit, it knows
that it should look for a numerical quantity rather than considering this
as the potential beginning of a data name.
A restriction on the use of reserved words (see Section III.2.3.3) is
124 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
another facet that improves compiler efficiency in the scanning. The term
reserved words usually means the concept that a certain number of words in
the language are fixed and cannot be used for data names or statement labels.
In some languages there are fixed words but they can also be used for data
names; this requires a great deal more investigation by the compiler of the
context in which the word is used. All kinds of variations or further restric-
tions can be placed on this concept, even going so far as to say that no data
name can begin with letters which might look like a reserved word.
For languages with large amounts of data to handle or for any language
on a small machine, the storage allocation problem is a critical one. For
this reason, any information which can be given to the compiler is helpful.
Types of useful information include possible segmentation points, portions
of the program which can be overlaid, and maximum expected size of
variable-sized data and arrays.
The line between debugging aids as part of the language and as part
of the compiler is sometimes unclear. We must also distinguish between
debugging at compile time and at object time. Some languages include
statements which assist debugging at object time, such as on error condition
statements which cause automatic transfers at object time under certain
circumstances. In other cases the languages provide specific statements
requesting traces of previously executed statements in order to obtain
information. These kinds of debugging aids which are specifically inserted
into the language are rather different from certain debugging aids and error
checking which may be provided by the compiler itself. For example, a good
compiler will normally do a great deal of error checking when scanning the
source program. The simplest and most common type of error, at least in
a large class of problems, is mismatched parentheses. A good compiler—and
even in many cases a mediocre compiler—will specify that parentheses are
mismatched. A good compiler will then attempt to indicate where the
difficulty 1s most likely to be. Other ways in which a compiler can aid
debugging are to list statement labels which are never referenced or give cross-
references of statements which refer to data names.
There is a difference between debugging aids which exist in the language
and are primarily for the purpose of handling object time errors and those
checks which the compiler itself performs primarily to find syntactic (or
even semantic) errors in the source code. A type of error which may be
considered either syntactic or semantic is to have a number of subscripts
associated with a variable which differs from the dimension declaration
(or its equivalent). Most compilers will detect such errors at compile time
and provide an error message to this effect. Far fewer compilers will insert
checks into the object code to see that the maximum value of the subscript
does not exceed the specified limit. One of the tradeoffs to be decided is
how many of these object time error checks will be inserted, considering
the amount of computer time they require. Ideally the user should decide;
PL/I actually permits him to do so in many cases.
Although this chapter attempts to list all the significant technical character-
istics of programming languages, it cannot possibly list everything. Any
particular features a certain language has that have not fallen in the cate-
gories above will be discussed under the particular language description.
126 TECHNICAL CHARACTERISTICS OF PROGRAMMING LANGUAGES
REFERENCES
1.4 .—111.6.
The scope of this chapter is almost self-evident. All the languages noted
here had their objectives either directly as, or deeply rooted in, the solution
of scientific problems by numerical techniques, using a digital computer.
These problems tended to be characterized by small requirements for
input/output and vast amounts of computation. Matrix inversion or the
evaluation of mathematical formulas for regularly changing sets of values
of the variables are prime examples of this. Such problems contrast with
the data processing problems which tend to have much input/output but
relatively little calculation. This distinction has become considerably less
clear over the past years, but it still has some validity and certainly did
at the time these languages were developed.
The availability of computers, and reasonable languages to use on them,
helped make a major field out of numerical analysis. Prior to the advent
of computers, relatively few people were familiar with the subject; with
the existence of proper equipment, and the apparent inability of such equip-
ment to handle problems analytically, numerical analysis techniques devel-
oped and flourished, virtually causing analytic solutions to disappear from
practical working situations. Attempts to reverse this trend are described
in Chapter VII.
128
IV.2.1.1. SHORT CODE 129
1. SHORT CODE
[RR52] it is stated (in the preface) that Dr. Mauchly’s “suggestion was,
in effect, to have a program which would accept algebraic equations as
originally written... ”. While SHORT CODE did not achieve that goal (nor
has any other system except those discussed in Section IV. 7), it was a remark-
able objective for that point in time.
The basic principle involved was to use a 2-character code to designate
either an operation or a variable and to use six of these codes at a time
(because the UNIVAC had a 12-character word). Thus the problem of
evaluating the equation A = B + C was written as
00 SO 03 $1 07 S2
2. Speedcoding
Work on the Speedcoding System for the IBM 701 was started in
January, 1953 under the supervision of John Backus and the general direc-
tion of John Sheldon. Those who worked on the project were H. Herrick,
D. Quarles, S. Skillman, J. Pulos, and L. Siegel. The first official manual
[IB53] was dated September, 1953.
The basic principle of Speedcoding was to create two sets of operations,
designated OP/ and OP2; the first category contained three addresses,
while the second contained only one. These operations were not part of the
hardware, and were selected for their utility to the mathematician. The card
format permitted one of each operation type, as well as a location field, in
a single card. Thus
=0.0053(a—y)/2ay,
y=5y,
Such statements could be numbered.
Normal precedence rules were used in evaluating the expression, so
that a + be was handled correctly as a + (bc). Both numerical and sym-
bolic subscripts were permitted; the former were denoted by a vertical bar
(which existed on the Flexowriter), followed by a superscript number; e.g.,
u|? represented u,. Symbolic subscripts used the vertical bar and the letter;
e.g., v|j represented v,;. Floating point arithmetic was programmed.
Both unconditional and conditional control transfers were permitted.
The former is designated by SP n where n is the equation number. Writing
CP ncaused a transfer to nif the previously computed quantity was negative.
A switch control could be used by writing SP x where x represents a vari-
able; control was transferred to the equation whose number was the value
of x. Closed subroutines could be executed by writing SR n.
Although there were no loop control statements originally, they
apparently were added later.
Loops could be controlled either by sequences of values or by fixed
increments; e.g.,
g|N=1,1.2,1.4,1.6,1.8,2,3,4,5,
g|N=1(.2)2(1)5,
132 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
are both equivalent. The flexibility of the second form has not yet appeared
in any significant programming language since then.
Over 20 common mathematical functions were available in a library,
and they were invoked by writing F with a superscript identification number.
A PRINT statement and a STOP performed the obvious functions.
The rules of arithmetic, conversion, etc., were controlled by the CS
system in use on Whirlwind at the time (see Adams and Laning [AD54)).
There was also a routine to solve differential equations.
This is truly an impressive system and, in my opinion, probably the
most significant of all the early work.
ADD ABC
where the first instruction meant add the values of the variables A and B and
call the result C; the second meant increase x1 by del x and if the result was
less than lim x, then go to the address (i.e., opn #) designated in the 1CN
line; if it equaled lim x, then go to the 2CN address. The arithmetic was done
in programmed floating point.
A-3 (also called ARITH-MATIC) was an improvement of, but not
completely compatible with, A-2. It also provided a number of additional
facilities which were not in A-2. However, A-3 never received much usage
as such because it was made available at the same time as the AT-3 (later
called MATH-MATIC) system, which was the Remington Rand conceptual
equivalent of FORTRAN. (See Section IV.2.2.1.) The MATH-MATIC
source program was translated to A-3 as an intermediate language, and
this was then in turn translated to machine code. However, for those opera-
tions which could not conveniently be performed using MATH-MATIC,
the user actually could write A-3 code in his MATH-MATIC program and
have the linkage and translation performed correctly and automatically.
IV.2.1.5. BACAIC 133
5. BACAIC
B-+B— K4*A*Ce2xD
that number in other statements. Thus WHN A GRT B USE 6 meant that
if the value of A was greater than or equal to the value of B, then expression
number 6 was computed next. Otherwise, the expression that followed was
computed.
Logically unnecessary parentheses could be excluded; thus the expres-
sion A + B « C was handled correctly. They even allowed multiple assign-
ment statements, such as
At+tBxSx«*tTx*U
which meant assign the value of A + B to §S, T, and U. This particular facility
did not appear again in any major language until ALGOL 60.
6. PRINT
where the variable field contained one to four variables, depending on the
Op Code. The operations provided included the arithmetic ones, a few
mathematical functions, testing, and input/output commands; these could
all be indexed. Operations which could not be indexed included tests, index
commands, and some input/output.
The main reason for including any mention of PRINT is the fact that
it was the other significant attempt (besides A-2 and A-3) to provide facilities
to handle scientific problems on a machine designed for use in data processing
applications.
1. MATH-MATIC (AT-3)
(n READ-ARRAY X(I,J) .
—
136
IV.2.2.2. UNICODE 137
the loop control statement. All these facilities were later picked up in one
way or another in either COBOL or ALGOL.
There are two unusual features of MATH-MATIC which are very
important but which have not really been supported in any major language
since then. The first is the ability to handle lower level languages in line.
MATH-MATIC was able to accept and handle statements written in both
UNIVAC machine code (commonly called C-10) and also in A-3, which
was a three-address intermediate language with its own compiler. (See
Section IV.2.1.4). The user could use the same variables in all three languages
(subject to some reasonable conventions) simply by listing these variable
names in a dictionary.
In my opinion, the most interesting feature of MATH-MATIC was
its implementation of automatic segmentation; this is a facility that appears
not to have been implemented since then, although a great many people have
talked about it and made claims that they were trying to do it but say they
have been prevented because of the difficulty. The MATH-MATIC system
provided completely automatic segmentation, in the sense that any object
program which was too large to fit in one memory load would automatically
have inserted into the object code (by the compiler) the necessary control
transfers and input/output statements to reload memory as many times
as necessary. Thus the compiler created an object program which brought
into memory that part of the program which was to be executed next. This
in itself is not very difficult to do, but it is naturally quite inefficient. The
MATH-MATIC system went still further, by examining the code for loops
and attempting to put them into a single segment. Thus, if the normal
segmentation caused part of a loop to be in one memory segment and
part in another, the compiler would create a shorter segment preceding
the loop and put the loop all in one segment. Obviously if the number
of statements within a loop could not fit into one memory load, the
compiler could not do much about it; but in that case it looked to see if
there was a subloop within the larger one and, if so, it would put that into
a single memory segment.
It is interesting to speculate whether if this system had been implemented
on a machine with fewer limitations than UNIVAC or with wider market
acceptance such as the IBM 704 or 705, it would not have become the major
language that FORTRAN became.
2. UNICODE
much better suited to the solution of scientific problems than the UNIVAC
was. In addition, from a timing point of view, UNICODE was able to pick
up some of the facilities ofp FORTRAN which are of value. A list of the allow-
able statements is shown in Fig, IV-3.
COMPUTE X.
X=A.
JUMP TO SENTENCE K.
IF X=Y JUMP TO SENTENCE K .
IF X NOT=Y JUMP TO SENTENCE K.
IF X<Y JUMP TO SENTENCE K .
IF X>Y JUMP TO SENTENCE K, IF X<=Y JUMP TO SENTENCE M .
IF X<Y JUMP TO SENTENCE K, IF X=Y JUMP TO SENTENCE M,
IF X>Y JUMP TO SENTENCE N .
IF X>=Y JUMP TO SENTENCE K .
RESUME K .
LIST X(I,J), TAPE L, ((Title)) .
LIST F(X,Y,Z,T), X, Y, Z, T, TAPE L, ((Title)), (Column Heading),
(Col. Hdg), (Col. Hdg), (Col. Hdg), (Col. Hdg) .
TYPE X(I,J), Y, ---, F(X), Z .
READ A.
READ A, IF END OF DATA, JUMP TO SENTENCE K .
STOP .
END OF TAPE .
The IT (/nternal Translator) system was developed for the IBM 650
by A. J. Perlis, J. W. Smith, and H. V. Zoeren, based on a version developed
for the Datatron by these people and M. Koschman, J. Chipps, and S. Orgel
at Purdue University. The system is described by Perlis et al. [PR57] and
[PR57a]. IT was designed primarily to handle numerical scientific problems.
It had two enormous shortcomings: One was the hardware language, which
was forced on the designers by the 650, and the other was the scanning
technique used, which forced unnatural (and essentially incorrect) evaluation
of mathematical expressions. In spite of these difficulties, however, IT was
a significant step in compiler development. Most importantly, IT showed
that an algebraic language could be implemented on a small machine (2000
words) with a small effort; it required only about two man-years to develop.
This language was the forerunner of several others (e.g., RUNCIBLE,
GATE, CORREGATE, and GAT which is discussed later) which had
more reasonable hardware and used better compiling techniques. Thus
a major contribution of IT was to inspire some aspects of compiler research
at Case Institute of Technology and the University of Michigan. In terms of
other work being done at that time, it 1s worth contrasting the notation
for IT with that used for MATH-MATIC (see Section IV.2.2.1), which was
far more natural and also ran on a machine with limited storage (originally
UNIVAC I, with 1000 words). However, MATH-MATIC had the advantage
of a reasonable character set and magnetic tapes for external storage, thus
placing it in the FORTRAN category.
In current terminology, the reference language consisted of the digits
and letters, punctuation characters and operators, and some other symbols;
the hardware representation is the single letter shown in the right-hand
column:
) Right parenthesis
Decimal point
Substitution
xIl+VVET:
KCN
Relational equality
Greater than
Greater than or equal
Addition
NAOAVOXENE
Subtraction
Multiplication
Division
x oN
General exponentiation
o
o
Comma
Quotes
Type
Finish
140 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
k: G13 IF Yl + Y2 = 9
which has the effect of punching out a single card containing the names and
current values of the (up to four) variables. A conditional output statement
was provided.
Loop control was written as
where the range was down through statement j, with the parameter v1
varying from v2 to v4 in increments of v3. A subroutine call was accomplished
by writing
k: "'nE, ... 7
1 READ F
2 Y2 Z OJ F
3 AK 11K 11K MIK IK F
4 Y2 Z Cll YI X Y2 F
5 H FF
10
y= a,x'
i=0
1: READ
2: Y2<- 0
4: Y2 — Cll + Yl X Y2
5: H
It has always been my contention that, from the user’s viewpoint, the diffi-
culties of the hardware representation completely outweighed any advan-
tages gained by the fundamental concepts in the language, which were
quite reasonable considering the machine involved and the year in which
the language was developed. On the other hand, IT was an early example
of the implementation of a programming language for scientific problems
on a small machine, and a number of students and scientists at the cited
universities made effective use of it. (Although the developers naturally
claim otherwise, it is not obvious to me that these same users would not
have had equivalent success with the 650 SOAP (Symbolic Optimum Assem-
bly Program).)
The FORTRANSIT system was developed (apparently) to have the
best of both worlds, namely FORTRAN and IT. FORTRANSIT was
merely a very simple subset of FORTRAN which the user could write;
this was translated into IT, which in turn was translated to the SOAP
142 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
assembler on the 650, and then to machine code. The FORTRAN statements
acceptable to FORTRANSIT were
GO TO n
IF (a) m, na, n3
PAUSE
STOP
DO ni = m, m2
DO ni = mi, m2, m3
CONTINUE
DIMENSION V, V, V, ...
4. ALGOL 58
IV.3 FORTRAN
The leader of this effort was John Backus, who thus deserves a major share
of the credit for the initial development of what has become the most widely
used higher level language in the world.
The 704 FORTRAN system was issued early in 1957 by the Program-
ming Research Department of IBM. As far as professional presentation is
concerned, the first paper appears to be the one given at the 1957 Western
Joint Computer Conference by Backus et al. [BS57]. It is interesting to
compare the preliminary specifications of November, 1954 and the finally
issued manual of October, 1956. There is surprisingly little difference,
although some interesting changes occurred. The preliminary specifications
only allowed for names with one or two letters but defined function names
as an alphabetic character followed by two or more characters. Then there
were three significant deletions from the preliminary specifications: (1)
Mixed number expressions were allowed, and these did not reappear until
ALGOL, nor within the FORTRAN family itself except for FORTRANSIT
(see Section IV.2.2.3), and then much later in FORMAC (see Section VII. 3).
(2) The DO statement allowed the range to be explicitly stated as a pair of
statement numbers. (3) The IF statement allowed a comparison between two
variables, rather than merely a test against zero. The list of FORTRAN state-
ments in this first system is given in Fig. IV-4. Note that a considerable
number of these statements are heavily machine dependent; in particular,
those relating to the sense switches, the overflows and divide check, and of
course the references to tape and drum.
Although FORTRAN is considered quite commonplace now, it was
not readily or easily accepted at that time. Customers raised many objections,
foremost among them was that the compiler probably could not turn out
object code as good as their best programmers. A significant selling campaign
to push the advantages of such systems was underway at that time, with the
spearhead being carried for the numerical scientific languages (i.e.,
FORTRAN) by IBM and for the “English-language-like” business data
processing languages by Remington Rand (and Dr. Grace Hopper in
particular).
In June, 1958 a new version of FORTRAN with significant language
additions was released as FORTRAN II for the 704 [IB58]. A summary list
of the FORTRAN II statements is given in Fig. IV-5. From a technical
point of view, the following are the most significant additions of FORTRAN
II to FORTRAN I: The subroutine concept exemplified by the
SUBROUTINE, CALL, and RETURN statements and the FUNCTION statement;
the COMMON statement was added to provide communication between
subroutines; the END statement was added to avoid putting an end of file
mark to indicate the end of the program; also, the use of subprograms
permitted the linkage to assembly-coded programs (i.e., SAP).
Statement Normal Sequencing
a = b Next executable statement
GO TO na Statement n
GO TO n, (n1, na, .-., Mm) Statement last assigned
ASSIGN i TO n Next executable statement
GO TO (n}, n2,..., Mm), i Statement 7,
IF (a) nz, n2,03 Statement nj,n2,n3 aS ao less than, =, or
greater than 0
SENSE LIGHT i Next executable statement
IF (SENSE LIGHT i) n7,n2 Statement n7, n2 as Sense Light i ON or OFF
IF (SENSE SWITCH i) n7, n2 ” ”» * as Sense Switch i DOWN
or UP
IF ACCUMULATOR OVERFLOW pn), n2 Statement nz,n2 as Accumulator Overflow
trigger ON or OFF
IF QUOTIENT OVERFLOW 1, n2 Statement nj, n2 as MQ Overflow trigger ON
or OFF
IF DIVIDE CHECK n7, n2 Statement n7, n2 as Divide Check trigger ON
or OFF
PAUSE or PAUSE na Next executable statement
STOP or STOP n Terminates program
DO ni = m}1,m2 or DO ni = m),m2,m3 Next executable statement
CONTINUE
399 39 99
PUNCH a, list
3° 99 99
PRINT n, list
39 39 99
99 $9
FREQUENCY on (i,j,...), m(k,I,...), ..-
Figure IV-4. Table of FORTRAN I statements for the IBM 704. The
spacing is not significant.
Source: [IB56], p. 50. Reprinted by permission from The FORTRAN Auto-
matic Coding System for the IBM 704 EDPM. © 1956 by International
Business Machines Corporation.
145
146 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
FORTRAN systems for the 709 and 650 were officially released late in
1958. In 1960, FORTRANSs for the 1620 and 7070 were released, and in
1962 FORTRAN IV was released on the 7030 (STRETCH).' The first
apparent implementation of FORTRAN (using that name) by a manufac-
turer other than IBM was the version of FORTRAN I for the UNIVAC
Solid State 80 which apparently was run as early as January, 1961.? Later
that year, an augmented version of FORTRAN II was developed for the
Remington Rand LARC by Computer Sciences Corporation.* Although
not using the name FORTRAN, the ALTAC system developed for the
Philco 2000 was an extended FORTRAN II running even earlier, in April,
1960.‘ By 1963 virtually all manufacturers had either delivered or committed
Basic 7070/7074
COMMON
7070/7074
709/7090
1620
650
704
705
ACCEPT n, list
xx
ACCEPT TAPE n, list
MM
KKK MK MMMM
ASSIGN i TO n
xx
KK OE
BACKSPACE i
MK
CALL NAME (a1, a2, -.., Gn)
COMMON (a], a2, ..-. ,; Gn)
CONTINUE
Kx x
KK ON KOK OM
NK KX
mm KKM
KKM
KKM
DIMENSION v1, v2, --.-, Yn
OK OR OK OK OK OK OK EK OK OK EN KOK
KK
DO n i=m], m2, m3
END (17, 2, 13, 14, 15)
MN
END FILE i
KX
KOK OE
EQUIVALENCE (a, b, c, ...), (d, e, f, ...), .-.
x
FORMAT (s7, s2,..- Sn)
x
FREQUENCY a(i, j, ...),
m(k, |, ...),...
HK KH
FUNCTION name (a), a2, . ~~, Gn)
GO TO n
OK OK OK
*
XK
OK OM
GO TO o, (n1, na, ..., Mm)
GO TO (n}, n2, . . . , Om), i
*
xx
KAKKM
KK
IF ACCUMULATOR OVERFLOW pn}, a2
MM MK KK MK KOK
IF DIVIDE CHECK ny, n2
IF QUOTIENT OVERFLOW n17, n2
IF (a) ny, n2, n3
DK OK KR
MK
KK
IF (SENSE LIGHT i) nj, n2
IF (SENSE SWITCH i) n7, n2
KARR mK
PAUSE n
PK
PK
KRY
PRINT n, list
PUNCH on, list
PUNCH TAPE no, list
READ n, list
KM
MMM
READ DRUM i, j, list
PRM
KKK
REWIND ji
KH
KKK
ROKK
SENSE LIGHT i
STOP n
mK
KO
TYPE n, list
WRITE DRUM i, j, list
KKK
KK
KOK
~~
149
150 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
to provide information useful for object time optimization was also dropped.
FORTRAN IV was definitely not a compatible extension of FORTRAN II.
One of the interesting results of this FORTRAN IV creation was the
development of the SIFT program (discussed in more detail in Section
IT.4.2.2).
In May, 1962, the ASA X3.4.3 (=FORTRAN) Committee to develop
an American Standard FORTRAN was formed and eventually produced
two standards, known officially as FORTRAN and Basic FORTRAN,
which correspond roughly to FORTRAN IV and FORTRAN II, respec-
tively. (However, Basic FORTRAN isa proper subset of FORTRAN.) This
will be discussed in more detail in Section IV.3.2 but it is essential to realize
that FORTRAN—and in fact two of them—have the distinction of being the
first programming languages that were actually standardized through the
normal procedures of the USASI (then called the American Standards Asso-
ciation).
6 It should be clear, in the ensuing text, when FORTRAN is being used in a very
general sense and when it refers specifically to a single language standard.
7 [IB56], pp. 2-3. Reprinted by permission from The FORTRAN Automatic Coding
System for the IBM 704 EDPM (Programmer’s Reference Manual). © 1956 by Inter-
national Business Machines Corporation.
1V.3. FORTRAN 151
SAMPLE PROGRAM—FORTRAN
With reference to the two standards, the languages are relatively machine
independent. The major exceptions are the actual precision of the arithmetic
which is being done (and which of course depends completely—in the prac-
tical world—on the size of the machine word) and some of the input/output
statements.
The situation is also fairly good relative to compiler independence.
The standard contains rigid rules about some of the normally tricky areas,
e.g., ordering of array elements and special cases with DO loops.
In discussing the question of dialects, we must distinguish between
dialects of the standards and dialects which have existed as a historical tradi-
tion. The former, by definition, should be either eliminated entirely or cer-
tainly minimized since that is definitely the purpose of the standard. For
several reasons the existence of dialects has actually been somewhat less of
a problem than with other languages, most notably ALGOL. First, within
IBM it was possible to control the language specifications and so no dialects
in the sense of language deviations really appeared (although there were
differences based on implementation); secondly, the major reason that other
manufacturers implemented FORTRAN was to permit their customers to
transfer FORTRAN programs originally written for IBM equipment, so of
course the manufacturers would go to great lengths to avoid dialects; thirdly,
dialects would defeat the purpose of the standard; a fourth reason is that
since FORTRAN was designed for direct input on a computer, there have
not been transliteration problems nor any particular reasons to deviate from
that set of specifications. These comments about dialects, however, do not
apply at all when considering extensions. Historically, the greatest deviations
among FORTRAN systems were extensions rather than dialects. As stated
above, other manufacturers were highly motivated to retain the exact IBM
FORTRAN notation for their customers; on the other hand, they were
competitively motivated to provide additional features beyond those avail-
able in IBM compilers. Thus whole classes of particular implementations
added new features of one kind or another and in a few cases FORTRAN
II was extended to include some of the features of FORTRAN IV but in
a compatible fashion. In some cases, extensions to the standards are being
implemented. Probably the greatest difficulty in obtaining compatibility
stems from implementation of slightly different sets of features; this is a
chronic problem with all languages, although the COBOL standard has been
created in a way which will recognize and define this problem. (See Section
V.5.3.2.) Discussions of some of these issues are given by Heising [HE64a],
McCracken [MR65], Oswald [OS64], and Wright [WR66].
As part of the subsetting characteristics, it should be noted that I have
no first-hand (or even reliable second-hand) knowledge of FORTRAN
being used to bootstrap its own compiler. What has been done in a few cases
was to add some character and string-handling subroutines (coded in
IV.3. FORTRAN 153
The standards were approved March 7, 1966 and became ASA Stan-
dards X3.9-1966 [AA66] (=FORTRAN) and X3.10-1966 [AA66a] (= Basic
FORTRAN). Within a year after approval, significant questions of inter-
pretation had arisen, and so the X3.4.3 Committee had to be reactivated
to deal with them.
An international standard was accepted for most practical purposes
in October, 1965 but its final official approval has been delayed by adminis-
trative problems and errors. It added another subset (based on the ECMA
work) to the two existing levels.
As indicated under the history, FORTRAN was initially designed by
a group of individuals (who were listed earlier), most of whom worked for
IBM; the objectives of the language were also stated earlier. The initial
implementation of the language was done by the people who designed it,
and they also did much of the implementation of FORTRAN II. Since then,
an enormous number of people have become involved, both in and outside
IBM. FORTRANSs have been implemented by a large number of different
people in IBM, by most computer manufacturers, and by virtually every
independent software house. The maintenance of the language (prior to the
standard) was done for IBM by various groups and for those outside of
IBM in no central place. As indicated earlier, however, most manufacturers
attempted to follow the IBM specifications.
FORTRAN was initially defined simply through the use of English
prose and examples. When it came time to define the standards, those who
were most heavily involved and had the strongest influence had no interest
In using any type of formalized notation. Thus both standards have been
written in narrative English with formats shown where appropriate. Some
attempts (e.g., Rabinowitz [RN62] and Burkhardt [BU65]) have been made
to provide a formal definition of FORTRAN but these are of necessity
somewhat incomplete. Since here we are defining the characteristics of the
Standard FORTRANs, there is only one form of documentation, namely
[AA66] and [AA66a]. Readers who are interested in obtaining a somewhat
better understanding about the documentation of the earlier IBM versions
are referred to Heising’s article [HE63].
Some version of FORTRAN has been made available on virtually every
the parentheses, which are used in specified places. Blanks have no sig-
nificance except in a few special cases. There are no noise words permitted.
The input form is highly card-oriented. The actual standard refers to
the significant unit of a line, which is a string of 72 characters containing
character positions called columns. A statement label can only be placed
in columns | to 5. The statement appears in columns 7 to 72. The physical
format permits continuation lines so that a statement can consist of an
initial line optionally followed by up to five ordered continuation lines.
A continuation line is any line that has a character other than zero or blank
in column 6 and does not contain the character C in column 1.
The language is not highly formalized nor is it strongly English-like.
Basic FORTRAN has a number of declarations which are described
later. The smallest executable unit is a single statement. In the sense used
in Section III.3.1, there are no groups of smallest executable units. Loops
are handled by the DO statement or by the tests in an /F statement.
There are actually four categories of procedures defined in Basic
FORTRAN: Statement, intrinsic, and external functions; and external
subroutines. The first three are normally called functions or function proce-
dures. The statement function is defined internal to the program unit in
which it 1s referenced and consists of a single statement of the form
F(a;, a2,...,Q,) = E where F is the function name, E is an expression,
and the ag; are the dummy arguments. This statement function must precede
the first executable statement of the program unit and must follow the
declarations. Aside from the dummy arguments, the expression E can only
contain constants, variables, references to intrinsic functions and previously
defined statement functions, and external functions. Intrinsic functions are
the specific functions of absolute value, float, fix, and transfer of sign. An
external function is defined externally to the program that references it.
Comments are designated by having the letter C in column 1. There is
no interaction with the operating system or the environment specified in
the Basic FORTRAN standard. There is no provision for direct inclusion
of machine language but external procedures can be written in other
languages.
All language units (i.e., declarations and executable units) are assumed
to start with an “initial line” which requires a zero or blank in column 6.
A statement or declaration can have up to five ordered continuation lines.
There is no definitive end of a unit—rather it is determined by recognizing
the beginning of the next unit. There is no type of recursion permitted.
Parameters are called by location. Functions can be embedded into assign-
ment statements but that 1s the only type of embedding permitted.
Declarations must precede statement function definitions, which must
precede the executable statements. The former must be in the order
IV.3. FORTRAN 159
l )
A I+ 2
A=5
B=A-—/7
IF (B) 9, 15, 20
to be passed into the range of the DO from outside its range. It is legal to
have a DO statement nested within another DO statement; in fact, they
can have the same range, which then causes the net effect of looping on
several parameters in succession. Overlapping of ranges is not allowed.
For example, the program
DOTZTM
= 2, 9, 2
A (M)
= M xx 2
DO 4 J = 1, 100
4 BU, M) = J+ M
7 C(M+1)=3%*M
are two statements which involve interaction with the operating system.
The first is the STOP statement, which may be followed by an octal digit
string containing from one to four digits; execution of this statement causes
termination of the execution of the program. The second executable state-
ment in this category is the PAUSE, which also can be followed by an octal
digit string; the execution of the PAUSE statement causes the program to
stop temporarily but execution must be resumable; the decision to do this
is not under the control of the program itself but rather under the control
of the operating system or the operator. If execution is resumed without
otherwise changing the state of the processor, then the normal execution
sequence is continued.
There are no data or file descriptions. There is a complicated FORMAT
description which is used in conjunction with the READ and WRITE commands.
This provides information on the form of the data, e.g., use of exponents,
number of decimal places, and number and width of columns.
Storage allocation is partially controlled by the DIMENSION, COMMON,
and EQUIVALENCE statements. The DIMENSION statement is of the form
DIMENSION v(i) or DIMENSION v(i,j) where v is a data name and
j and j are the maximum values that the subscript of that variable can
assume, and any number of variables can be listed, e.g., DIMENSION A(10),
C(5,9), M(2,8). Interestingly enough, the (Basic) FORTRAN standard
actually specifies the way arrays are to be stored by defining their subscript
values as follows: Assuming dimensions A and £, then subscript (x, y) has
the value x + A(y — /), considering the array as a linear string.
The EQUIVALENCE statement has the form EQUIVALENCE (k;), (kz), ...,
(k,) where each k; is a list of the form aj, az,...,a, Where each q;is a data
name. The EQUIVALENCE statement is used to permit sharing of storage by
two or more variables (or arrays). Thus each element in a given list is as-
signed the same part of storage by the compiler. When two variables share
storage because of the EQUIVALENCE statement, the names cannot both
appear in COMMON statements in the same program unit. It is important
to note that the primary difference between EQUIVALENCE and COMMON
is that the former permits several variables to share the same storage loca-
tion, whereas the latter simply makes the designated variables accessible
to all parts of the program.
There are different ways of declaring the four types of procedures
which are permitted. The simplest is the statement function, which is defined
internally to the program unit in which it is referenced. It is defined by a
single statement of the form f(a;, az,...,a,) = e, where f is the function
name, e is an expression, and the a, are dummy arguments. Note that since
statement function definitions must precede the first executable statement
in the program, it is logically possible to distinguish this from an ordinary
assignment statement.
164 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
Since there are now relational operators, they are used between two
arithmetic expressions to produce the values true or false for Boolean
(logical) variables. In this case, either arithmetic expression may be of type
real or double-precision, or both arithmetic expressions may be of type
integer. (See the description of new data types below.)
The restriction on the sequence of the declarations which exists in
Basic FORTRAN is removed here.
In addition to the four types of arguments for procedures permitted
in Basic FORTRAN, one can also use the name of an external procedure
and a Hollerith constant; the latter is an exception to the rule requiring
agreement of type. If an actual argument is an external function or sub-
routine name, the corresponding dummy argument must be used as an ex-
ternal function or subroutine name, respectively.
The most significant additions to Basic FORTRAN are in the area
of data variables and the arithmetic performed upon them. Boolean (logical),
complex, and Hollerith (i.e., alphanumeric) variables are permitted in
FORTRAN. As a result, complex and Boolean arithmetic are performed.
166 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
7. DP Float means transform the value to the form of a double precision datum,
retaining in the process as much of the precision of the value as a double precision
datum can contain.
integers, while the others are real). The array declaration is of the form
v(i), where (i) itself represents the subscript and can be composed of one,
two, or three expressions. Thus the type statement can also include the
DIMENSION information, e.g., LOGICAL | (3, 5). The DIMENSION statement
(or the equivalent information which can appear in a type statement or in
a COMMON statement) is more flexible. An array with an integer variable
name can appear in a subroutine; the variable names are called adjustable
dimensions. The dummy argument list of the subroutine must contain these
two items. Values of the actual dimensions must be defined prior to calling
the subroutine and cannot be redefined during the execution of the sub-
routine.
168 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
IV.4. ALGOL
IV.4.1. HISTORY
1. ALGOL 58
11 Perlis and Samelson [PR58], pp. 8-9. By permission of Association for Computing
Machinery, Inc.
174 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
Copenhagen, with Peter Naur as the editor. The impetus for this bulletin
came from a meeting held in Copenhagen in November, 1958, where about
forty interested people from several European countries held an informal
meeting to discuss implementation. A group was formed to implement
ALGOL for several machines, with agreement to be reached on everything
down to and including the paper tape code used; this later became known
as the ALCOR (ALgol COnverteR) group. The ALGOL Bulletin was ini-
tially used for communication primarily by Europeans, while Americans
sent their comments to the ACM Communications for publication. This
bulletin continues, although it stopped for 2 years after Naur’s resignation;
it was revived in 1964 by IFIP with Fraser Duncan as editor. The ALGOL
Bulletin serves as a very effective means of communication among people
strongly interested in ALGOL.
Among the more intriguing technical features of ALGOL 58 were its
essential simplicity; the introduction of the concept of three levels of lan-
guage, namely a reference language, a publication language, and hardware
representations; the begin... end delimiters for creating a single (com-
pound) statement from simpler ones; the flexibility of the procedure
declaration and the do statement for copying procedures with data name
replacement allowed; and the provision for empty parameter positions in
procedure declarations. While ALGOL 58 is not an exact subset of ALGOL
60, the only items of significance which are in the former but not the latter
are the do which was removed as a concept (although the word was used
for something else) and the empty parameter positions. Because of this major
carry-over, specific technical description of ALGOL 58 is not necessary.
The avowed purpose of ALGOL 58 was “to describe computational
processes”. For this reason, there were no input/output facilities provided,
and this situation was not remedied in the ALGOL 60 report.
2. ALGOL 60
3. Revised ALGOL 60
(edited by M. Woodger), indicating that there were still five areas which re-
quired further study.
The ALGOL Bulletin continues to be used for discussions of ALGOL
60 (revised), although the attention of WG 2.1 has been devoted more
toward various extensions of ALGOL.
4. ALGOL 6X
For years the ALGOL community has heard about the possibility of a
new version of ALGOL, presumably to be issued during the 1960’s and
hence known as ALGOL 6X. In the spring of 1968, a draft report describ-
ing ALGOL 68 (van Wijngaarden [VW68]) was issued. Its short and long
range fate are unknown.
SAMPLE PROGRAM—ALGOL 60
The four major subsets which have been defined over a period of time are
SMALGOL, the ALCOR, IFIP, and ECMA subsets. These are defined,
respectively, in [CC6Ib], [CC63a, CC64d], [CC64c], and [CC63b]. There are
three subsets defined in the ISO standard: Levels 1 and 2 are the ECMA
subsets with and without recursion, respectively, while level 3 is the IFIP
subset. Each subset is wholly contained within the one of next higher num-
ber.
Some early ALGOL compilers have been partially bootstrapped, but
it would be logically impossible to do this completely because of the lack of
input/output facilities in the language. In some cases, procedures for character
handling and input/output were coded in machine language and these were
used with ALGOL to accomplish bootstrapping.
Because of the essential simplicity of ALGOL, and more importantly
because of the formalism of the syntactic definitions, there has been less of
a problem of compatibility based on incomplete language definition than
in some other languages. This does not mean that the language interpretation
problem is nonexistent, as a wide variety of correspondence in the ALGOL
Bulletin and elsewhere proves otherwise.
The problem of converting an ALGOL program from one machine to
another is basically a problem in different hardware representations, as well
as normal difficulties accruing from machine and compiler differences. There
have been no significant attempts at translating ALGOL programs to
another language, except by hand to FORTRAN primarily for the purpose
of checking out algorithms.
Because ALGOL was created by an international committee and, in
fact, has received wider usage and attention in Europe than in the United
States, it is only natural that the standardization effort in the United States
would subordinate itself to that of the international organization, ISO. The
basic policy adopted by X3.4 was to wait until an international standard was
developed and then to see whether or not this was appropriate as an American
standard. However, the X3.4.2 (and then X3.4.8) subcommittees of X3.4
contributed to the ISO standard in several ways. They proposed solutions
of the issues left unresolved by the Rome meeting and took strong positions
on the necessity for a subset and for input/output. The ACM Programming
Languages Committee sponsored the committee to produce a specific pro-
posal for standard input/output (see [CC64a]). This was adopted, along with
the independent IFIP proposal [CC64b]. The international standard was
accepted for most practical purposes in October, 1965, but its final official
approval has been delayed by administrative problems and errors.
The designers of the language were indicated in the historical section.
The essential sponsorship for this effort came from professional computer
societies in the United States and Europe. This contrasted with COBOL,
where the development was by an American committee, heavily dominated
Iv.4. ALGoL 181
The language which is being defined here is the proposed ISO Standard
[1065], of which official copies were not generally available at the time of this
writing. Since [[065] is itself primarily based on, or a concatenation of, many
documents, primarily Naur [NA63], [CC63b], [CC64a], [CC64b], and [CC64c],
Iv.4. ALGOL 183
+ — x / + f
= £#£ < 3S > 2
= V A TD
C( ) — Jt ce, te Gi = wo U
go to for own switch
if step Boolean string
then until integer label
else while real value
begin comment array procedure
end do
Note that although many of the items look like words, e.g., step, begin, and
label, they are really considered single characters. This means that from the
point of view of the compiler there is no difference between the single letter
a, a period . and the (apparent) word if; each is considered a single character.
(Key words in ALGOL are customarily printed in boldface to emphasize
this point.)
Because most items which would intuitively be considered key words
are defined as single characters, e.g., if, there are no fixed words in the lan-
guage. This causes no trouble in the reference language but it is a source of
difficulty in creating a hardware representation and implementing it. The
graphic operators for the categories arithmetic, relational, and logical are
shown in the first three lines in the list of characters.
Both data names and program unit labels can consist of an unlimited
string of letters and/or digits, but the first character must be a letter. As far
as reserved words are concerned, there is (only) a strong recommendation
that the following identifiers be reserved for the standard mathematical
functions; these identifiers would be expressed as procedures and could be
used without explicit declaration: abs, sign, sqrt, sin, cos, arctan, In,
exp and entier. A variable can have subscripts; they are written within
square brackets and are separated by commas. There are no restrictions
on the form of subscripts; in particular, subscripts can be arithmetic
expressions and conditional expressions; they can have subscripts; and
there is no limit on the number or depth of subscripts allowed, eg.,
ALPHA [X+2, 3*YZ[2+I[3+J[2]]]]. Since there is no data structure in
ALGOL, there is no qualification needed or permitted.
184 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
plete list of declarations (used in the sense of this book, not necessarily
agreeing with ALGOL terminology) permitted is as follows: own, Boolean,
integer, real, array, switch, procedure, string, label, and value. These
declarations apply only to the block in which they appear (and also to
blocks included within that block).
The smallest executable unit is a single statement of the form x := y.
From this simple statement a complex structure can be built up. Individual
statements can be combined into compound statements by enclosing the
sequence in the delimiters begin, end, ¢.g., begin x := y + z;p:=r+1 end.
The begin-end pair causes the groups of individual statements to be
treated as a single statement. A larger type of subunit is a block which
consists of a series of declarations and statements, again completely enclosed
within the begin-end pair, e.g., begin real x, y; integer z; x: = y end.
A block is itself a statement, and thus one or more of the statements which
constitute a block may themselves be blocks.
Loops in ALGOL can be handled by the conditional statements and by
the for statement.
ALGOL provides for both functions and procedures, and the procedures
are really the backbone of the practical use of the language. Most algorithms
are written as procedures so that they can be invoked from other programs.
As is standard, the functions are a special kind of procedure, namely one
in which there is a single numerical or logical result.
The symbols ;, begin, and end can be replaced by the following, re-
spectively, to permit writing comments:
; comment < any sequence not containing ; > ;
begin comment < any sequence nof containing ; > ;
end < any sequence not containing end or ; or else >
Comments can therefore also be put into the procedure declaration.
ALGOL does not include any interaction with the operating system or
the environment. There is no provision for references to other languages.
A program is a block or a compound statement which is not contained
within another statement and which makes no use of other statements not
contained within it. Declarations appear in a block immediately after the
begin symbol and can then be followed by any number of statements until
the end symbol designates the termination of the block.
A statement in ALGOL is normally ended by the use of a semicolon.
A compound statement and a block are both delimited by the symbol begin
at the beginning and the symbol end at the end. Declarations (considered
to include the identifiers to which they apply) are delimited at the end by a
semicolon. A procedure declaration is preceded by the symbol procedure
and normally ended by the symbol end which refers to the block within the
procedure which is accomplishing the desired task.
186 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
ALGOL is almost the only (and was the first) language to allow recur-
sive procedures. There is no requirement that the procedure be defined
specifically as being recursive; this leads to inefficiency at object time in
many implementations because the compiler must prepare to cope with a
procedure which might be recursive but in fact is not.
ALGOL introduced the concept of two different types of parameter
passage for procedures—call by name and call by value. It also permits con-
siderable embedding, most notably, if statements in arithmetic expressions.
The language allows arithmetic and logical variables and arrays of them.
String variables are defined, but there are no operations defined on them. In
addition, there are two other elements which ALGOL defines as data types,
namely label and switch.
There are no hardware data units accessible as such in an ALGOL
program; this 1s quite consistent with the concept of machine independence
and a reference language. All the variable types can be either declared and/or
operated on, except for strings.
Two types of numerical arithmetic are provided in ALGOL, namely
integer and real (i.e., floating point.) A special division operation designated
by + 1s defined only if the variables involved are of type integer. Boolean
arithmetic is also provided.
Real and integer numbers can be intermingled, and the result of the
arithmetic operations is an integer (only) if the operands are integers.
Boolean expressions can be embedded in arithmetic ones. The normal
precedence rules for arithmetic and logical operations apply in the evaluation
of arithmetic and Boolean expressions, respectively.
General arithmetic expressions can include if clauses in which one out
of several simple arithmetic expressions is selected on the basis of the actual
values of the Boolean expressions. In this case, the Boolean expressions are
evaluated one by one in sequence from the left until the one having the value
true is found. The value of the arithmetic expression is then the value of the
first arithmetic expression following this Boolean expression. Thus if Ab < C
then 17 else gq [if w <O then 2 else nj +r is a meaningful arithmetic
expression.
There are two special functions, sign and entier, which yield integer
results. The sign (e) equals 1, O or —1 if e is greater than 0, equal to 0, or
less than 0, respectively. The value entier (e) is defined as the largest integer
not greater than e. There are no rules given for precision. There are a number
of rules relative to the computation in various modes, and in particular
there is a real problem relative to side effects if procedures involving call
by name are used in expressions.
ALGOL was the first language to introduce and define significant scope
rules for data variables. The main unit considered for this purpose is the
Iv.4. ALGOL 187
block. The basic principle is that the data named by an identifier occurring
within a block is usually specified to be local to the block and is always local
to the block if declared within the block. Thus the (data’s) identifier has no
existence outside the block, and conversely this identifier can be used else-
where but is not accessible inside the block. At the time of exit from a block,
all local identifiers lose their local significance, and in particular their values
are not available at the next reentry to the block. All identifiers except labels
and formal parameters of procedure declarations must be declared. If the
user desires to retain the meaning and value of an identifier throughout
significant portions of a program, this must be declared as an own variable,
which means that when the block is reentered, the previous values are
available. Nonlocal variables are those which are used 1n a block but declared
in a larger (i.e., containing) block. Global variables are those defined only
in the outermost block.
The assignment statement in ALGOL can be both single and multiple.
Thus A:=B:=C:=D+E; means that the variables A, B, and C, are all
assigned the value D + E. It is assumed that in the case of a multiple assign-
ment statement the type associated with all variables and procedure identifiers
on the left must be the same. If the type is Boolean, the expression must also
be Boolean; if the type is real or integer, the expression must be arithmetic.
If the types of the arithmetic expressions on the left and right do not match,
then the appropriate transfer functions are understood to be automatically
invoked to go from the right to the left.
There is no character data handling.
Normal sequence of control is from one statement to the next. There
is an unconditional control transfer designated by the single symbol go fo. It
is also possible to have this symbol go fo followed by a subscripted identifier,
e.g., go to K(I], where K has been previously identified as a switch by means
of a switch declaration. The value of the subscript designates which of the
possible labels is chosen. Designational expressions are rules for obtaining
statement labels as values and can be written as subscripts. Designational
expressions can be if statements, e.g.,
y := z + Step(line) x Value
In somewhat more general terms, a conditional statement can have the form:
The list over which a variable may assume values can be expressed in one of
three forms: It can be just a regular arithmetic expression; it can be something
of the form A step B until C where A, B, and C are arithmetic expressions, or
finally the form E while F, where E is an arithmetic and F is a Boolean expres-
sion. The last two of these can be described, respectively, most concisely
Iv.4. ALGOL 189
V :=A;
L1: if (V — C) x sign(B) > 0 then go to Element exhausted;
statement S;
V:=V+B;
go to L|;
and
L3: V:= E;
There is no separate file description since files as such are not an allowable
entity in ALGOL. There are some specific format descriptions included in
the large input/output specifications. There are no declarations in the lan-
guage specifically about storage allocation, although information of this
type is conveyed to the compiler through array declarations and is implied
Iv.4. ALGOL 191
The procedure body always acts like a block even if it does not have
the form of one. A function declaration has the same form as a procedure
declaration except that in the body of the former there must be an assignment
statement with the procedure identifier on the left.
The switeh declaration is specifically defined. It consists of a sequence
of values (which can be defined by general arithmetic expressions) which are
called the switch list; e.g.,
the scope of variables; (2) formal language definition; (3) recursive proce-
dures; (4) significant embedding capability for differing subunits; (5) a
general simplicity combined with power for stating computational processes;
(6) concepts of separate reference, publication, and hardware languages;
(7) a requirement for the development of better implementation techniques;
and (8) spawning a significant number of languages as outgrowths. Although
in a somewhat different category, the collection of algorithms written in
ALGOL [AC66] is certainly a significant contribution.
The block structure was the first occurrence of the concept of
unlimited levels of nesting of executable units. For example, FORTRAN
had none, COBOL allowed three, but ALGOL permitted any number. This,
of course, led to a series of problems about the scopes of variables which
had to be solved.
Probably the greatest contribution accruing from ALGOL 1s some-
thing which is actually not directly related to the language, namely the use
of a formal syntactic definition for the language and the publication of a
report in that form. This in turn has led to increased studies in methods of
language definition and, in a parallel fashion, to the development of syntax-
directed compilers.
Recursive procedures were introduced by ALGOL. They certainly should
be considered a significant contribution to the technology, but it is not clear
how great a one. The advocates of this facility claim that many important
problems cannot be solved without it; on the other hand, people continue
to solve numerous important problems without it and even in a few cases
manage to handle (sometimes in an awkward way) some of the problems
which the recursion proponents claim cannot be done.
The fourth point is a general one, namely that ALGOL is a clean
language of great power for expressing algorithms to solve a wide class of
problems. This is quite different from the practicality of ALGOL as a lan-
guage for use on a computer. Because of the significant difference between
the appearance and usage of the reference and hardware languages and
because for many years there were no input/output facilities, the contribu-
tion seems to be much more in the area of expressing algorithms than in
direct use on a computer.
The introduction of the concept of a reference language with translitera-
tions to publication and hardware languages is considered by me to be quite
significant, although it has not actually been used to any real extent by any
language development since then. However, the development of a program
to go from a hardware representation to the reference language, with the latter
on a paper tape for controlling a photocasting device, has been done by
von Sydow [VS67] and might prove to be of major significance.
Finally, many of the features in ALGOL forced the development of
new or better implementation techniques. Problems such as handling recur-
194 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
sive procedures, own variables, dynamic storage allocation, and the distinc-
tions between call by name and call by value have all been solved to varying
degrees of efficiency. Furthermore, the implementation of ALGOL on a
number of small computers has created a body of useful compilation tech-
niques for this class of machine.
At least as significant as ALGOL itself is the fact that ALGOL 58
engendered enough interest to cause the creation of several other languages.
While this 1s a disadvantage in adding to the proliferation, each of the direct
outgrowths (JOVIAL, MAD, NELIAC) has itself contributed to the
technology. Furthermore, the specific features mentioned in the first para-
graph of this section have been at least considered by almost every language
designer since 1960. (Of course this does not mean that all the features can or
should be put into new languages.)
ALGOL has had an impact on programming language development
that far exceeds its direct practical usage in the United States. It has been
used far more in Europe than in the United States, but even in Europe it
appears that FORTRAN is more widely used for practical problem-solving.
6. DIAMAG
7. GPL
BYTE and pointer (PTR) data types, more general block structure, and user
ability to define a MACRO (for in-line object code). However, the most inter-
esting aspect of this language is its facility to allow the user to define new
operators and new data types.
8. Extended ALGOL
1. The ability to access a partial word by giving the beginning and ending
bits.
2. A TIME function which can yield either the current date, or various
elapsed times.
3. A concatenate expression which provides an efficient method of forming
a primary (or Boolean primary) from selected bits of two or more pri-
maries (or Boolean primaries).
4. A FILL statement which permits assignment of specified values to one row
of an array.
5. A DOUBLE statement which causes assignment of the double-length
result of operations on double-length variables.
. STREAM procedures which manipulate words, characters, and bits.
NN
10. A DEFINE declaration to permit use of a single identifier for a longer legal
program string.
11. SORT and MERGE statements.
This language appears to have a great many facilities which are useful in
business data processing and in character-handling applications, e.g., com-
piler writing. It is definitely a multipurpose language and has apparently
been used to write its own compiler.
Although ALGOL 58 itself had only a very short life-span, its importance
transcends its actual usage. Aside from its obvious role in the development
of ALGOL 60, it motivated the creation of several other languages which
have become quite significant. Two of these, namely NELIAC and MAD,
are described in this section since their basic purpose, flavor, and general
facilities fall primarily in the class of languages for numerical scientific
problems. However, JOVIAL is an outgrowth of the CLIP effort, which
IV.5.1. NELIAC 197
itself was based on ALGOL 58, and both are far more general. JOVIAL is
discussed in Section VIII.3 and CLIP in Section IX.2.5.2.
The role played by ALGOL 58 in the development of each of the
languages is described within the discussion of the history. It will presumably
be clear, however, that although each of these languages may have started out
being based on ALGOL 58, the end results bear little resemblance; if it were
not for the historical statements, I doubt whether the reader would recognize
any connection with ALGOL 58. This comment is in no way meant to be a
criticism of any of these efforts; it merely points out that objectives and
achievements are often far from motivations.
1V.5.1. NELIAC
as there are physical compilers. The language described will be that discussed
in Halstead’s book [HS62]. Certain improvements to this language were made,
however, by Huskey et al. [HU63].
During much of 1962 and part of 1963, there was a great deal of con-
SAMPLE PROGRAM—NELIAC
key punches which then require a hardware representation for some of the
characters.
The compatibility of NELIAC is something about which one could
write an entire book (and to some extent Halstead did). It was meant to be
machine independent, particularly since the NELIAC compilers were written
in NELIAC except for the initial bootstrapping. However, the ability to
allocate variables to particular bits or characters in words makes this impos-
sible. Furthermore, differing input/output facilities made NELIAC obviously
dependent upon particular machines. Since the compilers were readily
changed, it is not clear if the results obtained on one compiler could neces-
sarily be obtained on the other; there does not appear to be any significant
substantive data on this. There were definitely subsets created to permit
bootstrapping, but much less was done in the way of providing direct clearly
identifiable extensions; most of the latter appeared in the form of removing
certain restrictions, which of course can be considered a form of extension.
There is no doubt but that a NELIAC program can be very easily converted,
if not directly at least with a very small amount of effort, to run on another
machine with a NELIAC compiler. NELIAC can be transliterated fairly
easily into ALGOL publication language, but in my view its external ap-
pearance does not resemble ALGOL 58 very much.
Any consideration of NELIAC compatibility must take into account
the basic philosophy that the language is meant to be easy to modify for any
particular implementation or application. In Halstead’s words, “In short,
itis a dynamic language, with compatibility preserved by the ease with which
desirable features can be added to any implementation as it becomes useful
to do so.”'? While recognizing the validity of such an approach for solving
problems, I do not feel that this philosophy addresses itself to compatibility
( ) — 1 € )
+ — x /
= ££ < > = 2B
N U
8 (subscript)
used for identifiers. An identifier can have one subscript which consists of
one of those letters or an integer, or a letter with an integer added to it;
some compilers permit the use of a variable as a subscript. Generally only
one subscript is permitted.
The operators consist of the five arithmetic operators, the absolute
sign, and the six relational operators. There are also two Boolean operators.
Punctuation is extremely critical and used as the delimiters in most cases, as
seen from the following rules.
(1) The comma is used to delimit executable statements. (2) A semicolon
can be used for this purpose also except in conditional statements, where
the true and false parts must end with either semicolons or periods. (3) A
semicolon also delimits the dimension statement. (4) A comma following
a single identifier denotes a subroutine call. (5) A period following a single
identifier denotes an unconditional control transfer. (6) A double period
denotes the end of the program. (7) A colon is used to delimit a statement
label and also to delimit the comparison in a conditional statement. (8)
Braces are used to enclose a subroutine, to delimit the range of a loop, and
to delimit either alternative of a comparison statement. Braces are also used
to specify parts of a word in both the dimension statement and the exe-
cutable statements.
As indicated in the rules for naming, blanks are significant. Although
in many cases both fixed words and punctuation may be written, it is the
punctuation which is critical and the words can be omitted. In general, noise
words are not permitted, except for the cases of this type. Literals are
enclosed in quote marks "' which appear in some hardware representations,
but they are often limited to one machine word.
Since there are differing devices—although primarily paper tape in the
earlier systems—used for input, the physical input form depends on the
device somewhat. The conceptual form is certainly free form to the largest
extent possible.
There is really no smallest executable unit considered as a separate
entity because the language is completely based on the concept of a triplet
consisting of two operators and an operand between them. Thus there is
no grouping. Looping is controlled by either conditional statements or by
the FOR statement. Both subroutines and functions can be defined with
input and output parameters; they are called by location. Delimiting is
normally accomplished by the specification of the meaning of each triplet.
However, function and subroutine definitions must be enclosed in braces.
Functions can be embedded in expressions. There is no language provision
for recursion. The noun list which contains the dimensioning information,
and can contain initial values, must appear at the beginning. Other languages
can be entered through the use of the crutch operator, which serves as a flag
to the NELIAC compiler that some other language is to be processed.
202 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
Several points need to be made about this general form. First, the relation
can have only a single variable on the right of the relation sign. Thus, the
following are legitimate:
FA+B=B+1:
IFA<BNC=DUA=D:
Second, the words IF NOT are not required; the semicolon or period fol-
lowing the statement for the true path is the defining character for the nega-
tive path. Third, the executable statements can themselves be conditional,
provided they are stated completely within either the true or false path.
Finally, the actual sequencing rules are controlled by punctuation. Since
either a period or a semicolon can terminate the true or false path, these
paths can contain subroutine calls or unconditional transfers. For example,
one can write
Loop control is handled by the FOR statement, which has the following
format:
In some compilers there was a restriction that the final value must be
reached precisely by adding increments to the initial value.
Since ALGOL did not have any input/output statements, it is not sur-
prising that NELIAC did not originally. Many of the early compilers just
created subroutines or borrowed existing input/output packages. However
a semi-machine-independent technique has been implemented on a few of
the NELIAC compilers. This technique makes use of the < and > symbols
to serve as quotation marks. Three forms exist, of which the first specifies
the output of headings, the second the output of numerical data, and the
third calls for the reading of data into the computer, as shown below:
IV.5.2. MAD
they felt a fast compiler was needed for their IBM 704. A system which was
very much along the spirit of GAT (see Section IV.2.2.3) was finished
around February, 1960 and given to SHARE. It was designed to be a fast
translator for the 704 and expected to be used primarily by students. The
main objectives were speed of translation, generality, ease of use, few rules
to learn, and ease of adding to the language.
As with many other such systems, it is still being improved by the
University of Michigan, and there have been numerous versions (each
containing the previous one as a subset). It has also been heavily used at
M.I.T., but that version was frozen in a manual dated November, 1964.
The source document used for this description is the 1966 MAD manual
[UM66].
It is interesting to see that the MAD compiler has served a rather
inverted purpose relative to compatibility. Because a number of people were
interested in using the FORTRAN language and yet wanted to obtain the
speed of the MAD compiler, a system called MADTRAN (written in MAD)
was developed. MADTRAN was simply a translator from FORTRAN to
MAD, which then of course compiled machine code. It was distributed
through SHARE and used at several places. MADTRAN assumes correct
FORTRAN programs, so it provides no diagnostics; thus if the programmer
has errors, he is in trouble. It is believed, however, that any correct
FORTRAN program will be correctly translated by the MADTRAN
system.
The basic purpose of MAD was stated by Arden, Galler, and Graham
[AR6la] as being “developed for the specific purpose of training large
numbers of university students and handling the large volume of university
research problems. The primary motivation for writing this rapid translator
may be traced directly to the special environment of a university computing
center.” They then go on to say that “ALGOL 58 provided the basic pattern
for the language and to the extent that ALGOL 58 is like ALGOL 60, MAD
is an ALGOL translator.”!4 In my opinion, MAD is no more of an ALGOL
translator than a FORTRAN translator. MAD was motivated by ALGOL
58, but it does not resemble ALGOL 58 in any significant way.
The original language was primarily designed and implemented by the
people noted at the start of this section. Maintenance and improvements
have been made by these and a few other people at the University of Michi-
gan since then. The primary documentation has been a sequence of official
manuals, each including some extensions which were originally documented
as addenda and minor revisions to the many printings of the first edition
[UM60]. The source used for the description in this book is the August,
1966 version [UM66]. Because of the way these manuals were printed, no
SAMPLE PROGRAM—MAD
declared one (floating point) by following it with the letter M and a code
number.
Both data names and statement labels have the same form, namely a
letter followed by zero to five letters or digits. The same name cannot be
used for a variable name and a statement label. Both variable and statement
labels can be subscripted, and the latter are enclosed without parentheses.
There is no limit on the number of subscripts. For one- or two-dimensional
arrays, data name subscripts can consist of any arithmetic expression and
can themselves be subscripted. However, the expressions for subscripts in
an array with more than two dimensions must be integers. There are a few
reserved words, primarily some function and system names. The bulk of
the key words in the language are not reserved words since they are longer
than six letters and the other symbols are surrounded by periods. There is,
however, a standard set of abbreviations which can be used to replace the
longer words. This consists of the first and last letters with an apostrophe
between them, such as W'R for WHENEVER and D'N for DIMENSION.
All operators except those represented by single nonletter characters
are surrounded by periods. The operators include the five arithmetic ones,
+ — * / and .P. (for exponentiation); the absolute value .ABS.; nega-
tion —, and the relational and logical operators. The relational operators
include equal, not equal, greater, greater than or equal, less than, and
less than or equal; these are designated, respectively, by .E., .NE., .G.,
.GE., .L., and .LE.. The Boolean operators are .NOT., .OR., -AND., .THEN.,
-EQV., and .EXOR., where the last three represent, respectively, implies,
equivalence, and exclusive or. There are also operations for full words,
consisting of bitwise negation .N., logical and .A., logical or .V., and exclusive
or .EV.. Punctuation as such has no meaning, except for commas to separate
lists of items. Blanks are not significant except in literals. There are no noise
words.
The input form is designed for cards, with the statement labels any-
where in columns | to 10, the statements beginning anywhere in columns
12 to 72, and a continuation symbol permitted in column 11. A statement or
declaration must start on a new card. In my opinion, the conceptual form
is a mixture of ALGOL and FORTRAN.
There are several declarations and they are described later. The smallest
executable unit is any of the specific statements that exist. There is no way
of grouping them. There is loop control by means of the THROUGH state-
ment and by the use of conditional statements.
There are two main types of functions, the internal and external. AMAD
procedure is merely a function with multiple inputs and/or outputs. State-
ment labels and function names may be used as arguments. The external
functions are normally called subroutines or procedures; i.e., they are headed
Iv.5.2. MAD 209
There are two types of conditional statements. The first is the simple
conditional of the form WHENEVER B, Q where B is a Boolean expression
and Q is any executable statement except the END OF PROGRAM, another
conditional, an iteration, or a function entry; e.g., WHENEVER X .LE. 1,
Y = A + B is legal but WHENEVER X .LE. 1, WHENEVER Y .LE. 2,A =B+C
is not. This is an illustration of a place where a comma must be written, as
is true in other statements. A compound conditional is of the following form:
$1 WHENEVER BI
executable statements
$2 OR WHENEVER B2
executable statements
OR WHENEVER Bn
executable statements
Sn END OF CONDITIONAL
Often the last condition is one for which the condition is always true, and
in this case the programmer may write OTHERWISE. The Si are optional
statement labels. The executable statements can be simple or compound
conditional statements. Testing starts with the first Bi, and as soon as some-
thing with the value true is encountered, then the set of statements following
it up to the next S(j + 7) are executed. Computation then continues from
the first statement after the END OF CONDITIONAL statement. Note that
this means only one of the alternative computations is performed.
The loop control is handled by the THROUGH statement which has
one of the two following forms:
PRINT FORMAT F, L
PRINT ON LINE FORMAT F, L
PUNCH FORMAT F, L
READ FORMAT F, L
READ BCD TAPE N, F, L
WRITE BCD TAPE N, F, L
READ BINARY TAPE N, L
WRITE BINARY TAPE N, L
LOOK AT FORMAT F, L
REWIND TAPE N
END OF FILE TAPE N
BACKSPACE RECORD OF TAPE N |, IF LOAD POINT TRANSFER
TO S|
BACKSPACE FILE OF TAPE N [, IF LOAD POINT TRANSFER TO S|
SET LOW DENSITY TAPE N
SET HIGH DENSITY TAPE N
UNLOAD TAPE N
There are also some simplified input/output statements, namely
READ DATA
where the variable names and their values are punched on
cards in the form V; = m, V2 = no,...,Vn = Mn OF even as
values in an array written V(j) = m, n2,... , Mn
READ AND PRINT DATA
PRINT COMMENT $string starting with carriage control$
PRINT RESULTS L
PRINT BCD RESULTS L
PRINT OCTAL RESULTS L
INTERNAL
FUNCTION name. (parameter list)
{EXTERNAL
body of the routine
FUNCTION RETURN expression
END OF FUNCTION
An alternate way of writing the first two lines is by omitting the function
name on the first line and writing ENTRY TO NAME. on the second. A
procedure which provides several output values as parameters omits the
expression. Functions can also have multiple entry points. The same func-
tion definition can be used to define any number of functions and/or pro-
cedures. They must use exactly the same set of arguments, however. Thus,
the functions CPADD. (X,Y,A,B) and CPMPY. (X,Y,A,B) can be defined by
one definition, but the functions SIN.(A) and COS.(B) would require
separate definitions.
An interesting compiler directive is the PARAMETER declaration, which
permits the assignment of values to symbols at compile time. The user
writes PARAMETER Aj(B2), A2(B2),..., An(B,) Where A; 1s an identifier and
B; is an identifier or a constant. The effect is to replace A; by B; in any later
occurrence in the program. This is of course a special case of the more
general macro facility concept.
A rather unusual declaration (for its time) in MAD is the presetting of
vectors; this is done by writing VECTOR VALUES A(i) = Co, Ci,..., Cas
where A is an array with each element’s position reduced to a single sub-
script value. The values of the C; are assigned. The C; can be constants,
statement labels, or character strings.
Probably the most interesting facility in MAD is its ability to allow
some language extension by permitting the user to redefine existing operators
or define new operators or modes for a particular program. This can be done
because of the basic philosophy that is used in the implementation of MAD,
namely the concept of an operator code number followed by modes of the
variables and an address where the instruction sequence for that particular
operator number begins. The exact format is as follows:
15 [UM66], p. 118.
IV.6. ON-LINE SYSTEMS 215
SAME AS a
(1) DEFINE {Uae} OPERATOR [cofnes] , PRECEDENCE LOWER THAN? [°*isIing
BINAR op HIGHER THAN op
move structure [ede] = [mode] [defined] mode’
no. no. op no.
defining sequence
SAME AS- -
(2) DEFINE {pnagy| OPERATOR [FRE] , pRECEDENCE {LOWER THAN? [°*!sting
BINARY ° HIGHER THAN op
MODE stRucTuRE [™0?]
no.
= [mode] [“enre] [moc’*] , SAME SEQUENCE
AS mode! [esting] [moe?]
Figure IV-12. Format for changing operators and modes in MAD. Braces
indicate that a choice is to be made from the enclosed material. Square
brackets have no logical significance.
Source: [UM66], p. 114.
the user at a remote terminal with some facilities for doing numerical com-
putations. The scope of these ranges from something slightly above a desk
calculator (the original JOSS!*) to small programming languages (BASIC,
CPS) to a virtually full-fledged version of FORTRAN (QUIKTRAN) to
systems involving special keyboards and scopes (Culler-Fried, AMTRAN)
to systems providing high level language primitives (MAP, Lincoln Reckoner)
to a system with many unusual operations (APL/360) and one using a stylus,
push button, and scope but no input typewriter (DIALOG).
The only parts of these languages which are being discussed here are
those which relate to the actual computations and/or the debugging facilities
that are available to the user. Any aspects associated with the language which
are primarily (or constitute a major set of) control functions to the time-
sharing system itself are dealt with in Section IX.3.6. If the language can
coexist with other languages or systems, this factor is considered irrelevant
in this section. Languages originally designed for use in a batch environment
which might be available under general time-sharing systems (e.g., MAD
is available under CTSS—see Crisman [ZR65]) are not considered on-line
languages.
A description of one organization’s experience with a variety of systems
is given by O’Sullivan [0U67].
The differences in the philosophy of the first four systems discussed in
this section must be emphasized. In the case of JOSS and BASIC, the idea
was to produce as simple a system as possible to do useful work. However
JOSS was slightly more oriented to an industrial environment with working
engineers and scientists, while BASIC was created for use on a college campus
with a multitude of students doing small jobs that might only be experiments.
There is a provision for execution of lines immediately when entered in JOSS,
but there must be a full program in BASIC. There was no concern in either
case for connection with other languages. There are a number of versions of
JOSS implemented in varying places, but they will not be included here
because they are not significantly different. A partial list of these dialects
appears in Section IV.6.2.
QUIKTRAN represents the opposite end of the spectrum, in the sense
that it took an existing and widely used language, namely FORTRAN, and
adopted it for use on a remote terminal. This was done by omitting a few of
the language features which made it hard to implement in the environment
used and adding a number of features to facilitate debugging in a remote
console type operation. A further factor in QUIKTRAN was the need to
maintain compatibility with FORTRAN, so that programs checked out
at the terminal could be compiled with a regular compiler for production
runs.
16 JOSS is the trademark and service mark of The RAND Corporation for its com-
puter program and services using that program.
Iv.6.2. joss 217
IV.6.2. JOSS
Program Explanation
*Program to find the mean (M) and standard
* deviation (S) of N numbers. Ny
Let M=sum(i=1(1)N:p(i))/N. M = (x P(i)\/N
Let V=sum(i=1(1)N:p(i)*2)/N — M*2. Ne,
Let SmeartlV} NPG" v= [d, PO)VN —M?
N=10 S=/S/V
3.1 Demand pili). \
Do part 3 for i=1(1)N.
p(1) = 7.5
p(2) = 3.5
The goal of the JOSS experiment (JC64] was to demonstrate “the value of
on line access to acomputer via an appropriate language”. “It was designed
to give the individual scientist or engineer an easy, direct way of solving his
small numerical problems without a large investment in learning to use an
operating system, a compiler, and debugging tools, or in explaining his
problems to a professional computer programmer and in checking the latter’s
results.”!8 It has unquestionably served this purpose.
The main published documentation of JOSS I is Shaw [JC64]. Numerous
talks have been given on the subject, and much of the training of new people
/ * blank
$s >< > = ¥¢
] ’ ; ¢ | —
The centered dot is used for multiplication and the pointed star for exponen-
tiation. Parentheses and square brackets are interchangeable wherever group-
ing is needed.
Data names consist of a single upper- or lower-case letter which can
have two subscripts separated by commas. The values of subscripts must
be between 0 and 99.
Statement labels consist of numbers which can have decimal points in
them to allow for insertion of lines since every line must be numbered. When
referring to them, the word step is used for a single line, e.g., 3.2, while
part refers to all lines with the designated number at the left of the decimal
point, e.g., 3.1, 3.3, or 3.4. A period is used to denote the end of a statement.
Blanks are significant in some places.
The input is free form. However, a step cannot exceed a single line, nor
can there be more than one step on a line. The first word on a line must be
capitalized. _
Only arithmetic variables are permitted; they can be either integers or
mixed numbers. However JOSS represents all numbers internally as floating
point numbers to the base 10.
Statements are executed immediately after they are typed, or they may
be stored.
The basic assignment statement in JOSS is designated as
with an optional period after the expression. Thus the user writes
Set Y = 123+456.
Or
Set Y = Ceexp(—x
* 2/2).
sb 2 #$ 7?
. indicates a field for a number in a forn.
cocceesee indicates scientific notation in a form.
# is the strike-out symbol.
$ carries the value of the current line number.
* at the beginning or end kills an instruction line.
Brackets may be used above in place of parentheses.
Indexed letters (e.g. v(a), wfla b)) may be used above in place of x, y-
Arbitrary e ressions ( e.g. 3-[sin(2-p+3)-q]er ) may be used above
in place o a, b, cy ooo @
220
Iv.6.2. joss 221
Set x = sqrt(z) + y.
or
x = sart(z) + y.
or
1.23 Set x = sart(z) + y.
but not
1.23 x = sqrt(z) + y.
To step 1.35.
or
To part 4.
Built-in functions are invoked by writing the function name with the param-
eter(s) in parentheses. Conditions can be attached to the end of steps. Thus
one can write
Set y = q + 4.2 if a > b.
Or
To 3.9 if c = d + 1.
Numerical relations can be combined with the words and, or, €.g.,
where a and ¢ are the initial and terminal values and b is the increment.
The range can either be a single line (using step) or many lines (using part).
The parameters can also be specified as a sequence of values separated by
commas after the equals sign, e.g.,
where the $ carries a numerical value equal to the line number of the type-
writer’s current position on the page. He can also refer to a form with condi-
tional, e.g.,
Thus there is great output flexibility, considering the basic simplicity of the
system.
The functions available to the user include the basic mathematical
routines sqrt, log, exp, sin, and cos, as well as the following:
There is no doubt but that some of the language constraints are imposed
by implementation considerations. Since JOSS is interpretive and was
originally implemented on an old, small, slow machine, some user con-
veniences could not be provided. What is probably the most amazing aspect
of the whole JOSS activity is that it provided such a useful tool to so many
people at the RAND Corporation.
JOSS II has been implemented on the PDP-6. A summary of its com-
mands is given as Figure IV-14. The discussion below is based on indicating
the additions to JOSS I.
Data names can now have up to 10 subscripts instead of the previous 2.
Logical expressions were formerly allowed only after the /f. In JOSS IIT
they can appear in a number of other places, e.g., in a Type statement and
in a Let statement (discussed below). In addition to the operators and and or,
the word not can be used; parentheses may be used for grouping, thus per-
mitting such statements as
Do part 3, 5 times.
e@ An expression, e.g., 3+sqrt (2), has a numerical value. A proposition, e.g., asb,
has a truth value (true or false).
An if P clause can be appended to any command except a short Set.
A conditional expression may be used wherever an expression is allowed; e.g.,
define f(x) by a conditional expression: Let f(x)=(x<0:0;0<x<1:x*2;1) defines f(x)
to be 0 for x<0, x*2 for 0<x<1l, and otherwise 1.
224
FILE COMMANDS SINGLE-WORD COMMANDS
Use file tnt (ident). Page.
File ... as item int (code). Line.
Recall item int (code). Go.
Discard item int (code). Stop.
Done.
Quit.
Cancel.
file int and tdent are assigned
by the Computer Sciences PARENTHETICAL COMMANDS
Department. Cancel or any Do com-
item int and code are assigned mand may be enclosed in
by the user at time of filing. parentheses.
l<ints25. code, if used, <5
letters and numbers.
"..." stands for any combination SPECIAL COMMANDS
of elements that can be deleted Reset timer.
by a Delete command. Let S be sparse.
225
226 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
letter name. Up to 10 parameters may be used, and they are local to the
definition, e.g.,
The function can be invoked by writing its name and arguments in an expres-
sion such as
Two new operators, sum and prod are similar to the mathematical
operators >} and II. Thus
10
sum[i=1(1)100:i
* 2] =>) i?
i=1
A new function called first gives the value of the first index which sat-
isfies the proposition which is its argument. Its format is similar to that of
sum, €.g.,
first[i=1(1)10:i>4] = 5
There are statements permitting the user to file (and retrieve) programs
and/or data.
As stated in the introduction to this entire section, there have been a
number of variations of JOSS developed. Some of these are available com-
mercially to on-line users.
IV.6.3. QUIKTRAN
SAMPLE PROGRAM—QUIKTRANT
t[IB67e], extracts from pp. 56-57. Reprinted by permission from Fundamentals of Using
QUIKTRAN. © 1967 by International Business Machines Corporation.
228 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
IV.6.4. BASIC
SAMPLE PROGRAM—BASIC
110 READ A, B, C
120 LETX =A
130 LET Y = B
140 GOSUB 500
150 LET X = G
160 LET Y = C
170 GOSUB 500
180 PRINT A, B, C, G
190 GO TO 110
200
300 DATA 60, 90, 120
310 DATA 38456, 64872, 98765
320 DATA 32, 384, 72
330
500 LET Q = INT(X/Y)
510 LET R = X — QxY
520 IF R = O THEN 560
530 LET X
540 LET Y
550 GO TO 500
560 LET G = Y
570 RETURN
580
999 END
IV.6.5. CPS
SAMPLE PROGRAM—CPS
The character set consists of the 26 upper- and lower-case letters, the
10 digits, the 3 special characters, $, @, and # (which together with the
letters and digits are called alphameric), and the following 21 symbols:
+ -—-* /()
( =>
< + ,' 2 5 %
iL & | ¢ blank
Some pairs of special characters are used to denote special operations. These
CPS - ONE PAGE SUMMARY
PTATEMENTS THAT ARE COLLECT ONLY AND NEED LINENUMBER
pien ON AND SIGN OFF
GO TO label; 16
ZLOGINCacct, subacct); ZLOGINCacct, subacct, CPS): 01
1F expression THEN statement; ELSE statement; 17
ZLOGOUT(OFF); ZLOGOUTCOFF,ACCT); 02 IF expression THEN statement;
ZLOGOUTCRESUME); ZLOGOUTCRESUME, ACCT);
label :N0; label:DO WHILECexpresstion); 18
TATEMENTS THAT ARE DIRECT ONLY label:DO varlablesspecification,specification,...3
/*Follow one of the above with other statements*/
/*Then writes/ END label;
ZEXECUTE; /*This may be abbreviated as %XEQ;#/ 03
2XEO linenumber; %XEQ Iinenumber THRU I'tnenumber;
LET functlon(varlable) expression; 19
ZXEQ THRU 1! nenumber; 2XEQ label;
STOP; 20
ZLIST; &LIST Tinenumber THRU 1Inenumber; 04
label: IMAGE;
ZRESEQ Tinenumber THRU lI nenumber FROM snare BY STEP;
Image specification; /*for example, the followings/
ZRESEQ THRU Tinenumber FROM start BY ste
TEMP: ---.-DEG. PRESSURE:.....BARS. MEAS NO:---
ZRESEQ 1tnenumber; /*RESEQ means RESEQUENCE®/ 05
DECLARE varlable(dimension list) DECCInteger); 22
QERASE Vinenumber; ERASE lt nenumber THRU 1 tnenumber;
/*examples below show some possibllitiess/
ZERASE THRU 1 i nenumber; ZERASE label; 06
DECLARE A(3);> DCL B(4&,5)3; DCL Cl-1:2);
DCL D DEC(6); DCL E(6,-3:4) DEC(B8);
ZLOAD(member); ZLOAD(member, key); 07
DCL C(-1:2), D DEC(6), E(6,-3:4%) DEC(8);
PET
Identifiers must start with a letter or with $,@,or @ 19 tn LET, function Is an Identifier that you use to
and may have up to sIx alphanumertc characters. name the functlon you are defining and Its argument
may be a single varlable or a list of varlables
03 A linenumber begins with 1 to & digits followed by an separated by commas.
optional decimal poltnt and up to 2 fraction digits.
A Is an Identifier that labels part of a 21 Five or more dots - floating point.
program. One or more dashes - Integer.
One or more dashes with a polnt - decimal.
You may use ... Instead of a lIinenumber after THRU. Other characters stand for themselves.
Anywhere In EXECUTE,LIST,RESEQ, and ERASE you may use 22 OCL and DEC stand for DECLARE and DECIMAL.
a label In place of a lInenumber. A ts a3 element vector and B Is a & by 5 array.
C ts a & element vector:C(-1),C(0),C(1),C(2).
Ste
05 The first linenumber after resequencing Is start and D ts single precision; others are double.
the next linenumber Its start+ . You may declare several arrays at once. All arrays
You may omit ‘FROM start’ and/or ‘BY step’. In an expression have [Identical bounds,
Array varlables are OK In assignment, GET, PUT.
07 A member Is an Identifier used to name a member of a
flle; It Is the name of a filled program. 2h arctangent In radians and degrees
25 arctangent In radians and degrees of x,y coord!inates
A key Is a one to four character Identifler used to cosine, sine; of radians and degrees
read a protected member of a file. 27 exponential and natural logarithm
28 abselute value and square root
A longkey Is a one to s!Ix character Identifier used minimum and maximum of list of expressions
to protect a member. The longkey Is needed to change 30 first expression modulo the second
this member. The first four characters of a longkey stgn (41,0,-1)
are the corresponding key. largest Integer not exceeding expression
smallest Integer not exceeded by expression
12 Any ordinary algebralc expression may be used on the Integer part of expression, with stgn
right side of an statement. Bracket com-
plex divisors. You may use bulltin functions, 32 Follow IMAGE with specification as above ustIng:
functlons you have defined, assign the same value to "card fold, | tab, - Input character, # 1lIne number
several varlables, and use logical operators. 33 You may uSe as many members as you wish.
13 Operators grouped by order of evaluation. 34 CPS will tell you what Jobname to use.
The logical operators™, 4, | are not, and, or.
A varlable Is an Identifier. 35 These are the same as described [In 2-11.
are
>= Greater than or equal to
<= Less than or equal to
1= Not equal to
** Exponentiation
11> Not greater than
1< Not less than
tively. The relations permitted are >=, <=, =, 1=, <, >. In addition,
A|B evaluates to +1 if either [A] >= 1 or |B] >= 1 and to O otherwise. Both
single- and double-precision floating point arithmetic is done; the system
automatically retains 14 significant digits in all computations. If an expres-
sion contains a variable naming an array, the operations are performed on
all corresponding elements of these arrays.
The assignment statement permits array variables on both sides of the
equals sign and also permits multiple assignments, e.g.,
line-number-2
ro | eee THRU 2label-name-2
XEQ label-name-]
If nested /Fs are used, the ELSE clause must be written explicitly.
The loop control is handled by means of a DO statement. This is of
the form
label: DO er = spec-], spec-2, ..., spec-n}
‘
WHILE (expression)
END label;
238 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
where the range is denoted by the first succeeding END statement that has
the same label as the DO. The spec-i can be any of the following forms:
A: DO X = 1 WHILE (Y<A), 5 BY 2;
END C;
END B;
END A;
Note that it would be illegal to reverse the position of the END statements.
The input/output statements are GET, PUT, and LIST. Their formats are
as follows:
line-number-2
LIST et THRU ee
label-1 ’
The GET causes the system to obtain (or prepare to obtain since GET can be
both collect and direct) data from the terminal. Values can be assigned to
both single variables and arrays. The PUT provides output to the terminal,
with optional formatting and spacing, and allows expressions rather than
just variable or array names. The IMAGE option in the PUT is a format state-
ment providing various types of numeric conversion, specific number and
placement of characters, or other text reproduced as it was input. The physi-
cal placement of the carriage while typing the [MAGE statement is used to
specify the output positioning, so the user can easily see his format.
The LIST command causes printing of the specified portion of the pro-
gram.
There are a number of built-in functions provided. In addition to the
fairly standard mathematical ones, there are functions for determining
Iv.6.5. cps 239
maximum, minimum, absolute value, floor, ceiling, truncation, si gn, and remainder.
The routines for sine, cosine, and arctangent are available in both radians
and degrees.
The ERASE command has the same format as the LIST command and
causes the deletion of the specified statement(s).
The STOP terminates execution. It can be resumed with the statement
following the STOP by using one of the EXECUTE forms in which the line num-
ber 1s omitted.
An interesting command is the RESEQ, which causes immediate rese-
quencing of a program based on the information shown in the command;
the format is
where the line numbers identify the beginning and ending lines of the set
to be resequenced and the increment to be used is shown. The line-3 specifies
the first line number to be assigned. Standard values are defined for each
optional parameter. Thus the user can write
% RESEQ 2 THRU...
% RESEQ BY 100;
There are three declarations: DECLARE, IMAGE, and LET. The DECLARE
(also written DCL) provides the dimension information for arrays, e.g.,
DCL A(2:15, —2:8, 7). The dimension ranges from the first number to and
including the second number in steps of 1. The second number must be
greater than or equal to the first. If a single number is shown, it is treated as
the upper dimension with an implied first number of 1.
The IMAGE provides formatting information; this was mentioned earlier.
The LET provides for function definitions by writing
IV.6.6. MAP
(v=3.295 xx (a * 3. * 10 xx (—5))
The user then types in the value of the parameter and the system then
responds
COMMAND PLEASE
This means that the computation has been completed; the results are not
automatically printed out.
The basic element of data is a mathematical function of a single variable.
If the user types an assignment statement involving functions which are
undefined, e.g.,
The user is thus given the opportunity either to define the function in terms
of some known quantities or to define it by means of tabulated values which
are typed into the computer. If he chooses the latter, the system asks him to
specify the minimum, maximum, and incremental values for the independent
variable y. These are used to compute the subscripts. Thus if the user specifies
—3.5, 1.5, and .5, the system will have the subscripts range from —7 to 3
in steps of 1. The user can specify a different set of values of the independent
variable for each occurrence of a different function using that variable; the
system will automatically use the old values if no new ones are given.
After the values of the independent variable are specified, the system
gives a five-line message telling the user how to type in the values of the
function. There is an editing command which permits corrections to be
made and a provision for filing the data for later use. This process is repeated
for each function as needed. The user can suppress the five-line message by
typing the word no after the word input.
The specific mathematical functions of a single argument available for
use in expressions include sine, cosine, tangent, cotangent, arcsine, arccosine,
arctangent, hyperbolic sine, cosine and tangent, exponential and logarithm
(base e), absolute value and square root. The code name for each of these ends
in the letter f.
There are functions whose argument is an expression containing at
least one function. These are?°
There are also matrix operations similar to those in the Lincoln Reckoner
(see Section IV.6.7).
THE FOLLOWING ARE THE VALUES OF THE FITTED CURVE AT VALUES OF X FOR WHICH
DATA (X) IS TABULATED.
-2583E01 wee .4656E01
.9091E01 we -6745E01 *
-6926E01 wee -7160E01
.7123E01 wae -6984E01
.6870E01 wee -6999E01
DO YOU WANT THE DIFFERENCES BETWEEN THE FITTED AND ORIGINAL CURVES PRINTED.
yes
— .2498E—01 we -1683E—01
-1164E—0O1 wae .1398E—01
— .1469E—01 oe -1398E—01
-1585E—0O1 ... —=.8650E—02
—.1400E—01 tee .9052E—02
COMMAND PLEASE
Figure IV-17. Example of the use of Least Square command in MAP. Words
and symbols in lower case are input by the user. Upper-case characters and
all of the numbers are typed out by the system. Dots are used in place of
numerical results which were omitted in this figure, although they appeared
in the actual example.
Source: Kaplow, Strong, and Brackett [K P66], pp. 22-23.
243
244 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
The most interesting thing about these commands is that the user does
not have to know what information is to be supplied. For example, see
Figure IV-17, where the upper-case characters are those printed by the sys-
tem and the lower-case ones are user input. (The dots represent actual values
which would be typed out.) On the other hand, if the user is familiar with the
system, he can merely type in
which accomplishes the same thing as the first eight lines in Figure 1V-17.
Input is either typed in directly upon request from the system or it can
be loaded off-line and then retrieved and referenced by the user.
The user obtains output by writing print and the name of the function;
he can also specify the range desired. MAP can be used to generate graphs
either on the ESL display console or on storage oscilloscopes, and the user
can use the plot command with a choice of linear, log-log, linear-log, or log-
linear scale. By using the compare command, a scaled graph 1s obtained by
plotting the designated function(s) on the vertical axis and the values of
another function on the horizontal axis.
Commands for examining and handling data are as follows:
which causes the name RESULT to be assigned to the product of the matrix
YANS by ZANS, and this is inverted and given the name NEWRESULT. Arrays
can be added, subtracted, multiplied, and divided. The functions of reciprocal,
square root, log (base e or 10), exponent, sine, and cosine can be applied
to a single array. Individual elements can be extracted and operated on.
Other types of operations available include array shuffling (copy part of an
array, join arrays), matrix operations (e.g., calculate determinant, eigen-
vectors), control (synonym, drop an array), and input/output. A lengthy list
is given in Stowe et al. [SW66]. The format for invoking each of these usually
consists of a key word followed by a sequence of variables relevant to the
routine.
In order to create subroutines, the user writes
BUILD NAME
GO ON
whereupon the user types the body of the subroutine. When finished, he types
FINIS
OK
Temporary variable names in the subroutine are written with a period pre-
ceding the name and the system automatically assigns the name of the
subroutine as a local name.
The subroutine is invoked merely by writing its name (and the param-
eters if there are any). While executed, a subroutine may be interrupted by
the interrupt button, an error message, or something in the subroutine itself.
The subroutine execution is suspended, control is returned to the keyboard,
and the user can print results, do other calculations, or define and/or execute
other subroutines. If desired, he can then resume the interrupted subroutine.
One of the main concepts in the Reckoner is that it is really a collection
of programs which can work together; this concept is referred to by the
developers as coherence, which means that the results of any program in the
set can be used as inputs by any other program for which the results are
meaningful.
SAMPLE PROGRAM—APL/360t
t Falkoff and Iverson [FA67a]. By permission of Association for Computing Machinery, Inc.
to contrast it with other small on-line systems. Further references for the full
language are given Section X.4.
The input device is an IBM 1050 or 2741, with a very special Selectric
typewriter ball. The character set consists of the 26 upper-case letters, the
10 digits, and the following 52 characters:
; ~ ¢« ) € J? ' © ©
fe
+ > *€ \ Sf
>
Qg@m4<-.
Nn VU OF C¢
%i—
Emr
A Vo
Oo
nN
The five arithmetic operations are denoted by the first five characters
shown. The use of these and other operators (called scalar functions in APL)
are shown in Figure IV-18. Most of the symbols involved are both unary
and binary; in the latter usage the symbol is considered binary wherever it
is preceded by an operand.
A data name or function name can be any string of letters and/or digits
beginning with a letter. Literals are enclosed in quote marks. Mathematical
expressions are evaluated from right to left within parentheses and therefore
IV.6.8. APL/360 AND PAT 249
tThe symbols for most standard functions are single characters, but some (such as !) are
formed by backspacing and overstriking.
3.x 4
A<3xX4
250 LANGUAGES FOR: NUMERICAL SCIENTIFIC PROBLEMS
X<-2,3,5,7
followed by X[3, 1,4] yields the value 5,2, 7. The dimension of a vector
Z is denoted by pZ.
The expression eN yields a vector of the first N positive integers, while
NpxX yields a vector of dimension N whose components are the successive
elements of X, repeated cyclically if necessary. Thus 6pv4 is the vector
1,2,3,4,1,2.
Component-by-component addition (or any other arithmetic operation)
of two vectors with the same dimension is indicated with the plus sign (or
the appropriate operator), e.g., X+Y.
The sum-reduction of a vector X is denoted by +/X and it is the sum of
all the components of X. More generally, for any binary scalar function #,
the expression #/X 1s equivalent to
equals 20.
The statement M<(A, B)pX defines M as a matrix of A rows and B
columns whose elements in row-major order are the successive components
of X replicated cyclically if necessary. Writing M[; J] yields the Jth column,
while M[/;] selects the /th row. The expression @M produces the vector
(A, B). For example,
23 The examples in this section are taken from Falkoff and Iverson [FA67].
IV.6.8. APL/360 AND PAT 25]
M<-(3,4) p412
defines M as
1 2 3 4
5 6 7 8
9 10 11 #12
9,10,11,12
| 10 , 26
, 42
and + /[1]M yields
15,18, 21
Cll;JJ=+/A[I;]
x B[;J]
252 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
Z<XO.x Y
Other operators can be used in both the inner and outer product forms.
Set theoretic operations of membership, intersection, difference, and
union are defined as follows: If X and Y are vectors, then Xe Y produces a
logical vector U of dimension px such that U[!] = 1 if X[/] is a member of
Y. The intersection of X and Y is denoted by XN Y and defined by
XnNY=(KXeEY)/X
X~Y=(~XEY)/X
XUY=X,Y~X
VD<-ABC
AP i,j,...
and then statements ;,j,... will have the value of the result variable printed
out each time P is executed.
A much earlier attempt to implement a subset of the programming
language defined by Iverson was the Personalized Array Translator (PAT)
IV.6.9. CULLER-FRIED SYSTEM 253
The Culler-Fried system is one name for two physically separate but
direct descendants of the system developed by Glen Culler and Burton
Fried at Thompson Ramo Wooldridge, Canoga Park, California, begin-
ning in 1961 [Culler, Fried [CU63]; [CU65]]. The first of these is the
On-Line Computer System (OLC) at the University of California at
Santa Barbara (UCSB) [Winiecki [WN66]] which operates on the same
computer as the original system. The OLC system is used for research
and teaching on the Santa Barbara campus as well as from remote ter-
minals at UCLA and Harvard. The second, an expanded version of the
original system, has been implemented at TRW Systems (formerly
Space Technology Laboratories) in Redondo Beach, California for the
use of scientists and engineers and has been operating since late 1964
(Fried, Farrington, Pope [FQ64], Fried [FQ66]]. The original system, which
in some ways was more sophisticated than the present versions, was
254 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
24 Ruyle, Brackett, and Kaplow [RU67], pp. 151-52, but presenting the reference
citations in the form that is being used in this book. By permission of Association for
Computing Machinery, Inc.
25 Culler [CU65], p. 70.
26 Based on examples in Culler and Fried [CU65], pp. 71-72.
IV.6.10. DIALOG 255
ber, say 99. Until this number is changed, operations will deal with functions
represented by 100 points. To define a variable T with the range 0 < T < J,
the following 10 keys are pushed:
IJ+ 10.5 = T
which defines the variable T. To compute functions of T, the LOAD BUTTON
and the subsequent appropriate keys are pressed. For example, to form
S = sin 4e”
IV.6.10. DIALOG
played on the screen; these consist of the 26 upper-case letters, the 10 digits,
and the following special characters:
i!™N
x
A Vv
Clit+
A
) I
Ay
—
~o
e
’ 4
\
The characters [~ and <= represent space and backspace, respectively. The
2 is used to remove all characters from the line being created.
The DIALOG interpreter accepts and acts on one character at a time.
The character is shown on a line on the screen immediately above the display
of the character set. Then the system determines what the legally allowable
next characters are and displays only those on the screen for the user to
choose from. The screen permits the display of portions of the program in
addition to the line being created. A summary of the language elements is
given in Figure I[V-19.
There is a list of key words, and each is surrounded by '. Wherever
logically possible, the system will automatically provide the whole word
when the initial character is given. Thus, if 'P is entered, the system auto-
matically supplies LOT' since this is the only legal sequence permitted after
the 'P.
Variable names begin with a letter followed by up to five alphanumerics.
One or two subscripts are permitted, where any expression can be used and
the value of the expression is rounded to an integer. Subscripts are enclosed
within square brackets and separated by a comma. Literals are delimited by
square brackets; the context distinguishes between literals and subscripts.
Statements can be entered with a line number for later execution or
without a number for immediate execution. The numbers can contain a
decimal point. Sequence of execution is based on the value of the statement
number. All statements are terminated by a semicolon. Comments are of
the form
prepared off line, normally consisting of a stored program. The SAVE pro-
gram causes punching out on paper tape of the stored program in a form
suitable for reentry by the LOAD command. A WRITE command prepares
a magnetic tape for off-line printing.
There are no declarations required, even for type or dimension informa-
tion.
IV.6.11. AMTRAN
SAMPLE PROGRAM—AMTRAN?t
RUN,B=H Z,Y=Y1+8B/2.
RUN,C=H Z,X=X+H/2,Y=Y1+C.
RUN,D=H Z,Y2=Y=Y1+(A+2 B+2 C+D)/6.
RUN,A=H Z,X=X+H/2,Y=Y2+A/2,G=A.
10. RUN,B=H Z,Y=Y2+B/2.
11. RUN,C=H Z,X=X+H/2,Y=Y2+C.
12. RUN,D=H Z,Y=Y2+(A+2B+2C+D)/6,RUN,D=H Z.
13. E=ABS(Y—Y1—(F+4 G+D)/3)/(.000001 ABS Y+A1), F=LOG MAGNITUDE K+1.
14. IF E GT 1, THEN X=X—2H AND Y=Y1 AND IF E GT 2,H=H/(EXP(F LN
1.5848931))
14.¢C AND GO TO 3,OTHERWISE H=H((.5/E)*«x.2) AND GO TO 3.
15. IF E LT=.016,THEN H=2 H,OTHERWISE H=H((.5/E)*x.2).
16. J=0,REPEAT N,Y3 SUB 1=Y2 SUB J AND [=!+1 AND J=J+1.
17. J=0,REPEAT N,Y3 SUB I=Y SUB J AND I=I+1 AND J=J+1.
18. GO TO 3.
19. Y3.
20. NAME.THIS RUNGE] 104.
Seitz, Wood, and Ely [UV67]. By permission of the Association for Computing Machin-
ery, Inc.
assign these to a specific button. One version of the system called the
Sampler uses only the regular console typewriter and card reader of the
1620; mnemonic labels are used to call the operations otherwise provided
by the special keyboard. It is the (larger) combined system which is being
described here. It includes 5-inch display scopes. The program (or other
desired information) can be displayed on the scope and also printed as hard
copy.
The typewriter has the following character set (in addition to the 26
upper-case letters and the 10 digits):
4+Vv™
xX
eA +
~ t V#
||
ae
_
~w
260 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
Greek letters:
0 xX
gv w
Miscellaneous characters:
So fIAV
The special keyboard contains at least the buttons shown in Figure
IV-20. The meaning of some of these is discussed later.
The system is said to be approximately equivalent to FORTRAN II
in overall capability (although definitely not in notation), plus of course
having all the additional facilities from the push-button keyboard. Although
provides “picturebook” integer and floating point formatting, it does not
afford the extensive formatting capabilities of FORTRAN II nor does it allow
for fixed point or variable-precision arithmetic.
A data name can consist of a single letter, one of six Greek letters, or
a letter followed by up to three digits. (This permits implicit multiplication.)
Subscripts are permitted and can themselves be subscripted. However, they
are designated by following the variable name with the word SUB, e.g.,
Y SUB I. Any operand read into the system is dimensioned automatically,
and array arithmetic is performed automatically in future operations. Thus,
if B has been defined to be an N-dimensional vector, then multiplying a
scalar A by B will automatically cause the result to be an N-dimensional
vector.
The assignment statement in AMTRAN 1s denoted by an =. The con-
ditional statement is of the form
Mathematical Operators
= STEP.FCT
1+
Af CUBIC
Ab
lt~x
SUM.OF.SERIES
ERF
d/dx LAPLACE
Array SOLVE
S*
Input-Output Operators
262
Special Variables and Data Operators
ar REG
DMR
§ ‘ (prime)
7 INSERT
HMR
X.MIN CONCATENATE
X.MAX SORT
BOD
INTERVALS ORDER
ROW
Special Operators
Complex Routines
263
264 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
IV subroutines may be added to the system. Input and output were initially
limited to card, printer, and the console keyboard/printer.
This system seems to have a great many excellent features combined
in a convenient way. The fact that it can be implemented on a small computer
gives it a reasonable possibility of becoming a significant language (system.)
As noted in all the languages described earlier in this chapter, the user
is seriously handicapped, both in writing the language and looking at the
form in which it is put into the computer, by the constraints of the hardware
equipment that has been most commonly available, namely the key punch.
The use of a typewriter has proved of some advantage because of a larger
character set, but it still does not provide naturalness of notation. The pri-
mary disadvantage is the lack of two dimensions, which would permit
subscripts and superscripts to be written where they belong. There have
been small but significant efforts devoted to developing languages which
have a format that is closer to normal mathematical notation. Because the
inherent difficulty is one of hardware rather than software, each system has
involved either the construction of a special typewriter or the major modi-
fication of existing equipment.?®
In discussing languages with natural mathematical notation and
nomenclature, there are three factors which should be kept in mind. The first
are the notational problems which can be corrected or improved by special
equipment. In this category fall such things as the ability to write exponents
above and subscripts below the line; ease of displaying fractions; and
existence of special symbols such as partial differentiation, integral, and
sigma signs. The second factor involves ease of learning and writing programs
in the language. This can be relatively independent of the hardware facilities.
In particular, some work was done under my direction to see how natural
a language could be defined using only key punch equipment (Boyer
[QI65]). The third factor, namely ease of readability, is more readily achieved
than ease of learning and writing. Reading and understanding a program
which was written based on use of this special equipment is usually quite
28 Since writing this, a manual for a system called MAC-360 has appeared ([MT67]).
This system basically provides the user with three input lines for a single equation in a
manner that can be keypunched, as shown by the following example (from page 1 of the
manual) to represent the equation R; = A?e?* + Bie-2
E 2 2 Pl 2 —2 Pl
M R =A E + BE
Ss 1 l I
IV.7.2. COLASL 265
simple; whereas at least in the COLASL case (Section IV.7.2), the rules for
writing it are extremely complicated. It is my contention that a mathematical
language (for use on computers) which is truly natural in notation and
nomenclature will convey to a prospective user about 85 percent of the
information that he needs to write correct programs merely from a large
series of well-chosen examples. This hypothesis assumes the user is not trying
to trick the system and is not making any effort to obtain maximum efficiency.
A partial proof of this contention is given by the two-page manual of Klerer
and May (Section IV.7.5).
All the systems in this section involve special hardware, and they have
usage limited to one or just a few places. They are included because they
represent a significant potential direction for development of more natural
languages. The primary interest, however, is due to the special input/output
characteristics and not the new language concepts. With the exception of
some facilities in MADCAP (Section IV.7.3) which are significant and
have not appeared in any major way elsewhere, the languages in this section
do not provide conceptual new ideas. However, the availability of special
input/output equipment coupled with concepts that are impractical on stan-
dard equipment could eventually cause a major breakthrough in languages
for scientific problems.
IV.7.2. COLASL
COLASL is one of two systems which were developed at the Los Alamos
Scientific Laboratory of the University of California; the other is
MADCAP (Section IV.7.3). They were developed by different groups, and
COLASL tended to be used in a more production-oriented environment
than MADCAP. Source materials available for COLASL are the paper by
Balke and Carter [BQ62] and the unpublished programmer’s manual by
Carter, Balke, and Bacon [CA63]. COLASL runs on the IBM 7030
(STRETCH).
COLASL is moderately general and has very good notational facilities
for mathematics. It is easy to read a written program, but the specifications
on how to write programs are very complicated. |
The application area is numerical scientific problems. The language is
procedural and problem-solving. It is a hardware language for use with
special equipment (described below) but it is also a good publication lan-
guage. The intended user is a nonprogrammer.
The language is completely designed for use with special prototype
hardware known as the IBM-9210 Scientific Descriptive Printer (4) which
was available at Los Alamos in May, 1961. It contains 132 characters, many
of which can be easily combined to provide additional symbols, and 15
266 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
carriage control functions, including the ability to turn the carriage up and
down for superscripts and subscripts. Because of the special hardware and
the localized usage, all other functional characteristics are insignificant
except that the language was designed and implemented by the same people,
and seems to have been useful.
The COLASL character set is shown in Figure IV-21. All the items in
v&tn PTP XY @ pb FE
TrT@®A® Q Algebraic Symbols
ae Characters
Superprinting +: —- xX ° f/f =F > < Vv
++ 2 728s ¢ F¢
0
Special Symbols
Overprinting Characters A od # +
P =u
Rl°
B+
@
the alphabet are either direct characters on the typewriter or can be formed
from them, e.g.,
= - £#
There are 16 key words, namely and, attach, end, exit, for, from,
function, go, if, or, range, routine, stop, then, through, to. The graphic
operators and punctuation symbols appear in Figure [V-21. The formation
rules for data names and program unit labels are significantly different.
Data names consist of a single letter (in the extended sense of Figure IV-21),
together with descriptive subscripts, and this string may be prefixed by either
a A or Q. The total length must not exceed eight symbols. For example,
the following are data names:
IV.7.2. COLASL 267
A AB OW 74
Ynut Ag Com3g4
Statement labels contain eight or fewer characters and are of two different
forms: (1) The # followed by one to seven digits; (2) an extended letter
followed by extended letters or digits, with or without a numeric subscript.
Examples are as follows:
#012 #1234567 #3
The reserved words can be used for statement labels since the latter appear
in a fixed place, but it is not advisable. Variables can have descriptive and
numeric subscripts. The former are for mnemonic purposes only. The latter
are variable or constant subscripts to denote elements in vectors or matrices,
and they are separated by commas. There is no stated limit to the number
of subscripts, and they can be subscripted but the expression must all fit
on one line. Subscript variables can have constants added to them and can
take on negative values.
The operators are not clearly defined as such, but they are the fairly
obvious ones from the COLASL alphabet shown in Figure IV-21. Note
particularly the square root symbol, which is an operator with the obvious
meaning. The delimiters are the punctuation marks and some of the reserved
words. The punctuation characters are those shown in Figure IV-21, and
although a sentence can (and must) be terminated by a period, exclamation
point, or question mark, there is no syntactic distinction among these.
Commas, colons, and semicolons are also used for punctuation. Blanks may
not be used in some places but are permitted in others. Use of noise words
is permitted ; however, see the discussion on comments in the next paragraph,
and on p. 269. The only literals that are permitted are numeric constants.
The input form is an interesting combination of very natural free form
but with three fixed fields prior to the main part of the statement. The first
field cannot be used, the second one denotes class, and the third contains the
statement name. The reason for choosing this format was to permit the
programmer to interject statements from the STRETCH assembly program
into a COLASL program. The only reason for the class column is to permit
markers which cause the compiler to ignore the material between them.
The conceptual form is maximum naturalness, partially caused by the free-
form interspersion of comments with the meaningful program. The following
device to accomplish this has been used: The programmer writes his
program using a red pencil and a black one. Everything appearing in red is
268 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
We wish to find those equations which have real roots, and print their coefficients
and roots; and to print the coefficients of those equations having complex roots. Let
there be a marker, m, for each equation such that mi = 0 if the roots are real and
mi =1 if the roots are complex. We read (according to format F1) the number of sets
of coefficients, |. \f (10 or I>100) then the data are incorrect, and we stop. Otherwise
we read (per format F2) the coefficient triples, a(i), b(i), and c(i); we also set the initial
value of each m;=0, for (i==1, 2, ..., 1).
We now compute the discriminant of the current equation, which we will call d, from
#1 d=b? — 4aijcj.
If (d<O) then mi=1, and we continue from #2. Otherwise, we compute the roots,
Xpos and Xneg, from the relations:
Xpos;
_= bi +
oa,
vd
Xneg, _= ~—bi — vd
a
#2 To complete the calculation repeat the above from #1 for (i=I, I—1,..., 1).
The subscripted variables have the ranges: 100 to 1 for a, b, c, m, Xpos, and
Xneg. When the calculation is complete, print ( format F3) which provides headings; then
print the coefficients and roots as indicated in the following.
#3 If (mj=0) then print (using F4) each of the variables, ali), b(i), c(i), xpos (i), and xneg (i);
then proceed from #4. Otherwise, print (per F3), the variables a(i), b(i), and c(i).
#4 Do everything from #3 for (i=1, 2, ..., 1); then stop.
Fl is the format for reading I. It is (EO*3).
F2 is the format for reading the coefficients and printing them where the roots are complex.
It has the form (3€2.1.13.3).
F3 is the heading format, (SO, X27, HkCOEFFICIENTS*, X50, HkROOTSx*, 52).
F4 is the last format, which controls printing of coefficients which have real roots. It is
(3E2.1.13.3, X3, 2E2.1.13.3). To make it accessible to the input-output package, we
attach i fo an index register; this is the end of the problem.
Loops can be written in three ways. Both functions and subroutines in the
FORTRAN sense are permitted. COLASL has an extremely flexible method
of specifying comments because any material which does not conform to
defined syntactic units in the language is treated as noise and discarded.
However the designers quite wisely caution the user to use some dis-
cretion in taking advantage of this facility, because it is easy to change the
meaning of a program by inserting an extra key word or a punctuation
mark in a critical place (i.e., the user might inadvertently create correct
syntactic units even though he was only writing commentary). To avoid this
difficulty, the use of the red and black pencils as described earlier 1s recom-
mended.
Assembly language can be written in the midst of COLASL programs
and will be appropriately handled.
The only types of data variables and constants are arithmetic. “An
expression in the COLASL language is translated into a machine code which,
when executed, will produce the same number for the value of the expression
as a human computer might be expected to produce if he worked to the
same significance as the machine.”®
The most interesting aspect of COLASL is the flexibility of the expres-
sions which can be created. Examples are given in Figure [V-23. There are
complicated rules for creating these expressions so that the scope of under-
lines, radical signs, absolute value signs, etc., 1s correctly defined. Since
variable names are only a single letter, juxtaposition can be used to denote
multiplication.
There are two kinds of assignment statements, called algebraic and
parametric. Algebraic is the standard type, but it also allows multiple naming
on the left-hand side, e.g., X=Y=C+5. The parametric type is identified by the
equivalence sign, e.g., g=l + 5. Parametric variables must ultimately be
defined in terms of constants; they are evaluated at compilation time.
Unconditional control transfers are written as either GO TO #5 or
FROM #S, which are equivalent. A GO TO statement appearing at the begin-
ning of the sentence has its action deferred until the end of the sentence.
Thus, in GO TO #3, X=5 the variable X will be assigned the value 5 before
transferring control to statement #3. A facility for computing switch control
is provided. Functions are invoked from within expressions. Subroutines
are invoked by writing the name in a phrase under the same circumstances
as a key word. The conditional statement is of the form IF B THEN S, where
B has a truth value and § itself can be conditional; e.g.,
Division Exponentiation
ctdet+f) b+e | etf y3 -yt#3_— ez?
ghi(kk—1) dd g nty yt 4 9
Ap*Y yupz
4ac/37
lol—[b} $2815
or Knit |
(Ja}—]b])|
Subscripting with Constants
XO X25 Ptemp_.
Xi ;=3 cos(yi), (i=0, 1, ..., 5); z=] sin (jw;'*3), (j=5, 4, ..., 0).
library. The word EXIT is defined in functions and routines and has the same
effect as the RETURN statement in FORTRAN. The command STOP termi-
nates the execution of the program.
Dimension information can be written in a flexible format, called the
range sentence. It must contain the word range or ranges, and all the rest
of the clauses must be of the form
where the m; and p; represent constants or variable names and the vy; rep-
resent variables; the word and can precede v,. For example, the following
are legal:
IV.7.3. MADCAP
r. = jit 7 Ry
1 é
= . _ 37
for k — i, i+1, ooelvay! rk — —Ry
k = [(1/2)]; x = 71i+$
e
coef(r,,x)R,
Z* = Constant, +
1,J k J J
(Py4y)- (Fy)
#3000 (20 characters)Format = "ZH y=XXoXXX"
for i = 1 to 10
for j=1tov7
print by Format: 1, Jj, aX yj
T[MP64], Appendix I, p. 1.
272
IV.7.3. MADCAP 273
ware language for use with special equipment (described below) and also a
good publication language. The user is meant to be a nonprogrammer.
The language is completely designed for use with a modified Frieden
Flexowriter which records all the key strokes on a paper tape as well as
on the typed page. It does not have nearly the number of characters that are
available on the machine used with COLASL. Because of the special hard-
ware and the localized usage, the other functional characteristics are insignifi-
cant, except that the system appears to have been developed in an experi-
mental environment and undergone many levels of improvement.
The characters available from the modified Flexowriter may be printed
in red as well as black and are as follows:
There are also a number of control functions available as keys on the type-
writer. In particular, subscripts and superscripts can be placed where they
belong through use of control keys. As in COLASL, characters can be
combined to make syntactically meaningful units. The following are specif-
ically defined:
4 > FE Di
The graphic operators and punctuation symbols are shown in the list above.
There are a large number of key words in MADCAP.
Data names and program unit labels are defined quite differently. The
former can be one of five forms, with the constraint that the name can
contain only seven characters: (1) A single letter; (2) “letters” composed
from three basic characters, e.g., 8; (3) a capital letter followed by lower-
case letters, e.g., Count, Pb; (4) one of the preceding followed by digits,
prime, double prime, or asterisk, e.g.,a2*,B '', C291; (5) any allowable
name prefixed by A or #. The data name can be terminated by a space,
some form of punctuation, or arithmetic operators (including juxtaposition
for multiplication). Statement labels consist of the number sign, #, followed
by up to four digits; statement label variables can be subscripted. There is
a large list of key words in MADCAP, and the formation rules for data
names do not cause them to coincide. Where key words and products appear
to coincide, the compiler distinguishes between them from context. The key
words are usually written in lower case in programs but can be either initial
or all capitals. The latter will be used here for ease of reading. Data names
274 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
y=qsy = ytl
and
q>y; y+l7y
have the same meaning. There is also an interchange statement written with
two arrows; thus x«—y causes the values of x and y to be interchanged.
In the second example above, the positions of /eft and right side are obviously
reversed. It is possible to have several variables on the /eft side. Unlike most
other programming languages, if the modes of the variables on the two sides
differ, the one on the left is assigned the type of the one on the right, unless
there is a specific declaration to the contrary. Thus, writing Z = 14.2 would
cause Z to be assigned the real value 14.2, while writing (COMPLEX)Z=14.2
would assign to a complex number Z the real part 14.2 and the imaginary
part O.
There are no direct character-handling statements, although characters
can sometimes be handled by word-set operations (described below).
Unconditional control transfer is designated by go to, followed by
either a statement number or a variable taking on such values, e.g., go
to #17 or go to r. A procedure is invoked by giving the procedure title
followed by the arguments enclosed in parentheses, with the arguments
preceding a semicolon called by value and those following called by name.
A function call can appear within a statement or as a statement by itself.
Procedure calls are separate statements. Recursive procedures are not per-
mitted.
There are many forms for the conditional control transfer. The one
which is most similar to those in other languages 1s
IV.7.3. MADCAP 277
IF condition
statement-]
OTHERWISE
statement-2
next-statement
IF condition
statement
The words UNLESS, WHILE, or UNTIL can be used in place of IF. The con-
dition following UNLESS is the negation of the one following IF. The
WHILE causes recycling through the condition as long as it is true. The
UNTIL has the combined effect of an UNLESS and a WHILE. Thus the following
four examples are all equivalent:
#5 if A>2
B=C
go to #5
while A>2
B=C
#3 unless AS=2
B=C
go to #3
until A=2
B=C
which can only be used between real numbers and is written expr-l=expr-2
(mod expr-3); this permits such statements as
In the case where the final expression is omitted, the termination condition
IV.7.3. MADCAP 279
must be handled from within the range of the loop. In the third and fourth
cases, the increment is +1 unless expr] is a constant greater than expr2,
which is also a constant. In the fifth case, the increment is d2—d].
In addition to the cases above, the parameter variation can be defined
in terms of sets; in particular,
for i in S
for i in S'
for x in (0, 5, 23, 99}
for V Cc W
for V C W'
where V and W are sets and the ' denotes set complementation. Even a few
more variations are possible, but they will not be listed here.
There can be more than one parameter per loop-control statement;
they are separated by , as e.g.,
for i = 1 to I, as k in S, as j = O, 3,...
fori = 1 tol; k in S: A, = 2i
In the range of the loop there are no restrictions against entry or exit.
Furthermore, there is a loop back statement which causes control to return
to the incrementing and testing part of the loop control from a point other
than the physical end. Similarly, there is an explicit EXIT FROM LOOP
statement. For example,
for
i = 3, 5, ..., 21
a= b + ¢i
if a = m, loop back
if light 3 is on, exit from loop
subscript range: Do to 3, 0 to 11
Variables are assumed to be real, unless they are declared otherwise. These
declarations can be REAL, PRECISE (=double-precision), COMPLEX, MATRIX,
LABEL, and STRING. Sets are declared by WORD—SET and SET. The user can
specify the size of matrices by writing m COMPONENTS and the length
of the strings by writing n CHARACTERS. Each of these declarations is
enclosed within parentheses and written immediately preceding the variable
to which it applies.
Procedures and functions are declared through the use of the bracketing
symbols
(... and )
at the beginning and end, respectively. After the opening delimiter, the name
of the procedure is given, followed by the names of the variables in paren-
theses. The variables are separated by commas, with the call by value variables
first and that list terminated by a semicolon. If the procedure (or function)
will fit on one line, then it can be written this way:
Although the language was originally designed for use with numerical
scientific problems, the addition of the set theoretic notation and facilities
has made it quite suitable for work with combinatorial problems. It is
unfortunate that this feature, which is one of the significant technological
contributions of MADCAP, has not been made available to a larger group
of users.
It appears that even though the COLASL character set is larger, the
language specifications for it are much more complicated. This indicates
that sheer improvement in the hardware is no panacea nor any guarantee
of good language design.
IV.7.4. MIRFAC
begin
1 print title sample problem for miss jean sammet.
2 print 2 blank lines
rejects even k.
8 enter section prime
this section leaves s=-1 if k is prime and s=1 if k is composite.
9 jump to line 14 if s=1
10 f=v {3k+sink}
11 p,=h
add k to the list of primes
12 add 1 tor
13 jump to line 15
14 f=v{4k+cosk!
15 print k to 0 decs and f to 5 only
16 print word |
282
IV.7.4. MIRFAC 283
which begin with a verb and have all the necessary information as fixed
words but in an arbitrary order. Thus find by newtons method the root
near x=a of the equation is syntactically equivalent to find newtons method
root near x=a Or find in the equation the root near x=a by newtons method.
Note that this is an example of a very high-level command.
The input has all statement labels starting in the same column, followed
immediately by the statements, with a single statement per line.
The smallest executable unit is also the only one, namely a sentence
which begins with a verb in imperative form and contains one and only one
operand together with whatever qualifiers are needed to define the required
operation uniquely. The verb must appear first, but the other information
can be in any order. (See the example given above.) The sole exception to
beginning everything with a verb is in the assignment statements which can
be of the form variable=. Loops are handled by using if or cycle statements.
Comments are shown by typing in red, as are the names of mathematical
functions.
Data variables and constants can be numeric, alphabetic, or bit arrays.
Juxtaposition denotes multiplication. The computer COSMOS on which this
system runs has double-precision fixed point arithmetic. Computation 1s
mixed number, with 40 bits on both sides of the radix point.
The assignment statement is written in the form 0 = A + B, or
set 02=2, w=1/3. However, the technique of writing 0=0@+3 is not per-
mitted, and is replaced by add 3 to @. There are actually two kinds of
unconditional control transfers, designated by the words jump and return.
The former is used to go forward (i.e., to higher statement numbers), while
the latter goes backward, thus permitting the compiler to check such state-
ments. The most general form of return or jump instruction which
MIRFAC will accept is of the form return [or jump] to line N if ARB
where R is one of the comparison symbols =, #, >, <, >, <s. One
illustration of a loop control statement is given by the use of the word
tabulate in the two programs shown in Figure IV-24. Note that the print
set a = 0
—
d= fi 6 tan-! a dO
WN
statement shows the number of figures to be used and also permits differing
variables to be printed to differing degrees of accuracy.
All the mathematical function subroutines signal an error automatically
if one occurs, e.g., if the user tries to take the square root of a negative
number.
The @ is used to correct punching errors; if an incorrect letter or symbol
is punched, it may be followed at once by a m and then the correct symbol.
Two black squares effectively delete the entire line.
The system is used for mathematical work of various kinds, data reduc-
tion, design automation (using a plotter), and information retrieval.
4-1
1) Os Vc
FROM i=1 TO n COMPUTE y,= ——=+—______._ -
O54
n
Arithmetic operators: + — x / |
Relational operators: > 2= < = =
(with overtyping permitted, e.g., 4)
Punctuation: ~ , € ) blank
and 6 special characters. These latter, shown at the lower right corner of
Figure IV-25b, have been very carefully designed to permit combining and
hence the creation of symbols of arbitrary size. Even large-sized integral
signs can be created. Not only can the newly formed symbols be recognized
by the compiler, but the strokes can be typed in any order and need not
be combined neatly; e.g., in typing a summation sign, the lines that make
up the physical sigma as well as the indication of the limit can be typed in
any sequence.
REFERENCE MANUAL
Vocabulary List Subscripted variables need not be dimensioned when used in forms such
as:
ABS CARD END LN READ TANGENT
ABSOLUTE CARDS EOF LOG RETURN TANH (1) Aik= 85 Qi,k FOR k=0(2)20 AND i= 1 TO5
AND COMPUTE EQUALS LOOP REWIND TAPE or
ARC CONTINUE XP MAXIMUM ROUND THE (2) MAXIMUM n= 10, J= 15
ARCCOS = COS FILE MESSAGE SEC THEN
ARCCOSH COSECANT FINISH MINUS SECANT TIMES Aix= Bi Qik FOR k=4,5,.. WITHIN i=0 BY 3
ARCCOT COSH FOR OF SECH TO
ARCCOTH COSINE FORMAT SIN UNTIL n.
ARCCSC §=s- COT FORMULA OTHERWISE SINE TRUNCATE
ARCCSCH
ARCSEC
COTANGENT FRACTIONAL
COTH FROM
PART
PAUSE
SINH
SLEW
TYPE
UNTIL (3) ay, “T | cy,
ARCSECH CSC GO PERFORM SPECIAL UPPER 1,J=0
ARCSIN CSCH HEADING PLOT RT VARIABLE
ARCSINH CYCLE iF PLUS STATEMENT VARIABLES * (a) READ TAPE C, 2, 2, 10.
ARCTAN DIMENSION = INFINITY PRINT STOP WITHIN
ARCTANH DIVIDED LABEL PROCEDURE SUBROUTINE WRITE
BY DO LINE PROGRAM = SWITCH FROM i-E(BY F] tune G
CALL ELSE LINES PUNCH TAN
A period denotes the end of a statement or the end of an implied loop. FROM i =E TO G (Unit steps assumed)
Corrections can be made by overtyping or by pressing the control key FROM i =N BY 2.34 UNTIL A+B
ERASE when positioned over the error. FROM A=B+5 BY 2 UNTIL Q>20
Each program must be terminated by the statement END OF PROGRAM. FROM i =E TO INFINITY
or FINISH. Note: Any number of dots per-
More than one statement per typing line is acceptable. missible but no extra spaces
To continue a statement beyond the maximum typing length for one line, FOR i=-1,2,...,5 before terminating comma. The
press the carriage return as many times as desired. FOR j= 5(10)55 difference between the first
Names of variables with more than one character should be defined by a FOR i-0,.5,...,7-5 two numbers specifies the in-
SPECIAL VARIABLES statement before use. crement in the first FOR form.
A comma or the word AND may be used to separate computable state-
ments. FROM or FOR forms can be used either to begin or end a statement.
FROM i=1 TO 10 COMPUTE A;=B;+Cj4,, C;=Ai+,X AND D=SING;.
C;=A;= iB; FROM i=1 TO 10.
Superscripts and subscripts must be in straight line form but forms such
as (A*)? are permissible. FROM i=1 TO 10 COMPUTE A;=iB;.
Qh
arms of the sum symbol. The FOR ¢=0,5, ..., 90 WITHIN r=1 TO 10 AND o=1 TO § LOOP TO
operand of the sum should be FORMULA 6.
outside the symbol. The loop to be performed most often is the first one; the least often is
the last.
i=
Ay Ac Ags Acor i ve
1, JjxE READ = READ CARD =READ CARDS
READ A; FROM i=1 TO A,>15.
Card Format is free field; number of data points may vary from card to
DIMENSION A=(N,M). card and may be in either fixed or floating point form.
This indicates that A is an (N+1) by (M+1) array READ X.
DIMENSION B=40, Z=30, Q=(10, 50). READ A;, Bj4, FROM i=E UNTIL Aj = 93.643.
SPECIAL VARIABLE [S}]= DIMENSION
SPECIAL VARIABLES TEMPERATURE, HUMIDITY, PRESSURE,
COUNT, LBJ=(14, 200), ay=10. Data may be punched into cards in the following forms:
UPPER is used in the same manner as DIMENSION and SPECIAL 2 -2 1.596 +3.213 ~4.60 2.78T2[=2.78x10"]
VARIABLES except that the indicated arrays are stored in upper memory. 2.78T—2=2.78x1077] 2.78E—3[=2.78x10~*]
Each datum should be separated by at least one blank space and the
UPPER C, WEIGHT =56, K=(20, 30). value should be within +102’* and not exceed nine significant digits.
FROM rel UNTIL 4 COMPUTE B,=5-n. READ n. ae0, READ o. READ W. p=0.
PERFORM Her FOR rel UNTIL 5. READ Ay, B, FROM 1-0 TO n. FORMAA 1. READ x, ¥,- FROM Xe0 TO W READ uy, Vy-
awatl. IF asw GO TO FORMULA 1. 0O FORMULA 3 FROM x90 TO W.
4 4 4
(8, > *%) a Teas] . Sea=O. STATEMENT 1. fea, Pel. onl.
A= 4 +M . = Jet STATEMENT 2. PePxgy,, Babel. FROM Yex TO W COMPUTE secuyvy-
IF BSw THEN GO TO STATEMENT 2. paptu,o.
= e+ — PRINT X. FINISH,
SeS+Px, AND aea+l. FORMAA 3. PRINT p.
PRINT A, 1F wea GO TO STATEMENT 2. ENO OF PROGRAM.
286
PRINT X,i TAL Y,tA.BI, Z;- SIN(6;+Yi) FOR i=1,2,...,N. Use of the next forms eliminates the necessity of using ““DO"’ or ‘‘).OOP”
PRINT E, F {A.BI, X=GIAI. statements. Computable sub-statements within an implied loop are
PUNCH E, F 1A.BI, X= GIAl. separated by a comma or AND.
FOR i= 1(1)50 AND k=0 BY 2 UNTIL Y > 2000 READ Xix,
A and B are integers between 0 and 9 but their sum may not exceed 9. F
COMPUTE Y= 2X;,, AND PRINT Y.
and Y; will be printed (or card punched) with A places to the left of the
decimal point and B places to the right. The value of G and i will be FROM i=1 TO INFINITY READ X,, IF X;410 COMPUTE Y-Y+X,,
printed (or card punched) as an integer of A places. G will be stored in X. n=n+2 OTHERWISE GO TO STATEMENT 1.
E, and Z; will be printed (or card punched) in floating point form.
Superscripts that are red are used to form new characters rather than be-
PRINT Y=E {A.B.Cl. ing interpreted as exponents. The following is a short program to deter-
mine the maximum absolute value of a set of positive numbers \.
Same as above except that E is first divided by 10° to change its range.
oa
In the print statement a maximum of 8 expressions (including a blank FROM i=1 TO 100 IF |X;|>X™4* THEN XMAX= |X), fred)
between commas) are allowed. Each is centered in a 15 position field. In the following magnetic tape commands L is the number of elements in
the array V, T is the tape number and P is the controller (plug) number.
PRINT LABEL A, COUNT, X-Y, SIGMA (J).
PRINT LABEL =LABEL = HEADING = PRINT HEADING READ TAPE V,, T, P, L. The first L elements of the tape record is
Each label, separated by commas, in a PRINT LABEL statement may read into locations V, to V,.;.
be up to 15 characters in length and will be printed in a 15 position WRITE TAPE V,, T, P, 5. (Locations V2 — Vg ave written on tape)
field. A maximum of 8 labels per statement is permitted and should REWIND T, P. RWD T, P.
contain only those characters used on the high-speed printer. WRITE END OF FILE T,P. EOF T P.
IF END OF FILE P THEN... IF EOF PGOTO...
The PRINT FORMAT statement may be used when it is desired to mix
literals and answers or to have more than 8 answers per line. In the following example Y is the variable to be plotted, X is the ‘‘inde-
pendent index’’ (i.e. Y=f(X), A=the minimum value of Y and B=the
PRINT FORMAT n, E, F, X=G.
maximum value of Y.
FORMAT nv LLL...L xxxx LLL...L x.xx y.
PLOT Y, X, A, B. PLOT Z;, i, 0, 1 FROM i=1 TO 5657.
n is an integer of up to four places, LLL stands for any literals that are
printable on the high-speed printer. Small x’s are used to denote the
EXAMPLES
actual position and number of digits of fixed point quantities while one
small y is used for each floating point quantity. The first set of x’s READ A,, COMPUTE Yesy AND PLOT Y, 4, -1, 1 FROM 1=2
denotes the first expression/equation/variable mentioned in the PRINT A
UNTIL Y>1.
FORMAT statement, the second set of x’s denotes the second expres-
sion...etc. FORMAT statements may be located anywhere in a program: 1F a>k COMPUTE xm /(a-k)d , YeB, jX#CyT AND PRINT Y,
a, T, k, OTHERWISE COMPUTE xe2ak, YeB, ,x4CoTA AND PRINT Y,
PRINT FORMAT 12, 6;, SIN 0;, 4; = a FROM i=1 TON. a, T, k FROM a=) TO n WITHIN Te2 BY .O1 UNTIL 3 AND FOR
i0=0(5)90.
FORMAT 12 ANGLE (RADIANS)
=y SIN THE
TA =x.xxxx AND THE
ANGLE IS xxx DEGREES. FROM 11 TO 10 AND Jul TO 10 READ Ayy,
COMPUTE By yoAy #Xy4¥) AND PRINT Ay yy Byys Xyo Vyo 2, Je
If 6;=37/4 then the following would be printed on the high speed printer:
**ANGLE (RADIANS) = .23561945 1 SIN THETA = .7071 AND THE
FOR rel, 2, ..., 10 AND FOR Ge-1(.01)5 COMPUTE S.=rSINZe,
ANGLE IS 135 DEGREES.”’ C= \/r cos te, Ant, = TAN(.199@),
oe
SLEW N (Printer paper spaced N lines)
SLEW [[TO]TOP] (Paper will advance to top of page) TT LOG.e
‘= a
2
AND PRINT r, 0, V_, As
Messages on the typewriter or printer are printed using the following forms: gel A+ z
eee
TYPE NEGATIVE SQUARE ROOT. IF (X2¥ AND y>0) OR | 42=-7/e | > (x-¥)? THEN COMPUTE
PRINT MESSAGE (END OF PROGRAM) AND SLEW. Tyyr7 (eng)? AND We(YTy)T® AND PRINT Wy Tyys Xe FROM
IF F=G THEN GO TO STATEMENT 1. y=2k+3 BY .Olt UNTIL W>5800 AND FROM X=1 TO 100
IF F=G GO TO STATEMENT 1. OTHERWISE GO TO STATEMENT 2.
IF F=G THEN B=C+E.
IF F=G THEN READ... .
IF F=G THEN CONTINUE.
evse | E Hy
To define a procedure within a program:
IF F=G THEN... Go To SUBROUTINE (Name)
forsee COMPUTE ... - ++. PROCEDURE AME). cece cece eer ec cece eee e ence eeeees
AN CIMT)
T=r cos@ when i#j
T is not computed when i=j and mén. co ~~ - _ —_ - - -_
In case 2 T=r sin 6 when i=j and m=n
T=r cos6 when i=j and mén i7tsruate bot + t tf an | '
T is not computed when i#j. wwJ Lo Ce Ud led OL OL a |
GO=GO[TO]}
GO TO STATEMENT 20
PAUSE will cause the object program to go into a loop. Exit out of Suggested Reference Citation:
the loop will occur if console switch No. 0 is toggled. M. KLERER and J. MAY, REFERENCE MANUAL
Columbia University, Hudson Laboratories
Comments (non-computable statements) are entered between {| { symbols. Dobbs Ferry, New York
Revised Edition July, 1965
FROM i=1 TO 10 READ X;{READ VALUES}. This work has been supported by the Office of Naval Research and
Yli,jl=i+ 12]. the Advanced Research Projects Agency under Contract Nonr-266(84)
8
n
retype the corrected statement after the computer message A000040 e=f
has been typed. A0000S0 g=h
A0N00060 k=1
READ ready
When input data is expected by the program, the word "INPUT" FINISH.
is typed, and the data may be typed in any of the linear .10000000
. 20000000
ee ee
forms used for card input. Corrections may be made in the
usual manner. Pressing the "TAB" key erases the entire . 30000000
line of data. The input data is terminated by pressing .40000000
the carriage return key. - 50000000
- 60000000
IMAGE what mode
“IMAGE” and ''FORMAT'" are similar but for the fact that an
"IMAGE" may be any two-dimensional construction. As in
"FORMAT", output data is represente y small x's for
fixed point and a Small y for floating point format. The
left-uppermost output data fields are given precedence. OFF-LINE USAGE
Example. i To edit a program off-line by paper tape, set console
PRINT IMAGE 1, A, B, §, i, ) r, i, J switch 18 and read in the program tape. When the paper
tape has been read in "toggle 19" is automatically typed
x r=0 on the console typewriter. Place new paper tape
A _ XXX.XX L containing additions and correcticns in the paper tape
r=xxx THE SQUARE ROOT
IMAGE 1 B” xx.xxx > ¥ ) reader and toggle switch 19. After all corrections
— OF x EQUALS y.
r=0 have been read in, lift switch 18 and toggle 19 to
Note: The "IMAGE" is not permanently stored with the compile the program. Note that each time switch 19 is
object program and therefore the program must be run toggled a revised program listing is printed. All
immediately after compilation. editing should refer to the last (most recent) revised
listing.
All other output which usually goes to the printer or
typewriter is aiso typed on the Flexowriter, i. e., PLOT, To define a function:
~
PRINT, PRINT FORMAT, PRINT LABEL, etc.
Name / =f£
FUNCTION Name (X,Y,Z,...) .
Pressing the "carriage return" key answers all toggle 0
requests and overrides the PAUSE instruction.
The program may be interrupted in two ways during execution. E may include previously defined functions. X, Y, Z,...
(1) Press the tape feed button to restart the program. are dummy variables local to the function definition.
(2) Press the stop-code key to stop execution and call 2 arguments of the function name, if any, may include
the compiler. a replacement operator.
FINISH
The range of FOR and FROM statements may be delimited
Typing "FINISH.'' causes the edited or listed program to by parentheses.
be compiled. The last compiled program is always available
for editing or listing.
INSERT
Suggested Reference Citation:
To insert a statement or a set of statements after statement
A000030, for example, type “INSERT A3Z.™ followed by the Working notes addendum (Jan. '66 edition) to:
statement(s). To insert a statement(s)} at the beginning of M. KLERER and J. MAY, REFERENCE MANUAL
the program, i.e. before statement A000010, type "INSERT Columbia University, Hudson Laboratories
A4."" followed by the statement(s). Dobbs Ferry, New York
Revised Edition July, 1965
288
IV.7.5. KLERER-MAY SYSTEM 289
where rel is one of the relations <, <, =, >, 2, and S, and S, can be
one of the statements Y=..., READ, COMPUTE, GO TO, CONTINUE, or
IF; OTHERWISE can be used in place of ELSE. Parentheses may be used to
define the scope of subsidary JF statements. More complicated logical
expressions can be used, thus allowing something of the form IF B-expression
THEN S, ELSE S, where B-expression is any combination of relations
separated by AND and ORs. Parentheses (rather than precedence rules)
are used in case of ambiguity, e.g., IF A=G OR (E<S AND C<D<F) THEN
(IF Q=R SIN?0 THEN P=Q) ELSE P=R COS260.
Loops are controlled in one of several ways, namely through the
FROM, FOR, or DO statements. The words FROM, WITHIN, and AND
are functionally equivalent and are used to define a loop whose range is
exactly the sentence containing the loop specifications. The words DO, LOOP,
and CYCLE are equivalent to each other and to conventional loop control
statements. The parameter and terminating information can be controlled
in several ways as follows:
C, = An + 5S FROM n = 4 BY 2 UNTIL 12
C, = A, + 5 FOR n = 4 (2) 12
IV.7.5. KLERER-MAY SYSTEM 291
followed by the body of the subroutine. The word RETURN is used to indicate
each branch back to the calling program; there can be as many as needed.
There are several options for indicating the end of the subroutine.
While there are no specific debugging statements in the language itself,
there are some separate ones for use with batch and on-line programming.
The system is designed to provide the user with a significant amount of
information. In particular, because the user can write statements which have
more than one interpretation, the system prints out in a modified language
the particular interpretation that has been given. The user can then decide
whether the system has chosen the correct meaning. For example, in Figure
IV-26, there are a number of ambiguities. Not only is A; ambiguous, but
the argument of SIN might be A or A COS B. Similarly, the argument of
CSCH— is either A or A—L but which is not obvious. In the summation
statement, it is not clear whether M is within the summation or not. In this
particular instance, the system interprets L and M as outside the argument
of the CSCH~! and the sigma, respectively, but it does interpret Aj as a
two-dimensional array. In differing contexts, different decisions might be
made by the compiler. Thus every attempt is made to provide the user with
reasonable information and judgment.
Y=SIN A COS B,
-
Z=SEC TAN “1 ABB°
A=CSCH7! A -L,
C=A/2B.
E=LOG,, ek+1
.,4P* + =2°
ade002 YeSIN(ajeCOS(B)
ado00s ZESECCARCTAN(((A)/(20B))))
aoo004 ABARCCSCHLA)
oL
400006 C8A/2eB
FINISH.
Thus, except for what is outlined in... {the reference manual] we are
asking the user to “play the game” without first telling him all the rules
of the game. He learns whatever rules he needs depending on the type of
game he plays, i.e. the type of problem he presents. In the first place,
the immediate output of the system is a detailed presentation of how the
system interprets his presentation of the problem. If the system inter-
pretation is in disagreement with the intention of the user, then the output
indicates that he should retype the questionable statement (to which the
system assigns a code number) in a more explicit form.*!
IV.8. MISCELLANEOUS
There are a few languages and/or concepts which seem worth mention-
ing very briefly, but they do not conveniently fit into one of the preceding
sections. Hence they are lumped together here in a miscellaneous section.
IV.8.1. CORC
There are 43 reserved words. Data names and statement labels each can
consist of up to eight nonblank characters and are terminated by a blank
or special character. All arithmetic is done in floating point, although
31 Klerer and May [KL64], pp. 291-92. By permission of Association for Computing
Machinery, Inc. .
IV.8.1. CORC 295
numbers can be input with the decimal point in any desired place. Variables
can have one or two subscripts, and subscripts can be nested to any depth.
The relational operators allowed are EQL, NEQ, LSS, LEQ, GTR, and
GEQ.
All executable statements start with a key word. The assignment state-
ment starts with the word LET. In addition, the statements
can be used, and the abbreviations INC and DEC are permitted.
Control transfer is designated by GO TO statement-name. The con-
ditional control transfer is one of the following forms, where R is one of the
relations listed above:
where the latter is a triplet as in the ALGOL for statement. The label which
appears in the REPEAT statement is used to define a closed subroutine,
delimited by BEGIN and END using the same label with each. The user writes
label BEGIN
body of subroutine
label END
no direct parameter passage, and each variable name has the same meaning
throughout the program.
READ and WRITE statements provide for input and output of variables.
Comments are denoted by NOTE, and the program ends with a STOP state-
ment. A TITLE command causes the printout of the remainder of the card
and continuation cards.
The user is required to declare al/ his variables at the beginning of the
program and to specify the dimensions for the subscripted variables.
IV.8.2,. OMNITAB
and all words in a statement but the first are optional. The meaning is pre-
sumed to be intuitively obvious unless specifically shown.
Matrix operations
DUPLICATE 49 1 11 1 5 INTO 2 ll
ACC O. le 41
ACC O- 2 42
ACC 3 0. 43
MULT 2 @Y 2 BY .5 43
MULT 2 BY 3 44
RAISE 2 TO 3- POWER MULT BY .16666666 ADD TO 44
MULT .5 3 4
MULT 3 BY 4 45
RAISE 2 TO 4. FOWER MULT BY .04166667 ADD 45
MULT 2 2 4 45
ACC 1. O- 20
BEGIN
EXPAND COL 11 TO 4TH POWER IN STEPS OF 1 START STORING IN 21
INCREMENT 1 BY 10 0 0
AMULT 1 20 50 5 BY 1 41 1 26
RGWSUM COLS 26 27 28 29 30 STORE 31
INCEX 4 BY l
FINISH
REPEAT 15 5
HEAD CCL 1/ T
HEAD 31/ 100.
HEAD 32/ 200.
HEAD 33/ 300.
HEAD 34/ 400.
HEAD 35/ 500.
FIXEC 5
PRINT 1 31 32 33 34 35 1
STOP
297
298 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
Special functions
Bessel functions
Special operators
Control operations
Note that in the fourth case the existence of input equipment which would
permit a sigma symbol would make the statement an entirely natural mathe-
matical one.
Obviously, in order to permit the user to provide less detailed informa-
tion about his statements and their sequencing, algorithms are needed for
examining the program and translating it. One attempt at this has been made
by Homer [HM66]. In this system the user provides (1) arithmetic statements
defining the problem area, (2) statements to define the available and desired
data, and (3) control statements. Information from all these statements is
entered into a matrix. For the arithmetic statements, the variables from
the right side are put into rows and the left side variables are entered into
the columns. Variables needed for input or output [category (2) above]
are entered into rows. Each column is marked as to its nature, and each row
is marked to show the availability of the variable it represents, e.g., in storage,
input, and to be computed. The matrix then is scanned to determine what
can be done.
REFERENCES
IV.2.1.2. Speedcoding
[BS54] Backus, J. W. and Herrick, H., “IBM 701 Speedcoding and Other
Automatic Programming Systems”, Symposium on Automatic Program-
ming for Digital Computers, Office of Naval Research, Dept. of the
Navy, Washington, D.C. (1954), pp. 106-45.
[BS54a] Backus, J. W., “The IBM 701 Speedcoding System”, J. ACM, Vol. 1,
No. 1 (Jan., 1954), pp. 4-6.
[IB53] Speedcoding System for the Type 701 Electronic Data Processing
Machines, IBM Corp., 24-6059-0 (Sept., 1953).
[AD54] Adams, C. W. and Laning, J.H., Jr., “The M.I.T. Systems of Auto-
matic Coding: Comprehensive, Summer Session, and Algebraic”,
REFERENCES 301
IV.2.1.5. BACAIC
[GR55] Grems, M. and Porter, R. E., A Digest of the Boeing Airplane Company
Algebraic Interpretive Coding System, Boeing Airplane Co., Seattle,
Wash. (July, 1955).
IV.2.1.6. PRINT
IV.2.2.2. UNICODE
[PR57] Perlis, A. J., Smith, J. W., and van Zoeren, H.R., Internal Translator
(IT)—A Compiler for the 650, U. of Michigan Statistical Research Lab.,
Ann Arbor, Mich. (Jan., 1957).
[PR57a] Perlis, A. J. and Smith, J. W., “A Mathematical Language Compiler”,
Automatic Coding, Jour. Franklin Inst., Monograph No. 3, Philadelphia,
Pa. (Apr., 1957), pp. 87-102.
IV.3. FORTRAN
[1B57] Programmer’s Primer for FORTRAN Automatic Coding System for the
IBM 704, IBM Corp., 32-0306-1 (1957).
[B58] FORTRAN II for the IBM 704 Data Processing System (Reference
Manual), IBM Corp., C28-6000 (1958).
[1B60] IBM 709-7090 FORTRAN Monitor, IBM Corp., C28-6065 (1960).
[IB61] FORTRAN (General Information Manual), IBM Corp., F28-8074, Data
Processing Division, White Plains, N.Y. (1961).
[IB62] IBM 1620 FORTRAN (Reference Manual), IBM Corp., C26-5619-0
Data Processing Division, White Plains, N.Y. (1962).
[[B64a] IBM Operating System/360: FORTRAN IV, IBM Corp., C28-6515-2,
Data Processing Division, White Plains, N.Y. (1964).
[IB66h] IBM 7090/7094 IBS YS Operating System—Version 13: FORTRAN IV
Language, IBM Corp., C28-6390-3, Data Processing Division, White
Plains, N.Y. (Apr., 1966).
[1C62a] “General Panel Discussion: Is a Unification ALGOL-COBOL,
ALGOL-FORTRAN Possible? The Question of One or Several Lan-
guages”, Symbolic Languages in Data Processing. Gordon and Breach,
New York, 1962, pp. 833-49.
[JU65] Junker, J. P. and Boward, G. R., “COBOLvs. FORTRAN: A Sequel”,
Datamation, Vol. 11, No. 4 (Apr., 1965), pp. 65-67.
[M067] Moulton, P.G. and Muller, M. E., “DITRAN—A Compiler Empha-
sizing Diagnostics”, Comm. ACM, Vol. 10, No. 1 (Jan., 1967), pp. 45-52.
[MR65] McCracken, D. D., “How to Tell If It’s FORTRAN IV”, Datamation,
Vol. 11, No. 10 (Oct., 1965), pp. 38-41.
[OL65] Olsen, T. M., “Philco/IBM Translation at Problem-Oriented, Sym-
bolic and Binary Levels”, Comm. ACM, Vol. 8, No. 12 (Dec., 1965),
pp. 762-68. ;
[OS64] Oswald, H., “The Various FORTRANS”, Datamation, Vol. 10, No. 8
(Aug., 1964), pp. 25-29.
[QH66] Budd, A. E., A Method for the Evaluation of Software: Procedural
Language Compilers—Particularly COBOL and FORTRAN, Mitre Corp.
(DDC) AD651142, Commerce Dept. Clearinghouse, Springfield, Va.
(Apr., 1966).
[RM62] Robbins, D. K., “FORTRAN for Business Data Processing”, Comm.
ACM, Vol. 5, No. 7 (July, 1962), pp. 412-14.
[RN62] Rabinowitz, I. N., “Report on the Algorithmic Language FORTRAN
II’, Comm. ACM, Vol. 5, No. 6 (June, 1962), pp. 327-37.
[RO61] Rosen, S., “ALTAC, FORTRAN, and Compatibility”, Preprints, ACM
16th Nat’l Conf., 1961, pp. 2B-2(1)-(4).
[RO65] Rosen, S., Spurgeon, R.A., and Donnelly, J.K., “PUFFT—The Purdue
University Fast FORTRAN Translator”, Comm. ACM, Vol. 8, No. 11
(Nov. 1965), pp. 661-66. (Also in [RO67].)
[SA65] Sakoda, J.M., DYSTAL Manual— Dynamic Storage Allocation Language
in FORTRAN, Brown U., Dept. of Sociology and Anthropology, Prov-
idence, R.I. (1965, revised).
[SY67] Shantz, P. W. et al., “WATFOR—The University of Waterloo FOR-
TRAN IV Compiler”, Comm. ACM, Vol. 10, No. 1 (Jan., 1967), pp.
41-44.
304 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
IV.4. ALGOL
[AC66] “Collected Algorithms, from the Comm. ACM”, Association for Com-
puting Machinery, Inc., New York (1966ff.).
[AR61] Arden, B. W., Galler, B.A., and Graham, R.M., “Criticisms of
ALGOL 60” (letter to editor), Comm. ACM, Vol. 4, No. 7 July, 1961),
p. 309.
[AU67] Auroux, A., Bellino, J., and Bolliet, L., “DIAMAG: A Multi-Access
System for On-Line ALGOL Programming”, Proc. SJCC, Vol. 30
(1967), pp. 547-52.
[BH62] Bottenbruch, H., “Structure and Use of ALGOL 60”, J. ACM, Vol. 9,
No. 2 (Apr., 1962), pp. 161-221.
[BN64] Baumann, R. et al., Introduction to ALGOL. Prentice-Hall, Inc., Engle-
wood Cliffs, N.J., 1964.
[BS60] Backus, J. W., “The Syntax and Semantics of the Proposed International
Algebraic Language of the Zurich ACM-GAMM Conference”, Proc.
Internat’! Conf. Information Processing, UNESCO, Paris, 1959, R.
Oldenbourg, Munich; Butterworths, London, 1960, pp. 125-32.
[CCS9] “Recommendations of the SHARE ALGOL Committee”, Comm. ACM,
Vol. 2, No. 10 (Oct., 1959), pp. 25-26.
[CC61] “ACM?’s ALGOL Resolution”, Comm. ACM, Vol. 4, No. 11 (Nov.,
1961), p. 476.
[CCéla] “ALGOL References in Communications of the ACM, 1960-61”, Comm.
ACM, Vol. 4, No. 9 (Sept. 1961), p. 404.
[CC6lb] “SMALGOL-61”, Comm. ACM, Vol. 4, No. 11 (Nov., 1961), pp. 499-
502.
[CC63a] “ALCOR Group Representation of ALGOL Symbols”, Comm. ACM,
Vol. 6, No. 10 (Oct., 1963), pp. 597-99.
[CC63b] “ECMA Subset of ALGOL 60”, Comm. ACM, Vol. 6, No. 10 (Oct.,
1963), pp. 595-97.
[CC64a] “A Proposal for Input-Output in ALGOL 60 (A Report of the Sub-
committee on ALGOL of the ACM Programming Languages Com-
mittee)”, Comm. ACM, Vol. 7, No. 5 (May, 1964), pp. 273-83.
[CC64b] “Report on Input-Output Procedures for ALGOL 60 (IFIP)”, Comm.
ACM, Vol. 7, No. 10 (Oct., 1964), pp. 628-30.
[CC64c] “Report on SUBSET ALGOL 60 (IFIP)”, Comm. ACM, Vol. 7, No. 10
(Oct., 1964), pp. 626-28.
[CC64d] “CORRIGENDA: ‘ALCOR Group Representations of ALGOL
Symbols’”, Comm. ACM, Vol. 7, No. 3 (Mar., 1964), p. 189.
REFERENCES 305
[W064] Woodger, M., “ALGOL”, IEEE Trans. Elec. Comp., Vol. EC-13, No. 4
(Aug., 1964), pp. 377-81.
[WT63] Wirth, N., “A Generalization of ALGOL”, Comm. ACM, Vol. 6. No. 9
(Sept., 1963), pp. 547-54.
[WT66] Wirth, N. and Hoare, C. A. R., “A Contribution to the Development
of ALGOL”, Comm. ACM, Vol. 9, No. 6 (June, 1966), pp. 413-31.
[WT 66a] Wirth, N. and Weber, H., “EULER: A Generalization of ALGOL,
and its Formal Definition: Part I’, Comm. ACM, Vol. 9, No. 1 (Jan.,
1966), pp. 13-23.
[WT66b] Wirth, N. and Weber, H., “EULER: A Generalization of ALGOL,
and its Formal Definition: Part II’, Comm. ACM, Vol. 9, No. 2
(Feb., 1966), pp. 89-99.
[Y E66] Yershov, A. P., ALPHA—An Automatic Programming System of High
Efficiency”, J. ACM, Vol. 13, No. 1 (JJan., 1966), pp. 17-24.
[YS62] McMahon, J. T., “ALGOL vs. FORTRAN”, Datamation, Vol. 8, No. 4
(Apr., 1962), pp. 88-89.
IV.5.1. NELIAC
[V.5.2. MAD
[AR6la] Arden, B. W., Galler, B. A., and Graham, R. M., “MAD at Michigan”,
Datamation, Vol. 7, No. 12 (Dec., 1961), pp. 27-28.
[UM60] TheMichigan Algorithm Decoder (The MAD Manual), U. of Michigan
Computing Center, Ann Arbor, Mich. (Sept., 1960).
[UM66] The Michigan Algorithm Decoder (The MAD Manual), U. of Michigan
Computing Center, Ann Arbor, Mich. (Aug., 1966).
IV.6.3. QUIKTRAN
[AA66a] American Standard Basic FORTRAN, American Standards Association,
ASA X3.10-1966, New York, Mar., 1966.
[DM64] Dunn, T. M. and Morrissey, J. H. “Remote Computing: An Experi-
mental System Part 1: External Specifications”, Proc. SJCC, Vol. 25
(1964), pp. 413-23.
[IB66d] Information Marketing QUIKTRAN User’s Guide, IBM Corp., E-20-
0240, Data Processing Division, White Plains, N.Y. (1966).
[[B67e] Fundamentals of Using QUIKTRAN, IBM Corp., J20-0002-0, Data
Processing Division, White Plains, N.Y. (1967).
[KR64] Keller, J. M., Strum, E.C., and Yang, G.H., “Remote Computing:
An Experimental System Part 2: Internal Design”, Proc. SJCC, Vol.
25 (1964), pp. 425-43.
[MJ65] Morrissey, J. H., “The QUIKTRAN System”, Datamation, Vol. 11,
No. 2 (Feb., 1965), pp. 42-46.
IV.6.4. BASIC
IV.6.6. MAP
[KP66] Kaplow, R., Strong, S., and Brackett, J., A System for On-Line Mathe-
matical Analysis, M.1.T., MAC-TR-24, Project MAC, Cambridge, Mass.
(Jan., 1966).
310 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
[K P66a] Kaplow, R., Brackett, J., and Strong, S., “Man-Machine Communi-
cation in On-Line Mathematical Analysis”, Proc. FJCC, Vol. 29 (1966),
pp. 465-77.
[UU63] Stotz, R.H., “Man-Machine Console Facilities for Computer-Aided
Design”, Proc. SJCC, Vol. 23 (1963), pp. 323-28.
[UU67] Stotz, R. H. and Cheek, T. B., A Low-Cost Graphic Display for a Com-
puter Time-Sharing Console, M.1.T., ESL-TM-316, Electronic Systems
Lab., Cambridge, Mass. (July, 1967).
IV.6.9. CULLER-FRIED
[(CU62] Culler, G. J. and Huff, R. W., “Solution of Nonlinear Integral Equa-
tions Using On-Line Computer Control”, Proc. SJCC, Vol. 21 (1962),
pp. 129-38.
[CU63] Culler, G.J. and Fried, B.D., An On-Line Computing Center for
Scientific Problems, Thompson Ramo Wooldridge Inc., MI9-3U3,
TRW Computer Division, Canoga Park, Calif. (June, 1963).
[(CU6S5] Culler, G. J. and Fried, B. D., “The TRW Two-Station On-Line Scien-
tific Computer: General Description”, Computer Augmentation of
Human Reasoning (M. Sass and W. Wilkinson, eds.). Spartan Books,
Washington, D.C., 1965, pp. 65-87.
[CU67] Culler, G. J., “User’s Manual for an On-Line System”, On-Line Com-
puting (W. J. Karplus, ed.), McGraw-Hill, New York, 1967, pp. 303-24.
[FQ64] Fried, B. D., Farrington, and Pope, STL On-Line Computer: General
Description and User’s Manual, Thompson Ramo Wooldridge Inc.,
9824-6001-RU-000, Redondo Beach, Calif. (1964).
[FQ66] Fried, B.D., On-Line Problem Solving, Thompson Ramo Wooldridge Inc.,
9863-6001-ROO0, Redondo Beach, Calif. (1966).
[QK67] Blackwell, F. W., “An On-Line Symbol Manipulation System”, Proc.
ACM 22nd Nat’! Conf., 1967, pp. 203-209.
[RU67] Ruyle, A., Brackett, J. W., and Kaplow, R., ‘‘The Status of Systems for
On-Line Mathematical Assistance’’, Proc. ACM 22nd Nat’l Conf., 1967,
pp. 151-67.
[WN66] Winiecki, K. (ed.), Culler On-Line System User Manual, Harvard U.
Computation Lab., Cambridge, Mass. (1966).
IV.6.10. DIALOG
[CS66] Cameron, S. H., Ewing, D., and Liveright, M., DIALOG: A Conver-
sational Programming System with a Graphical Orientation, 1.1.T. Re-
search Inst., Tech. Note No. 109, Computer Sciences Division, Chicago
(Sept., 1966).
[CS67] Cameron, S. H., Ewing, D., and Liveright, M., “DIALOG: A Con-
versational Programming System with a Graphical Orientation”, Comm.
ACM, Vol. 10, No. 6 (June, 1967), pp. 349-57.
IV.6.11. AMTRAN
[CM66] Clem, P. L., Jr. et al., “AMTRAN—A Conversational-Mode Computer
System for Scientists and Engineers”, Proc. IBM Scientific Computing
Symposium on Computer-Aided Experimentation, IBM Corp., Data
Processing Division, White Plains, N.Y. (1966), pp. 115-50.
[RF66] Reinfelds, J. et al., “AMTRAN, A Remote-Terminal, Conversational-
Mode Computer System”, Proc. ACM 21st Nat’! Conf., 1966, pp. 469-77.
[UV67] Seitz, R.N., Wood, L.H., and Ely, C.A., “AMTRAN—Automatic
Mathematical Translation”, Proceedings of the Symposium on Interactive
Systems for Experimental Applied Mathematics, Washington, D.C.,
August 26-28, 1967, Academic Press, Inc., New York (1968).
312 LANGUAGES FOR NUMERICAL SCIENTIFIC PROBLEMS
[WD66] Wood, L.H. et al., “The AMTRAN System”, Datamation, Vol. 12,
No. 10 (Oct., 1966), pp. 22-27.
IV.7.2. COLASL
[BQ62] Balke, K.G. and Carter, G.L., The COLASL Automatic Coding
Language, Symbolic Languages in Data Processing. Gordon and Breach,
New York, 1962, pp. 501-37.
[CA63] Carter, G. L., Balke, K. G., and Bacon, B. A., COLASL J. Los Alamos
Scientific Lab., Los Alamos, N.M. (June, 1963) (unpublished).
IV.7.3. MADCAP
IV.7.4. MIRFAC
[WS64a] Wells, M.B., “In Defense of MIRFAC” (letter to the editor), Comm.
ACM, Vol. 7, No. 6 (June, 1964), p. 379.
IV.8.1. CORC
IV.8.2. OMNITAB
[DT63] “OMNITAB on the 90”, Datamation, Vol. 9, No. 3 (Mar., 1963), p. 54.
[HR66] Hilsenrath, J. et al., OMNITAB—A Computer Program For Statistical
and Numerical Analysis. National Bureau of Standards Handbook 101,
Washington, D.C. (1966).
[HM66] Homer, E. D., “An Algorithm for Selecting and Sequencing Statements
as a Basis for a Problem-Oriented Programming System”, Proc. ACM
21st Nat’l. Conf. 1966, pp. 305-12.
[QI65] Boyer, M. C., COMpound PROcedural SCientific Language, IBM Corp.,
TRO0.1242, Data Systems Division, Development Lab., Poughkeepsie,
N.Y. (Feb., 1965).
[QL67] Schlesinger, S. and Sashkin, L., “POSE: A Language for Posing
Problems to a Computer”, Comm. ACM, Vol. 10, No. 5 (May, 1967),
pp. 279-85.
[R166] Rice, J. R. and Rosen, S., “NAPSS—A Numerical Analysis Problem
Solving System”, Proc. ACM 2Ist Nat’l Conf., 1966, pp. 51-56.
V LANGUAGES FOR BUSINESS
DATA PROCESSING PROBLEMS
The languages in this chapter are those whose primary intent is the effective
solution of business data processing problems. The scope of this application
area is assumed to be understood by the reader; briefly summarized, it is
meant to include problems which have very large files on which straight-
forward operations must be performed. Some common illustrations of such
problems are payroll, inventory control, and insurance files. Fortunately
or unfortunately, there is only one language in major current use which
falls into this category—namely COBOL. The forerunners to COBOL are
FLOW-MATIC, AIMACO, Commercial Translator, and FACT; each of
these is described very briefly to indicate its historical significance and
technical contributions. GECOM, which largely paralleled some of the
COBOL effort in time scale, is also discussed. Lest any reader wonder
about the absence of SURGE ({[NM00], Longo [LN62]), 9 PAC ({IB61b]), or
report generators ({IB65d], Leslie [LS67]) from this list, it must be emphasized
that none of those are /anguages by my definition of the term. Thus it is not
the function of this chapter to debate the merits of languages versus fixed
format forms for the solution of problems in business data processing.
Only those systems which meet the characteristics of Chapter I are included.
The basic pattern for programming languages in business data process-
ing problems was set—as shown Section V.2.1—by FLOW-MATIC, which
established the concept of an English-like language with “natural” words
for both the operations to be performed and the data on which they are
to be acting. All major language developments in this area have followed
this concept.
Other languages, or classes whose absence might be questioned are
314
V.1. SCOPE OF CHAPTER 315
DETAB X, DETAB 65, and decision tables in general. They are not con-
sidered languages within the framework of this book. Some references are
given at the end of Chapter I for the reader wishing to pursue this area.
One of the unfortunate things about this particular application field is
the fantastic variety of ways to say exactly the same thing. In Willey et al.
[WY6la] there is a description of eight languages available (or at least
defined) in 1960 and 1961. Four of these, or at least versions of them, are
the ones mentioned in this chapter, and the other four are from England.
It is shocking to look at this small reference booklet and find there are
eight ways of trying to add three numbers and define the name of the result.
Lest anyone doubt this, the actual specifications are given in Figure V-1.
ADD ADD
atb+c=z atb+c=c’
ADD (a) TO b TO ¢;
FLOW-MATIC STORE THE SUM IN =z As Column 1
IBM . As Column 1, or
COMMERCIAL SET z = G@) + (6) + ©) ADD (a) TO ¢, ADD (6) TO
TRANSLATOR
ADD (a) AND (6)
COBOL AND (6) GIVING 2 ADD (a) AND (6) TO ¢
SET z [EQUAL] TO
FACT @+6+@) ADD (a) PLUS (6) TO
(PLUS = +)
CODEL
| CALCULATE
(b) 4 ©)
z = (@) + As Column 1
Figure V-1: Eight different ways to add three numbers. The last four systems
were developed in England. The use of a circle means that either a constant
or piece of data can be used. Square brackets denote an option and braces
indicate a choice to be made. Lower-case words are program supplied.
Source: Willey et al. [WY6la], p. 10.
316 LANGUAGES FOR BUSINESS DATA PROCESSING PROBLEMS
This gives added proof of the necessity for letting people define their own
artificial languages (discussed in Chapter XII).
It is not altogether surprising that the higher level languages for mathe-
matical problems appeared before the development of languages suitable
for business data processing problems, for the former field had a formalized
and accepted notation which could be used as a common basis. There are
far fewer systems to discuss here than there were in Chapter IV.
As early as January, 1955, Dr. Grace Hopper and her staff at Reming-
ton Rand UNIVAC (among the key people were F. Delaney, L. Cousins,
M. Harper, M. Hawes, T. Jones, M. Mulder, R. Rossheim, E. Somers, and
D. Sullivan) had preliminary specifications of a language which would be
suitable for doing business data processing on computers and still be easy
to use. They made some early and unsuccessful attempts to provide abbre-
viations, on which numerous people could agree, for things like GROSS
PAY or COMPUTE (as they could agree that SIN X is a reasonable abbre-
viation for COMPUTE THE SINE OF X). Then the idea of abbreviations
was dropped and the designers introduced the concept of having a noun
corresponding to a data description, rather than a symbol which would
require lookup in a list to understand the meaning. A preliminary manual
for the running system was marked Company Confidential and dated July,
1957; it was available to me at that time since I was an employee of the
Sperry Rand Corporation. The first generally distributed version was avail-
able early in 1958. Its revision [RR59a] contained the first fairly complete
list of commands; they are shown in Figure V-2.
Dr. Hopper and her group pioneered not only in the development and
convincing that was necessary for the computer input of English-like nota-
tion but also in the general problem of getting users to accept programming
languages of any kind. (See Chapter IV, for the early mathematical systems
A-2 and MATHMATIC.) One of the first published user commentaries
on this concept 1s given by Kinzler and Moskowitz [KB57].
The two most significant concepts introduced in FLOW-MATIC are
(1) the use of understandable English words for both the operations to be
performed and the data on which they are to operate, and (2) the reali-
zation that the data designs can and should be written completely inde-
pendently of the procedures to be executed. Thus, it was possible to write
ADD
(h)AADDA field-nameA(f;)ATOAfield-name(f2)A[TOA...etc.A]
s ASTOREATHEASUMAINAfield-nameA(fp)A.A
CLOSE-OUT
(h)ACLOSE—OUTAFILEAF
7A foAf3A...efc. A.A
COMPARE
Option I:
(hJACOMPAREAfield-nameA(f])A WITHA field-nameA(f2)A;A
IFAEQUALAGOATOAOPERATIONAh]A;A
IFAGREATERAGOATOAOPERATIONAHh]A;A
OTHERWISEAGOATOAOPERATIONAh24A;A
Option IT:
(h)ACOMPAREAfield-nameA(f] AAWITHAField-nameA(f2)A;A
EQUALA
A }GoatoaoPERATIONAh A;A
IF \ontarcra
IFA \eauate A
}GOATOAOPERATIONAA2:;4
EQUALA
OTHERWISEAGOATOAOPERATIONAh3A.A
COUNT
Option I:
(h)ACOUNTAfield-nameA(f7)A[,APRESETAVALUEAISAn7A][,AINCREMENTA
ISAn2A]
EQUALS
;AWHENACOUNTERA | angA[,ARESETATOAn4A,AAN DA]JGOATOA
EXCEEDS
OPERATIONAh] A[AOTHERWISEAGOATOAOPERATIONAH24A].A
Option II:
(h)ACOUNTAfield-nameA(f7)A[, APRESETAVALUEAISAn]A]
LAINCREMENTAISAn2A][,GOATOAOPERATIONAh]A].A
DIVIDE
(h)ADIVIDEAfield-nameA(f;)ABYAfield-nameA(f2)A
GIVINGAfield-nameA(f3)A.A
EXECUTE
(hy) AEXECUTEAOPERATIONAh] A[THROUGHAOPERATIONAN24].A
FILL
f;A
(h)AFILL
A A
\iiivitem-namesinafyaf
[ AfgA,AF3A...A][sub-item-nameAINAf2A,A
SPACES x==any character other
sub-item-nameAINAF3A.. cw x \. A than a period or
PERIODS space.
317
Figure V-2. (cont.)
HALT
Option I:
(h)AHALTA[Any-Descriptive-English]A.A
Option IT:
(h)AHALTABREAKPOINTAmAFORCEATRANSFERATOAGOATO
AOPERATIONAh]A[Any- Descriptive-English]A.A
= 0, 2, 4 through 9
IGNORE
(h)AIGNOREA.A
INPUT
SERVOAS]A
L___J
(h) AINPUTAname-of-fileAFILE-f}a|
SERVOSAs]A,As2A
SERVOAS]A
remeo-es PLE ft]
Ld
SERVOSAsS]A,As2A
INSERT
Option I:
(h)AINSERTAconstantAINTOAfield-nameA(f7)A[,Afield-nameA(f2)A,A...A].A
Option IT:
(h)AINSERTAconstantAINTOAfield-nameA(f;)A[,Afield-nameA(f2)A,A...A]
SPACES | AA
;AW HEREAXAE A
xAEQUALS {peetops
Option II:
(h)AINSERTAconstantAINTOA field-nameA(f1)A[,Afield-nameA(f2)A,A4...A]
;AWHEREAxEQUALSASPACESAANDA yAEQUALSAPERIODSA.A
JUMP
(hMAJUMPATOAOPERATIONAN]A.A
MOVE
(h\AMOVEAfield-nameA(f;)ATOAfield-nameA(f2)A[,Afield-nameA(f3)A
..etc.A}
[;Afield-nameA(f ;')ATOAfield-nameA(f2')A[,Afield-nameA(f3')A...etc.A]].A
318
Figure V-2. (cont.)
MULTIPLY
NUMERIC—TEST
Option I:
(hJANUMERIC-TESTAfield-nameA(f})A[,Afield-nameA(f2)A,A...4
NUMERICAL
ield- A];
field-nameA(f,)A];AlF AIFA NUMERIC \ AGOATOA
GOATOAOPERATIONAh] AhyA
[;AOTHERWISEAGOATOAOPERATIONAh2A].A
Option I:
A -
(h)ANUMERIC-TESTAfield-nameA(f7)A;AIF
Afield- A(f])A;AIFA
NUMERICAL
{NUMERIC laMOveaToa
field-nameA(f2)AANDAGOATOAOPERATIONAh] A[;AOTHERWISEAGOATO
AOPERATIONAA2A].A
OVERLAY
(hYOVERLAYAFROMAOPERATIONAh]A.A
PRINT-—OUT
Option I:
(h)APRINT—OUTAfield-nameA(f))A[,A...efc.A].A
Option IT:
(h)APRINT—OUTAconstantA,AconstantA[,A...etc-A].A
Option II:
(h)APRINT—OUTAfield-nameA(f1)A,AconstantA[,A...efc.A].A
READ—-ITEM
(h)AREAD—ITEMAF 7 A[;AIFAENDAOFADATAAGOATOAOPERATIONAh]A].A
REPLACE
LEADINGAZEROES
PERIODSA
LEADING AOA
SPACESA
(h)AREPLACEA PERIODSA © WITHA
ZEROESA
SPACES
yA
xA
INAfield-nameA(f7)A[,Afield-nameA(f2)A...,Afield-nameA(fp)A].A
REWIND
(h)AREWINDAF]A[,AF24,AF3...,efc.A].a
319
Figure V-2. (cont.)
SELECT
INPUTA
(HASELECTAY \name-of-FileAFILE-F 14
OUTPUTA
[name-of-fileAFILE-f2A...A]
OUTPUTA
\name-of-FileFILE-f
li \ INPUTA
[name-of-fileAFILE-fmA...A]J]A.A
SELECT-LEAST
(h) ASELECT—LEASTAKEYA;AIFAF] AGOATOAOPERATIONAH]4,A
IFAf2 AGOATOAOPERATIONAh24,A[IFAf34 GOATOAOPERATIONAN3A, A. .
IFAfs3AGOATOAOPERATIONAN3AI.A
SET
(h) ASETAOPERATIONAh] ATOAGOATOAOPERATIONAh2A[, AOPERATIONA
h3ATOAGOATOAOPERATIONAhA4A..., AOPERATIONAh5ATOAGOATOA
OPERATIONAN6A].A
STOP
(h)ASTOPA.A(END)
SUBTRACT
(hJASUBTRACTAfield-nameA(f1)A[ANDAfield-nameA(f2)AANDAetrc. A]
AFROMAfield-nameA
(fn) A; ASTOREA THEAREMAINDERAINA field-nameA(fm)
A.A
SUPPLEX
Option I:
(h) ASUPPLEXAxxxA[BLK—RELATIVEA ][Any-Descriptive-EnglishA].A
where xxx IS a Section number
Option IT:
(h)ASUPPLEXAnnnA[BLK—RELATIVEA]:A
iS SPACE
USEAv;A[WHEREAx
AviA AxA \ * A {reeop | al{Any-Deseriptive-English
[ANDAv,A...efc.A].A
where nnn must be any alphabetic or alphanumeric designation assigned
to this SUPPLEX routine
where each of the values v1, v2, ... vx may take any one of the following
forms:
a
bbbb
cecccc
dddddddddddd
field-nameA(f})
320
Figure V-2. (cont.)
SWITCH
(h)ASWITCHA[any-alphabetic-or-numeric-designation-for-the-switch]A.A
TEST
Option I:
(h)ATESTAfield-nameA(f;)AAGAINSTAtest-valueA;A
GREATERA
EQUALA
IFA LESSA GOATOAOPERATIONAh]A;A
UNEQUALA
OTHERWISEAGOATOAOPERATIONAh?24A.A
Option IT:
(h)ATESTAfield-nameA(f;)AAGAINSTAtest-valueA;A
GREATERA
IFA, EQUALA =-GOATOAOPERATIONAN]4A;A
LESSA
GREATERA
ro] rauat \cosronoretrionsiz
LESSA
OTHERWISEAGOATOAOPERATIONAN3A.A
Option IIT:
(h) ATESTAfield-nameA(f])AAGAINSTAtest-value-1A;A
GREATERA
raf eQUALa \eoaronorerarionsh es
LESSA
AGAINSTAtest-value-2A;A
GREATERA
IFAS EQUALA =4SGOATOAOPERATIONAN2A;A
LESSA
GREATERA
IFA, EQUALA = »pGOATOAOPERATIONAH34;A
LESSA
[AGAINSTAtest-value-nA;A
GREATERA
EQUALA
IF A LESSA ATOA AhmA;4
GOATOAOPERATIONAh)A;
UNEQUALA
OTHERWISEAGOATOAOPERATIONAh,)A.A
TRANSFER
Option I:
(h)ATRANSFERAF] ATOAF2A.A
Option IT:
(h)ATRANFERAsub-item-nameAINAf); ATOAF24.A
321
322 LANGUAGES FOR BUSINESS DATA PROCESSING PROBLEMS
Option IIT:
(h) ATRANSFERAF; ATOAsub-item-nameAINAFf2A.A
Option IV:
(h) ATRANSFERAsub-item-nameAINAF] ATOAsub-item-nameAINAf2A.A
TYPE
(h)ATYPEA[any-descriptive-wordsA |INTOAfield-nameA(f])A,A
[field-nameA(f2)A,A...etc.A].A
UNIVAC
(h)AUNIVACAxxxA[BLK—RELATIVEA
|[ Any-Descriptive-EnglishA].A
where xxx is a section number
WRITE-ITEM
(h)AWRITE-ITEMAF7A.4
1 Note that FLOW-MATIC was originally called B-@. All the early Remington
Rand systems had a letter(s) followed by a digit to indicate which version it was, until
some marketing people decided that names such as FLOW-MATIC and MATH-MATIC
were more appealing than B-@ and AT-3.
V.2.1. FLOW-MATIC (AND B-0) 323
(0) INPUT INVENTORY FILE-A PRICE FILE—B ; OUTPUT PRICED-—INV FILE—C UNPRICED-INV
FILE-D ; HSP D.
(1) COMPARE PRODUCT—NO (A) WITH PRODUCT—NO (8B) ; IF GREATER GO TO
OPERATION 10 ; IF EQUAL GO TO OPERATION 5 ; OTHERWISE GO TO OPERATION
2.
(2) TRANSFER A TOD.
(3) WRITE-ITEM D .
(4) JUMP TO OPERATION 8 .
(5) TRANSFER ATO C.
(6) MOVE UNIT—PRICE (B) TO UNIT—PRICE (C) .
(7) WRITE-ITEM C .
(8) READ-ITEM A ; IF END OF DATA GO TO OPERATION 14 .
(9) JUMP TO OPERATION 1 .
(10) READ-ITEM B ; IF END OF DATA GO TO OPERATION 12 .
(11) JUMP TO OPERATION 1 .
(12) SET OPERATION 9 TO GO TO OPERATION 2.
(13) JUMP TO OPERATION 2 .
(14) TEST PRODUCT—NO (B) AGAINST ZZZZZZZZZZ72Z ; IF EQUAL GO TO OPERATION 16
; OTHERWISE GO TO OPERATION 15.
(15) REWIND B.
(16) CLOSE-—OUT FILES C;D.
(17) STOP . (END)
ness data processing problem, the size of the field varied and alignment of
decimal points was always required. Thus although the FLOW-MATIC
generators were an extension of those developed in A-2, the generators for
the business data processing compilers were far more essential. The gen-
erators referred to here are used by the compiler to create object code for
each operation in which the possible choices are almost infinite. For ex-
ample, instead of having at object time all the code needed for each possible
type of addition, (only) the instructions needed for each case are ascertained
from the data description and included in the object program. The major
alternative is some type of interpretation at object time.
FLOW-MATIC, and its later modification known as AIMACO (see
Section V.2.2), was a major input to the Short Range Committee developing
COBOL (discussed in Section V.3.1). In actual fact, FLOW-MATIC was
the only language with which there was any experience at that time. Perhaps
the only disadvantage that accrued from the experience was what can be
defined as bending over backwards to provide an English-like language.
In other words, the Remington Rand people felt that no businessman or
person concerned with business data processing problems was really inter-
ested in writing symbolic formulas and that if he actually wanted to com-
324 LANGUAGES FOR BUSINESS DATA PROCESSING PROBLEMS
V.2.2. AIMACO
la [1B59], p. 33.
326 LANGUAGES FOR BUSINESS DATA PROCESSING PROBLEMS
V.2.4. FACT
ADD GO REPLACE
ARE IGNORE REVERSE
CLOSE IS REWIND
CONTROL LEAVE SEE
DELETE LOCK SET
DIVIDE MULTIPLY SORT
DO OPEN SUBTRACT
EQUALS PERFORM UNWIND
FILE PUT UPDATE
FIND RELEASE USE
GET REMOVE WRITE
V.2.5. GECOM
1. Data names cannot exceed 12 characters and cannot contain all numerals
and the letter E.
2. Data descriptions are given in a fixed format on a printed form.
3. Several verbs are omitted, both by name and function, e.g., EXAMINE,
USE, INCLUDE.
4. Several verbs have functional capabilities changed or omitted or they
incorporate those from others, e.g., OPEN, CLOSE, READ, WRITE (but no
ACCEPT or DISPLAY), and PERFORM (see under extensions).
5. No THEN clause is allowed in the /F statement; the latter is only of the
form IF...GOTO....
It should be clear, even from this very brief outline, that GECOM
syntactically resembles no particular language. It is not enough like COBOL
to be considered a dialect or even COBOL-like, and it is much further from
ALGOL. The flavor and spirit resemble COBOL, but that is all that can be
said for the resemblance. From the viewpoint of the functions it performs,
the designers chose the features from both languages which they felt were
V.3. COBOL
4 Since I was present not only at this initial meeting (representing Sylvania Electric
Products), but also was chairman of two different task groups of the Short Range Com-
mittee, the historical description of the early COBOL work is based on firsthand knowl-
edge and participation, and is supported by appropriate documents (some of which I
wrote at the time).
v.3. COBOL 331
The assigned mission of the Short Range Committee was actually ‘‘to
do a fact finding study of what’s wrong and right with existing business
compilers (such as FLOW-MATIC, AIMACO, COMTRAN, etc.) and the
experience of users, thereof. This short range group is due to complete its
work in three months, 1.e., by September 1, 1959.”® However, the Committee
actually set itself the very ambitious goal of developing a language within
three months. Thus this was the first attempt to have an intercompany
committee, consisting primarily of competitive computer manufacturers,
specify a complex machine-independent language on any time scale, let
alone such a short one.
Working groups on data description and procedural statements pre-
pared proposals for consideration by the full committee which met in August,
1959 for the purpose of preparing a report to the Executive Committee. The
report, dated September 4, 1959, was presented and it stated that the Short
Range Committee felt it had prepared a framework upon which an effective
common business language could be built. It was recognized that the tech-
nical material contained rough spots and needed additions. The report
requested that the Short Range Committee be authorized to complete and
polish the system by December 1, 1959. It was also requested that the
Short Range Committee continue beyond that date in order to monitor the
implementation. Both these requests were granted.
The Committee held several meetings between September 18 and
October 21, 1959 and proceeded steadily in its task of resolving problems
and completing the language. The name COBOL, which suggests a COmmon
Business Oriented Language, was adopted. From October 26 to November
7, 1959, H. Bromberg and N. Discount (RCA), V. Reeves and J. Sammet
(Sylvania), and W. Selden and G. Tierney (IBM) worked continuously,
integrating the rough specifications into a systematic language.
The COBOL System was reviewed and approved by the Short Range
Committee during the week of November 16 to 20. Final editing by the
people named above was done (with myself as chairman of the group),
and initial distribution was accomplished December 17, 1959.
In January, 1960 the Executive Committee of CODASYL accepted and
approved the report of the Short Range Committee. During the period from
January to April, 1960, the report underwent editing for typographical and
other minor errors, and it was published by the Government Printing
Office in April 1960 [US60]. (After considerable debate, it was decided to
list in that report only the names of the organizations involved and not
the specific individuals representing them. Aside from the six people listed
above (who were acknowledged by the Short Range Committee to have
6 [US65], p. HI-1-1.
v.3. COBOL 335
SAMPLE PROGRAM—COBOLt
IDENTIFICATION DIVISION.
PROGRAM-ID. ‘SORT360'.
REMARKS. THIS PROGRAM WAS WRITTEN TO DEMONSTRATE THE USE OF THE SORT
FEATURE. THIS PROGRAM PERFORMS THE FOLLOWING TASKS —
1. SELECTS, FROM A FILE OF 1000—CHARACTER RECORDS, THOSE RECORDS
HAVING FIELD—-A NOT EQUAL TO FIELD-B.
2. EXTRACTS INFORMATION FROM THE SELECTED RECORDS.
3. SORTS THE SELECTED RECORDS INTO SEQUENCE, USING FIELD—AA,
FIELD—BB, AND FIELD~CC AS SORT KEYS.
4. WRITES THOSE SORTED RECORDS HAVING FIELD-—FF EQUAL TO FIELD—EE
ON FILE-3 AND WRITES SELECTED DATA OF THE OTHER RECORDS ON FILE-—2.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE—COMPUTER. IBM—360 F50.
OBJECT—COMPUTER. IBM—360 F50.
INPUT-OUTPUT SECTION.
FILE—CONTROL. SELECT INPUT—FILE-1 ASSIGN TO 'F401' UTILITY.
SELECT SORT-—FILE—1 ASSIGN ‘SFI’ UTILITY.
SELECT FILE-2 ASSIGN 'F402’ UTILITY. SELECT
FILE~3 ASSIGN 'F403' UTILITY.
DATA DIVISION.
FILE SECTION.
FD INPUT—FILE-1 BLOCK CONTAINS 5 RECORDS
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD
DATA RECORD IS INPUT—RECORD.
O1 INPUT—RECORD.
02 FIELD-A PICTURE X (20).
02 FIELD—C PICTURE 9 (10).
02 FIELD—D PICTURE X (15).
02 FILLER PICTURE X (900)..
02 FIELD—B PICTURE X (20).
02 FIELD—E PICTURE 9 (5).
02 FIELD-—G PICTURE X (25).
02 FIELD—F PICTURE 9 (5).
SD SORT-FILE—1 DATA RECORD !S SORT—RECORD.
O1 SORT—RECORD.
O02 FIELD—AA PICTURE X (20).
02 FIELD—CC PICTURE 9 (10).
02 FIELD—BB PICTURE X (20).
02 FIELD-DD PICTURE X (15).
02 FIELD—EE PICTURE 9 (5).
02 FIELD—FF PICTURE 9 (5).
Ol FILE~2—RECORD.
O02 FIELD—EEE PICTURE $$$$$9.
O2 FILLER-A PICTURE X (2).
O2 FIELD-FFF PICTURE 9 (5).
O02 FILLER—-B PICTURE X (2).
02 FIELD—AAA PICTURE X (20).
O02 FIELD-BBB PICTURE X (20).
FD FILE-3 BLOCK CONTAINS 15 RECORDS
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD
DATA RECORD IS FILE—3—-RECORD
PROCEDURE DIVISION.
RECORD-—SELECTION SECTION.
PARAGRAPH—1. READ INPUT—FILE—1 AT END GO TO PARAGRAPH-2.
IF FIELD-A = FIELD—-B GO TO PARAGRAPH-—I ELSE
MOVE FIELD—A TO FIELD—AA MOVE FIELD-F TO FIELO—FF
MOVE FIELD-C TO FIELD-—CC MOVE FIELD—B TO FIELD—BB
MOVE FIELD—D TO FIELD—DD MOVE FIELD-E TO FIELD—EE
RELEASE SORT—RECORD. GO TO PARAGRAPH-1.
PARAGRAPH-—2. EXIT.
PROCESS—SORTED—RECORDS SECTION.
PARAGRAPH—3. RETURN SORT-—FILE—1 AT END GO TO PARAGRAPH—4.
IF FIELD-FF = FIELD-EE WRITE FILE-3—-RECORD FROM
SORT—RECORD GO TO PARAGRAPH—3 ELSE
MOVE FIELD—-EE TO FIELD—-EEE MOVE FIELD—FF TO FIELD—FFF
MOVE FIELD-AA TO FIELD-AAA MOVE FIELD—BB TO FIELD—BBB
MOVE SPACES TO FILLER—A, FILLER-B WRITE FILE-2—RECORD.
GO TO PARAGRAPH-3.
PARAGRAPH—4. EXIT.
TReprinted by permission from JBM Operating System/360 COBOL Language, pp. 142--43.
© 1965 by International Business Machines Corporation, C28-6516-3, Data Processing
Division, White Plains, N.Y. (1965).
338 LANGUAGES FOR BUSINESS DATA PROCESSING PROBLEMS
7 [US62], p. II-1.
V.3. COBOL 339
patibility issues much clearer. On the other hand, the majority of incom-
patibilities arise from implementors who choose to deviate from clearly
defined specifications. To deal with this problem, many organizations have
written internal papers or manuals which tell users either how to hand-
convert from one machine (or compiler) to another or how to write programs
initially to avoid (or minimize) incompatibilities. Other groups have pre-
pared lists of quirks which affect efficiency and/or compatibility (e.g., the
COBOL Programming Tips of Westinghouse [WM67]).
Obviously, certain information pertaining to individual computers
would never carry over to another machine. It was felt, however, that the
advantage of having a common means of expression even for these features
was sufficiently great to warrant the development of a standard form.
Dialects have not been a problem with COBOL, except for differences
in interpretation and actual implementation, probably because there was
a broadly based group which was defining the language. However, the
problems of subsetting and extensions have been very significant from the
beginning, and the subsetting is dealt with in an unusual way by the USASI
standard (discussed later).
Although at the start of the Short Range Committee’s activity it was
tacitly assumed that COBOL was being developed only for large com-
puters, an increasing number of manufacturers and users became interested
in having this available on smaller machines. As a result, it was necessary
to try to provide some official subsets that would be an adequate subsection
of the language but still be more easily implemented on small machines than
the entire language would be. In the COBOL-60 specifications, a subset
called Basic COBOL was defined. In the 1961 specifications, a subset entitled
Required COBOL-1961 was defined to consist of “that group of features
and options, within the complete COBOL specifications for the year 1961,
which have been designated as comprising the minimum subset of the total
language which must be implemented (to the extent of hardware capability)
by any implementor claiming a “proper” COBOL-1961 compiler.”® All
other features and options were considered elective; but if they were imple-
mented, they had to be done so in accordance with the specifications given
in the manual. The manual for COBOL-1961 Extended kept this idea,
but the concept was later dropped entirely. A subset known as Compact
COBOL was defined by a COBOL Committee subcommittee but was not
published because of possible confusion with the standards work.
As with all other languages, there have been some difficulties in com-
patibility arising from different interpretations of the specifications. As
time progressed, these became minimized.
Converting COBOL programs from one machine (and/or compiler)
8 [US61], p. I-3.
340 LANGUAGES FOR BUSINESS DATA PROCESSING PROBLEMS
The resulting proposal for the standard took the form of a nucleus and
9 Shown as a note in Scope of X3.4.4 in Minutes, Task Group X3.4.4, Jan. 15-16, 1963.
v.3. COBOL 341
*After the original issuance of the proposed standard it was decided to remove the Random Processing Module from the standard and place it in an
Appendix for information purposes only. When the RPM is present, either 1RAC 0, 2 or 2RAC 0, 2 must also be present.
Figure V-6. Schematic diagram showing the structure of pUSASI COBOL standard. The first digit in all the codes
represents the level’s position in the hierarchy, and the last two digits indicate the minimum and maximum
levels of the module to which the level belongs. For example, 2NUC 1, 2 denotes the second level of the Nucleus
which is composed of two levels, neither one of which is a null set.
Source: [XB67], pp. 1-6a.
v.3. COBOL 343
pressure from the government, which essentially said that a company which
wanted to sell or rent computers to the federal government had to have a
COBOL compiler unless they could clearly demonstrate that it was not
needed for the particular class of problems involved.
The maintenance has been done with different organizational structures
but always by a group of people under the official direction and sponsorship
of the CODASYL Executive Committee. Both users and manufacturers
have participated heavily in the maintenance. There have been two major
problems in the maintenance: One is that many times implementers
needed clarification on a particular point and could not obtain it from the
maintenance committee fast enough to suit their schedules; this resulted
in diverse interpretations of the language and a natural reluctance by each
group to sacrifice its meaning at a later point in time. The second problem
in maintenance was that in some cases the individuals serving on the com-
mittee changed quite frequently; the new person had to be educated rapidly,
and in many cases he would bring up points that had been previously dis-
cussed at great length. Furthermore, most people had this activity as a low-
priority assignment. It is very interesting to note that there are at least
as many differing opinions on technical points within a company as across
companies, and it was not at all uncommon to see one individual reversing
the vote of another individual from his organization who had been on the
committee somewhat earlier.
There was a great deal of talk in the earlier days about the poor defini-
tion of COBOL, climaxed by the often repeated comment that the language
was not really defined. In actual fact, there was at least as much rigor in the
definition of COBOL as in the definitions of FORTRAN. The complaints
stemmed from two different problems. The first was that there were am-
biguous statements in the descriptions (i1.e., the semantics) which led to
different interpretations by the implementers. This problem is still inherent
in the state of the art of language definition, even for ALGOL, which was
considered to have a more rigorous definition than either FORTRAN or
COBOL. The second problem was that since the format of the COBOL
manual was not the same as that of the ALGOL report, then the former
was assumed to be vague. A paper (Sammet [SM6la]) showed this com-
plaint to be invalid since the notation used for the COBOL report was
actually a metalanguage which is roughly equivalent to the type of meta-
language used for the ALGOL report. More recent work in providing a
formal definition has been done by ECMA [EC67]. Thus the syntax for
COBOL is as well-defined as that of ALGOL. A set of syntactical charts
for COBOL-61 was also produced (see Berman, Sharp, and Sturges [BF62]).
With regard to documentation, there has always been exactly one
definitive manual, namely the one issued by the Government Printing
Office under the auspices of the CODASYL Executive Committee. Other
v.3. COBOL 345
March, 1968. In a few cases this includes elements not contained in the
standard, which is based on COBOL-65 and changes approved through
January 1, 1967. Although the standard does not include all of COBOL-65,
the latter was chosen as the basis for the description in the book because of
the continuing changes in the standard as it was being developed.
The character set in COBOL consists of 51 characters. These include
the 10 digits, 26 upper-case letters, and the following 15 symbols:
qualifier; in such a case the subscripts are written with the lowest element
in the hierarchy.
The operators are the four arithmetic ones and three relational ones,
GREATER THAN, LESS THAN, EQUAL TO, each of which can be preceded
by the word NOT.
Blanks and punctuation are considered significant in COBOL and,
in particular, are used to delimit identifiers and reserved words. The punc-
tuation characters are the following:
create. The PROCEDURE Division specifies the steps that the user wishes the
computer to follow. These steps are expressed as statements, sentences, para-
graphs, and sections.
The executable statements appear only in the PROCEDURE Division, while
the declarations in a COBOL program occur in the IDENTIFICATION, ENVIRON-
MENT, and DATA Divisions.
The smallest executable unit in the COBOL program is called a state-
ment. This can be either imperative, conditional, or compiler directing. An
imperative statement consists of either a verb and its operands or a sequence
of verbs and operands. A conditional statement is either of the form IF...
THEN ... ELSE or it is an imperative statement followed by a conditional
statement. (This format is shown in more detail later.) A compiler-directing
statement simply consists of a compiler-directing verb and its operands.
There are several hierarchical levels of executable units. The one immediately
above the statement is a sentence which consists of a sequence of one or
more statements. Sentences can be grouped together to convey one idea,
and such a grouping is called a paragraph. A paragraph is the smallest
grouping which can be named. Paragraphs can be combined to form sections,
which must be named.
Looping is controlled in two ways in COBOL. The first is the fairly
standard JF... THEN... statement. The second (and main) looping facility
in COBOL is provided by the PERFORM verb.
There are no functions provided in COBOL. Subroutines and proce-
dures without parameter replacement can appear as either paragraphs or
sections. Library routines can be included at compile time by using the
COPY verb. At object time other programs can be invoked by the CALL
verb.
Comments are designated by an asterisk in a fixed location on the line.
The primary way in which the program is able to interact with the
operating system is through error returns that the user may specify in some
verbs (e.g., ADD) but most significantly through the USE verb. This latter
permits the user to specify procedures for hardware input/output error and
label handling, which are in addition to the standard procedures supplied
by the input/output system. The OPEN and CLOSE verbs also provide a
form of interaction in the sense that they provide for label checking (on
input) and creation (on output).
Other languages can be written following the ENTER verb which serves
as a flag to the compiler.
A complete COBOL program is comprised of entries from the four
divisions written in the order indicated above.
Statements do not have any required delimiter since the beginning of
the next statement can always be determined when a verb is encountered.
v.3. COBOL 349
O01 TIME—CARD
O04. NAME
06 LAST—NAME
06 FIRST—INITIAL
06 MIDDLE—INITIAL
O04. EMPLOYEE—NUMBER
O04 DATE
05 MONTH
O05 DAY
O5 YEAR
04 HOURS
For the sake of simplicity, only the level number and data name of
each entry have been given in the example above.
A group includes all groups and elementary items described under it
until a level number less than or equal to the level number of that group is
encountered. Thus, in the example above, HOURS is not a part of the group
called DATE. MONTH, DAY, and YEAR are a part of the group called DATE
because they are described immediately under it and have a higher level
number.
The hardware data units which are accessible are controlled entirely
by the data description which is given. The basic principle of describing
data is that it is assumed to be stored contiguously from the beginning of
the storage area. Since the basic description of the data refers to its external
format, it is up to the compiler to interpret this in the most efficient way
internally; three of the entries in the Record Description format which
are useful for this purpose are SYNCHRONIZE, JUSTIFIED, and FILLER.
The first indicates that data should be aligned with word boundaries; the
second one indicates whether data should be left or right, justified within
some storage unit; and the third term indicates that there is now to be some
empty space with no meaningful data in it. Since all of this is controlled
by the entries in the DATA Division, the commands have access to each of
these subunits simply by referencing the data name. The variable types which
are meaningful for the commands are the arithmetic, alphabetic, and of
course the arrays and hierarchies.
The type of arithmetic done in COBOL is integer and mixed number.
The system is responsible for aligning numeric data items so that the decimal
points appear in appropriate places and then proceeding to do the correct
arithmetic. There is no floating point or rational arithmetic nor of course
complex numbers, although some implementers have provided floating
point. With regard to precision, a rule exists limiting the maximum size
of any numeric operand to 18 decimal digits; obviously the question of
whether or not this is double or multiple precision depends on the word
size of the computer. In a peculiar sense, arithmetic can be done on vectors
and arrays through the use of a CORRESPONDING clause, which means
v.3. CoBoL 351
ADD
Format I:
identifier-1 , identifier-2 . wp
ADD tines \ literal.2 | ... , identifier-n [ROUNDED]
Format 4:
ADD {cone | identifier-1 TO identifier-2 [ROUNDED]
CORRESPONDING
[; ON SIZE ERROR imperative-statement}
ALTER
ALTER procedure-name-! TO [PROCEED TO} procedure-name-2
[, procedure-name-3 TO [PROCEED TO] procedure-name-4] ...
CALL
literal-1
j}LUSING identifier-2 [, identifier-3] ...]
CALL \identifier.
CANCEL
literal-1 , literal-2
CANCEL {recite 2} j dentitier.2 | _
CLOSE
. REEL NO REWIND
CLOSE file-name-! | [we tone |
. REEL NO REWIND
, file-name-2 | oan || W'TH \tock + eee
353
Figure V-7. (cont.)
COMPUTE
COPY
DISPLAY
tienwin MI literal-2
DISPLAY
identifier-1 , identitier-2 | -+ [UPON mnemonic-name]
DIVIDE
Format I:
identifier-1
DIVIDE ' | INTO identifier-2 ROUNDED
literal-1
[, identifier-3 [ROUNDED]] ...
[; ON SIZE ERROR imperative-statement]
Format 2:
identifier-1 identifier-2
\ GIVING identifier-3 [ROUNDED]
DIVIDE linen \ INT linen
ee
Format 3:
identifier-1 identifier-2
\ GIVING identifier-3 [ROUNDED]
DIVIDE fines \ — tienen
[, identifier-4 [ROUNDED]] ...
[; ON SIZE ERROR imperative-statement]
Format 4:
DIVIDElinet f
literal-1
INTO Mente t GIVING identifier-3 [ROUNDED]
literal-2 —_—_—
ee
——_—
REMAINDER identifier-4 [; ON SIZE ERROR imperative-statement]
Format 5:
identifier-1 identifier-2
DIVIDE literal \ — literal
\ GIVING identifier-3 ROUNDED
REMAINDER identifier-4 [; ON SIZE ERROR imperative-statement]
354
Figure V-7. (cont.)
ENTER
EXAMINE
EXAMINE identifier
UNTIL FIRST
FIRST) |. ; ‘teral-2 .
rari A tidentif 1} | REPLACING BY ti identifier-2
eral \|
LEADING iaiaieall
ALL
PLACING EADING et 3} BY lidentif 3
[UNTIL] FIRST identifier- identifier-
EXIT
EXIT [PROGRAM] .
GENERATE
GENERATE identifier
GO TO
Format I:
GO [TO] [procedure-name-1|
Format 2:
GO [TO] procedure-name-I [, procedure-name-2] ... procedure-name-n
DEPENDING ON identifier
HOLD
ALL
HOLD \section-name-1 [, section-name-2]| aS
iF
INITIATE
report-name-] [, report-name-2] “I
INITIATE (at
MOVE
| CORRESPONDING J, dentitier.1
MOVE 4| CORR enter bro identifier-2 [, identifier-3] ...
literal
355
Figure V-7. (cont.)
MULTIPLY
Format I:
identifier-1
MULTIPLY | ene \ py identifier-2 [ROUNDED]
OPEN
. REVERSED
OPEN | INPUT {fite-name with NO newinp |t | eee
Format 2:
PERFORM procedure-name-! [THRU procedure-name-2]
lintegent
. i TIMES
integer-1 —
Format 3:
PERFORM [procedure-name-] [THRU procedure-name-2] UNTIL condition-]
Format 4:
PERFORM procedure-name-! [THRU procedure-name-2]
index-name-2
VARYI
————._NG (identif ier-1 !
{(70°X-PAMET FROM 2 fiteralI-2
sy
identifier-2
-
literal-3
UNTIL condition-1
~~ Lidervitien-3}
twas}
AFTER {index-name-4) coo J iteral-5
—— l(identifier-4 —— |, eps
identifier-5
ti teral-6
——
dentifer-6t UNTIL condition-2
nd 7 literal-8
|
identifier-7
tenner index-name-8
literal-9 was
t Nentitier-9f UNTIL condition-3 ||
[=
356
Figure V-7. (cont.)
PROCESS
PROCESS section-name [FROM identifier] | usING {veces \|
record-name
READ
Format I:
READ file-name RECORD [INTO identifier]
; AT END imperative-statement
Format 2:
READ file-name RECORD [INTO identifier]
; INVALID KEY imperative-statement
RELEASE
RETURN
RETURN file-name RECORD [INTO identifier] ; AT END imperative-statement
SEARCH
Format I:
SEARCH identifier-1 | VARYING index-name-I |
————._ (identifier-2
[; AT END imperative-statement-T]
imperative-statement-2
; WHEN condition-! !
NEXT SENTENCE
imperative-statement-3 |
| WHEN condition-2 {
NEXT SENTENCE
Format 2:
SEARCH ALL identifier-] [; AT END imperative-statement-1]|
Moe ewneee
; WHEN condition-1 {noe SENTENCE
SEEK
SEEK file-name RECORD [WITH KEY CONVERSION]
SET
Format I:
. . index-name-3
SET index-name-] L, index-name-2] “| 10 Jidentifier-3
—— l(identifier-1 [, identifier-2] ... :
literal-1
357
Figure V-7. (cont.)
Format 2:
. . UP BY identifier-4
SET index-name-4 [, index-name-5] ... \pOWN wy} {terol \
SORT
DESCENDING
SORT file-name-1] ON \ ASCENDING | KEY data-name-! [, data-name-2] ...
DESCENDING
| ; ON LeSCENDING i KEY data-name-3 [, data-name-4] | eee
STOP
literal
STOP trun \
SUBTRACT
Format 1:
literal-1 , literal-2
SUBTRACT {iieriiee- |" Nertitier2 | .
FROM identifier-m [ROUNDED] [, identifier-n [ROUNDED]] ...
[; ON SIZE ERROR imperative-statement]
Format 2:
literal-1 , literal-2
SUBTRACT \dennitier-1f | dentifier-2 | ”
FROM literal-
——
ee ™ —( —-———
|identifier-m}
GIVING identifier-n [ROUNDED]
—<——<—$————
[, identifier-o [ROUNDED]}] ...
[; ON SIZE ERROR imperative-statement]
Format 3:
SUBTRACT Sone
CORRESPONDING identifier-
identifier-] FROM identifier-
identifier-2 [ROUNDED]
SUSPEND
SUSPEND
file-name-1 test
teense
literal-2
1
| |
eport-name.!
repor'-nam idennitier.2
file-name-2 |
literal-3
identifier-3
literal-4
| ”
report-name-2 |
Mectiher-a -
358
Figure V-7. (cont.)
TERMINATE
{anortnemen [, reporf-name-2] “I
TERMINATE
USE
Format 1:
USE AFTER STANDARD ERROR PROCEDURE ON
file-name-1 [, file-name-2] ...
INPUT
OUTPUT .
INPUT-OUTPUT
1-0
Format 2:
Geer
AFTER \ STANDARD
BEGINNING) rae
| erases FILE
|
UNIT
——
NI
Format 4:
ALL
USE FOR KEY CONVERSION ON {file-name.t [, file-name-2 wah
Format 5:
USE FOR RANDOM PROCESSING.
WRITE
Format 1:
WRITE record-name [FROM
identifier-1]
identifier-2 LINES
BEFORE .
{ AFTER \ ADVANCING into une}
mnemonic-name
E T END—OF—PAGE
\ imperative-statement |
’ EOP
Format 2:
WRITE record-name [FROM identifier-1]
; INVALID KEY imperative-statement
Figure V-7. Formats of COBOL verbs. The general notation is the COBOL
metalanguage described in Section II.6.2.
Source: [US65] plus CODASYL approved changes through March, 1968.
359
360 LANGUAGES FOR BUSINESS DATA PROCESSING PROBLEMS
{ore se | statement-2
ELSE NEXT SENTENCE
of the form
Naturally, with this amount of flexibility, great care must be taken. This
method of writing conditions is more general than in any other language
in this book.
The nesting permits a different type of flexibility. For example, the
single sentence IF Cl S1 IF C2 S2 OTHERWISE S3 OTHERWISE S4 IF C3
S5 OTHERWISE Sé6 represents the complicated flow chart shown in Figure
V-8.
S6
latter, and they are discussed later. A CANCEL statement releases the memory
areas occupied by the named program.
The primary interface with the operating system is almost a default
one, namely the USE verb which (as indicated earlier) allows the programmer
to specify procedures which are in addition to those assumed supplied by
the normal input/output system. The STOP verb has a RUN option in which
the ending procedure established by the installation and/or compiler is
instituted. Alternatively, the STOP verb can cause a particular literal to be
displayed to the machine operator and from that he can perform actions
depending on what the compiler and/or installation has specified.
There are no facilities for really using specific machine features in
COBOL. However, the SPECIAL—NAMES paragraph and the APPLY clauses
in the ENVIRONMENT Division allow some connection between general lan-
guage facilities and specific machine or implementation facilities.
COBOL is the first major language to devote significant attention to
the problem of describing wide varieties of data. There are three major
categories of data to be concerned with: (1) Information on files coming
to or from the computer, (2) data developed internally and placed in
working storage (which might be used for report purposes), and (3) con-
stants. The COBOL DATA Division has four sections: FILE, REPORT,
WORKING—STORAGE, and CONSTANT. The most important is the FILE
Section, which is itself subdivided into File Descriptions (including Sort
File Descriptions as a special type), and Record (i.e., detailed data) Descrip-
tions. These correspond to the physical and conceptual characteristics of the
data. The physical aspects include items such as the mode in which the file
is recorded, the grouping of logical records within the physical limitations
of the file medium, and the means by which the file can be identified. The
term conceptual characteristics means the explicit definition of each logical
record within the file itself. A logical record is any consecutive set of infor-
mation. In an Inventory Transaction File, for example, a logical record could
be defined as a single transaction or as all consecutive transactions which
pertain to the same stock item. Several logical records can occupy a block
(1.e., physical record), or a single logical record can extend across physical
records.
The sections in the DATA Division consist of a series of related and un-
related entries as will be shown in Figures V-9 to V-13. This is different from
the paragraph-sentence-statement structure which characterizes the other
three divisions. An entry consists of a level indicator, a data name, and a
series of independent clauses which may be separated by the use of semi-
colons. The clauses may be written in any sequence, except when the entry
format specifies otherwise. The entry itself is terminated by a period.
A detailed data description consists of a set of entries (Shown in Figure
V-9). In defining the lowest level or subdivision of data, the following infor-
v.3. coBoL 365
In some cases this information can be defined either through specific clauses
or by the PICTURE clause.
The large (although not total) amount of machine independence, while
still retaining some efficiency, comes through the use of features such as
assuming only decimal numbers regardless of whether the computer is
binary; controlling spacing within the word boundaries through such
general clauses as SYNCHRONIZED or JUSTIFIED, which can be implemented
appropriately on different computers; and indicating USAGE so that the
compiler knows the best internal form in which to store the number.
To specify a particular format for input or output, the programmer
obviously provides the appropriate data description. However, in order to
provide the full flexibility of a report generator, the Report Section is in-
cluded in the DATA Division. This consists of the Report Name (RD) and
Report Group description entries, shown in Figures V-10 and V-11, respec-
tively. The former contains the information pertaining to the overall format
such as number of physical lines per page, limits for specified headings,
footings, and details within a page structure. The latter allows the pro-
grammer to “fill in” the pictorial representation of a line or series of lines;
the format is shown in Figure V-11.
The WORKING—STORAGE and CONSTANT Sections in the DATA Division
have a format similar to that of the Record Description.
‘A File Description (FD) entry (shown in Figure V-12) generally includes
the following: The manner in which the data is recorded on the file, the
size of the logical and physical records, the names of the label and data re-
cords and reports contained in the file, and finally the keys on which the data
366 LANGUAGES FOR BUSINESS DATA PROCESSING PROBLEMS
Format I:
O01 data-name-1 ; COPY library-name
word-] word-2
| REPLACING eter} BY rresiher-2f
| word-3 | py word-4 \)
lidentifier-4 soo |e
’ lidentifier-3) —
Format 2:
level-numb weet
evel-number +. ep
[; REDEFINES data-name-2]
sonst
; SIZE IS integer-2 {orens
ACTTER ‘\
eger-2 {pie RAC
; SIZE IS [integer-1 TO] int ) DIGITS
[DEPENDING ON data-name-3]
- COMPUTATIONAL )y-,
COMP
COMPUTATIONAL-n
COMP-n )
; [USAGE |S] 1 GISPLAY
DISPLAY-n
| _ | INDEX
INDEX-n )-
[; OCCURS integer-4 TIMES
ASCENDING
\ KEY IS data-name-5 [, data-name-6] | ees
| OScERONeS
[INDEXED BY index-name-] [, index-name-2] ...]
; OCCURS integer-3 TO integer-4 TIMES {DEPENDING ON data-name-4]
ASCENDING
\ KEY IS data-name-5 [, data-name-6] | wee
| {oescewoms
[INDEXED BY index-name-! [, index-name-2] ...] 4
: iSiGN
SIGNED \
SIGN IS data-name-9
} {SYNcHRON
SYNC
ZED} (er ]
RIGHT
|
LEFT PLACES
; POINT LOCATION IS tare} integer-5 {ars a
ALPHABETIC
NUMERIC
SraS® 1S.) ALPHANUMERIC
AN
; JUSTIFIED } RIGHT
ust
[; RANGE IS literal-1 THRU literal-2]
V.3. COBOL 367
~ (ZERO SUPPRESS
CHECK PROTECT [LEAVING integer-6 PLACES]
' )FLOAT DOLLAR SIGN
FLOAT CURRENCY SIGN.
[; BLANK WHEN ZERO]
[; VALUE IS literal-3] .
Format 3:
66 data-name-1]; RENAMES data-name-2 [THRU data-name-3] .
Format 4:
VALUE IS
88 condition-name ; { \ literal-1 [THRU literal-2]
VALUES ARE
[, literal-3 THRU literal-4]] ... .
Format 1:
RD report-name ; COPY library-name
word-] word-2
Format 2:
RD report-name
[; WITH CODE mnemonic-name-]]
CONTROL IS aay . .
+ \CONTROLS ARE identifier-1 [, identifier-2] ...
—_—— FINAL , identifier-1 [, identifier-2] ...
LIMIT IS LINE
[ PAGE tLMits ane} integer-] tines} [, HEADING integer-2]
[, FOOTING integer-5} |.
Figure V-10. Report description (RD) skeleton in COBOL. The general nota-
tion is the COBOL metalanguage described in Section II.6.2.
Source: [US65] plus CODASYL approved changes through March, 1968.
Format 2:
01 [data-name-1|
ALPHABETIC
NUMERIC
; [CLASS IS]
ALPHANUMERIC
AN
integer-1
[ LINE NUMBER IS « PLUS tana}
NEXT PAGE
integer-3
| NEXT GROUP IS 4 PLUS integer-4
NEXT PAGE
CHARACTERS |
[ SIZE IS integer-5 {
DIGITS
/ REPORT HEADING : )
RH
PAGE HEADING
PH
OVERFLOW HEADING
OH
{ca Hema f
CONTROL HEADING) (identifier-2
1 TPE1s | DETAIL
DE
(er tema f
CONTROL room| identifier-3
OVERFLOW FOOTING
OV
PAGE FOOTING
PF
REPORT FOOTING
. RF /
DISPLAY-n
[ [USAGE IS] {
DISPLAY \|
Format 3:
level-number [data-name-1]
ALPHABETIC
NUMERIC
; [CLASS IS]
ALPHANUMERIC
AN
[; COLUMN NUMBER IS integer-1]
368
V.3. COBOL 369
ZERO SUPPRESS
CHECK PROTECT [LEAVING integer-2 PLACES]
* ) FLOAT DOLLAR SIGN
FLOAT CURRENCY SIGN
[; BLANK WHEN ZERO]
[; GROUP INDICATE]
JUSTIFIED
‘ just }ricur
integer-3
; LINE NUMBER IS 4 PLUS integer-4
NEXT PAGE
fw
PIC \ iS character-string
=e
LEFT
; POINT LOCATION IS { \ integer-5 PLACES |
RIGHT
RESET ON {on |
identifier
-2
RESE
=e
; SIGNED]
—
Figure V-11. Report group skeleton in COBOL. The general notation is the
COBOL metalanguage described in Section II.6.2.
Source: [US65] plus CODASYL approved changes through March, 1968.
The listing of data and label record names in a File Description entry
serves as a cross-reference between the file and the records in the file.
A sort file is a name for the set of records to be sorted by a SORT state-
ment. The format of its description (SD) is shown in Figure V-13. There are
no label procedures which the user can control, and the rules for blocking
and internal storage are peculiar to the SORT verb. Each of the sorted records
can be made available, in order, by being RETURNed from the sort file during
the output procedures specified by the SORT statement. The sort file created
by the execution of RELEASE statements can only be SORTed and its records
can only be obtained by being RETURNed from the sort file during the
OUTPUT PROCEDURE.
The storage allocation is handled automatically by the compiler. The
prime unit for allocating executable code is a group of sections called
Format 1:
FD file-name ; COPY library-name
word-] word-2
| REPLACING retiter-1} bY (nretier-2}
| word-3 BY word-4 \)
’ lidentifier-3) — (identifier-4 ser ye
Format 2:
FD file-name
[; RECORDING MODE IS mode]
[; FILE CONTAINS ABOUT integer-I RECORDS]
. . RECORDS
[ BLOCK CONTAINS [integer-2 TO] integer-3 \craonc test
REPORT !S
\ report-name-! [, report-name-2] |
: {REORTS ARE
[; SEQUENCED ON data-name-9 [, data-name-10] ...]
identifier-1 LINES
I LINAGE IS {now LINES y .
mnemonic-name
Figure V-12. File description (FD) skeleton in COBOL. The general notation
is the COBOL metalanguage described in Section II.6.2.
Source: [US65] plus CODASYL approved changes through March, 1968.
Format 1:
SD file-name ; COPY library-name
word-] word-2
| REPLACING er kent} BY enero}
BY word-4 |
| word-3 coe [ie
’ lidentifier-3} — (identifier-4
Format 2:
SD file-name
[; FILE CONTAINS ABOUT integer-] RECORDS]
[; RECORD CONTAINS [integer-2 TO] integer-3 CHARACTERS]
RECORD IS
[ DATA heconbs ret data-name-! [, data-name-2] | .
Figure V-13. Sort file description (SD) skeleton in COBOL. The general
notation is the COBOL metalanguage described in Section IT.6.2.
Source: [US65] plus CODASYL approved changes through March, 1968.
370
v.3. COBOL 371
Format 1]:
OBJECT—COMPUTER . COPY library-name
word-] word-2
| REPLACING (ecitteraf BY (rrecniter-2
f
BY word-4 |
| word-3
’ lidentifier-3} —— (identifier-4 very
Format 2:
OBJECT—COMPUTER . computer-name [WITH SUPERVISOR CONTROL]
WORDS
integer cianacrens
, MEMORY SIZE MODULES
ADDRESS literal-1 THRU literal-2
[, literal-3 THRU literal-4] ...
[, [literal-5] implementor-name-]] ...
[, SEGMENT-LIMIT IS priority-number] [, ASSIGN OBJECT—PROGRAM
TO input-unit] .
the relationship among certain hardware devices used by the COBOL com-
piler and the names they are referred to by in the program (see Figure V-15).
Thus there is an easy mechanism for providing information about compiling
on one machine for another; to the best of my knowledge, this “cross
compilation” has not been done by anyone.
372 LANGUAGES FOR BUSINESS DATA PROCESSING PROBLEMS
Format I:
SPECIAL—NAMES. COPY library-name
word-] word-2
| REPLACING ‘rectitter-1f BY reiter2f
| word-3 BY ea 4 |
’ lidentifier-3) — lidentifier-4) | “| °
Format 2:
IS_mnemonic-name [, ON STATUS
IS_mnemonic-name [, OFF STATUS
SPECIAL—NAMES. | implementor-name
ON STATUS IS condition-nome-1
OFF STATUS 1S condition-name-2
IS condition-name-] [, OFF STATUS ISIS condition-name-2]]
1s condition-name-2 [, ON STATUS Is condition-name-]]]
L OFF STATUS IS condition-name- -2)
[, ON STATUS Is. condition-name-1]
[, ‘CURRENCY SIGN IS literal] [, DECIMAL—POINT IS COMMA].
Format 1:
FILE—CONTROL. COPY library-name
word-1 word-2
[ REPLACING eiter-t BY (identiter-2f
! cn | y word-4
’ (identifier-3) —- (identifier-4) | "| °
Format 2:
, PRIORITY IS implementor-name-3}]
FILE—LIMIT IS data-name-] THRU data-name-2
1
SEQUENTIAL
, PROCESSING MODE IS FOR integer-3 RECORDS} |
{RANDOM —
Format 3:
FILE—CONTROL. {SELECT [OPTIONAL] file-name
ASSIGN TO implementor-name-4
[, implementor-name-5] ... OR implementor-name-6
[, implementor-name-7] ...
REEL integer-4 | AREA ||
| FOR MULTIPLE ——
{feat I. R
RESERVE {No ha L TERNATE AREAS
Format 1:
I-O—CONTROL. COPY library-name
word-] word-2
| REPLACING {rectiter-a} BY Lidentiter 3
| word-3 BY word-4 \)
’ \identifier-3) — |identifier-4) | “| ©
Format 2:
I-O-—CONTROL. [APPLY input-output technique ON file-name-1
[, file-name-2] ...] ...
; RERUN [on {nereme \
—- | implementor-name
REEL
‘fe OF iar to file-name-4 | aoe
EVERY integer-T RECORDS
integer-2 CLOCK—UNITS
condifion-name
verb; and NOTE, which signifies that the following sentence or paragraph
is a comment and hence is not to be translated by the compiler.
The compiler-directing declaratives are COPY and USE, both of which
were discussed earlier.
I am not aware of any serious attempts to write a COBOL compiler
in COBOL, although I believe it probably could be done. The EXAMINE verb
was included partially to aid in such a process. Some amount of concern
was given in the design of COBOL to the ease of implementation, but it
was not a major factor.
Some of the early implementations were carried on in parallel with the
language development; this had the obviously valuable effect of providing
instances in which the draft specifications were unworkable from an imple-
mentation point of view. Many of the early COBOL compilers were absolutely
dreadful in terms of performance; in many cases this was considered a
reflection on the language, whereas in reality it was merely an indication of
the fact that techniques for efficient implementation of complex data proc-
essing languages like COBOL had not yet been developed. Current
COBOL compilers are much more satisfactory from both the compile time
and object time point of view. Some of the difficulties in the implementation
v.3. COBOL 375
are caused by the fact that it may be very hard to do something on a par-
ticular machine which is simple on another.
COBOL does not impose any implied storage allocation problems on
the compiler since all the requirements are given in the source program.
This obviously does not mean that some compilers will not be more effective
in their storage handling than others, but such features as recursion and
dynamic storage allocation are not required by the language. The most sig-
nificant element in this area is the necessity of providing buffers for input
and output data.
There are no separate requirements for debugging aids and error
checking; these are left to the implementer. The language specifications
point out a number of cases in which the results of a given error type are
unpredictable.
1. IDS
The IDS (Untegrated Data Store) system has been developed by
C. Bachman and others at the General Electric Company. Although 1m-
plemented as an extension of COBOL, the concepts are general and can
be applied to any computer which has a mass memory device.
The basic concept is to place in a normal data record some additional
fields called chain fields which contain the address of other IDS records.
(This concept is closely related to the concept of /ists developed in Chapter
VI.) Additional entries are provided in the COBOL Record Description,
e.g., RETRIEVAL VIA CALC CHAIN, PLACE NEAR data-name CHAIN, and
PAGE-RANGE. Other additions to the Data Division are provided. New
verbs are also added. In particular, the verbs STORE (a new record into
the file and link it into the chains as specified in the Data Division),
RETRIEVE (a record which is already in the IDS system), MODIFY (change
the content of one or more fields with automatic relinking of the chains if
necessary), DELETE (a record from its chains and the files) are provided.
File handling systems are beyond the scope of this book for several
reasons. First, much of the emphasis is (quite rightly) on the file organization
REFERENCES 377
with the language elements being secondary and/or primitive. Second, many
of the systems concentrate on the use of printed forms rather than languages.
Third, the overlap and interconnnection between query languages (or
systems) and file handling languages (or systems) is quite high. In some
instances they are almost synonymous, 1.e., a system might be considered
a file handling or query system based primarily on the bias of the user.
References to some file handling systems are included with those listed
in the bibliography for Section IX.3.2.1.
REFERENCES
[DG63] d’Agapeyeff, A., Baecker, H. D., and Gibbens, B. J., “Progress in Some
Commercial Source Languages”, Annual Review in Automatic Program-
ming, Vol. 3 (R. Goodman, ed.). Pergamon Press, New York, 1963,
pp. 277-98.
[1B61b] IBM 7090 Programming Systems, SHARE 7090 9PAC Part 1: Intro-
duction and General Principles, IBM Corp., J28-6166, Data Processing
Division, White Plains, N.Y. (1961).
[IB65d] IBM System 360/Operating System Report Program Generator Speci-
fications, IBM Corp., C24-3337, Data Processing Division, White Plains,
N.Y. (1965).
[LN62] Longo, L. F.,. “SURGE: A Recoding of the COBOL Merchandise
Control Algorithm”, Comm. ACM, Vol. 5, No. 2 (Feb., 1962), pp.
98-100.
[LS67] Leslie, H., “The Report Program Generator”, Datamation, Vol. 13,
No. 6 (June, 1967), pp. 26-28.
[MG59] McGee, W. C., “Generalization: Key to Successful Electronic Data
Processing”, J. ACM, Vol. 5, No. 1 (Jan., 1959), pp. 1-23.
[MG60] McGee, W. C. and Tellier, H., “A Re-Evaluation of Generalization”,
Datamation, Vol. 6, No. 4 (July-Aug., 1960), pp. 25-29.
[MG63] McGee, W.C., “The Formulation of Data Processing Problems for
Computers”, Advances In Computers, Vol. 4 (F. L. Alt and M. Rubi-
noff, eds.). Academic Press, New York, 1963, pp. 1-52.
[NM00] SURGE: A Data Processing Compiler for the IBM 704, North Ameri-
can Aviation, Inc., Columbus, Ohio.
[RR55a] BIOR (Business Input-Output Rerun) Compiling System, Remington
Rand, Inc., ECD-2 (1955).
[SH65] Shaw, C.J., Theory, Practice, and Trend in Business Programming,
System Development Corp., SP-2030/001/02, Santa Monica, Calif.
(July, 1965).
[WY6la] Willey, E. L. et al., “Some Commercial Autocodes—A Comparative
Study,” A.P.L.C. Studies in Data Processing No. I. Academic Press,
Inc. (London) Ltd., 1961.
378 LANGUAGES FOR BUSINESS DATA PROCESSING PROBLEMS
V.2.1. FLOW-MATIC
V.2.2. AIMACO
V.2.4. FACT
V.2.5. GECOM
V.3. COBOL
[GV62] Greene, I., “Guides to Teaching COBOL”, Comm. ACM, Vol. 5, No. 5
(May, 1962), pp. 272-73.
(H162] Hicks, W., “The COBOL Librarian—A Key to Object Program Effi-
ciency”, Comm. ACM, Vol. 5, No. 5 (May, 1962), p. 262.
[HY62] Humby, E., “Rapidwrite—COBOL Without Tears”, Symbolic Languages
in Data Processing. Gordon and Breach, New York, 1962, pp. 573-83.
[HY63] Humby, E., “Rapidwrite”, Annual Review in Automatic Programming,
Vol. 3 (R. Goodman, ed.). Pergamon Press, New York, 1963, pp.
299-310.
[1B63] COBOL and Commercial Translator: A Comparison, IBM Corp.,
J28-6310, Data Processing Division, White Plains, N.Y. (1963).
[1C62a] “General Panel Discussion: Is a Unification ALGOL-COBOL,
ALGOL-FORTRAN Possible? The Question of One or Several Lan-
guages”, Symbolic Languages in Data Processing. Gordon and Breach,
New York, 1962, pp. 833-49.
[JU65] Junker, J. P. and Boward, G. R., “COBOL vs. FORTRAN: A Sequel”,
Datamation, Vol. 11, No. 4 (Apr., 1965), pp. 65-67.
[KS62] Kesner, O., “Floating-Point Arithmetic in COBOL”, Comm. ACM,
Vol. 5, No. 5 (May, 1962), pp. 269-271.
[LN62] Longo, L. F.. “SURGE: A Recoding of the COBOL Merchandise
Control Algorithm”, Comm. ACM, Vol. 5, No. 2 (Feb., 1962), pp.
98-100.
[LP62] Lippitt, A., “COBOL and Compatibility”, Comm. ACM, Vol. 5, No. 5
(May, 1962), pp. 254-55.
[MN61] Makinson, T. N., “COBOL: A Sample Problem”, Comm. ACM, Vol. 4,
No. 8 (Aug., 1961), p. 340.
[MU62] Mullin, J. P., “An Introduction to a Machine-Independent Data Divi-
sion”, Comm. ACM, Vol. 5, No. 5 (May, 1962), pp. 277-78.
[NF64] Naftaly, S. M., “Compiling a COBOL Questionnaire”, Datamation,
Vol. 10, No. 8 (Aug., 1964), pp. 30-33.
[QH66] Budd, A. E., A Method for the Evaluation of Software: Procedural
Language Compilers—Particularly COBOL and FORTRAN, Mitre Corp.,
(DDC) AD 651142, Commerce Dept. Clearinghouse, Springfield, Va.
(Apr., 1966).
[SG62] Siegel, M. and Smith, A. E., “Interim Report on Bureau of Ships COBOL
Evaluation Program”, Comm. ACM, Vol. 5, No. 5 (May, 1962), pp.
256-59.
[SM61] Sammet, J. E., “A Method of Combining ALGOL and COBOL”,
Proc. WJCC, Vol. 19 (1961), pp. 379-87.
[SM6la] Sammet, J. E., “A Definition of the COBOL 61 Procedure Division
Using ALGOL 60 Metalinguistics”, Summary in Preprints of 16th
Nat’! Meeting of the ACM, Sept., 1961, pp. 5B-1 (1)-4).
[SM61b] Sammet, J. E., “General Views on COBOL”, Annual Review in Auto-
matic Programming, Vol. 2 (R. Goodman, ed.). Pergamon Press, New
York, 1961, pp. 345-49. (Same article as [SM6lIc].)
[SM6Ic] Sammet, J. E., “More Comments on COBOL”, Datamation, Vol. 7,
No. 3 (Mar., 1961), pp. 33-34. (Same article as [SM61b].)
REFERENCES 381
[SM62] Sammet, J. E., “Basic Elements of COBOL 61”’, Comm. ACM, Vol. 5,
No. 5 (May, 1962), pp. 237-253. (Also in [RO67].)
[SX63] Saxon, J.A., COBOL: A _ Self-Instructional Manual. Prentice-Hall,
Inc., Englewood Cliffs, N.J., 1963.
[US60] COBOL: Initial Specifications for a Common Business Oriented Lan-
guage, Dept. of Defense, U.S. Govt. Printing Office, Washington, D.C.
(Apr., 1960).
[US61] COBOL-1961: Revised Specifications for a Common Business Oriented
Language, Dept. of Defense, U.S. Govt. Printing Office, Washington,
D.C. (1961).
[US62] COBOL-1961 Extended: Extended Specifications for a Common Busi-
ness Oriented Language, Dept. of Defense, U.S. Govt. Printing Office,
Washington, D.C. (1962).
[US65] COBOL: Edition 1965. Dept. of Defense, U.S. Govt. Printing Office,
Washington, D.C. (Nov., 1965).
[WH62] Whitmore, A. J., “COBOL At Westinghouse”, Datamation, Vol. 8,
No. 4 (Apr., 1962), pp. 31-32.
[W M67] COBOL Programming Tips, Westinghouse Electric Corp., Management
Systems Dept. (Apr., 1967).
[WY61] Willey, E. L. et al., “A Critical Discussion of COBOL”, Annual Review
in Automatic Programming, Vol. 2 (R. Goodman, ed.). Pergamon
Press, New York, 1961, pp. 293-304.
[X B00] X3.4 COBOL Information Bulletins, BEMA/DPG, Numbers 1-11
(Apr., 1963—present) (continuing publication, distributed irregularly).
[XB67] X3.4 COBOL Information Bulletin No. 9, “Proposed USA Standard
COBOL”, ACM SICPLAN Notices, Vol. 2, No. 4 (Apr., 1967).
[ZQ67] Callahan, M. D. and Chapman, A. E., “Description of Basic Algorithm
in DETAB/65 Preprocessor”, Comm. ACM, Vol. 10, No. 7 (July, 1967),
pp. 441-46.
V.4.1.1. ZDS
For several reasons, this chapter is probably a more difficult one to com-
prehend than most of the others. The main reason is that relatively few
people have had experience with, or exposure to, the types of problems for
which the languages in this chapter are needed. In the other areas, far less
background and/or direct experience is required to appreciate the language
facilities described. Thus, this chapter may well have the unfortunate
characteristic that the people who are not familiar with the languages involved
may not understand the descriptions, and those who are familiar with them
will not need the information contained herein. In spite of this dilemma, it
is obvious that no book on programming languages would be complete
without a description of the languages used for list processing, string manipu-
lation, and pattern matching. A further difficulty arises because the outline
of Chapter III is difficult to follow for this class of languages; hence the
technical descriptions in this chapter do not particularly match the sequence
or emphasis of material in that chapter.
In order to have any understanding at all of the language facilities
provided in differing ways, it is necessary to comprehend the basic concept
of a list. This concept was first introduced by Newell, Simon, and Shaw
[NW56] to help solve the particular problem that they were working on,
namely the proof of theorems in the propositional calculus. The list concept
has since become one of the cornerstones of a great deal of work in the com-
puter field. Its need arises in the many applications which require dynamic
storage allocation of a very large and complex kind. One specific type of
problem in which this arises occurs when there is a need to maintain tables
382
VI.1. SCOPE OF CHAPTER 383
for several different kinds of data, but the user has no way of telling ahead
of time how much space should be allocated to each table; in other words,
he cannot tell (in fact, it changes from problem to problem) how many ele-
ments will be in each table. In addition to that difficulty, there are many
applications in which the major activity consists of inserting and deleting
elements from tables. If the information is stored in sequential memory
locations, this requires constant work (by both the programmer, and the
computer at object time) to move the data elements.
Some of the specific areas using this type of activity are compiler writing,
theorem proving, manipulation of formal algebraic expressions, picture
processing, some types of linguistic data processing, and most aspects of
work in artificial intelligence. These applications have tended to become
lumped together under the general title symbol manipulation.
The basic concept of a list is quite simple. Instead of storing data sequen-
tially in memory, each item contains not only the data element but the
address of the next data element in logical sequence. (See Figure VI-1.) It
is immediately obvious that this may (but does not always) waste storage.
If the data item and the address fit together in some logical storage unit
in the machine (e.g., a word), then perhaps not much space is wasted. On
the other hand, it may be necessary to use a second memory location for the
500 A |503
50| ~ C {509
502
503 —~ B | 50 |
509 Lo D
address (commonly called a pointer) to the next element. This is one of the
penalties accruing from the use of list processing. On the other hand, to insert
or delete an element is extremely simple. Thus, to insert an element between
B and C in Figure VI-1, it is only necessary to change one address rather
than moving all the elements. (See Figure VI-2.) Beyond this basic concept,
one of the significant elements in list processing is whether the element of
a list can itself be a list, as illustrated in Figure VI-3. Another situation occurs
when each element of a list can consist of many data elements. This is some-
times called an n-component element or plex.
900 A {503
90! C C |;509
903 L_ B | 506
906 | INSERT} 5O |
909 > D
Figure VI-2. Inserting element in a list. Contrasting this with Figure VI-1
shows that only one address, namely the one in position 503 (associated
with B) has been changed to point to the INSERT item in 506. The pointer
from JNSERT goes to C in 50/]. Nothing else had to change.
mL > M
Figure VI-3. List structure, i.e., list containing list as element. This shows
several levels of sublists. The element Q points to an element which contains
no data but instead points both to a single element R, and to a sublist whose
first element is X. X points to Y which in turn points to an element containing
no data but points to a single element Z, and to a sublist containing the
elements L and M.
refer the reader to this paragraph after he has studied Sections VI.6 and
V1.7. COMIT seems to be a more complex language for professional pro-
grammers than SNOBOL since some of the facilities in the latter are closer
to those of other programming languages. On the other hand, linguists and
programmers have certainly used both languages successfully. I am unaware
of any carefully written detailed comparisons; the following comments are
of necessity superficial COMIT permits a more complex data structure
through the use of its logical and numeric subscripts than SNOBOL does;
SNOBOL provides only strings. Furthermore, the ability in COMIT to
define individual elements (i.e., constituents) which are either single charac-
ters or groups of characters (e.g., English words) provides more flexibility
in programming and scanning. The list rule feature in COMIT to provide
fast table lookup is a distinct advantage. On the other side, the ability of
SNOBOL to assign names to specific strings and to name unknown strings
provides an ease of programming far above equivalent actions in COMIT.
The ability to define functions and the elaborate types of pattern searching
which are available in SNOBOL provide that language with definite advan-
tages in certain cases. In conclusion, as in deciding between any two lan-
guages, the potential user must weigh carefully all the technical features,
the specific implementations he is dealing with, and the factors discussed
in Chapter II.
TRAC’ is a still more recent development which attempts to combine
some of the basic facilities from the list and string processing languages and
to do this in an on-line environment.
Finally, there are several langugaes which have been developed and
implemented but are not in any way widely used. These include AMBIT,
TREET, CLP, CORAL, SPRINT, and LOLITA.
A general description of many symbol manipulation languages is given
in Raphael et al. [RA67]. This provides an excellent bird’s-eye view of most
of the languages described in this chapter and in Chapter VII. However,
some of the items in that paper are not languages by the criteria established
in this book.
Any reader who has had previous exposure to list processing or who
has even absorbed some of the atmosphere in this field may wonder at the
absence of SLIP and DYSTAL from the list of languages discussed in this
chapter. The reason is simply that they are not languages but merely packages
of subroutines which are embedded in a language, e.g.,. FORTRAN. To
quote from the SLIP designer, “It [SLIP] is a language system designed to be
imbedded in a higher order language capable of calling machine language
subroutines”,? and his personal comment to me “of course SLIP 1s not a
1 TRAC is the trademark and service mark of Rockford Research Institute Incor-
porated in connection with their standard computer controlling languages.
2 Weizenbaum [WZ63], p. 524.
388 sTRING AND LIST PROCESSING LANGUAGES
There are no list or string processing languages which fall in this category.
VI.3. IPL-V
VI.3.1. History
One of the most significant events that has ever occurred in program-
ming was the development of the concept of list processing by Allen Newell,
VI.3. IPL-v 389
J. C. Shaw, and Herbert Simon. The classic paper in which these ideas were
presented is by Newell and Simon [NW56]. Because of the historical signifi-
cance of this work, a list of most of the principal primitive instructions from
that paper is included as Figure VI-4; however, this language was never imple-
mented. From a conceptual point of view, the early language was fairly
application-oriented, where the applications involved proving theorems in
the propositional calculus and playing chess. The first language (which was
really a collection) was called IPL-I (Information Processing Language-I). The
first implemented version was IPL-II, which is described in Newell and Shaw
[NW57a]. This was implemented on the JOHNNIAC at the RAND Corpora-
tion. The first major use of the language was for proving theorems in the
propositional calculus and was reported in Newell, Shaw, and Simon
[NW57]. The next version, IPL-III, was abandoned shortly after it became
operational because it required too much space. IPL-IV was used for a num-
ber of significant programs in the field of artificial intelligence; IPL-IV
strongly resembles IPL-V* but has never actually been documented. Work
on IPL-V actually started in late 1957 at Carnegie Institute of Technology
on the IBM 650 as a modification of IPL-IV. A running version of IPL-V
was available in early 1958. A newer (and essentially final) version of the
language became operational on the 704 at the end of the summer in 1959.
The first published description of IPL-V appeared in 1960 (see Newell and
Tonge [NW60)).
The implementation and development of this line of language stopped
with IPL-V because the people most vitally concerned were more interested
in the problems they were trying to solve than in further language develop-
ments. This is a refreshing contrast to other areas in which the language
development began to overshadow the problem-solving. However, an IPL-
VI was proposed as an order code for a computer (see Shaw et al. [JC58)).
IPL-V has been one of the most widely implemented languages, and
versions exist on at least the following machines: IBM 650, 704, 709/7090,
1620, UNIVAC 1105 and 1107, Control Data 1604 and G20, Burroughs
220, Philco 2000, and AN/FSQ-32.
Numerical
we OX
NAGG Add G(x) to G(y); result in G(y).
NAH wm
Add one to H(x).
NAK Add one to K(x).
K
Assign
Compare
ara
rTrrr
Find
Store
NM ON
<=™“N
Put
Test
TB If E(x) is blank, — b.
TU If E(x) is a unit, —> b.
1GG If G(x) > 0, — b.
Mm
Branch
B b Branch to b.
BHB In higher instruction, — b.
BHN In higher instruction, — next.
IPL has come to be described as “like assembly code” when its description
in the early 1960’s was as a problem-oriented language. The IPL application
area is “for problems that are sufficiently complex, ill-structured, and dif-
ficult to require intelligence for their solution by humans.”* It was certainly
meant to be used only by a professional programmer. It was definitely devel-
oped for use as a batch system, but it has been successfully used in general
time-sharing systems or in those with remote job entry facilities.
By its very nature, it is not hard for IPL-V to be fairly machine indepen-
dent, providing only that the data items will fit into the portion of the machine
word allocated to data. Since most of the implementations are interpretive,
there is slightly less of a problem about compiler dependence and the systems
are essentially (although not 100 percent) interchangeable. As far as dialects
are concerned, because the structure of the language consists of a long list
of available routines, it is very easy for somebody to add other routines.
The problem of subsettings and extensions has not really arisen, except in
the sense of having these new routines added by individual groups.
There has been no consideration of official USASI standardization.
In addition to A. Newell, F. M. Tonge, E. A. Feigenbaum, B. F. Green,
Jr., and G. H. Mealy, who are the editors of the manual [NW65], numerous
other people were involved in the implementation for their individual
computers. A list is given at the beginning of the IPL-V manual. There is
no official maintenance. However, in an effort to provide some coordination
SAMPLE PROGRAMS—IPL-V
Problem: Reverse the symbols after the head cell of the list named in HO.
Program:
Name PQ Symb Link Comment
R2 J60 Step pointer to cell containing first sym-
bol
70 J8 Clean up and stop if list was empty
40 HO
40 HO Push down two copies of pointer to first
symbol (needed as arguments for J65
and J68 below)
R2 Recursively reverse symbols after the
first
12 HO Get the first symbol
J65 J68 Insert it at the end and delete it from
the beginning
Problem: Test whether two list structures are equal, where “equal” means
they have the same hierarchical structure and the same elementary symbols in
corresponding positions.
Program:
Name PQ Symb — Link Comment
R1 J51 Spread arguments in working storage
9-3 12 WO Get next symbols
12 Ww!
J2 Compare symbols
70 9-2 Branch if not identical
9-4 11 WwO
J60 Step first list
20 WwO
70 9-1 Branch if first list ended
11 WI!
J60 Step second list
20 WI!
70 J31 9—3 Clean up and quit, or loop
9-2 12 wo Symbols not identical
J132 Test if local, i.e., name of a sublist
70 J31 Quit if either not local
12 Wl
J132
70 J31
12 WO Both local. Input substructure names
12 Ww!
RI Recursively test sublists for equality
70 J31 9-4 Quit if substructures differ
| 11 Wl
J60 Are main lists the same length?
30 HO
J5 J31 Set H5 to + if R1’s two inputs are names
of “equal” structures, and set H5 to
— otherwise. Cleanup and quit.
V1.3. IPL-v 393
Associated with each storage cell is a data list called a pushdown list. The
storage cell is the head of the list and the cells used in the storage system are
list cells. By convention, WO,..., W9 are used for temporary storage,
although any cell can be a storage cell.
Since the basic purpose of IPL-V is to operate on lists, it is essential to
know what types are defined. IPL permits data lists, data list structures, and
list structures.
A data list is a set of cells whose sequence is defined by the rule that the
LINK part of the cell contains the name of the next cell in the list. (When
nothing is written, there is an automatic link to the next word.) The link of
the last cell in the list is a termination symbol, denoted by 0. A data list is
created by writing a symbol in the NAME field of some line, and this symbol
is the name of both the list and the symbol at the head of the list. The termina-
tion symbol 0 1s written for the link of the last cell. The system will assign
an internal name to any cell not explicitly named by the programmer;
however, the programmer may give names to list cells by using local sym-
bols (since using regional symbols usually starts a new list). This can be done
to avoid writing the data list information in sequential order on the coding
sheet. For example,
A list structure is a set of lists connected by the names of the list occur-
ring on other lists in the set. A data list structure is a fairly simple form of the
list structure since there are a number of restrictions on what a data list
structure can contain. A data list structure is made up of data lists and can
be more complicated than a tree since the name of a sublist can appear in
the structure.
The smallest executable unit is a single instruction which always has
the standard form: P OQ SYMB LINK, where the LINK defines the location
of the next instruction and the rest shows the operation to be performed.
Single instructions can be combined to form a program list which can be
reentrant. A program list can have regional symbols as LJNKs and names
of list cells as SYMB. Programmed lists can be combined into a higher
executable unit called a routine; this is a list structure with one programmed
list (called the main list) that has a regional or internal name while all the
other lists are called sublists and have local names. The program list cannot
have a description list associated with it. A program is a set of routines.
Every routine may be a subroutine or a main program; no special linkage
conventions are needed.
There are three types of cells defined relative to a routine. A storage
cell is called safe over a routine if the routine leaves the symbol in the cell
(and the pushdown list) the same as it was prior to beginning the routine,
except where the latter calls for modification. A routine can have input and
output symbols. By convention, inputs for a routine are placed in a special
storage cell called the communication cell which is designated HO. If there
are multiple inputs, they are in the pushdown list of HO in the sequence
determined by the definition of the routine. Similarly, multiple outputs are
placed in the pushdown list. The communication cell must be safe over all
routines, which means that a routine must remove all the input symbols
from the communication pushdown list before the routine terminates. The
outputs of course are to be left in HO. A cell called the test cell and designated
H5 is used to record yes or no information, where the symbols + and — are
used, respectively; they are denoted internally by J4 and J3. -
The Q prefix is called the designation operation in an instruction. The
operand of the Q prefix is SYMB and the result is a new symbol S. Q can
have eight values, including the provision for one or two levels of indirect
addressing (denoted by 1 and 2) and tracing provisions (designated by 3
and 4).
The P prefix actually specifies the operation in an instruction. The eight
P operations on S permit the execution of subroutines (P = 0), the transferral
of symbols to and from the communication cell HO (P = 1, 2, 5, and 6), push
or pop the pushdown list of S to S (P = 3, 4), and transfer control to S$
if H5 has a minus sign (P = 7); the last is thus a conditional transfer.
The heart of the system is the set of basic processes (designated by J).
V1.3. L-v 397
Some of these are primitive, and some are elementary routines built up from
the primitives (i.e., coded in IPL-V). (In the definition of the J processes,
we let (0) represent the symbol in HO, (1) represents the first symbol beneath
the top of the pushdown list, (2) represents the second symbol from the top
of the pushdown list, etc.) There are system regions and system cells which
are used by these basic processes. The regions H, J, and W cannot have new
symbols defined by the programmer. There are a number of specified cells
which have special functions, e.g., HO,...,H5, WO,..., W43. As illustra-
tions of how these are used, H3 is a tally of the interpretation cycles executed,
W11 is the remainder of integer division, W21 holds the name of the integer
determining the print column, W28 holds the symbol indicating the cause
of the trap, and W38 holds the name of the routine which tests whether slow
auxiliary storage should be compacted at this time and compacts it if yes.
While not all the basic titles of the J routines are self-explanatory, the
general categories are described here in order to give a feel for what is
available. The complete list (by title) is shown in Figure VI-5.
General processes JO-J9. These are shown completely to give the general
idea.
398
VI.3. IPL-v 399
description list is found in the head of the describable list and is a local
symbol whenever it is created by these processes.
Read and write processes (J140-J146). Only data list structures can be
input or output by these processes.
400 sTRING AND LIST PROCESSING LANGUAGES
Print processes (J150—J162). The printing processes provided are for units
of data and for a line of information. There are actually quite flexible facilities
for controlling the format of these, as well as the form of arithmetic.
There are a number of other processes available but they become
heavily involved with actually loading the program or other very specialized
areas. There are also partial word processes, however, which read individual
lines, partial words, etc.
VI.4. Lé
SAMPLE PROGRAMS—L¢
they have the same hierarchical structure and the same elementary symbols in
corresponding positions. Each node is assumed to have three fields: R holds
pointer to right subtree or zero, L holds pointer to left subtree or zero, S contains
a symbol. List structures to be compared are pointed to by bugs X and Y. Exit is
to the place just beyond the call if structures are equal; otherwise to the designated
failure exit.
Program:
TEST IFALL (X,E,0)(Y,E,O)JDONE
IFALL (X,E,0})(Y,N,O)FAIL
IFALL (X,N,0)(Y,E,O)FAIL
IF (XS,N,YS)FAIL
THEN (S,FC,X)(S,FC,Y)(X,P,XL)(Y,P,YL)(FL,DO,TEST)(R,FC,
Y)(R,FC,X)
THEN (S,FC,X)}(S,FC,Y)(X,P,XR)(Y,P,YR)(FL,DO,
TEST)(R,FC, Y)(R,FC,X)DONE
FL THEN (R,FC,Y)(R,FC,X)FAIL
Explanation: Line 1: if both lists are null, test succeeds. Lines 2 & 3: If one
list is null but not the other, test fails. Line 4: if symbols of top blocks are different,
test fails. Line 5: after saving pointers to top of lists, X and Y go to their respective
left subtrees and perform the entire subroutine recursively, going to FL if subtrees
are not equal, otherwise X and Y are restored. Line 6: likewise with right subtrees.
Line FL: if subtrees were not equal, restore X and Y but use failure exit from this
level.
user with very primitive facilities for defining storage allocation, and struc-
tures for lists and their pointers. The general structure of a program is a
sequence of individual commands, each of which appears on a separate line
and is highly symbolic. For example,
IF(XA,E,0)THEN(R,FC,X)DONE
Field Designators
¢ “contents”, i.e., designation of a field whose contents are used in a test or opera-
tion: either a bug, A, B,...,Z, or a remote field, AO, Al, ..., ZZZZZZ.
a “affected field”, i.e., designation of a field whose contents are affected by an
operation: a bug A,B,...,Z, or remote field, AO, Al,..., ZZZZZZ.
Names
f name ofa definable field:0,1,...,9,A,B,...,Z
s aprogram symbol (i.e., name of a program location)
Literals
o an octal number specified directly: 0,1, ..., 777777777777
d a decimal number specified directly:
0, 1, ..., 34359738267(235 — 1).
h a Hollerith literal: 0, 1, ..., ZZZZZZ. Permissible characters are the ten digits,
26 letters and period. Other characters must be specified in terms of their octal
equivalences.
Alternatives
cd “contents or decimal”—1.e., either ¢ or d as explained above.
co “contents or octal”—1.e., either c or o as explained above.
A. Tests
Equality Inequality Greater than Less than
(c, E, cd) (c, N, cd) (c, G, cd) (c, L, cd)
(c, EO, 0) (c, NO, 0) (c, GO, o) (c, LO, 0)
(c, EH, h) (c, NH, h) (c, GH, h) (c, LH, h)
Pointers to One-bits of Zero-bits of
same block (c, O, co) (c, Z, co)
(cz, P, ¢2) (c, OD, d) (c, ZD, d)
(c, OH, h) (c, ZH, h)
B. Operations
Setup Storage, Get and Free Blocks
Setup storage Define field Get block Free block
(s1, SS, d, s2) (ed}, Df, eda, cd3) (a, GT, cd) (a, FR, 0)
size Aword (a, GT, ed, a2) (a, FR, c)
first word first bit
last word last bit
Copy Blocks and Fields
Copy field Duplicate block Interchange Point to
(a, E, cd) (a, DP, c) field contents same block as
(a, EO, 0) (a7, IC, a2) (a, P, c)
(a, EH, h) (a, 4) = abbrev.
for (a, P, aA)
403
404 sTRING AND LIST PROCESSING LANGUAGES
Arithmetic Operations
Add Subtract Multiply Divide
(a, A, ed) (a, S, ed) (a, M, ed) (a, V, ed)
(a, AO, o) (a, SO, 0) (a, MO, 0) (a, VO, 0)
(a, AH, h) (a, SH, h) (a, MH, h) (a, VH, h)
Logical Operations
Logical or Logical and Exclusive or Complement
(a, O, co) (a, N, co) (a, X, co) (a, C, co)
(a, OD, d) (a, ND, d) (a, XD, d) (a, CD, d)
(a, OH, h) (a, NH, h) (a, XH, h) (a, CH, h)
The word IF can be used for IFALL and NOT for IFNONE. There is also an
unconditional THEN which is followed only by operations. Operations can
be omitted, in which case the label is required.
As an illustration,
that the contents of XD (i.e., the D field of the block that bug xX
points to) Equals the contents of Y or that the contents of XA Equals 0
and contract bridge bidding, etc. (See the list of references at the end of the
chapter.)
LISP is not a very general language, in the sense that it is ill-suited for
anything except general symbol manipulation and list processing. Its hard-
ware representation 1s succinct, formal, and highly unnatural. It is reasonably
consistent but there are a number of particular cases which involve special
rules. It is extremely difficult to read and write because of the existence of
large numbers of parentheses and the problem of matching them; as a result,
the use is extremely error prone. Depending on the mental set and receptivity
of the audience, it is either easy or hard to learn.
The application area is primarily problems which have the following
characteristics, although some may be more significant than others: (1)
They require list processing; (2) they require significant amounts of recur-
sion in the operations they want to perform; and (3) they are dealing with
some type of symbol manipulation.
LISP is sufficiently unique in its concept and notation so that it does
not really fit at all well into the classifications of programming languages
given in Chapter I. About the only statement that can be made which is
both true and relevant is that there are two forms of language, a hardware
Data Language
there also. A primer by Weissman [WE67] exists. The last and single most
useful document about LISP is the one edited by Berkeley and Bobrow
[BY 66].
The evaluation of LISP as a language is difficult to separate from an
evaluation of its implementations. In particular, the early implementations
were all interpretive, and when this proved to be too slow, then compilers
were written. People now use both and are tending more toward compilers.
(However, several significant programs were written using the interpreter,
e.g., Slagle’s integration program [SL61] and Evans’ geometry analogy
program [EV64].) The great advantage of LISP is its ability to express in
a meaningful way solutions to problems which people cannot handle any
other way and to express them in a form which is natural to that class of
problems. The greatest disadvantage to LISP, and probably the one that
prevented its widespread use, is the notation that is used. This has been and
is being corrected in LISP 2, which would seem to have a much more pro-
mising future for widespread use than any of the LISP i(i < 2).
+ —- x* /( )=,. $ blank
The arithmetic operators are not used in their normal way for arithmetic
operations.
Identifiers consist of a letter followed by letters and/or digits; some
implementations place a limit on the number of characters allowed. Identi-
fiers are called atomic symbols. They cannot be subscripted but there are
other ways of dealing with arrays. No blanks are permitted within an atom.
The concepts of LISP are so different from other languages that it is
better to try to present the fundamental ideas rather than to try to follow
the general outline of Chapter III.
The whole language is built on the concept of operators or functions,
and operands. In most cases the program is a collection of function defini-
tions, which relate to each other as a set of subroutines do. A program
is executed by invoking one function (which in turn invokes the others).
While this is an oversimplification, it serves to convey the flavor of the
language. The motivation for this concept, which is the lambda calculus,
and its implications for computability theory, are beyond the scope of this
book.
The fundamental data element in LISP is the atom, which is either an
atomic symbol (i.e., identifier) or a number. All data and programs in LISP
VIS. LispP1.5 411
are written as S-expressions, which are binary tree structures built up from
atoms. An S-expression can be empty, in which case it is written as
>)
or more commonly, as NIL. For example,
A
(A)
(A B C)
(A (B C) D)
are S-expressions.
Lists may have sublists; e.g., (A B C) is a list with three elements,
whereas (A (B C)) is a list of two elements, A and (B C). The second element
itself consists of two elements, namely B and C. Each expression in list
notation has an internal computer representation.
The language for expressing operations on the S-expressions is called
the metalanguage, and the legitimate strings which can be written are called
M-expressions. There are five elementary functions which can be applied
to S-expressions: car, cdr, cons, eq, and atom. In the metalanguage (.e.,
in M-expressions), the arguments of these functions are enclosed in square
brackets and separated by semicolons, and the functions are written in small
letters. The car and cdr are functions to define, respectively, the first element
of a list (i.e., the head), and the rest of the list after the first element (i.e.,
the tail). Thus
car[(A B)] =A
car[((A B) C)] = (A B)
cdr[((A B) C)] = (C)
cdr[(A B C)] = (B C)
cons[(A;NIL)] = (A)
cons[A;(B C)] = (A B C)
cons[cons[A;NIL];(B)] = ((A)B)
Note that cons[A;B] cannot be expressed as a list and is expressed
using dot notation as (A.B). The use of the dot is a fundamental means of
forming S-expressions. The S-expressions are used to represent data and
are defined as follows: An S-expression is either an atomic symbol, or
if e] and e2 are S-expressions, then (el . e2) is an S-expression. (See Figure
VI-7 for syntactic definition.) |
LISP defines a predicate as a function whose value is true or false,
denoted by T and NIL (or F), respectively. The predicate eq is a test for
equality on atomic symbols and is undefined for equal nonatomic arguments.
Thus
eq[A;A] = T
eq[A;B] = F
eq[A;(A)] = F
eq[(A);(B)] = F
eq[(A);(A)] = undefined
The predicate atom is true if the argument is atomic but false otherwise. Thus
atom[ABCDEFGHIJKL] = T
atom[NIL] = T
atom[(A B C)] = NIL
atom[car(A B C)] =T
atom[cdr(A B C)] = NIL
where p; has the value T or NIL, and e; is any expression. The value of the
entire conditional expression is the value of the e; for the first true p;. (This is
of course equivalent to the more normal way of writing a conditional state-
ment, namely IF p; THEN e; ELSE IF po THEN e2 ELSE ... IF p, THEN en.)
If none of the p; are true, the value of the expression is undefined. The T or
NIL can be used to designate truth or falsity. For example, if we have
ff[((A B) C)]
yields A as the result. However, this is really quite unrigorous, because the
= has no meaning and the ff on the right side is not defined as being the
same as the one on the left. This problem is dealt with later.
One of the fundamental conceptual inputs to LISP is Church’s lambda
calculus (Church [ZP41]). The need for this arises when we try to determine
the meaning of something like
y? + 3x (3, 4)
by the word QUOTE (except for T and NIL, which need not be QUOTEd).
Thus, for example,
becomes
(12A5)
(ALPHA 327)
are legal S-expressions. There are a set of arithmetic functions, e.g., plus,
minus, difference, times, add], sub], max, min, recip, quotient, remainder,
divide, and expt. Unfortunately, the format for these is “Polish” (i.e., paren-
thesis free) notation. Thus, to express the computation AxB+C, it is neces-
sary to write
(PLUS (TIMES A B) C)
Although more than two operands for multiplication and addition are
permitted, the inconvenience of this notation is obvious. The arithmetic
functions can be used recursively, just as other functions can, as shown
in the following definition of factorial:
DEFINE ((
(FACTORIAL (LAMBDA (N) (COND ((ZEROP) N 1)
(T (TIMES N (FACTORIAL (SUB1 N) ))) )))
))
which is the machine input form for
n!=A[[n][n=0> 1;,
ne [n—1]
T> J]
V5. LISP 1.5 415
successful compilers have been written in LISP and have compiled themselves
using an interpreter.
The greatest advantage to LISP is its recursive power and list processing
capability for those who are able to appreciate these and use them properly.
It is also easy to write interpreters for string and pattern-matching type
facilities, e.g., CONVERT (see Guzman [ZH66]). The greatest disadvantages
are the inconvenience of the notation in general (most particularly the
arithmetic) and the enormous difficulty in keeping parentheses balanced.
More recent implementations have added features which help to minimize
this problem.
VI.6. COMIT
Work on COMIT for the IBM 704 started in 1957, and a brief and
general description of the language appeared as early as December, 1957
(Yngve [YN57]). The COMIT system was designed and programmed at
v1.6. comir 417
This means that the label FIND is assigned to a statement which examines
a string to see if it consists of the word BOY followed by any number of
words, then followed by a comma followed by any number of words; if so,
the word BOY is removed and the word GIRL is placed after the comma
418 sTRING AND LIST PROCESSING LANGUAGES
and the rest of the string is deleted; the material now preceding the comma,
and the comma, are written out on tape and control is transferred to the
statement labeled NEXT. At first glance this language appears highly formal
and difficult to read and write. In actual practice, it is fairly simple in nota-
tion, compact, and both succinct and quite natural within its class of applica-
tions. Key design objectives were naturalness, ease of learning, and ease
of use, all within the framework of doing language data processing, and
these were definitely achieved.
SAMPLE PROGRAM—COMIT II
COMIT Il EDITOR
(THIS PROGRAM READS IN TEXT AND PRINTS N CHARACTERS PER LINE. EXTRA)
(BLANKS ARE INSERTED BETWEEN WORDS TO FILL OUT LINES.)
(READ IN N)
* $= //*RCKI *
* $t+x. = 1 //*K READ
RI $l +$+x. = 14+2+—-+2+— //*Q1 4 5 (COPY ON SHELF 1) *
READ $= 1+$0 //[*RCK2 RI
* $1 = N/*xCSNI + —x. —PRINT—THE—FOLLOWING—STRING— + 1
+ — —CHARACTERS—PER—LINE.*.—x. //*WAM2 3 4 x
(PRINT INPUT TEXT)
PRINT $1+$80 = 1+2+. //*WAM2 3 PRINT
* $14+$ = 14+2+%.—x.—x. [/*WAM2 3,xA1 2 *
COPYN N = 1+1 //*S2 1 (SAVE N ON SHELF 2) *
TEST N/.GO+$1 = 1/.D1+2 //*Q3 2 (CHECK FOR N CHAR.) TEST
* N/.GO = [[*A3 1 LASTLINE
x $0+ N+—+$ = 4 //*S1 1,*A3 1 (CHAR N+1 BLANK) WRITE
* N+$= /[[*S1 2,*A3 1 *
* $0 = K/.0 *
FINDK K+$+$——+$0 = 1/.11+2+3 //*S1 3 FINDK
* K+$+—4+$0 = 1/.114+2 INSERT+ WRITE
* ERR
WRITE $= —+1+x. //*WAM1 2 3,*A2 1,xAl 2 COPYN
(SUBROUTINE TO INTERSPERSE K BLANKS IN A LINE)
INSERT $0+K/.0 = 0 (GO IF K=0) +
* - = (AT LEAST 1 BLANK) LOOP
* $1 = 0 (NO BLANK) +
LOOP $1+$+— = 14+24+34+— //*Q4234 TESTB
* $ = $0+1 [[*A4 1 LOOP
TESTB $0+K+— = //*Q4 3 (REMOVE ALL LEADING BLANKS) TESTB
* $0+K/.GO = 2/.D1 LOOP
* K+$ = [[*A4 1 +
LASTLINE $ = —+1+x. //*WAMI1 2 3 END
ERR $ = —k.—*kk*k—EDITOR—CANNOT—PRINT—LINE—BECAUSE—N—IS—
x. TOO—SMALL.— [/*WAM1
END *
END
v1.6. comir 419
used as a basis for implementing the language on other machines. For such
purposes the detailed flowcharts will also have to be studied.”!!
In this instance, the language and the method of translating and execut-
ing it are so intricately linked together that a separate evaluation is not
reasonable.
In my opinion, the primary errors of omission are the lack of reasonable
arithmetic facilities and the inability to conveniently and naturally assign
names to strings. Certain other features, such as providing indirect naming
for variables and the ability to access substrings to any reasonable depth,
are also wanting; they have been provided in SNOBOL, which is discussed
in Section VI.7.
x f $+ - = ()., blank
In COMIT II, a special feature allows the use of the apostrophe, which
replaces the hyphen on some key punches. It is essential to note at this early
stage in the description that virtually none of these characters has the usual
arithmetic meaning.
Identifiers can be up to 12 characters in length and can consist of letters
and numbers and periods or hyphens, although the latter two cannot be at
the beginning or end. Up to 10 periods and/or hyphens can be used.
The operations of addition, subtraction, multiplication, and division
of integers are available, but they are denoted by symbols other than the
normal arithmetic ones (even though the latter are in the character set).
It was deemed more important by the designers to use the arithmetic symbols
for purposes more central to the basically nonnumeric character of the
language. In particular, since the + sign was normally used by linguists to
denote concatenation, it was not used for addition. There are also comparison
operators for integers, namely greater than, less than, and equals.
There are no commands in the usual sense of the word. COMIT is
basically a language for handling strings and patterns. Everything to be done
is embodied within a rule which depends primarily upon notation and
position within the rule for specifying the action to be taken. (in this sense,
COMIT is slightly more nonprocedural than most of the numerically oriented
programming languages.) There are no data names as such because COMIT
is designed to deal only with strings of text; they are in either a fixed storage
area called the workspace or they can be stored in some temporary storage
areas called shelves. Since the basic input to a COMIT program is a string
of text and operations are performed on the string in the workspace, there is
less need to provide data names. (However, such a facility does turn out to
be very useful.) COMIT uses the terms numerical and logical subscripts,
but these bear little relation to subscripts as normally used; their meaning
will be described later. Although the COMIT subscripts can be used to
denote arrays, this is seldom done. There is no hierarchical data structure
and hence no qualification. There are statement labels and a certain number
of key words; but since there are no variable names, there is no conflict. In
order to represent as literals either the 10 digits or the 8 special characters,
+ — = x* $ / ( ), the user must precede them by an asterisk.
The reason for this is to allow the data strings read in or put out to be
completely arbitrary and, simultaneously, to permit the specification of
unambiguous rules and patterns. Spaces are critical in certain places.
Punctuation characters are not used in the usual way, although they are
certainly sprinkled throughout the language. There are no noise words.
The COMIT program is written with some fixed requirements, and the
notation 1s certainly highly symbolic. Normally COMIT rules are punched
one to a card. Each rule must always start at the beginning of the card with
a nonblank character in column 1. A rule can extend onto more than one
card if necessary; in such a case there must be a hyphen in the last nonblank
character before column 73 on the card.
A COMIT rule has five sections and can be represented schematically
as follows:
The fundamental purpose of the /eft-half part of the rule 1s to specify a pattern
which is to be searched for in the data in the workspace. If this pattern is
found, then something is shown in the right-half part of the rule to indicate
what is to be done with it, the right-half is executed, and control then depends
on the contents of the go-to section. This “rewriting” of a string is the central
concept in COMIT. If the pattern is not found, then control is automatically
transferred to the next rule in sequence.
The name section, which is really a statement label, begins in column
] and must be followed by one or more spaces. (An asterisk can be used
instead of a name.) The go-to is defined as the last string of nonblank char-
acters on the card and Is preceded by one or more blanks. The other sections
are optional except that some combinations are required together. The
left-half is usually terminated by an equals sign. The routing section 1s
always preceded by the two slashes.
There are no declarations in COMIT, nor is there any logical need for
them. The smallest executable unit is the rule, whose format has just been
vI.6. comit 423
shown above. There are two kinds of rules: Grammar rules, which may
involve program branches under the control of information in the dis-
patcher (described later), and list rules, which may be used for dictionary
lookup operations. Both kinds of rules can include a variety of instructions
for operating on the data and affecting the flow of control and both may
have a number of subrules.
‘Loops consisting of any number of rules can be written, and there are
several ways of exiting from them, including presence or absence of specific
data in the workspace, comparison tests on integers, and choice of subrule.
Closed subroutines can be written and used in COMIT. There are no
functions. Comments enclosed in parentheses may be inserted in the rule
format wherever spaces are allowed.
The program consists of a sequence of rules preceded by a title card and
followed by an end card. In COMIT II, there may be one or more COMSET
cards after the title card. These have various functions such as setting the
limits on the length of the run, changing margin settings for printed output,
and establishing options where the standard values may be inappropriate.
From a language point of view, the only interaction with the operating
system and the environment is through the COMSET cards.
The rules are delimited by the format described earlier. They are
recursive only in the sense that the same rule can be repeated many times ,
before the pattern in the /eft-half fails to be found and control proceeds
to the next rule. The user can easily program recursive subroutines because
there is a built-in pushdown list for the returns and the workspace and
shelves (discussed later) can be used for data pushdown lists. The only way
of passing parameters to a subroutine is by leaving them in the workspace
or on specified shelves.
There is a provision for binary-coded subroutines to be used with
COMIT II programs. (This is one of the significant additions to COMIT I.)
There are no arithmetic variables directly permitted in COMIT,
although a very awkward equivalent is available through the use of sub-
scripts; only integers are allowed. The only type of variable allowed is a
string of characters. The characters are themselves organized into groups
called constituents. Constituents consist of either individual characters or
groups of characters and may have subscripts. For example, in COMIT
notation, where the boundaries between constituents are represented by
plus signs, one type of input data might be represented in the following way :'”
THH+I1+S+—-+1+S4+—-—-+D+A4+T+A4.+4
(Ex. 1)
where the hyphens represent spaces.
12 This example, and most of the others, are taken from Yngve [Y N66] or from [MT61]
and [(MT6la].
424 STRING AND LIST PROCESSING LANGUAGES
If the data were in the form of one constituent per word, it could be
written as
Conditional statements are of several forms. The first is each rule itself,
in which the left-half provides a test. The second form of conditional state-
ment performs comparisons on numerical subscripts and is itself a form
of left-half test. A third kind is grammar subrule selection which is dependent
on the dispatcher setting (discussed later). A fourth type of conditional
statement involves list subrule selection based on table lookup. The last
two of these are really types of switch control.
COMIT permits a rule to have several subrules. The first subrule has the
rule name starting in column 1, and succeeding subrules have one or more
blanks starting in column 1. Each subrule also has a subrule name. The
subrules permit a choice of alternate computations at a given point in the
program. The choice is made by the dispatcher, which is a switch control
mechanism in COMIT (discussed later).
Loop control can be specified in several ways. The simplest type is
through the kind of test indicated in the basic rule itself, where essentially
the only thing that controls the loop is the presence or absence in the work-
space of the string indicated in the left-half section of the rule. Another way
to control looping is by specifying the number of times to execute a loop.
This is handled by using a numerical subscript as a counter and will be
described when the notation is shown in somewhat more detail. Exit from
a loop can also be determined by choice of a subrule.
The user can call a built-in dump facility at any point in his program
by putting a comma in column |. He can use a period to request a dump if
the left-half fails.
COMIT is basically a language for handling strings and patterns. The
left-half section of a rule indicates a pattern to be searched for in the work-
426 STRING AND LIST PROCESSING LANGUAGES
space, which is the storage area containing the data, and the right-hand
side (which includes the right-half, routing, and go-to sections) indicates
what is to be done if that pattern is found. Let us consider the simple case
where the workspace contains
A+B+CH+tA+tB
$+ C+A=24+14+3%
C+tA+t+Bt+A+B
The numbers on the right represent the sequence numbers of the constituents
in the /eft-half. Thus, C is the second constituent in the /eft-half, and A is the
third constituent. The $ indicates that an arbitrary number of constituents can
be allowed when the test is made. Having numbered the constituents in the
left-hand side of the rule, their sequence can be redefined in the right-hand
side as shown. If the left-half had been B + $2 + A, then the test would
have failed because the $ immediately preceding a specific integer requires
that exactly that number of constituents must appear, and neither of the
A’s in the workspace follows a B with exactly two intervening constituents.
Any constituent shown in the /eft-half which is not mentioned in the right-
half is automatically deleted (if the rule succeeds thus causing the right-half
to be executed). An interesting illustration of what can be done is the fol-
lowing rule which doubles any letter before the sequence of letters E and D:
*$1 +E+D=1+1+2+3«
Note that this rule doubles any letter before the E + D, not just consonants;
it would be possible to write the rule to exclude doubling of a vowel imme-
diately preceding the ED if vowels and consonants had been named by
different subscripts.
The following is a list of notations used for search patterns which can
be expressed in the Jeft-half section of a rule:
*A+Bt+tCH24+D4+1
+ F + 2
THE + DOG
writing
* $1 + $1 = //* El 2*
Tt+H+E+trD+t+0+G
In the /eft-half section, search for constituents with the specified property:
The two most frequent uses of these operations are either for setting
counters in loops or for testing actual numerical values that a constituent
might have. In the first case, a program to do something 50 times could
look like the following:
v1.6. comir 429
However, if only a radio operator is needed and the other qualities are
irrelevant, then all that needs to be written is the following:
* $1/OCCUPATION RADIO-OPRTR =
results in GEORGE having the HOBBIES of GOLF since only subscript values
appearing in both the workspace and the rule are left on the constituent
when there is an overlap in values. However, by writing
then GOLF and CHESS are dropped and replaced by POKER. In essence,
430 srRING AND LIST PROCESSING LANGUAGES
when there is an overlap, then only the intersection is used; when there is
no overlap, the values in the right-half of the rule replace the values in the
workspace. Various other rules and facilities also exist for manipulating
these logical subscripts. The subscripts are a powerful feature of COMIT
which permit the efficient handling of some problems which do not involve
a simple string data structure.
The entries in the dispatcher are in the form of logical subscripts; the
subscript names designate the program branches, and there is a dispatcher
entry for every subscript name (or rule name) in the program. In certain
cases where the dispatcher is not itself actually set to a given value, the
branch is chosen by using a random number generator. Information in the
dispatcher can be altered by an entry in the routing or by an entry from
the workspace. In the former case, it is written directly in the routing instruc-
tion in the same form as a right-half logical subscript and is merged into the
dispatcher in the same way that subscripts are merged. Information is entered
into the dispatcher from the workspace by writing * Dn as a routing instruc-
tion, where nis a single constituent number. When this instruction is executed,
the logical subscripts attached to the indicated workspace constituent are
merged into the dispatcher.
The general form of an output statement (which is written in the
TGuing) is * WFDni, where the F can be either A or S (these represent two
different types of formats); the D can be either M (monitor output tape),
| (output tape for punching), L (on-line printer), P (on-line card punch),
or other characters for other devices defined in the interface; the ni refers
to right-half relative constituent numbers, up to a maximum of 128. Format
A is used for normal output and essentially removes the plus signs between
the constituents in the workspace; in addition, subscripts will also be lost.
If the user asks to have less than a single line of material printed, it will be
kept in an output buffer until enough characters are accumulated through
write commands to cause the contents of the buffer to be written out; how-
ever, a specific end-of-line character can be used to cause the printine of
a short line. Conversely, if the output requires more than one line, the
COMIT system will automatically end the line for the user by means of bell
and margin settings analogous to those on a typewriter. There are standard
values for these, but they can be changed by the use of COMSET cards.
The user is able to insert into the workspace specific characters to control
the on-line printer paper-feeding mechanism.
Format § is used to print the contents of the workspace in detail, includ-
ing full constituent structure; this is primarily useful for debugging.
Format B 1s for fast input and output for temporary storage of workspace
data on tape or disc.
The general format for the read command is * RFDn, where F can be
C (cards), A (single character per constituent), T (text), S (with subscripts),
v1.6. comitT 431
*FEsn
*B=C//
However execution will be very slow because the rule replaces only one
B at a time and then goes back to the beginning of the workspace again to
search until it finds the next B to be replaced by a C. A faster routine to
do this would be the following:
*$ + B=14+C // * Q2312/
* $0 = // *A23
1 x
The left-half of the first rule finds everything up to and including the first
B and changes it to a C. The instruction following the double slash serves
to move all constituents up to and including the C onto the right end of
shelf 23, keeping them in the original workspace order. Thus when the rule
is executed again, the string that has already been examined is no longer in
the workspace. After all the B’s have been changed to C’s, the rule fails and
the next rule returns everything from shelf 23 back to the beginning of the
workspace again. (Note that if shelf 23 were not initially empty, it would be
necessary to clear it before starting this routine. This avoids putting extra-
neous material into the workspace when the second rule is executed.)
The number of memory locations required for the various types of
information in the workspace and shelves is shown in the manual. Storage is
automatically reallocated to the various uses as needed.
The user is able to test the amount of free storage available and to allow
certain corrective action to take place if there is insufficient free storage
for further operations; such action might consist of deleting material from
the workspace or the shelves or writing it out. The commands available for
V1.6. ComMIT 433
this testing are written in the routing section and consist of the following:
There are actually quite a few statements that permit the user to have
some effect on the overall operating environment; these are handled by
means of COMSET cards. The facilities available to the user include items
such as specifying that the minus sign and the hyphen are to be considered
different characters, setting margins for output, eliminating the automatic
COMDUMP at the end of the program, counting the number of constituents
on indicated shelves, specifying ways of marking the end of output records,
and providing controls over the way in which various formats are handled.
One of the special features in COMIT is the availability of list rules
which facilitate rapid table lookup. A list rule consists of two or more list
subrules, and it may be used like a dictionary with its entries. To illustrate
the need for, and use of, this facility, the following example is given.’
Consider the following program for word-for-word substitution. We
assume that the workspace contains a German sentence. Each letter is
a constituent and words are separated by -’s, representing spaces. There is
no punctuation, but - at the beginning and at the end. It is desired to look
up the words in a list, substitute English equivalents, and print them out.
A-~+$+—+$
= // *WAMI, *K2, *Q5 3 4 DICT
* STOP
DICT IST = |$ B
* ALT = OLD B
* MANN = MAN B
* DER = THE B
B $ // *WAMI, *A5 1A
STOP x
END
B$+-— // xWAMI A
STOP x
END
Vi.7. SNOBOL
After several years of exposure to, and experience with, COMIT (see
Section VI.6), some of its significant deficiencies became extremely clear;
the most notable of these were the inability to name strings or to do arith-
metic conveniently. Motivated by a desire to improve this and by the need
for a more effective language to do symbol manipulation, in 1962 at Bell
Telephone Laboratories, D. J. Farber, R. E. Griswold, and I. P. Polonsky
with assistance from M.D. Mcllroy developed a system called SNOBOL
which they defined as a string manipulation language. The first publication
of information on this system was in Farber, Griswold, and Polonsky
[FB64]. The system became popular among certain groups outside Bell
Laboratories (primarily universities). After some period of time, certain
improvements to the system were found desirable, and these were incor-
porated gradually, eventually leading to the creation of SNOBOL3, which
is defined by the authors above in [FB66]. Still further improvements were
made during 1967 and SNOBOL4 was created. The timing of the latter
work made it impossible to include it in this book, so it is SNOBOL3 which
is described here. A brief indication of the major improvements in
SNOBOL4 is given at the end of Section VI.7.3.
SNOBOL3 has been implemented on at least the following machines:
IBM 7090/94, 7044, 1620, System/360, CDC 3100, 3600, RCA 601/604, and
SDS 930/940.
This means that the label HERE is assigned to a statement which examines
a string named TEXT to see if it contains the words THE and 1S with any
string between them; if so, the string named TEXT is replaced by the string
found between THE and {S and control is transferred to the statement
named NEXT. |
VI.7. SNOBOL 437
SAMPLE PROGRAM—SNOBOL
31
*SNOBOL3 EDITOR
* THIS PROGRAM READS IN TEXT AND PRINTS N CHARACTERS
* PER LINE. EXTRA BLANKS ARE INSERTED BETWEEN WORDS
* TO FILL OUT LINES.
MODE(""ANCHOR")
DEFINE(" INSERT(K,LINE)’’,”"IN’’,”,
BLANK, WORD")
* READ IN N
TRIM(SYSPIT) *Nx*
SYSPOT =
SYSPOT = "PRINT THE FOLLOWING STRING " N
'" CHARACTERS PER LINE:”
SYSPOT =
tFarber, Griswold, & Polonsky [FB66], p. 943 (with slight modifications). Copyright, 1966,
The American Telephone and Telegraph Co., reprinted by permission.
438 sTRING AND LIST PROCESSING LANGUAGES
At first glance this language appears highly formal and difficult to read
and write. In actual practice, it is fairly simple in notation and is compact,
succinct, and reasonably natural within its class of applications. It is easy
to learn, to read, and to write, although it is somewhat more complex
(and more powerful) than COMIT.
The primary application area is anything in which string naming and
manipulations are important component elements, with at most simple
integer arithmetic being needed. It is a problem-oriented language which is
simultaneously a hardware, reference, and publication language. In the same
sense as COMIT, it is slightly (and intuitively to me) more nonprocedural
than most of the more numerically oriented programming languages.
In my opinion, the user will tend to be at least a novice programmer, i.e.,
somebody who has some programming background but is not necessarily
a professional programmer. It is definitely designed for use in a batch
system, although both an early version and SNOBOL3 run under M.I.T.’s
CTSS (see Crisman [ZR65]). The system is not machine dependent, but
its description in the previously cited reference makes it more compiler
dependent than most languages, particularly with regard to the input/out-
put facilities. No particular concern has been expressed about the creation
of dialects or subsetting or extensions; some of these variations exist on
different implementations. Although never explicitly stated, there are several
places in which the language is implicitly defined with respect to a particular
method of implementation.
The whole problem of conversion has not arisen in any significant way.
There has been no consideration of USASI standardization.
The designers of the first version of the language were primarily the
authors of the two cited papers. Their avowed objective was to develop
a language for use on problems involving the manipulation of character
strings. Any maintenance of the language is being done by the designers.
A SNOBOL Bulletin exists for informal interchange of information among
users and any other interested people.
In addition to the two main published papers cited, some significant
unpublished papers are included in the list of references at the end of this
chapter. The language definition has been given in English, with heavy
dependence upon examples for clarification of the definition.
SNOBOL3 is too new to be able to give it any type of reasonable
evaluation based on usage, although a number of groups seem to find it
worthwhile. It has been used in a number of courses.
The character set for the language is never explicitly defined, but it
appears to consist of the 26 capital letters, the 10 digits, and the following
VI.7. SNOBOL 439
special characters:
+ —- * f/f:,.()" $ = blank
A statement can contain some or all these fields. Labels must begin
in column 1; a statement with no label must have a blank in column 1.
Statements can be continued over one card, and a period in column 1 1s
used to indicate continuation of the preceding statement. Statements may
be split across cards wherever a blank is permissible in the text. However,
literals cannot be broken over a card, and a long literal which would not fit
on one card must be represented as a concatentation of literals. A card with
an asterisk in column | is treated as a comment.
The conceptual form is highly symbolic.
There are no declarations as such in SNOBOL. Some things which
would normally be handled as declarations (e.g., arithmetic mode) are
actually specified through function calls.
The smallest executable unit is a statement, and there is no way of
grouping these units. Loops can be written in either of two ways. In the
first instance, a rule can repeat itself, providing the transfer in the go-to
section is to the statement itself; in other cases, the looping can be controlled
by arithmetic counters and tests on them.
Functions of three kinds are permitted in SNOBOL. The first are those
defined by the system; the second are defined in a particular SNOBOL
program; and the third are machine language routines which can be invoked
as functions in SNOBOL. There are no other procedures or subroutines.
Comments can be written anywhere in the program and are designated
by an asterisk in the first column of the card.
A complete SNOBOL program consists of statements terminated by
an END card. A function must be defined before it is invoked. There are
a number of compiler-directing control cards which can be used in a program
before the END card.
The end of a statement is determined by the beginning of a statement
on the next card. Function calls must not have a blank between the function
name and the left parenthesis; thus, SIZE(A) is a function call, while SIZE (A)
is a concatenation of a name and a parenthetical grouping.
Statements are recursive in the sense that control may be transferred
back into the statement itself, depending upon the failure or success of the
left-hand pattern matching. Most SNOBOL programs are recursive. Defined
functions can be recursive.
Function calls can occur anywhere in a statement where a string value
is appropriate. An argument of a function can be a string expression, no
matter how complicated.
No other languages can be written in SNOBOL programs; however,
it is possible to include machine language functions which have been com-
piled or assembled separately. There is a set of conventions specifying how
to do this.
Although the only variable type in SNOBOL is a string, there are
VI.7. SNOBOL 441
certain strings which have the property of being integers. Thus, unlike
COMIT, there are conceptually integer variables and constants in SNOBOL
but no actual arithmetic data type. While there are no logical variables as
such, the six comparison functions mentioned earlier return a null value
if the condition is satisfied, and they fail otherwise.
Indirect addressing or naming can be used to any level desired. Func-
tion calls, parenthetical grouping, and names may be indirectly referenced.
Parentheses are required between successive levels of indirect references.
For example,
$($($ROUTE))
$SIZE(END)
$(END” $(1))
are all examples of legally written indirect references.
Only integer arithmetic is permitted, and there are various rules per-
taining to what happens when the result of division or exponentiation is not
an integer. It is possible to combine integer constants and names; thus the
expression
N + "3"
is legal assuming that N has an integer value. Since each of the arithmetic
operations is considered purely binary, it is necessary to group terms to
create more complicated expressions. Thus, the user must write
N + ('3"' * "2")
to achieve
N + "6"
is N12 since juxtaposition of two strings with a space between them (i.e.,
"'N” '5'') denotes concatenation. Also, the value of
"RED" "ORANGE"
X "'3.5'' Y
= ABC + "5"
<~<<
"Y + SIN(Z)"
ll
9? Bi
ABC = $(°N” 1)
If there is a need for any arithmetic shown on the right-hand side, it must
follow the rules of precedence already described. The result in every case
is a string.
There is no alphanumeric data handling as such.
As an illustration of the effect of the sequence of assignment statements,
consider the following sequence of statements:
ALPHA = "ABCD"
KY = SIZE(ALPHA) + "1"
Z = KY + "3"
M = ("—" KY Z) + "2"
SIZE is a SNOBOL primitive whose value is the number of characters in the
string indicated. Thus, the sequence of statements above would cause
KY to have the value 5, Z to have the value 8, and M to have the value —56.
Statements are normally executed in sequence unless the statement
contains a go-to field; transfers are always enclosed within parentheses and
preceded by a / which is itself preceded by a space. The control transfers
can themselves be conditional by prefixing them with either an S or an F for
success or failure, respectively. For example, A = B /(K) will automatically
cause control to transfer to the statement with the label K. On the other
hand, the statement ALPHA "',”’ /S(XYZ) will cause the statement XYZ to be
VI.7. SNOBOL 443
N = "yf"
COMPUTE $(''CU" N) = N * (N * N)
N = .LT(N, 50") N + "1" /SCCOMPUTE)
would cause the search to be successful and would assign to the variable
named VAR the value THE. In addition to arbitrary string variables, there
are two other types, namely fixed length and balanced. The former can be
used to match a string with a specified number of characters; the name of
the string variable is followed by a slash; this is followed by the string
specifying the length, and the whole thing is delimited on both sides by the
asterisks. Thus, for example, if we had the statement
this match succeeds with A = ''FGH" because the pattern that is being
looked for is three characters which are juxtaposed. For example, if the
pattern had been written as *A/''2''* A then the pattern would not have
matched.
The specifications in the basic reference for SNOBOL3 indicate very
clearly that the input/output facilities may vary significantly on different
machines. The following is a very brief description of the capability available
on the 7090/94 system.
Input and output are accomplished by associating string names with
logical files. There are three standard file names which are automatically
assumed at the beginning of every program. The user can associate the value
of a name with the value of a particular file, including the three named files.
Thus, PRINT(’’X"’, "OUT'') associates the name X with the logical file OUT.
After execution of this function, copies of all values assigned to X will be
placed in the file OUT. Similarily, PUNCH(NAME, FILE) and READ(NAME, FILE)
associate the value of NAME with the value of FILE in the punch and read
sense, respectively. Output occurs whenever an output-associated name is
given a value. Printing and punching file associations are different in their
carriage control. Various facilities for short and long lines and appropriate
fillers are given. In reading input, all strings read from the standard input
are 84 characters long, and blanks are used to fill out shorter records;
records read from other files are not extended. In using a read-associated
name, the loss of the previous value of the name occurs. There is a failure
if the read operation fails as the result of an end-of-file record.
There are various other functions existing for performing standard
input/output and file operations, including name deletion, rewinding,
backspacing, and opening a file.
There are no library references as such, but there are a number of
built-in functions. They are as follows:
SIZE(N)
Specifies the number of characters in the string whose name is N.
EQUALS(X,Y)
Returns a null value if the value of X is identical to the value
of Y and fails otherwise.
446 sTRING AND LIST PROCESSING LANGUAGES
UNEQL(X,Y)
Returns a null value if the values of X and Y are not identical
and fails otherwise.
TRIM(X)
Returns the value of X with trailing blanks removed.
TIME()
A function of no arguments which returns as a value the milli-
second time from the beginning of the program to completion.
DATE()
A function of no arguments which returns the value of the
current date as a six-character number.
TRACE(LIST)
The value of LIST is a list of function names whose trace is
desired.
STOPTR(LIST)
Stops the tracing of functions specified in the LIST.
STRACE(X, Y)
Associates the value of X with the value of Y. Every time
a value is assigned to X, a trace message will be printed on an
associated file name indicating the names, its new value, and the
statement value where the new number was assigned.
MODE("'DUMPERR"’)
Causes a string dump if execution is terminated by an error
during execution.
MODE('DUMP”)
Causes a string dump following either normal or error termina-
tion.
where form gives the function name and the formal arguments, label denotes
the entry point, and the value of names is the list of local names separated
VI.7. SNOBOL 447
will fail; whereas if that statement had not occurred or if it were followed
by a MODE(''UNANCHOR’’), then the match would be successful.
A mode affecting results of a division is available.
SNOBOL programs cannot modify themselves nor is there any provision
for self-extension of the language.
The implementation of SNOBOL on the CDC 3200 was done by writing
the compiler in SNOBOL; the one developed for the IBM System/360 was
also written in SNOBOL. At least one group is attempting to develop a ver-
sion which is fast enough to be practical for compiler writing.
As with COMIT, the translation system consists of a compiler, which
translates source programs into an intermediate language, and then an
interpreter, which controls the execution. The language specification and
the implementation of some of the pattern-scanning mechanism seem to be
intimately related, i.e., the rules for the language match the algorithms
which have been designed for scanning and vice versa.
The biggest problem with respect to the language and its implementation
is the need for dynamic storage allocation.
SNOBOL4 (described in Griswold, Poage, and Polonsky [GF67] and
[GF68]) is not a true extension of SNOBOL3, although it is certainly very
similar. Two syntactic changes involve the following requirements in
SNOBOL4: Identifiers begin with a letter and may not contain colons, and
a colon : instead of a slash / is used to begin the go-to field. On the other
hand, there are a number of significant improvements, including at least the
following:
VI.8. TRAC
14 TRAC is the trademark and service mark of Rockford Research Institute In-
corporated in connection with their standard computer controlling languages.
V1.8. TRAC 449
SAMPLE PROGRAM—TRAC
# (CL, #(DS,CAT,DOG)#(DS,AA,CAT)#(CL,AA))
then DOG is the final value of the function. This is obtained because the
processor generates first
# (CL, #(CL,AA))
and then
#£(CL,CAT)
and eventually DOG is obtained.
v1.8. TRAC 451
The overall control of the TRAC program comes from what is called
the idling procedure, #:(PS,##(RS)). The PS and RS stand for print and read,
respectively, and read has the value consisting of the string of characters
typed at the keyboard up to the first occurrence of a specified metacharacter
or terminator. The latter is normally designated by an apostrophe, ', but
there is a TRAC function which can be used to change it. Since both tele-
types and typewriters can be used, upper- and lower-case letters are permitted
and are handled appropriately, depending on the form of input device. In
particular, if there is a shift character on the input device, then it will be
retained. Carriage returns or line feeds are ignored except within strings so
the user can format his functions conveniently.
The distinction between an active and a neutral function (mentioned
earlier) is that the value from the active function is rescanned, while in
the neutral function it is not. Scanning and execution of functions are
done from left to right but from inside out. These concepts are illustrated
in the following example:'* Suppose that both #(DS,AA,CAT)' and
#(DS,BB(##(CL,AA)))’ have been presented to the processor. Then,
Now that the basic concepts in TRAC have been seen, it is possible to
discuss the primitive functions that are available. A function defined to have
a null value causes some action to occur, but it does not create a value which
could then be used in other functions.
There are four arithmetic functions and they operate only on integers.
The subtraction function is designated as #(SU,D1,D2,Z), which subtracts
D2 from D1; if the result overflows the capacity of the arithmetic process,
then the overflow value Z of the function is taken. A similar format is used
for the other three arithmetic operations. Bit strings are permitted and the
functions of Boolean union, intersection, complement, shift, and rotate are
permitted; these are designated by the function mnemonics BU, BI, BC, BS,
and BR, respectively. There are two conditional transfer functions, namely
##(EQ,X1,X2,X3,X4), which has the value x3 if string X17 is equal to string
X2 and the value X4 otherwise. The function #:(GR,D1,D2,X1,X2) tests the
decimal number at the tail of string D7? against the number at the tail of
string D2; if the first is greater than the second, the value of the function is
XI, otherwise it is X2.
There are a number of functions that relate to defining and retrieving
strings. They are as follows:
#(DS,N,X)
Stands for define string and has a null value. The string shown
as the argument X is placed in storage and given a name shown
as N. The string shown as X is placed in a list of forms, which
are in storage; a form is merely a named string. If there is al-
ready a form in storage with the name N, then the first form
Is erased.
FE(SS,N,X1,X2, . . -)
Represents segment string, where there can be three or more
arguments; this function has a null value. The form named N
is scanned to see if it has a substring matching X]; if so, the
location is marked and the matching substring is excluded from
further scanning and creates what is called a segment gap. The
rest of the form is then scanned with respect to X]1 to create
any additional segment gaps. These are all given an internal
code marking of 1. Anything not in a segment gap is now
scanned with respect to X2 and segment gaps of code marking
2 are created. This is continued until all the Xi are used; then
the marked form, along with the identifiers for the gaps, is put
back into storage (still with the name N). The untouched por-
tions of the string are called segments. This function essentially
creates a macro in which the XI], X2, etc., indicate the dummy
variables.
#-(CL,N,X1,X2, .. .)
Means call segmented form and has two or more arguments.
The form named N is retrieved from storage and its segment
gaps of code marking 1 are filled with string X1, the gaps of
marking 2 are filled with string X2, etc.
Ft(CS.N,Z)
Means call segment and it obtains the string up to the next
segment gap of the form named N;; if the form is empty, its
value is Z.
#(CC,N,Z)
Calls exactly one character.
VIL.8. TRAC 453
4##(CM,N,D,Z)
Calls M characters from the form named N and obtains as
many more as are designated by an integer at the end of the
string D.
F#(IN.N,X,Z)
Searches the form named N for the first location where the
string X produces a match. The value is the string up to the
character just before the matching string.
#(CR.N)
Restores the pointer of the form named N to the initial char-
acter.
##(DD,NI,N2, . . .)
Deletes the forms NI, N2, etc., and removes their names from
the list of names.
#(DA)
Deletes all forms and names.
also states that he is working on extensions which promise to make the lan-
guage more powerful. One contemplated direction is to extend the string
storage apparatus to strings of machine code; this would permit operating
systems to be built in TRAC.
VI.9.1. AMBIT
Another way of stating the basic concept is that the replacement rule
16 Christensen [CQ64], p. 1.
V1.9.1. AMBIT 455
SAMPLE PROGRAM—AMBITt
If this action is possible, then it is performed and the replacement rule has
the execution value true; if the action is not possible, the current data string
is left unchanged and the replacement rule has the value false.
As an example,'’ consider the following replacement rule:
pA (AxA) > pA (A t 2)
then the replacement rule fails and the data string is not changed.
There are no input/output commands within AMBIT itself. The pro-
gram is inserted, followed by a data string; after execution, the resultant
data string is then put out automatically.
A number of declarations exist to permit the association of one of the
data types with either a dummy name, multiple name, or literal.
The design of the language has been made with the overall implementa-
tion plan (see Christensen [CQ66]) very much in mind so as to permit cer-
tain types of maximal efficiency to be obtained.
This system does not seem particularly suited for practical usage even
in the areas for which it provides appropriate facilities, and it does not seem
to have a solid enough theoretical foundation to provide new insight in any
particular direction. Perhaps further usage and development will make either
or both of these statements less true.
7 VI.9.2. TREET
SAMPLE PROGRAMS—TREET
18 Haines [HA65], p. 3.
VI.9.2. TREET 459
relational operators are the next three graphics, and the logical operators
are the following three. Identifiers must be delimited on each side by one of
the following characters:
$s 3; * ( ) blank
Any number of blanks can be used where one is permitted. Literals are
delimited by a prime, ' , on either side.
The input is free format.
A TREET program consists of one or more user-defined functions.
Even things normally considered statements, e.g., IF, DO, are considered
functions, although their format is not necessarily of that type. Almost any
function can serve as the main program, invoking other functions. Com-
ments can be inserted into any function definition; they must be preceded
by an asterisk, x, and must end either with an * or at the end of a unit
record (e.g., column 72 of a card). The programs themselves are stored as
list structures; they will normally be compiled after they are debugged. The
macro assembler TAP is part of the implementation and can be used to
define functions; operations include both list processing and machine code.
Recursion is definitely permitted, but it is not considered as important
as in LISP. Statements in the reference language are terminated with a
semicolon except in a few special cases in which it can be omitted.
The data type allowed in TREET is (only) the LISP S-expression
(defined in Section VI.5); all lists are terminated by a right parenthesis.
However, an additional type of atom is a card, which contains 80 characters
and is dynamically allocated and reclaimed just as single cells are. List cells
have a third address field which may be used for backward pointers or
additional data. Integers and floating point numbers are permitted. All
calculation is done in floating point and converted to integer if the result
is integral. There are no logical values defined as data types, since TREET
adopts the convention that NIL (representing the empty list) means false
and all other S-expressions are true.
There are certain system-defined variables which can be used by all
functions.
The assignment operation is defined as a function called replacement
and is written with := in the reference language, e.g.,X := X + 5.
The unconditional transfer is written GOTO (label). The RETURN
causes the current function to finish and have the value of the argument of
RETURN. The conditional statement is of the form IF function-1 THEN function-2
[ELSE function-3];. function-] is evaluated and if it is not NIL (i.e., false), then
the value of function-2 is the value of the IF expression. The predicate (.e.,
function-1) always has a value, assigned to the free variable P, which can
then be used by other functions. For example, the statement IF (Y=6) THEN
460 sTRING AND LIST PROCESSING LANGUAGES
RETURN ((IF Z THEN 5 ELSE 7)); assigns to P the value TRUE if Y = 6 and
Z is true, and the value NIL if Y=6 and Z is false. If Y + 6, P is NIL.
In cases where only a single argument to a function is normally al-
lowed, the effect of executing several statements can be achieved by writing
DO (statements).
The loop control is a WHILE function with two arguments. The second
(which is usually a DO) is evaluated as long as the first 1s true, e.g.,
));
The following is a set of list processing functions which are either
equivalent to or identical with certain LISP statements:
The following LISP functions are also included in TREET: LIST, NULL,
CONS, ATOM, MEMBER, = (same as LISP EQUAL), RPLACA, RPLACD, and
COPY.
There are a number of output functions. One is PRINT, followed by
any number of arguments which are printed with a single space between
them. Writing
VI.9.3. OTHERS
1. CLP
2. CORAL
3. SPRINT
( (}) FNAMRING)
EP ( (OLOBLK}2) BS UBRI> LABEL!)
Figure VI-8. Example of CORAL statements. The main operator in the first
line is © (put right). The element to be inserted is the first tie register of a
newly created block of type BLK1. BLK1 is a symbolic name for some integer
type number. The pointer named NEWBLK is assigned the address of the
inserted ring element. The new tie element will be inserted next to an element
determined by what follows the © operator. To find the reference element,
the program will move the pointer OLDBLK down three registers and then left
(backwards) around that ring. The number of steps moved is determined by
the contents of the data structure register found by moving the pointer
OLDBLK down five. The accumulator’s contents are identical with those of
NEWBLK after the statement has been executed.
The second line takes the accumulator pointer to the newly inserted tie
element, moves to its ring start, then to the top of the block containing
the ring start, and down a distance equal to NAMRING. If the resulting tie
register is not empty, control goes on to the next line. If the register is empty,
then the subroutine SUBR1 is performed for each member of the ring found
by moving the pointer OLDBLK down one. After all the members of the ring
have been treated, control transfers to LABEL1.
Source: Sutherland [SU66], p. 29.
ic Operators (ADD, SUB, MPY, DIV); read and write data (RDT, WDT); reverse
two elements (REV); repeat (REP); delete (DEL); concatenate (CON) and
deconcatenate (DCN); bring (BNG) a named list; call (CLL), which puts a
named list into the instruction stack; transfer (TRA); store (STO); find
(FND), which affects the flow of control; and test for zero (TZE).
To evaluate the algebraic expression ((A+B)C+D)(E—10), one would
execute the following program:
where the @ indicates data and all other marks are assumed to be instruc-
tions.
Elements of a matrix can be named independently of the size of the
matrix; there is completely dynamic storage allocation which never requires
the use of declarations for array size.
It is possible not only to write subroutines but to execute them after
they have been written or modified at object time.
SPRINT is admitted by the developer to be inefficient because it is an
experimental attempt and is designed to be efficient on machines of an
entirely different logical structure.
464 sTRING AND LIST PROCESSING LANGUAGES
4. LOLITA
REFERENCES
V1.3. IPL-V
[SF63] Stefferud, E., The Logic Theory Machine: A Model Heuristic Pro-
gram, RAND Corp., Memorandum RM-3731-CC, Santa Monica,
Calif. (June, 1963).
[TN60] Tonge, F. M., “Summary of a Heuristic Line Balancing Procedure”,
Computers and Thought (E. Feigenbaum and J. Feldman, eds.).
McGraw-Hill, New York, 1963, pp. 168-90.
[ZK63] Gullahorn, J. T. and Gullahorn, J. E., “A Computer Model of Ele-
mentary Social Behavior”, Computers and Thought (E. A. Feigenbaum
and J. Feldman, eds.). McGraw-Hill, New York, 1963, pp. 375-85.
[ZN65] Cowell, W. R. and Reed, M.C., A Checker-Playing Program for the
IPL-VC Computer, Argonne Natl. Lab., ANL-7109, Applied Mathe-
matics Division, Argonne, III]. (Oct., 1965).
V1.4. L6é
VI.6. COMIT
VI.7. SNOBOL
VI.8. TRAC
[ME67] Mooers, C. N., “How Some Fundamental Problems Are Treated in the
Design of the TRAC Language”, Symbol Manipulation Languages and
Techniques, Proceedings of the IFIP Working Conference on Symbol Mani-
pulation Languages (D. G. Bobrow, ed.). North-Holland Publishing Co.,
Amsterdam, 1968, pp. 178-88.
[SQ65] Strachey, C., “A General Purpose Macrogenerator”, Computer Jour.,
Vol. 8, No. 3 (Oct., 1965), pp. 225-41.
VI.9.1. AMBIT
[CQ64] Christensen, C., AMBIT: A Programming Language for Algebraic
Symbol Manipulation, Computer Associates, Inc., Report No. CA-64-
4-R, Wakefield, Mass. (Oct., 1964).
[(CQ65] Christensen, C., “Examples of Symbol Manipulation in the AMBIT
Programming Language”, Proc. ACM 20th Nat’! Conf., 1965, pp.247-61.
[CQ66] Christensen, C., “On the Implementation of AMBIT, A Language for
Symbol Manipulation”, Comm. ACM, Vol. 9, No. 8 (Aug., 1966),
pp. 570-73.
VI.9.2. TREET
[GQ67] Gross, L. N., On-Line Programming System User’s Manual, MITRE
Corp., MTP-59, Bedford, Mass. (Mar., 1967).
[HA65] Haines, E. C., Jr., The TREET List Processing Language, MITRE Corp.,
Information System Language Studies Number Eight SR-133, Bedford,
Mass. (M.S. thesis, M.I.T.) (Apr., 1965).
[HA67] Haines, E. C., Jr., The TREET Programming System: IBM 7030 Imple-
mentation, MITRE Corp., MTP-58, Bedford, Mass. (Mar., 1967).
[QA65] Bennett, E., Haines, E.C., Jr., and Summers, J. K., “AESOP: A
Prototype for On-Line User Control of Organizational Data Storage,
Retrieval and Processing”, Proc. FJCC, Vol. 27, pt. 1 (1965), pp. 435-55.
[ZT67] Chapin, P. G. et al., SAFARI, An On-Line Text-Processing System
User’s Manual, MITRE Corp., MTP-60, Bedford, Mass. (Mar., 1967).
VI.9.3. Others
[CN65] Conway, R. W. et al., “CLP—The Cornell List Processor”, Comm.
ACM, Vol. 8, No. 4 (Apr., 1965), pp. 215-16.
[KC67] Kapps, C. A., “SPRINT: A Direct Approach to List-Processing Lan-
guages”, Proc. SJCC, Vol. 30 (1967), pp. 677-83.
[QK67] Blackwell, F. W., “An On-Line Symbol Manipulation System”, Proc.
ACM 22nd Nat’! Conf., 1967, pp. 203-209.
[QW63] Sutherland, I. E., Sketchpad: A Man-Machine Graphical Communi-
cation System, M.1.T. Lincoln Lab., Tech. Report No. 296, Lexington,
Mass. (Jan., 1963).
[RB65] Roberts, L. G., “Graphical Communication and Control Languages”,
Information System Sciences: Proceedings of the Second Congress.
Spartan Books, Washington, D.C., 1965, pp. 211-17.
[SU66] Sutherland, W. R., On-Line Graphical Specification of Computer Pro-
cedures, M.I.T. Lincoln Lab., Tech. Report No. 405, Lexington, Mass.
(May, 1966).
Vil FORMAL ALGEBRAIC
MANIPULATION LANGUAGES
This chapter deals with languages which provide formal algebraic manipula-
tion facilities. The phrase formal algebraic manipulation applies to the
computer processing of formal mathematical expressions without any
particular concern for their numeric values. The main criterion for being
included in this area is one of intent rather than methodology; it will be
seen later that in at least one case the implementation techniques are in fact
numeric (rather than symbolic), although the motivation is to operate on
algebraic expressions. The phrase (formal) algebraic manipulation is being
used in preference to a slightly more common term, namely formula manipu-
lation, because the latter is somewhat misleading. It has often been used by
me, as well as others, to apply to formulas and/or expressions. Since there is
often a need to distinguish between formulas and expressions, the more
general phrase, algebraic manipulation, is being used. It must be emphasized
that this term in no way excludes the use of trigonometric or other types of
functions. Examples of the type of operations involved are differentiation,
substitution, integration, and deletion of a portion of an expression. In order
to appreciate the significance of this field, a little historical background is
necessary. Detailed discussions have been given in several papers by the
author (e.g., Sammet [SM66a] and [SM67]).
The primary motivation for the initial development of digital computers
was to solve numeric problems. This is generally conceded to be true, in
spite of the fact that the first UNIVAC was delivered to the United States
Census Bureau, whose problems by more modern standards would be
considered inherently data processing. Because of this tendency for using
a computer to solve numeric problems, there has been a major shift in
471
472 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
system which permits the user to specify which of several different mathe-
matical algebras he wishes to use. The Symbolic Mathematical Laboratory
and Magic Paper are independent languages whose implementations involve
either completely special equipment or unusual modifications of standard
computers.
In spite of the claims of some people, the ability to write recursive
procedures is not of major significance in this area, and while most of these
languages do not permit it, they are useful nevertheless.
Formula ALGOL is discussed in Section VIII.5 because in spite of
its name it provides enough other facilities to warrant placing it in the
multipurpose language category. It is an indication of both the relative
newness and the rapid growth of this field that two of the languages
(FORMAC and MATHLAB) are definitely in a second generation which
differs significantly from the first, and the Magic Paper situation is some-
what similar.
VIT.2.1. ALGY
Notice that there is no arithmetic defined, nor is there any facility for
loop control or control transfers.
Although ALGY apparently never received too much usage or publicity,
I consider it a major contribution to the field because it was the first system
to try to provide multiple capabilities on a general class of expressions all
in one system. In fact, for some ideas, ALGY was a conceptual forerunner
to FORMAC.
ViI.3. FORMAC!
1 It is hoped that the reader will attribute what might seem like an overly large
amount of space devoted to this language to my sincere belief in the long range importance
of this idea rather than to merely personal involvement.
VIL3. FORMAC 475
7090/94 IBSYS and (2) to get the system running as rapidly as possible.
Maintenance (in the sense of correcting the relatively few bugs which were
found) was carried on by the development group on an informal unofficial
basis.
The official and complete definition of the language is given in the
manual [IB65c]. Numerous papers have been written about FORMAC; the
language is described in increasing amounts of detail in Sammet and Bond
[SM64], Bond et al. [BZ64], and the manual.
As well as can be determined, the /anguage seems to have met its objec-
tives; while some minor improvements were needed, the commands chosen
seemed to fulfill the major needs of the users. Papers and reports describing
its use are shown in the reference list at the end of the chapter. The biggest
fault with the 7090/94 FORMAC was the storage or free list problem,
although this is inherent in the problem and not specifically the fault of
FORMAC. It is characteristic of this type of mathematical problem that
expressions require an enormous amount of space, and the most common
complaint has been that the user ran out of free list. This trouble presumably
can be corrected by increasing the amount of main storage available. Unfor-
tunately, the space required for problems tends to go up at an exponential
rather than linear rate, so doubling the available core does not double the
overall effectiveness. In fact, I have coined a new version of Parkinson’s
law, namely “expressions grow to exceed the space available.” Some of the
problems for which FORMAC has been used are described in articles listed
in the references at the end of the chapter.
The original plan in developing a version for the IBM System/360 was
to (1) define a specific extension of PL/I with a new data type and other
necessary additions and (2) incorporate the improvements which were shown
to be needed from experience with the 7090/94 system. A proposal for (1) is
given in Bond and Cundall [BZ67]. Unfortunately, it became impossible to
carry out the approach defined there because of time and funding constraints
and so a somewhat “less clean” language design was developed. It should be
emphasized that what is involved here is a subtle view of the language defi-
nition rather than any fundamental lack of capability. The language for the
running PL/I-FORMAC system is defined in the manual [IB67c].
* Both the 7090/94 (FORTRAN) and System/360 (PL/I) versions are being described.
Because of the greater familiarity of readers with FORTRAN, more emphasis is given
to that system. The language in the PL/I version is given with much less explanation.
VII.3. FORMAC 477
SAMPLE PROGRAM—PL/I-FORMACt
T{IB67c], pp. 88, 103 (slightly modified). Reprinted by permission from PL/I FORMAC
Interpreter. © 1967 by International Business Machines Corporation.
478 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
X = 3
Z=5
Y = X*¥*2
+ 3%xXXZ
would assign the value 54 to Y. However, we might wish to allow the variable
x to assume a nonnumeric value, say the expression a+ 6. Then a
FORMAC program would be written as |
LET X = A +B
Z 5
LET Y X*kkK2 + 3*¥X*Z
Example:
If ARRAY is (LI)JA + B* I—
(2)|—F MCDIF
(3)1( X ,X,1
(4)|) $
then ATOMIC A, B
J=0
LET | = EVAL (A -+ B), (A, 3), (B, 1)
10 LET Y = ALGCON ARRAY (1), J
results in Y —> A + Bx4, —1.
J = non-zero value
If a second expression began after the $, then returning to execute statement
10 would convert the next expression since J has a non-zero value.
AUTSIM
QINT
. QNUM
autsim-statement
f -stat := AUTSIM QNINT
ON
Example:
ATOMIC X, Y, B
[| = 3
LET A = 1 + 4 + IX] + FMCSIN(Y)XFMCFAC(I) -+- FMCDFC(B)**!
BCDCON
bedcon-statement : = LET ftn-num-vor = BCDCON fmc-exp, ftn-fxd-var, fxd-num
Example:
ATOMIC AB, BC, X
DIMENSION LIST (4)
LET R == ABXBC + FMCSIN(X)*FMCCOS(X) + 4.3
Q = 0.
LET Q = BCDCON PR, LIST, 4
481
Figure VII-1. (cont.)
would result in LIST (1) binary 16] FORTRAN fixed point value
(2)|A B* BC +] in binary as opposed to BCD
GB)|FMCSIN
(4) (X)* BB
Q + 0. (there is more to do).
Upon re-entry to BCDCON with Q@ = 0. the translation continues; and now
LIST (1) 14
Q)|FMCCOS
(3)|/(X ) +4.
(4)(3$ BERS
Q = 0. (translation complete).
Note that $ is inserted as the last character of every expression which is translated by
BCDCON. This is necessary in case the expression is to be read by the ALGCON routine.
CENSUS
WORD
census-statement := LET ftn-fxd-var = CENSUS let-var, < TERM
FACT
Example:
ATOMIC A, B, C
LET Z = A+ B
LET M = CENSUS Z, TERM
results in M = 2
LET M = CENSUS Z, FACT
results in M 1
| NI
Example:
LET B = AXXX%2 + CXX**4.2 + BRKX¥X3.1
LET Z = COEFF B, X**2, R
results in Z — A
R = 3.1
ERASE
erase-statement:— ERASE let-var {, let-var} ...
Example:
ERASE MAS, EOJ, A, X(4), M(3)
where MAS, EOJ, A, X, M are all let variables
results in MAS, EOJ, A, X(4), and M(3) all being erased
EVAL
eval-statement : =
482
Example:
Ri = —.5
LET A = B(1)*¥X + B(1)*(Y*X*X—1.)
LET R = X—4.
LET IANS(5) = EVAL A + R, (B(1),2), (X,ABSF(RI)), (Y,3)
After substitution A + R is 2.*(.5) + 2.*3.*%*—1. + .5—4. the floating point
arithmetic yields 1. + 2.*3.*%*—1. + .5 — 4. = —1.8333, etc., but IANB (5) is fixed
point mode and therefore IANS (5) = —1
EXPAND
expand-statement := LET let-var = EXPAND fmc-exp [, CODEM]
Example:
ATOMIC A,B,C,D
LET R = EXPAND(A + B)**2 + AX*(C—D)
results in R —> AXk*2, + A*B*X2. + B*¥*2. + AXC—AX*D
FIND
find-statement : =
Example:
ATOMIC B, C, D, F, X, Y, R(10)
LET A=>=B+C
+ D—F
LET Q = FIND A, APP, ALL, (B,C,D,F,G)
results in Q —> .FALSE.
whereas
LET Q = FIND A, APP, ONE, (B,C,D,F,G)
results inQ —> .TRUE.
LET
let-statement : = LET let-var fmc-exp
Example:
ATOMIC Z
N= 4
LET C = (M + Z)*®*(1/2)
results in C —> (4. + Z)*%*(.5)
MATCH
match-statement : =
483
Figure VII-I. (cont.)
Example:
ATOMIC A, B
LOGICAL Q
LET X = (A + B)**2
LET Y = A®k2 + 2*%AXB + BXX2
LET @ = MATCH ID, X, Y
results in Q = .FALSE.
LET Q = MATCH EQ, .OOI, X, Y
results in Q@ = .TRUE.
ORDER
order-statement =-
INC FUL
LET let-var = ORDER fmc-exp, {pect , {rer
Example:
LET Z = ORDER X¥®3 + X¥*2KZ%K2 + YRX*3, INC, FUL, (X)
results in Z -—> 3*®X ++ 2®X*¥k2kZ + X*kkZKY
PART
Example:
LET X = (A + B) + C
LET ANS = PART X, M
results in ANS -—> A
X—B+C
M = 4
SUBST
subst-statement :=
param-label max 9 {, porom-lovel)}
LET let-var = SUBST fmc-expo, { .
poram-list
poram-list := (seek-var, fmc-exp;) {, (seek-var, fmc-exp2)} ...
Example:
LET A = B + 3xC
M = 4
LET Z = SUBST A, (B, M), (C, FMCDIF(X**2, X, 1))
results in Z —> X*6. + 4.
Figure VII-1. 7090/94 FORMAC verb formats with examples. The general
notation is the COBOL metalanguage described in Section II.6.2.
Source: [IB65Sc], extracts from pp. 141-184. Reprinted by permission from
FORMAC (Operating and User’s Preliminary Reference Manual). © 1964
by International Business Machines Corporation.
484
VII.3. FORMAC 485
The actual format for writing most of these is with a LET on the left-
hand side and the command on the right, e.g.,
3 Private communication.
V1I.3. FORMAC 487
Substitution
Differentiation
where n= ) Nn,
dv™ dum... Quer EXPE
t=1
DRV (fnen-var).(arg1, ..-, argm), $(1), mi, $(2), no, .--, $(r), m)
Causes differentiation of unspecified functions with respect
to arguments.
DIFF (fncn-var) = CHAIN (expr-], expr-2, ..., expr-n)
DIFF is a pseudovariable which assumes fpnen-var is an
unspecified function of n variables. The expr-i are assigned
as the values of the first partial derivatives of fnen-var. (This
latter concept is described on page 489.)
Expression analysis
Storage allocation
Output
Mathematical
SIN, COS, SINH, COSH, ATAN ATANH, LOG, LOGIO, LOG2, ERF, EXP,
SQRT, SIND, COSD, TAN, TAND, TANH, ATAND, ERFC
Integer-valued
User-defined
Function variables
This is useful in creating argument lists for FORMAC functions and rou-
tines.
A number of options can be specified by the user, using an OPSET
statement. These provide control over certain aspects of automatic sim-
plification and output editing.
FORMAC and PL/I variables can each be transformed (and used in
the other part of the program) in several ways. A PL/I variable enclosed
within double quotation marks can be used in LET, PRINT__OUT, and SAVE,
490 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
and expressions. A PL/I variable can be used on the left side of a LET state-
ment if it is a character string variable; executing the statement assigns the
resulting FORMAC expression as the value of the PL/I variable.
Writing CHAREX (var = variable), where var must be a PL/I varying
character string, assigns to var the character string value of the FORMAC
variable.
Writing CONVERT FIXED (x1; ... ; Xn) FLOAT (y1;..-;ym) Where the
x; and y; are unsubscripted PL/I variables, causes assignment of the value
of FORMAC expression (which must be numeric) to the specified variable
whenever the latter appears (within quotes) on the left-hand side of a FOR-
MAC assignment statement. If the variable appears within quotes on the
right-hand side, the conversion is made from PL/I to FORMAC. The words
FIXED and FLOAT actually refer to the conversions which will take place.
Using the functions INTEGER and ARITH, each followed by a FORMAC
variable name enclosed in parentheses, causes the numeric evaluation of the
expression with that name and its return in fixed point binary or double-
precision floating point, respectively. This provides the mechanism for
evaluating an expression and using the numeric result in a PL/I statement.
There are several macros which can appear in PL/I statements. In par-
ticular, it is possible to write
will help steer people away from numerical analysis and back to analytic
solution of problems.
Vil.4. MATHLAB
The first language was fairly simple, with an unusual mixture of succinct-
ness and naturalness as can be seen in Figure VII-2. For example, one com-
mand was pleasesimplify (x y) which 1s fairly clear, whereas the command
factor ((x y...)) iS not intuitively obvious because of certain precedence
relations. Thus the language tended to be slightly inconsistent in style,
although certainly not in content. There was a strong tendency toward
English-like language in the output, where the system typed such messages
as THANKS FOR THE EXPRESSION or ARE YOU FAMILIAR WITH THE FORMAT
FOR TEACHING ME2?.
The application area is mathematics, and the stated objective is to
provide on-line facilities for mechanical operations such as addition of
expressions and equations, substitution, differentiation, integration, and
Laplace transforms, etc. Only a typewriter was used for input/output.
The language was definitely a problem-solving, hardware language, with
the user a novice or perhaps nonprogrammer. Although the user of
MATHLAB can be completely unaware of it, the system was coded in LISP
(see Section VI.5) and actually invoked LISP for the execution of all its
facilities.
Since the system was running on three machines, there was a compati-
492 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
DIFFERENTIAT#(Z T DZ)
(I DO NOT KNOW THE DERIVATIVE OF ARCSIN . DO YOU)
YES
CARE YOu FAMILIAR WITH THE FOR“AT FOR TEACHING ME)
NO
(PLEASE IMITATE THE FOLLOWING EXAMPLE)
ARCTAN ,
X
17h + X12) ,
30
ARCSIN,
9
I/SORTC1-Ut2),
CTHANK YOU)
!USERS
$ 7 USERS,
" DZ = PI*SORT CARCSIN (PI¥T)) + 1/2ePIt2*T/CSQRT CARCSIN CPI*T))*SQRT
C1 - (PI*¥T) -2))
RAISECZ 2 Z2)
Z2 = (CPI*TKSQRT CARCSIN CPI*T)))
12
EXPAND(CT))
CSIMPLIFY)
PLEASESIMPLIFY(Z2 Z2)
Z2 = PI t2*xTt2*ARCSIN (CPI*T)
NEWNAMECDIFFERENTIATE DIFF)
(SORRY THE NAME DIFF IS ALREADY TAKEN)
DENOTE NIL
CUBE = (A + B13,
(THANKS FOR THE EXPRESSION CUBE)
NEWNAMECPLEASESIMPLIFY PS)
OK
PS"PS(CUBE CUBE)
CUBE = (CA + B) 43
EXPAND( CA) )
(SIMPLIFY)
PS(CUBE NEWCUBE)-
NEWCUBE = AT3 + 3*AT2*B + 3*A*BTt2 + 3t3
bility problem, which really reduced to the compatibility of the LISP systems
which were available on the three different machines, and to the differences
in input hardware.
Since this was basically a system under continuing development and tight
control, with no users, there was no problem of subsets or extensions. Dialects
existed because of the compatibility problems.
VlI.4. MATHLAB 493
The character set consisted of the 26 letters, 10 digits, and the following
symbols:
+ — x f/f t ( ), = blank
(Where the input keyboard did not contain the up arrow, t¢, then **« was
used instead.)
Names of symbolic variables consist of a letter followed by letters
and/or digits; no limit on length was stated. No subscripting or qualification
was allowed. Variable names could be the same as the fixed commands of the
system. Numeric literals were used without any special delimiter. Blanks
were significant. The comma was the main punctuation character and was
used to separate functional arguments and also to delimit an individual data
item, e.g., an expression (which could itself be quite complicated). There
were no noise words permitted as input, but the system typed out a number
of polite but logically unnecessary words, e.g., THANKS ... .
The input was from an on-line keyboard, with a number of commands
defined as English words followed by parenthetical information to provide
the parameters.
The structure of the program was quite primitive. There were a few decla-
rations (which really had the effect of deferred commands; 1.e., they caused
something to happen but not until sometime later in the execution). There were
a number of single executable commands, but they could not be combined.
There were no loops or subroutines or functions in the normal sense. It was
possible to name objects and have the system remember the name and
retrieve the object when the name was given. The primary interaction with the
environment was through the normal commands of whichever time-sharing
system was being used. In essence, the system operated on a line-by-line basis
rather than as a stored program, with all the attendant advantages and
disadvantages.
The main delimiters for the commands and declarations were commas
and carriage returns. Declarations were intermingled with the executable
commands as needed.
The only individual data variable type permitted was formal (i.e., alge-
braic). However, these could be combined to form expressions, equations, or
494 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
DENOTE NIL
A=B + C,,
DENOTE NIL
B= D + 2,,
then B has the value D + 2 but A still has the valueB + C. (The first comma
delimits the equation while the second indicates that there are no more
equations.)
There was no alphanumeric data handling. Since this system was designed
to operate essentially on a line-by-line basis, there were no control transfers,
no conditional or loop-control statements, and no error condition statements.
The available algebraic expression manipulation statements were as
follows:
An equation was named and defined by writing two equals signs. For
example
SUBTRACT (X Y NAME)
The X and Y could be equations, functions, expressions, or
numbers.
DIVISION (X Y NAME)
Similar to subtraction.
RAISE (X Y NAME)
Defined by NAME = XY
NEGATIVE (X Y)
Defined by Y = —X
INVERT (X Y)
Defined by Y = 1/X
PLEASESIMPLIFY (X Y)
This command simplified (using a particular routine developed
at Stanford University) the expression X and named it Y. The
action of this command could be affected by the next two
commands.
FLIP (X Y)
Y becomes the name of the equation X with the left and right
sides interchanged.
496 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
MAKEEQUATION (X Y)
An equation is formed with the name Y; the left side 1s X and
the right side is the value of X. For example,
DENOTE NIL
A=B + C,,
MAKEEQUATION (A R)
(R)A=B+C
where there is now an equation named R.
MAKEEXPRESSION (E)
E must be an equation whose left side is a single word. This
command created an expression whose name is the left side of
E and whose value is the right side. Thus, using the informa-
tion above,
MAKEEXPRESSION (R)
would result in
A=B+C
MAKEFUNCTION (E)
This applied to an equation E whose left side was of the form
F(X1, X2,...,Xn) where each Xi was a single word. A new func-
tion F was formed whose dummy variable list was (XI X2 .. . Xn)
and whose value was the right side of E.
DIFFERENTIATE (Y X Z)
This differentiated Y with respect to X and called the result Z.
LEARNDERIVATIVE
The user defined for the system the derivative of a new function.
VI1I.4. MATHLAB 497
INTEGRATE (X Y 2Z)
This integrated X over Y and called the result Z. X must be a
rational function of Y, with rational numeric coefficients.
SOLVE (E X)
This command required that the equation E be rational (but
it could have symbolic coefficients) in X and be really (although
not necessarily explicitly) quadratic or linear in X.
RENAME (X Y)
The name Y was assigned to the item which had the name x.
NEWNAME (A 8B)
This allowed the use of the command name B in place of the
command name A. For example, instead of writing INTEGRATE,
the user could say NEWNAME (INTEGRATE 1), which would cause
| (A B C) to have the same meaning as INTEGRATE (A B C).
REPEAT (X)
This command printed out X. (It is useful when the programmer
has forgotten what he typed or created earlier.) For example,
using the earlier information, REPEAT A causes A=B+C to be
printed out.
FORGET (xX)
This deleted the item X from storage.
DENOTE NIL
A=B+(C,
B=D + 2,,
SUBSTITUTE ((B) A M)
results in
M=D+2+C
498 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
+ — « / ( ) , = 3: ' §$ blank
The variables and function names of MATHLAB are LISP atoms, and
the rules for constructing them are precisely the rules for constructing LISP
atoms in whichever LISP system MATHLAB is embedded.
The only numbers permitted for input/output are integers, but the
internal arithmetic is rational. :
The $ is used to terminate all input statements.
The : is used to store an expression or equation by name, e.g.,
V:X + Y $ and to specify the definition of a function, e.g., F(Z) : Z**2$.
Blanks are significant.
The ' is used to evaluate symbols which are the names of stored data
and to evaluate functions. Using the assignments of V and F above,
SAMPLE PROGRAM—MATHLAB 68
Problem: Given a random variable u with probability density f(u) defined by:
bu —x)+x-+ax u>x
The problem is to find the value of a such that the expectation of p is maximized
when x = y.
Program:
P1:(U—(1 —R)*X)/R+A&X$
U — (1 — R)X
P2:B%x(U—X)+X+A*X$
B(U — X) + X + AxX
F(U):3/(4*S*Y)*(1 —((U—Y)/(S*Y))**2$
3 U-Y 2
WS (U): ~-——(1 —(--—))
ASKY SxY
ALIAS SUBSTITUTE SUB$
DEFINT(EXPR,X,A,B):''(’SUB(B,X,INT:' INTEGRATE(EXPR,X))-’SUB(A,X,'INT))$
WS(EXPR,X,A,B) : "SUBSTITUTE(B,X,INT : INTEGRATE(EXPR,X))
—'SUBSTITUTE(A,X,'INT) |
‘SOLVE('SUB(Y,X,’DERIV('DEFINT('P1*'F(U),U,
Y —SxY,X)+'DEFINT('P2x'F(U),U,X,Y +S*Y),
X)}=0,A)$
THE ROOTS ARE
(B — 2)R + 1
MLl: momo occ
2R
ONCE
FINISHED
Comments:
The command “integrate” in MATHLAB computes indefinite integrals.
This was used, after introducing the initial data, to define the definite integral as
a MATHLAB function. After that, the problem can be posed in one instruction.
In the program, the lines typed by the user end with $ and the others are the
computer response.
500 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
DERIV(V,X) evaluates to DV
DX
DERIV('V,X) evaluates to 5 (Y+X)
'‘DERIV(V,X) evaluatesto 0
‘DERIV('V,X) evaluates to 1
Arithmetic commands
The arithmetic commands of the old system have disappeared. Instead
of typing ADD((E7 E2) name) we now type NAME: 'E] + 'E2 $ if storage by
name is desired, and 'E] + 'E2 $ if no name is needed. (In this case, the
expression is referred to as WS.) The real point is that input like
Xx(‘El + 'E2)$ is now allowed. It would have taken three commands to
achieve the same result in the old system.
Simplification
The user controls the usage of a simplification routine by means of on
and off switches, e.g., SIMP ON $ causes simplification to occur after the
execution of each statement. The SIMP $ switch reverses the status of the
simplification invocation. In addition, there is a command RATSIMP, which
uses the rational function routines to perform the required divisions. Thus
'RATSIMP(DATUM,EXPRESSIONI, ..., EXPRESSIONn) evaluates to the value
of DATUM, expressed as a rational function with a single numerator and a
single denominator, with all possible greatest common divisor cancellations
having been made. The expressions EXPRESSIONI, ..., EXPRESSIONn, if
present, are taken as the most important variables in decreasing order.
commands which were removed from the current system since they are all
special cases of the more flexible input syntax. Thus, to accomplish
MAKEEQUATION(A R) of the old system, merely type R: A = ‘A$
since the ‘A really denotes the value of A.
Output
Output expressions are presented two-dimensionally on the scope or,
when hard copy is desired, on the on-line printer. The display program is
described in Millen [ZJ67}.
Miscellaneous
Writing ALIAS A B permits A to be used in place of B.
MATHLAB was the first complete on-line system with formal algebraic
manipulation facilities. However, its effectiveness for man-machine inter-
action has been very limited because of the inadequacies of typed input
and output. It was the first language to include higher level operations such
as integrate, solve, etc. While these are of interest, they are not of major
significance from a language point of view. The major contribution of
MATHLAB is actually in an area which is beyond the scope of this book,
namely the routines which were created to implement these higher level
commands. Some useful work was also done so that the typewriter could
be used to print expressions and equations in a two-dimensional form, using
standard equipment.
The new version of the system (discussed briefly earlier) differs from
the first one above in a number of ways. The notation and framework are
more ALGOL-like, and they permit a stored program as well as the line-
by-line mode. Probably the most significant part of the new system will be
a method for defining and identifying mathematical subexpressions which
have been typed; this is planned to be done by using input editing routines
and by attempting to provide a typewriter facility equivalent to the concept
of pointing at a scope with a light pen.
Somewhat different from the question of language or syntax, but quite
important to the potential usefulness of MATHLAB, are improvements
(both internal and external) in its rational function routines which allow
them to operate in any number of variables and, in particular, to factor
polynomials over the integers in any number of variables. This results in
commands available to the user which provide such facilities as the com-
putation of direct and inverse Laplace transforms; the inversion of matrices;
and a spectrum of solves, including the solution of one equation rational
in the desired unknown, several equations linear in the unknowns, one linear
502 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
Vil.5. ALTRAN
SAMPLE PROGRAM—ALTRAN't
QA; Qo 3
D= Gig Aq = Ag3
G3; Az, G3
_ 2
a, = (ro + 14)
Qj = 1o? + rors + rors — NN;
_
r>>--
1
a C;
Program:
C DECLARATIONS.
LAYOUT (L1) CO 9, Cl 9, C2 9, C3 9
LAYOUT (L2) RO 9, RI 9, R2 9, R3 9
POLYNOMIAL Al, A2, A3, A1l2, A23, A31, D
C ESTABLISH THE A’S. ,
Al = (RO+RI)*xx2
A2 = (RO+R2)xx2
A3 = (RO+R3)x*2
A112 = ROXX2+ROXR1] +ROXR2—RI1&R2
A23 = RO*X*2+ROXR2+ROXR3—R2XR3
A31 = RO*X*2+RO&XR3+ROXRI —R3*RI
C COMPUTE AND PRINT THE CONDITION ON THE RADII
C AND THE CORRESPONDING CONDITION ON THE CURVATURES.
D=A1xA2xkA3k—A]12xk2kA3—A23%k2KA1 —A31] Xk2KA2+2%A1 2%*A23%A31
PRINT D, D(RO=1/CO,R1=1/C1,R2=1/C2,R3=1/C3)
STOP
END
where expr is purely numeric and control is transferred to n;, nz, n3, depend-
ing on whether expr is negative, zero, or positive, respectively. A second
conditional statement has only two statement numbers associated with it
and allows expr to be any of the five data types; control is transferred to
n, if the value is not 0 and to nz if it is 0. The DO statement from FORTRAN
II is permitted.
Arithmetic is done on rational numbers to produce exact results, just
as in FORMAC. When computation is done on rational functions, the
greatest common divisor is calculated automatically and used to simplify
the rational functions.
The main algebraic statement directly permitted in ALTRAN is sub-
stitution. There are two kinds, namely complete and partial. The complete
substitution has the general form F(A), ..., A,) where A;,..., A, are any
of the five variable types discussed above. The variables X;, ..., X, which
appear in the expressions represented by F are replaced by the values of
Ai, -.-, An, respectively. The substitute expression is distinguished from
a function reference because the latter has a function declaration. A partial
504 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
substitution has the general form F(Y;=B), ... ,¥,==B,), where the Y; are some
subset of the X; and the B; are expressions of type integer, rational, poly-
nomial, or rational function. The Y; are replaced simultaneously by the B;
in the expression represented by F. Note that every partial substitution could
be written as a complete substitution by merely replacing each of the vari-
ables which is not to be changed by itself.
The only input statement is of the form
where L 1s the layout name, the X; are the variables, and W, are the corre-
sponding field widths. The W, refers to the amount of space to be allocated
internally for exponents. All variables must be declared as either INTEGER,
RATIONAL REAL, POLYNOMIAL, or ALGEBRAIC. The words FUNCTION and
SUBROUTINE are used as in FORTRAN to declare functions and subroutines.
Functions can also be declared to be any of the first five types. It is possible
for the user to include FAP coded subprograms in his program. In particular,
all the subroutines and facilities from ALPAK are made available to the
VII.5. ALTRAN 505
Integer functions
Rational functions
Real functions
5 This list is taken from pp. Al-2-A1-4 of McIlroy and Brown [ML66].
506 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
Polynomial functions
Algebraic functions
This system has had very limited usage outside Bell Laboratories.
In conclusion, while admitting that my view may be biased, I feel that
ALTRAN itself has not contributed anything to the technology. The sig-
nificant part of the effort was the work done on ALPAK, which of course is
not within the scope of this book.
Vil.6. FLAP
FLAP is an experimental language that was written in LISP 1.5 (see Section
VI.5) by A. H. Morris, Jr., at the U.S. Naval Weapons Laboratory at
Dahlgren, Va.; it runs on the IBM 7090. FLAP permits the user to handle
different types of symbolic mathematical data, e.g., differential equations,
vectors and matrices, etc. Much of the nomenclature, although not the
notation, comes from LISP.
An atom is defined in FLAP to be a letter followed by up to 29 numbers
or letters. Atoms are used as variables, constants, or function names. There
are two special atoms defined, namely TRUE and NIL, which have the values
true and false, respectively,
A number of mathematical systems (which are really modes of arith-
metic) are provided. The simplest is the *NUMBER, which assumes that
only rational numbers are available. The systems available to the user are
called algebras since they have been defined to be that from a mathematical
point of view. The *SIMPLIFY is the second simplest algebra in FLAP.
It assumes that the basic data are rational numbers and constant atoms
such as A and PI, which are independent of each other. These constants can
vi.6. FLAP 507
SAMPLE PROGRAM—FLAPT
Problem: Given the two series >) a,x” and >) b,x" where b, + 0, evaluate
n=0 n=0
the first r + 1 terms ¢o,c),...,¢, Of the series >) c,x” = )) anx"/>> b,x". The
n=0 n=O n=0
variables A,B, N, R have the respective values a,, b,, n, r.
Program:
DIVIDESERIES sDOTPROD
DEF DIVIDESERIES
INPUT AeBeNeR
DUMMY Kel eVe8BO0eNUM
NUM # O
MODE #SIMPLIFY
BO = COMPUTE (SUBST (OeNeB) )#¥(—1)
L = LISTCCOMPUTE (SUBST (OeNeA) 2 *#B0)
Vee
LOOP IF NUM=R THEN RETURN(CAR(V))
FLAPPRINT CAR(V)
NUM = NUM+1
K = CONS (COMPUTE (SUBST (NUM¢eNoB) Dok)
RPLACD VeLIST(BO* (COMPUTE (SUBST (NUMeNeA) )=DOTPROD (Kel) ))
v = cOR(V)
GO tooP
ENO
DEF DOTPROD
INPUT KeY
DUMMY KeleM
x
CAREC R
Y
0
M+CAR(h.)#CAR(L)
COR (K)
COR (L)
IF NULL (K) THEN RETURN(M)
GO A
END
DIVIDESERIES (SINCA® (N41 ) DHFACTORIAL (ND ##(=11) SFACTORIAL (BN) HH (=1 De
Ne2)
be combined under the five normal arithmetic operators, and Morris applies
his definition of simplification to expressions; this means expansion to
eliminate parentheses, followed by combination of like terms. The algebra
*NUMBER is imbedded in *S/MPLIFY and the latter in turn is included
in every other algebra.
For arbitrary values, FLAP assumes that the variables are listed at
the beginning of the program so that the system can determine whether an
508 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
* MULTILINEAR
This has two modifier lists, K and L. The items of L are con-
sidered to be the mathematical data and each is assumed
independent of the others. The constants of this mode are
elements of the *MULT arithmetic based on the modifier list
shown in K. The differentiation operator DIFF(A,X) is also
defined. Using this operator, arbitrary symbolic differential
expressions can be manipulated.
* EXTERIOR
There are three «EXTERIOR algebras available, differing only
by the number of modifier lists used. If there is a single list B,
then B must be a basis for a vector space having as its ring of
scalars the xSIMPLIFY algebra. For two or three modifier lists,
then either the «MULT or the *MULTILINEAR algebras are used.
* MATRIX
There are three xMATRIX modes available, depending on the
number of modifier lists used. If no modifier list is used, then
every expression in the mode is assumed to be a matrix whose
components are values in the *S/MPLIFY arithmetic. If there
are one or two modifier lists, then the values of the matrix
elements are assumed to be in * MULT and *MULTILINEAR modes,
respectively.
A great many LISP functions are made available to the FLAP pro-
grammer. These include the following:
AND, APPEND, ATOM, CAR, CDR, CAAR, CADR, ..., CDDDR, CONC,
CONS, COPY, EQUAL, GET, LENGTH, LIST, MEMBER, NCONC, NOT, NULL,
OR, REVERSE, RPLACA, RPLACD, SELECT, SETQ, SUBST.
The first attempt at an on-line system was the Magic Paper described
by Clapp and Kain [CL63]; it was never fully implemented but, nevertheless,
it presented some interesting ideas which are worthy of note.
The system used the PDP-1, with a typewriter, display scope, paper
tape reader and punch, magnetic tape, and light pen for input/output. Some
of the control characters available to the user are shown in Figure VII-3.
The main input device was considered to be the typewriter, but this is obvi-
ously not the most convenient means of typing mathematical expressions.
For that reason, a number of symbols were designated as format control
characters; these are shown in Figure VII-4.
The display scope was the principal on-line output device. Equations
and other data could be displayed directly in fairly standard mathematical
notation. The results could be saved by photographing the scope or by
using punched paper or magnetic tape.
Numerical evaluation could be done; in addition to the five standard
operators, there were functions indicating summation or product over an
index between limits, and conditional expressions.
A new and independent version that retains the same name has been
developed at Computer Research Corporation under the direction of L.
Clapp, who was a developer of the first version. The newer version used
a nonstandard PDP-1 and special visual display equipment. The system was
not being used at the time of this writing because it needed to be integrated
with other packages. For this reason, only the highlights of the language
Label equation
Substitute
Underline equation
Replace underlined symbols
Factor out underlined terms
Get equation from storage and add to
bottom of display
Enter sketch input mode
wn
Symbol Function
[] (Space) Delimiter (except after nonspacing characters)
=> (Tab) Delimiter
© (Carriage return) Delimiter (end of line)
- (Center dot) Dismiss the symbol which follows from its con-
trol significance
T Denotes exponent
w~ Denotes superscript
Vv Denotes subscript
| (Vertical bar) Restore to main line
2 Drop exponent level one line
> Equation label follows
€ (Backspace) Ignore last character
> Treat the string just typed as a defined symbol
capability will be given. The main report on this system is Clapp et al.
[CL66].
The system contains a special keyboard, a flicker-free display, a light
pen, a push-button panel, and two foot switches. The panel is the primary
control for the system. Every button on it corresponds to a system command
which is invoked by pressing the button. These commands control the display
and also perform manipulations. The arguments either are selected by the
light pen or are entered through the keyboard. Both input equations and
calculated results are organized into a system of scrolls which are concep-
tually like pages of a book. The scrolls are used for displaying current results
and also expressions being entered. When the scroll is full it is automatically
rotated, but the user can also control the movement forward and back.
The light pen permits expressions on the screen to be brightened or under-
lined, and it is used to select arguments for use with commands.
The special keyboard used contains the 52 upper- and lower-case letters;
the 10 digits; Greek letters; keys for Greek mode and English mode; a panic
key; control keys for space, carriage return, and backspace; and keys for
subscript and superscript. It also contains the following characters:
+#-x/t=()E1C)12?-.,7
+ @
Variables can only be single letters since juxtaposition is used to denote
multiplication. Variables and function names can have subscripts and/or
superscripts; the latter can themselves contain subscripts and superscripts.
Multiple subscripts are permitted, with commas as separators; the same
applies for superscripts. Each of the “scripting” (abbreviation for subscript-
ing and superscripting) operations must be terminated by a question mark,
VII.7.1. MAGIC PAPER 513
2, which has the meaning return to the previous line, or terminate last ex-
ponentiation or scripting operation. Superscripting and exponentiation are
logically different but are displayed similarly. Denoting sub- and superscript
operations by ~ and A, respectively,
x)
would match the transformation mentioned above, but (c+1)? would not.
New transformations can be put into the table by the insert information
command, which specifies the transformation; similarly, one can be deleted
by the remove transformation. Transformations can be used in both directions
by appropriate use of the > and <.
The most recent result can be deleted and the system returned to its
earlier condition by the restart command. A cancel command deletes the
last step the user took in setting up the arguments for an operation.
The user has a procedure define which allows him to assign a procedure
to a particular button, and he has ways to specify the operands.
The most interesting language feature of this system is its provision for
user-defined new operators. The user specifies (or responds to questions
from the system) whether the operator is prefix, infix, or suffix; whether
its arguments must be parenthesized; how many arguments it must have;
whether it is associative and commutative; and what its precedence value is
relative to the other operators.
From a general point of view, most of the commands in this system
relate to providing an appropriate means of using the hardware. It does not
seem to have any significantly new or general concepts, although some of
the details seem both interesting and novel. The one exception is the concept
of the scroll, whereby previous information is available in a readable form
and can be displayed upon proper request. This seems to be a valuable
solution to one of the major problems in this type of system.
Program:
#t°E1 —'(DRV(:T,2,X(:T)) + OMEGAT24X(:T) = EP%(X(:T))13)#
FH EDISPLAY('E1)#
#t'E2<—'(X(TAU) = SUM(I,O,INF,EPTI*X[I](TAU)))#
FH EDISPLAY('E2)##
#t'E3<—'(:T(TAU) = TAU + SUM(J,1,INF,EPtJ*:T[J](TAU)))#
FP EDISPLAY('E3)#
#t'E4<—DRVFACTORIE1,':1,1)#
FP EDISPLAY('E4)#
#'E5— SUBSTITUTE(DELSUBST(E4, (DEL(: 1), '(DEL(TAU))/DRV('TAU,1,RIGHT(E3))),
(X(TAU)),'(X(:T)))#
FP EDISPLAY(‘E5)#
#'E6<—DRVDO(SUBSTITUTE(ES, RIGHTIE2), (X(TAU))),, TAU)#
Ft EDISPLAY('E6)##
#£'E7 — TRUNCATE(E6, EP, 1) #
Ft EDISPLAY('E7)##
Ft'E8<—!E7,6=;'E7,88#
# EDISPLAY('E8)#
#'E9<— SIMPLIFY(DRVDO(SUBSTITUTE(SOLVE(E8, '(X[1 ](TAU))),'(A*COS(OMEGAXTAU)),
'(X[O](TAU))),’
TAU)) #
FP EDISPLAY('E9)#
4 'E10<—COLLECT(EXPAND(SUBSTITUTE(E9, '((COS(3 OMEGAXTAU) + 3xCOS(OMEGA*
TAU))/4),'((COS(OMEGAXTAU))13))),((SINSOMEGAXTAU),COS(OMEGA&TAU))))#
# EDISPLAY('E10)##
#'E11 —SIMPLIFY(SOLVE(SUBSTITUTE(!E10,44,'C,'(DRV(TAU,1,:T[1 ](TAU))))=0,'C))#
FE EDISPLAY('E11)##
Comment: An example of the first three displayed equations as plotted by
the CALCOMP plotter is shown below.
2
515
516 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
with respect to U of the expression currently named E1. The second term
is the twentieth subexpression of a displayed expression currently named E2;
this subexpression has been indicated with the light pen. The final term is
the square of a subscripted function of X and Y.
There are no control statements, either conditional or unconditional,
except for a few which are inherent in some of the algebraic manipulating
commands. The complete list of these is as follows, where the description
of each command has been taken directly from Martin [ZB67],®> but the
subhead grouping was done by me. The presence or absence of blanks is
not significant.
Differentiation
DRV (X1, Ni, ---. Xr Nav Y)
Differentiate Y N; times with respect to X;, for each i.
DRVDO (EXP, X)
All indicated derivatives with respect to X in EXP are carried
out as far as posible.
DRVFACTOR (EXP, X, N)
dxNtH” dm (57 )
for each such subexpression in EXP.
DRVZERO (EXP, X)
All derivatives with respect to X in EXP are set equal to zero.
DELSUBST (EXP, OLDDEL, NEWDEL)
dx dx
d OLDDEL = d NEWDEL
for each such subexpression in EXP.
Types of substitution
REPLACE (E, X, Y)
Expression X replaces Y in the expression named E. Y is a term
indicated with the light pen or a group of terms indicated with
GROUP.
SUBSTITUTE (EXP, X, Y)
Substitue X for each occurrence of Y in EXP.
EVALUATE (EXP, SET)
SET is a set of equations; whenever the left side of one of these
equations can be matched to a subexpression in EXP, the right-
hand side is substituted. The left sides must be variables or func-
tions. A match occurs whenever a binding of the function
variables and subscripts can be made.
SIMPLIFY (EXP)
Simplifies expression EXP.
EXPAND (EXP)
Multiplies out all expressions of the form a*(b+c) in EXP. In
addition,
d da , db
dx (a+ b)-— dx + dx
Rearrangement of expressions
BRINGOVER (EXP, X)
Subexpression X, which has been indicated with the light pen,
is brought to the other side of equation EXP.
EXCHANGE (EXP)
If the top level connective of EXP is binary, its arguments are ex-
changed from right to left.
GROUP (SET)
The set SET of terms which has been indicated by the light pen
in EXP is grouped within the associated sum or product. The
value of GROUP is the grouped set of terms.
MULTIPLYTHROUGH (EXP, X)
Multiplies each top level term of EXP by xX.
VII.7.2. SYMBOLIC MATHEMATICAL LABORATORY 519
Input/output
EDISPLAY (E)
Displays the expression named E on the PDP-6 scope.
EPRINT (E)
Prints out the internal form of the expression named E with
PLS, PRD, EQN, and PWR in infix form; the other operators
are in prefix form.
EDELETE (E)
Deletes expression named E from the disc.
Miscellaneous
NEWNAME ()
Creates a name of the form Fn, where n is an integer.
520 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
DEPENDENCE (EXP)
Returns a set of the variable and function names in EXP.
There has been no real usage of the system except by the developer.
The most significant elements are the methods for displaying and manipu-
lating expressions and some of the internal techniques used for simplification.
REFERENCES
VIl.3. FORMAC
[BZ64] Bond, E. R. et al., “FORMAC—An Experimental FORmula MAnipula-
tion Compiler”, Proc. ACM 19th Nat’! Conf., 1964, pp. K2.1-1-K2.1-11.
REFERENCES 52]
[BZ67] Bond, E. R. and Cundall, P. A., “A Possible PL/I Extension for Mathe-
matical Symbol Manipulation”, Symbol Manipulation Languages and
Techniques, Proceedings of the IFIP Working Conference on Symbol
Manipulation Languages (D. G. Bobrow, ed.). North-Holland Publishing
Co., Amsterdam, 1968, pp. 116—132.
[CX65] Cuthill, E., Voigt, S., and Ullom, S., Use of Computers in the Solution
of Boundary Value and Initial Value Problems, Annual Progress Report,
SRO11-01-01 Task 0401 AML Problem 821-911, David Taylor Model
Basin, Washington, D.C. (June, 1965).
[DB67] Duby, J. J., “Sophisticated Algebra on a Computer—Derivatives of Witt
Vectors”, Symbol Manipulation Languages and Techniques, Proceedings
of the IFIP Working Conference on Symbol Manipulation Languages
(D. G. Bobrow, ed.). North-Holland Publishing Co., Amsterdam, 1968,
pp. 71-85.
[HQ67] Howard, J.C., “Computer Formulation of the Equations of Motion
Using Tensor Notation”, Comm. ACM, Vol. 10, No. 9 (Sept., 1967),
pp. 543-48.
[IB65c] FORMAC (Operating and User’s Preliminary Reference Manual), 1BM
Corp., No. 7090 R2IBM 0016, IBM Program Information Dept.,
Hawthorne, N.Y. (Aug., 1965).
[1B67c] PL/I-FORMAC Interpreter, IBM Corp., Contributed Program Library,
360D 03.3.004, Program Information Dept., Hawthorne, N.Y. (Oct.,
1967).
[JL66] Bleiweiss, L. et al., A Time-Shared Algebraic Desk Calculator Version
of FORMAC, IBM Corp., TR00.1415, Systems Development Division,
Poughkeepsie, N.Y. (Mar., 1966).
[ND67] Neidleman, L.D., “An Application of FORMAC”, Comm. ACM,
Vol. 10, No. 3 (Mar., 1967), pp. 167-68.
[SM64] Sammet, J. E. and Bond, E., “Introduction to FORMAC”, IEEE Trans.
Elec. Comp., Vol. EC-13, No. 4 (Aug., 1964), pp. 386-94.
[SM67] Sammet, J. E., “Formula Manipulation by Computer”, Advances in
Computers, Vol. 8 (F. L. Alt and M. Rubinoff, eds.). Academic Press,
New York 1967, pp. 47-102.
[SO65] Sconzo, P., LeSchack, A. R., and Tobey, R. G., “Symbolic Computation
of f and g Series by Computer”, Astronomical Jour., Vol. 70, No. 4
(May, 1965), pp. 269-71.
[SV66] Swigert, P., Computer Generation of Quadrature Coefficients Utilizing
the Symbolic Manipulation Language FORMAC, NASA TN D-3472,
Lewis Research Center, Cleveland, Ohio (Aug., 1966).
[TO66] Tobey, R. G., “Eliminating Monotonous Mathematics with FORMAC”,
Comm. ACM, Vol. 9, No. 10 (Oct., 1966), pp. 742-51.
[WB67] Walton, J. J., “Tensor Calculations on Computer: Appendix”, Comm.
ACM, Vol. 10, No. 3 (Mar., 1967), pp. 183-86.
Vil.4. MATHLAB
[EN65] Engelman, C., “MATHLAB—A Program for On-Line Machine Assis-
tance in Symbolic Computations”, Proc. FJCC, Vol. 27, pt. 2 (Nov.,
1965), pp. 117-126.
522 FORMAL ALGEBRAIC MANIPULATION LANGUAGES
[MV67] Manove, M., Bloom, S., and Engelman, C., “Rational Functions in
MATHLAB”, Symbol Manipulation Languages and Techniques, Proceed-
ings of the IFIP Working Conference on Symbol Manipulation Languages
(D. G. Bobrow, ed.). North-Holland Publishing Co., Amsterdam,
1968, pp. 86-97.
[ZJ67] Millen, J.K., CHARYBDIS: A LISP Program to Display Mathe-
matical Expressions on Typewriter-Like Devices, Proceedings of the Sym-
posium on Interactive Systems for Experimental Applied Mathematics,
Washington, D.C., August 26-28, 1967, Academic Press, Inc., New
York, 1968.
Vil.5. ALTRAN
[BW63] Brown, W.S., Hyde, J. P. and Tague, B. A., “The ALPAK System for
Nonnumerical Algebra on a Digital Computer”, Bell System Technical
Jour., Vol. 42, No. 5, (Sept., 1963), pp. 2081-119; Vol. 43, No. 2 (Mar.,
1964), pp. 785-804; Vol. 43, No. 4, pt. 2 (July, 1964), pp. 1547-62.
[BW66] Brown, W.S., “A Language and System for Symbolic Algebra on a
Digital Computer”, Proc. of the IBM Scientific Computing Symposium
on Computer-Aided Experimentation, IBM Corp., 320-0936-0 Data
Processing Division, White Plains, N.Y. (1966), pp. 77-114.
[BW66a] Brown, W.S., The ALTRAN Language and the ALPAK System for Sym-
bolic Algebra on a Digital Computer (presented at the Princeton U.
Summer Conference in Computer Sciences, Princeton, N.J., Aug., 1966)
(unpublished).
[ML66] Mcllroy, M. D. and Brown, W.S., The ALTRAN Language for Sym-
bolic Algebra on a Digital Computer, Bell Telephone Lab., Murray
Hill, N. J. (May, 1966) (unpublished).
[MZ65a] McClure, R. M., “TMG—A Syntax Directed Compiler”, Proc. ACM
20th Nat’l Conf., 1965, pp. 262-74.
Vil.6. FLAP
[MB67] Morris, A. H., Jr., The FLAP Language—A Programmer’s Guide, U.S.
Naval Weapons Lab., K-8/67, Dahlgren, Va. (Jan., 1967).
[CL63] Clapp, L. C. and Kain, R. Y., “A Computer Aid for Symbolic Mathe-
matics”, Proc. FJCC, Vol. 24 (Nov., 1963), pp. 509-17.
[CL66] Clapp, L.C. et al., Magic Paper: An On-Line System for the Manip-
ulation of Symbolic Mathematics, Computer Research Corp., Report
No. R 105-1, Newton, Mass. (Apr., 1966).
Chapters IV, V, VI, and VII contained descriptions of languages which were
designed primarily for use in solving, respectively, numerical scientific,
business data processing, string and list processing, and formal algebraic
manipulation problems. In some cases a specific language might have been
used for more than its intended purpose, but this was a by-product and not
a deliberate intent.
The term general purpose as applied to programming languages has been
in vogue for many years. However, after careful deliberation, I have reached
the conclusion that there is no programming language in this book which
is truly general purpose by any reasonable definition of the term. Each
language in this chapter provides effective capabilities for dealing with at
least two of the areas in the preceding four chapters, but none is really good
for all of them. Hence, the term multipurpose is used to provide a more
accurate description of the languages in this chapter. This term also implies
that a reasonable balance among the various areas is maintained in the defini-
tion of the language in order to qualify as multipurpose. In other words,
a language which provides excellent facilities in one area and primitive ones
in another is not considered multipurpose.
The first language developed which made a serious attempt to cover
several areas was JOVIAL. Its primary objective was to solve command
and control problems, and these involve both scientific calculation and a
certain amount of data processing. Hence JOVIAL itself provided fairly
balanced capabilities in both areas. |
The major language in this chapter 1s, of course, PL/I, which is really
523
524 MULTIPURPOSE LANGUAGES
ViN.3. JOVIAL
The story of the name JOVIAL has been told many times in differing
versions. According to the man who should know, namely Jules Schwartz,
the key points are as follows: He wrote a draft proposal for a programming
language to be used for the Air Force 465L program. The language was
based on IAL, but it had additional facilities. The title he put on the draft
was OVIAL (Our Version of the /nternational Algebraic Language). The
language concept was accepted, but the word OVIAL was not considered
satisfactory for several reasons. A suggestion for a new name was JOVIAL,
and this was accepted. However, it was necessary to decide what JOVIAL
stood for, and one joking suggestion was that it should be Jules’ Own Version
of the /nternational Algebraic Language. According to Schwartz, he felt
this was a joke but did not become too concerned about it. During a business
trip shortly thereafter, a statement of work was formally submitted to the
contracting officer which listed among the deliverable items a JOVIAL
(Jules’ Own Version of the International Algebraic Language) compiler. Nobody
would agree to changing the contract, and so the name remained, providing
both more fame and more blame to Schwartz than he deserved.’
The original version of JOVIAL was implemented on both the IBM
709 and the Military Computer used for SACCS (AN/FSQ-31). By no later
than May, 1961 (and possibly earlier), JOVIAL 1 became obsolete, was
replaced by JOVIAL 2 (running on the 709, 7090, and the SACCS com-
puter), and then eventually by JOVIAL 3. JOVIAL 3 (hereafter referred
to as JOVIAL) was implemented at least for the CDC 1604 and 3600, the
Philco 2000, the SAGE AN/FSQ-7, and the AN/FSQ-32. JOVIAL 2 was
implemented on the IBM 9020.
As usually happens, even before the compilers were fully operational,
work began on improvements to them and the language as well. In May
1960, a decision was made to standardize on JOVIAL as a common pro-
gramming language for SDC.’
JOVIAL has been used not only by SDC for Air Force projects but it
has been adopted by the Navy for use in its NAVCOSSACT and by the
Army in some of its programming efforts. In June, 1967 the Air Force issued
its own specifications to establish (a version of) JOVIAL 3 as the standard
programming language for Air Force command and control applications
(see [AF67]).
Although JOVIAL has been developed and used primarily by SDC,
the history of its development, its modifications, and the implementations
on various machines is almost as complicated as that of FORTRAN. Those
people interested in further details should see Shaw [SH63b], Steel [ST66],
and the references listed in [SH63b]. A list of usage in the Department of
Defense and a list of compilers are given in Figure VIII-1.
SAMPLE PROGRAM—JOVIAL
VIII-1.) There have been several versions of the official specifications with
the latest one by Perstein [PE66a], based on earlier ones by Shaw. On the
more positive side, in August, 1965 certain internal management decisions
were made in SDC with the resulting policy, stated in Perstein [PE66], that
any new JOVIAL compiler must implement Basic JOVIAL as defined in that
manual. If the new compiler provides capabilities included in J3
(JOVIAL 3), it must implement them in accordance with the official descrip-
tion given in Perstein [PE66a]. A new compiler may implement features that
are not included in the specifications of JOVIAL and are not incompatible
with the specifications of JOVIAL; of necessity, some features will be machine
dependent, e.g., precision of the arithmetic. Since most of the language
definitions have been given in a fairly formal way, there has been relatively
little problem of incompatibility caused by misunderstanding.
Until 1967 there was no significant attention paid to JOVIAL from the
viewpoint of American standardization (i.e., through USASIJ), although
obviously there has been tremendous attention paid to this within SDC
itself. As a result of interest by the Air Force and SDC, there is a possibility
that a USASI standard might be developed.
The original CLIP language work was started by J. Schwartz and E.
Book, and the former supervised the development of the first JOVIAL
system.‘ Since then, numerous people within SDC have contributed to the
further development of JOVIAL; in not all cases were the language designers
directly involved with the implementation effort since SDC set up various
groups to control the maintenance.
The basic objective of the language was to create a language for use
by professional programmers in solving large complex information pro-
cessing problems. In the various documents on JOVIAL, several different
notations for defining syntax have been used, ranging from reasonable to
arbitrary notation that in my opinion did not seem to have any justification
whatsoever, the latter appearing, for example, in Shaw [SH63a].
One complaint which never could be leveled against the JOVIAL
activity is a shortage of documentation. Shaw states “My collection of docu-
ments of JOVIAL weighs almost 50 pounds and stands almost two feet high.”
Since that was written in 1962, it seems reasonable that the material has not
decreased in quantity. Naturally some of those documents are working
papers of interest to limited groups only, but on the other hand at least some
of it is of widespread interest. The material ranges from primers (e.g.,
Kennedy [KE62]) to detailed syntactic descriptions (e.g., Perstein [PE66a])
to general description and tutorial articles (e.g., Shaw [SH63a] and [SH61)]).
Other references are listed at the end of the chapter, and still more are
4 Shaw [SHO0].
5 Shaw [SH63b], p. 90.
530 MULTIPURPOSE LANGUAGES
dent). There are a number of reserved words in JOVIAL, and they cannot
be used as names.
The relational operators are EQ, GR, GQ, LQ, LS, and NQ with the
meanings of equal, greater than, greater than or equal, less than or equal,
less than, and not equal, respectively. The logical operators are AND, OR,
and NOT. Punctuation is used in JOVIAL, but it is not particularly signifi-
cant except for the commas used to separate items in lists. Much of the
delimiting normally done by punctuation (e.g., end of statement) is done
through the use of the dollar sign. Blanks are quite significant, and the rules
about when they can and cannot appear are complicated; however, the
obvious cases where blanks can appear between operators and operands
and between key words and names are allowed. Whenever one blank is
permitted, any number are allowed. There are no noise words.
Two types of literals are permitted, namely alphanumeric (denoted as
Hollerith) and transmission code; the latter is used to specify the exact form
of the machine language representation of the literal. In both cases, the
number of characters in the literal precedes the identifying letter, e.g.,
AH(NUTS). It is also possible to denote literals by octal constants.
The format is quite free form, with the programmer being allowed to
start any JOVIAL statement in columns 1 to 72; more than one statement
per line may be written, and one statement may extend over several lines.
The conceptual form seems to fall on rather neutral ground; it is not par-
ticularly symbolic or succinct, but on the other hand it is not as English-
like as COBOL.
The following is a partial list of the declarations in JOVIAL: ITEM,
MODE, ARRAY, TABLE, OVERLAY, DEFINE, PROCEDURE, SWITCH, FILE. Many
of these in turn have further declarations associated with them, and all are
discussed later.
The smallest executable unit is a statement containing one of the execu-
table commands; it is terminated by $. Any such statement can be named,
and the name is followed by a period. Groups of statements can be combined
into a larger form which is composed of a BEGIN and END bracket, with
statements (and possibly declarations) between them. These compound
statements can be nested to any depth desired. Loops can be controlled by
an IF statement or through the use of the FOR command. JOVIAL permits
functions, procedures, and closed subroutines. The closed subroutine is a
special kind of procedure that has no parameters. There are different rules
involving the handling of all these with regard to loops.
Comments are delimited by two primes (i.e., '') at the beginning and
the end; the intervening string can consist of any characters except the dol-
lar sign and, of course, it cannot contain two primes prior to the end nor a
prime immediately preceding the ending pair. A complete program con-
sists of a list of declarations and statements preceded by the key word START
532 MULTIPURPOSE LANGUAGES
and optionally preceded by the word CLOSE. If the latter is used, it indicates
the program is a closed subroutine. The program ends with TERM $. It is
possible to specify the name of the first statement to be executed immediately
after the TERM delimiter.
The only interaction with the environment is from the input/output
statements.
The main delimiter is the dollar sign, which is used to end an executable
statement, and of course the BEGIN... END pair for compound statements.
Call by name and call by value parameter passage are provided. As indicated
above, compound statements themselves can be contained within com-
pound statements. A procedure can invoke other procedures (but no recur-
sion is permitted).
The executable units and the declarations can be intermingled in the
program. It is possible to include machine code statements in a JOVIAL
program by preceding the code with the key word DIRECT and following
it with the key word JOVIAL. It is also possible to make a definite con-
nection between the variables in the JOVIAL program and a machine
register since the programmer is allowed to write ASSIGN A = variablename $
or ASSIGN variablename = A $. The A is considered an undefined machine
register called the accumulator.
JOVIAL introduces the concept of a functional modifier which provides
built-in operations on certain types of expressions or conceptually provides
answers to questions about various program items. From a structural view-
point, functional modifiers seem to fall between direct executable statements
and declarations, although they actually appear in statements.
The types of data variables and constant permitted in JOVIAL are
arithmetic, Boolean, status, literal, and dual. Status variables are essentially
mnemonic names which can be associated with integer values of a data
variable and can be tested against these values. (This is the same concept
as the conditional variable in COBOL.) The dual constants represent an
ordered pair which is not a rational number but is useful for calculations
involving two-dimensional coordinate systems; it is only implemented on
machines with dual arithmetic and was motivated by the early existence of
such hardware. Arithmetic variables can be fixed, integer, or floating point.
There are no complex, formal, string, or list variables. Arithmetic expressions
are created in the normal way. Absolute value is designated by either
JY Sf)
or
ABS(+)
VIII.3. JOVIAL 533
5 $
>
7+ A$
wo
ll
>
causes A to have the value 12 and B to have the value 5.
There are no specific alphanumeric data-handling commands, although
the easy access to bits and bytes make their programming fairly simple.
The unconditional control transfer is the (single word) GOTO. It may
have statement label information with it, to provide both a computed and
an assigned GOTO. This command can be used to invoke a subroutine with
no parameters permitted; after execution of the subroutine, control is re-
turned to the statement immediately following the GOTO unless there has
been a transfer of control out of the subroutine. Procedures with formal
parameters are invoked by specifying the procedure name and a list of the
parameters enclosed in parentheses and separated by commas; an equals
Sign is written between the input and the output parameter lists to dis-
tinguish between them.
A function can be invoked from within an arithmetic or Boolean expres-
sion.
Conditional statements take one of two forms. The first is itself
called a conditional statement by JOVIAL writers and is of the form
IF Boolean-expression $ statement where the statement cannot contain an IF
except within a BEGIN. ..END bracket. Thus, IF AR EQ BJ $ CR = DK + EM $
and IF ALPHA — BETA LS GAMMA + DELTA $ BEGIN IF HE EQ SHE $
GOTO BLAZES $ END are correct, but IF ALPHA — BETA LS GAMMA +
DELTA $ IF HE EQ SHE $ GOTO BLAZES $ is not correct because the second
IF is not within a BEGIN .. . END bracket.
Another form of conditional statement provides alternatives, using the
following format:
END
where | | indicate optional elements. Any number of alternatives can be
listed, and the Boolean expressions are tested in sequence from the top;
the statement associated with the first true Boolean-expression is executed
and control is then passed to the statement following the END. For example,
VIII.3. JOVIAL 535
IFEITH AB GR BB $ AB = CD $
NAME . ORIF AB + CD LS CD $
BEGIN EF = (AB + CD) ** 2 $
LL. AB = BB + 2 $
CD = ABC $
END
ORIF 1 $ GOTO WARM $
END
NEXTST . AB = CD + 1 $
the range of the FOR is the set of statements contained within the BEGIN...
END pair. The paramlist is of the form
be rounded rather than truncated. It is also possible to show for each variable
an estimated minimum and maximum absolute value of the item. For each
status item, the list of status constants is given; these are encoded in order
by the integers 0, 1, 2, etc. The number of bits can be specified but if it is
omitted, then the compiler determines the maximum number of bits required.
It is often desirable to assign specific initial values; this can be done by
inserting a preset declaration immediately after the name and description.
As an illustration, the declaration
if one wants to add somebody to the payroll. For fixed length tables this is
538 MULTIPURPOSE LANGUAGES
an integer constant, while for variable length tables it is a counter that the
program itself must maintain. Another parameter for table processing ts
NWDSEN (number-of-words-per-entry) which is an integer constant estab-
lished at compile time. The ALL modifier was already seen in the FOR
clause to permit more effective processing of tables. The ENTRY modifier
allows a table entry to be treated as a single value. The MANTissa and CHAR-
acteristic modifiers permit the user to extract the indicated information from
a floating point variable and assign it to another variable. The ODD
modifier can be used to determine if the value of the least significant bit of
a quantity is 0 or 1; it can be assigned to a Boolean variable which will then
be true if it is odd and false if it is even.
The file declaration is of the following form:
Vill.4. PL/I
this accounted for the missing FORTRAN V.) It soon became clear to this
committee that they could not maintain compatibility with FORTRAN
and still develop a language which they felt was needed to meet modern
programming techniques and equipment. For example, in the minds of
many people, such issues as the use of blanks, card-oriented format, and
methods of handling declarations prevented a direct extension from being
desirable. However, even while the first report was being prepared, there
was considerable internal discussion about this issue until it was finally and
irrevocably decided that the new language would not be a compatible ex-
tension of FORTRAN. Obviously, the committee did not make arbitrary
changes just for the sake of being different, but the designers were in no
way bound by the provisions of FORTRAN.
During its deliberations, the committee heard presentations by numerous
people from both inside and outside IBM about features that the speakers
thought should be in the language. The committee also attempted to study
languages (e.g., ALGOL, COBOL, and JOVIAL) which contained features
or capabilities which should go into a new language even if in a different
syntactical form. Thus, every reasonable attempt was made to consider
concepts from as wide a source as possible.
A document dated March 1, 1964 and entitled “Report of the SHARE
ADVANCED LANGUAGE DEVELOPMENT COMMITTEE” [XY64]
was presented to SHARE in March, 1964. It was defined as “a status re-
port, in the form of language specifications from the Advanced Language
Development Committee”. It was received with mixed reactions; some people
felt that this was a new powerful language that would be well suited to their
needs, while others felt that it was a hodgepodge and not suitable for actual
usage.
It is of some historical interest to note a few of the items which were
included in that report and which have subsequently been either dropped
or significantly changed, e.g., the use of a dollar sign to terminate statements,
restriction of an identifier to 8 characters, restriction of the number of
subscripts to less than or equal to 15, and references to precision of 32 bytes
(thus causing accusation of being machine dependent). Some of these items
(most notably the first) were due to the planned use of only a 48-character
set. A major omission was the block structure which first appeared in the
April, 1964 version [XY64a] and the compile time (1.e., macro) facility which
first appeared in the IBM December, 1964 report [IB64].
Following the initial presentation to SHARE in March, 1964, a number
of comments, suggestions, and criticisms were received and an April
revision [XY64a] was prepared. The original committee, augmented by
M.D. Mcllroy (Bell Telephone Labs) and R. C. Sheppard (Procter and
Gamble), the latter representing GUIDE, worked diligently and produced
a drastically modified version in June [XY64b]. Somewhat later that year,
542 MULTIPURPOSE LANGUAGES
The reference used for the description of PL/I is [[B66b] and not any
specific implementation of it.
vi.4. PLA 543
PL/I is very general with the widest scope of any language in this book.
PL/I notation is succinct and semiformal rather than English-like; it follows
in the FORTRAN and ALGOL traditions rather than the COBOL line.
It is not particularly consistent in the sense that there are a large number of
special cases and exceptions. It is not particularly efficient to implement
because of its size and the fact that good implementation techniques have
lagged behind the development of languages that are this complex. It is fairly
easy to read and write, with no great tendency toward error-prone usage
except for errors due to its power and complexity. In considering its ease
of learning, one must specify the amount to be taught and the experience of
the learner. A person without any experience in a programming language
would find it very difficult to learn all of PL/I. On the other hand, a FOR-
TRAN programmer would find it easy to learn the PL/I subset equivalent
to the capability of FORTRAN. PL/I is an excellent illustration of the
point made in Chapter I that an extremely complex and powerful program-
ming language might be harder to teach and to learn than a very simple
machine code. Thus if a computer had no more than a dozen machine
instructions, a person could undoubtedly be taught machine code more
rapidly and easily than he could be taught the whole of PL/I.
PL/I is definitely aimed at having an extremely wide application area.
It was meant to be used in the fields for which FORTRAN and COBOL
were individually designed and, similarly, with regard to JOVIAL, whose
prime characteristic was the combining of such facilities into a single lan-
guage. PL/I is also effective for systems programming.
PL/I is a procedure-oriented language and, furthermore, it is really
the culmination of the whole line of procedure-oriented languages. There
are relatively few concepts that are relevant to this conceptual line of lan-
guages which are not already in PL/I or are not possible or obvious potential
extentions of it. PL/I is problem-oriented but only in the very broad sense.
It is simultaneously a reference, publication, and hardware language;
however, the 60-character set (defined in Section VIII.4.3) can be considered
a reference language with a 48-character set representation. It has very defi-
nitely been aimed at the entire cross section of users; i.e., PL/I has been
designed so that a novice programmer can write simple correct PL/I programs
without too much difficulty, while on the other hand the professional pro-
grammer has more control over his machine and environment than he has
ever had before. This environment, while primarily batch, has the facility
of being used in a reasonable fashion in an on-line situation. The format
was designed with that need in mind. In addition, there are facilities for use
in a multiprogramming environment.
PL/I as a language is quite machine independent except for certain
provisions for doing arithmetic; if it has any faults along these lines, PL/I
is more likely to be operating system dependent than actually hardware
544 MULTIPURPOSE LANGUAGES
SAMPLE PROGRAMS—PL/|
Problem: Inventory control program for company with 20,000 stock items.f
Program:
INVCTL: PROCEDURE;
DECLARE (OLDMAST INPUT, NEWMAST OUTPUT) BLOCK (FIXED,432,8),
PFILE OUTPUT,
1 WORK,
2 PARTNO CHARACTER (7),
2 DESCR CHAR(1 2),
2 (QOH, QOO, RP, RQ) FIXED (5),
2 UP FIXED (6),
2 YTDSALE FIXED (8),
2 CODE FIXED,
1 TRANS,
2 TNUMBER CHARACTER (7),
2 TCODE FIXED,
2 TQ FIXED (5),
CODEIS (4) LABEL;
ON ENDFILE (STANDIN) BEGIN; TNUMBER = '9999999';GO TO WRITNM; END;
ON ENDFILE (OLDMAST) BEGIN; IF TNUMBER = '9999999' THEN DO; CLOSE
OLDMAST DISCARD, (PFILE, NEWMAST)
STORE, DISPLAY (‘JOB FINISHED’);
END;
ELSE ERROR: DISPLAY (‘FILE OR DATA
ERROR’); EXIT; END;
ON SUBSCRIPTRANGE BEGIN; DISPLAY (‘BAD CLASS CODE JOB HALTED’);
EXIT; END;
READ (TRANS)(A);
READM: READ FILE (OLDMAST), (WORK) (A);
TESTM: IF PARTNO < TNUMBER THEN WRITNM: DO; WRITE FILE (NEWMAST),
(WORK) (A); GO TO READM; END;
IF PARTNO > TNUMBER THEN GO TO ERROR;
/*THEN PARTNO = TNUMBERX/
GO TO CODEIS (TCODE);
CODEIS(1): QOH = TQ; GO TO JOIN;
CODEIS(2):: QOH = QOH + TQ; QOO = QOO — TQ; GO TO JOIN;
CODEIS(3): QOO = QOO + TQ; GO TO JOIN;
CODEIS(4): IF QOH < TQ THEN DO; WRITE ('ONLY', PARTNO, ‘AVAILABLE’,
QOH, ' REQUESTED’) (3A, F(5), A)); TQ=QOH; END; QOH =
QOH—TQ; IF CODE = 1 THEN YTDSALE = YTDSALE + TQxUP;
JOIN: IF QOH + QOO =RP THEN WRITE FILE(PFILE), (PARTNO, CODE, RQ) (3 A);
READ (TRANS) (A); GO TO TESTM; END INVCTL;
of X3. As a result, X3.4 initiated a task group called X3.4.2.C, which held
its first meeting in April, 1966. This group considered the problem of subsets,
language development, character sets, and form of definition. Late in 1967,
X3.4.2.C recommended that standardization of PL/I not be started at that
time. In the spring of 1968 they reversed their position and issued an affirma-
tive recommendation. Thus there will probably be a USASI PL/I standard
at some point in time.
As indicated under the discussion of history, the first preliminary
specifications were designed by a group of six people, three from IBM and
three users from SHARE. That group, plus two more, also designed the
second version of the language which appeared 3 months after the first. As
time went on, an increasingly large number of people became involved, and
some of the original participants were no longer associated with the effort.
In particular, the joint I]BM-SHARE effort was terminated as such, although
a PL/I project was set up under SHARE.
Since the language is powerful and complex, its objectives cannot be
stated succinctly. The following statements of objectives are extracted from
the March 1, 1964 report [XY64]: “...to recommend a successor lan-
guage for currently available FORTRANSs to be used on unannounced
IBM equipment. ...to provide a language which would encompass more
users while still remaining a useful tool to the engineer. ...a deadline con-
sistent with IBM scheduling...in order to allow consideration of the
language for the new equipment. ...to redefine those parts of the present
FORTRAN language which appeared to be in conflict with, and to augment
those parts which were inadequate for, the ‘state of the art’ today. The
changes would, where practical, follow current syntax, but... not restricted
to this form. ...the need to keep the language simple, both to teach and
to use. ...to allow subsetting of the language.’”®
The following statements of objectives are extracted from the Introduc-
tion in the original official IBM manual [IB66b]: “. .. None of the traditional
high level languages,however, can be used with efficiency across the entire range
of ability of these new computers. That is the reason for PL/I, a multipurpose
programming language for use not only by commercial and scientific pro-
grammers but by the real-time programmer and the systems programmer as
well. It is a language designed for efficiency, a language that enables the
programmer to use virtually all the power of his computer. ... any program-
mer... can use it easily at his own level. ... One of the primary aims... was
modularity, that is, providing different levels of the language for different
applications and different degrees of complexity. ...every... description
of a variable, every option, and every specification has been given a ‘default’
interpretation. ...a ‘default’ interpretation...is made by the compiler
8 [XY64], p. 1.
548 MULTIPURPOSE LANGUAGES
The technical description of PL/I is being given in more detail than most
other languages because of the relative newness, its potentially major
significance, and also because of PL/I’s power and complexity. The de-
scription is based on [IB66b] except where stated otherwise; however, not
all these features have been implemented. For this reason and because some
of the specifications are being reconsidered, there may well be changes in
the information given here.
PL/I very carefully (and intelligently) defined two character sets, one
consisting of 60 characters and the other of 48. The 60-character set is com-
posed of the 10 digits, 26 upper-case letters, 3 characters defined as alphabetic,
namely
currency symbol $
commercial “At” sign @
number sign Ba
and 21 special characters. The 48-character set does not have the commercial
“At” sign or the number sign nor does it substitute graphics for them. The
following list shows the graphics for the special characters in both sets, where
the substitutions in the 48-character set are shown beneath the characters
they replace:
Certain special rules apply to the usage of the 48-character set equiva-
lents of : ; and &. In addition, certain character combinations in the
60-character set are replaced by alphabetic equivalents, as follows:
W
Mm bo
0CO
O
NR
Oo
then MATRIX (x,2) is the (vertical) vector
2
5
8
Hierarchies are permitted in PL/I (which uses the word structure rather
than hierarchy). This allows and requires qualification, with the rule that
only enough names to resolve any ambiguity are needed. The qualifiers
are written before the data name from left to right in increasing level-
number order; they are separated by periods. Thus REGULAR.HOURS and
OVERTIME.HOURS represent different variables.
Structures can contain arrays and arrays can contain structures, so
subscripted qualified names are permitted. The basic variable name is pre-
ceded by the qualifiers as just defined, and each qualifier itself can be sub-
scripted. Subscripts can actually be attached to names at a lower or higher
level than the one to which they belong. Thus, for an array A of structures
of the following description (where the notation is defined later),
8 This example, and most of the others in this section, are extracted and/or modified
from [IB66b]. Reprinted by permission from IBM System/360 Operating System: PL/I
Language Specifications. © 1966 by International Business Machines Corporation.
vu.4. PLA 551
a compound statement, of which there are two types, namely the /F and the
ON; they are called compound because they precede a simple statement.
The second type of grouping is actually called a DO group; this is used for
control purposes. It has a simple and a looping form, and the looping form
is discussed later. The simple form has an optional label, then the word
DO and a semicolon, then the set of executable statements, and the key word
END, which may have a label associated with it if the original DO statement
itself did. For example,
Note that in this example any of the single statements except the DO or
END statement is an example of a simple statement.
Statements can be combined to form a block whose primary purpose
is to establish the scope of an identifier but this can also be used for control
purposes. A block also contains declarations. There are two kinds of blocks,
namely begin blocks and procedure blocks. The format of the begin block
is the same as that of a simple DO group except for the use of the word
BEGIN instead of DO. A procedure block must have a label (which is simply
an identifier followed by a colon); it can have more than one label; and it
has the word PROCEDURE at the beginning. The begin block and the pro-
cedure block are very similar in syntax and role relative to delimiting the
scope of names. However, the begin block is executed in line whereas a
procedure can be activated only by a CALL statement or by invocation from
within an expression. A procedure block can also have more than one entry
point.
Loops are written using a DO statement or using an IF... THEN
sequence.
PL/I distinguishes between two types of procedures, namely function
procedures and subroutine procedures, and each type can have multiple
entry points. A procedure is considered a function if there is a specific result
obtained when it is invoked. This result is indicated as part of the RETURN
statement by which control is returned to the calling location. Functional
procedures are normally used as operands in expressions. A subroutine
procedure does not provide a value as part of the RETURN statement but
specifies results by setting some of its parameters. A subroutine procedure
may only be invoked by a CALL statement or by a statement with a CALL
option. Because a procedure may contain more than one RETURN statement,
it is possible to use it both as a function and as a subroutine procedure,
although this is seldom done.
A procedure that is not included in any other block is called an external
procedure; a procedure included in some other block is called an internal
vi.4. PL/I 553
procedure. Every begin block must be included in some other block; hence
the only external blocks are external procedures. This distinction affects the
scope of names, which is discussed later.
A comment is defined as any string preceded by the two characters
/x and terminated by x/ except that the comment cannot contain the
two-character string */. A comment can be used wherever a blank 1s
permitted (except of course within a literal).
PL/I has many facilities which can be considered as interaction with
the operating system or the environment. The first could be considered an
implementation problem in providing the necessary interface but because
of the complexity, it has wider implications; the interaction referred to
involves the various language features that the programmer can use to con-
trol storage allocation for the data variables. The second facility allows the
programmer to create tasks, to synchronize them, to test whether or not
tasks are complete, and to change the priority of tasks; thus he may perform
operations asynchronously. The third class is a set of interrupt conditions,
many of which relate to input/output conditions, both hardware and soft-
ware. The final way of communicating with the system is the compile-time
macro facility.
There is no provision for inclusion of other languages.
A program is composed of one or more external procedures. Thus, a
program is a set of procedure blocks, each of which is completely nested and
separate from the others. Statements and declarations can appear in any
order except for the restrictions due to the placement of declarations to
control the scope of variables.
The concept of prologue is used to refer to computations that must be
done at object time before executing the statements within a block. Thus, the
prologue must allocate storage or automatic variables and may need to
evaluate expressions which define lengths, bounds, and iteration factors, or
to supply initial values to variables. For this reason and others, there are
various rules which require that the allocation or initialization of differing
items not be circular; i.e., variable A cannot require information from
variable B and simultaneously have the converse be true.
The primary method of delimiting is the semicolon, which indicates the
end of all executable units and declarations. Labels are followed by colons,
and the colon has other uses as well. Macro statements are preceded by a
percent sign. A DO group is ended by reaching an END statement with the
same label or by the first END without a label. It is this definition rather than
a specific rule against it which prevents overlapping DO groups.
Procedures can be used recursively if they are so declared.
PL/I allows both call by location and call by value, although neither
phrase is used in the manual. The call by value occurs whenever the argu-
ment to be passed is either a constant, an expression involving operators,
554 MULTIPURPOSE LANGUAGES
have any of the characteristics of base, scale, mode, and precision; these
can be represented by a numeric picture. Formats for these are shown in
the description of the declarations, but the concepts will be described briefly
here. Base refers to binary or decimal, and scale refers to either fixed or
floating point form. Mode refers to real or complex. There is no specific
double or multiple precision in the language. Instead, the user specifies the
precision he wants by defining the scale of the data and the total number of
binary or decimal digits to be maintained, for both fixed and floating point
data. The implementer specifies the largest precision that he will handle.
Finally, it 1s possible to specify by means of a PICTURE the formats of the
variables. This is described in some detail later. The higher level data units
(1.e., arrays and structures) are handled by dealing with the individual
subparts.
There are a number of default conditions specified for arithmetic
variables; i.e., if the user does not provide a specific declaration, certain
characteristics are automatically assumed. Some examples are as follows:
if the first letter of a name is I, J, K, L, M, N, then FIXED REAL BINARY is
assumed; otherwise FLOAT REAL DECIMAL is assumed. If some but not all
the characteristics are specified, then it is assumed that the base is decimal,
the scale is float, and the mode Is real.
Although there are no Boolean variables defined as such, the net effect
of Boolean arithmetic is permitted because arithmetic expressions can con-
tain the eight relational operators; furthermore, binary arithmetic is per-
mitted and the operations of and, or, and not are defined on binary strings.
Concatenation of bit and character strings is permitted and the result
is a character string.
Arithmetic can be done on structures and arrays. The operands of a
structure expression are structures or a combination of structures and variable
expressions. The result is a structure; arrays are not allowed as operands
in structure expressions. To permit this arithmetic to be done, all the struc-
tures in an expression must have the same number of contained scalars and
arrays, their relative positioning must be the same, and similarly positioned
arrays must have identical dimensions and bounds. The data types need
not be the same.
Because of the numerous data types which are allowed in PL/I, the rules
for intermingling, converting, and precision are extremely complex. No
attempt will be made here to supply all the details but merely to give the
general principles involved. The term scalar expression is introduced rather
than arithmetic expression because the expressions involved may contain
nonarithmetic quantities. Scalar expressions can contain any variable types
except statement labels, area variables, task variables, and event variables.
Only the comparison operators = and 4= can appear with pointer data.
However, as indicated earlier, structure expressions and/or array expressions
556 MULTIPURPOSE LANGUAGES
5 kk prefix + prefix —
* /
infix + infix —
|
>= > |> {= < 1< <= =
&
|
(This differs slightly from the manual [IB66b] since an approved language
change has occurred since that publication.)
The rules of precision are based on a complicated formula. The aim is
to give a large enough result field for a fixed point operation (or the maximum
size in the case of division) or a result field for floating point with the greater
of the precisions of the two operands.
All the text of a begin block except the labels preceding the heading
statement of the block is said to be contained in the block. All the text of
a procedure except the entry names of the procedure is said to be contained
in the procedure. That part of the text of a block B that is contained in block
B but not contained in any other block contained in B is said to be internal
to block B. The scope of a declaration of an identifier is defined as that block
B to which the declaration is internal, but it excludes from block B all con-
tained blocks to which another declaration of the same identifier is internal.
This definition of scope applies to all identifier declarations except those for
entry names of external procedures; these have slightly different rules.
vi.4. PLA 557
It is possible to use the same name for different declarations of the same
identifier through the EXTERNAL attribute. All external declarations for the
same identifier are considered to be related to the same name; the scope of
the name is the union of the scopes of all the external declarations for the
identifier. The declarations must not be contradictory, of course.
The specific formats for the executable statements are shown in Figure
VIII-2. They use the metalanguage discussed in Section II.6.2.2 as pertain-
ing to COBOL. The discussion given below assumes the reader will examine
the formats. Because of differences in terminology, some items which are
called executable statements in PL/I are not considered so within the frame-
work of this book and so are not included in Figure VIII-2. Those omitted
are: BEGIN, DECLARE, END, FORMAT, PROCEDURE. They are discussed in the
body of the text and the format is described whenever it is appropriate to
do so.
The assignment statement can have multiple variables to the left of the
equals sign; furthermore, as noted from the specific format, they can be
arrays, structures, or label or pointer variables. The pseudo-variables are
discussed below. By writing the assignment statement, e.g., A,B = C+D;
the right-hand side is computed and assigned to the variables on the left-
hand side. When necessary, the expression for values on the right-hand side
is converted to the characteristics of the variables on the left, according to
the standard rules mentioned earlier. It 1s possible to have both complete
arrays and single elements from an array on the right-hand side, and there
is a well-defined rule for computation of arrays on the left-hand side.
If the variable on the left of the equals sign is a variable character string,
the assignment is performed from left to right starting with the leftmost
position. Specific rules are defined for the various cases that can arise.
Three examples from p. 110 of [IB66b] are given below; the second is
not self-evident without knowing the form of the DECLARE declaration which
is shown in examples on page 578.
ON
CONAO
W
—
Oh
Ph
A = (A+B)**2 — A(I, 1)
produces the following matrix for A (where the new A(1,1) is computed and
ALLOCATE
Option I:
ALLOCATE [level| identifier [dimension] [attribute] ...
[, [level] identifier [dimension] [attribute] ...] ... ;
Option 2:
ALLOCATE based-variable-identifier SET (pointer-variable)
[IN (area-variable)|
[, based-variable-identifier SET (pointer-variable)
[IN (area-variable)||
Assignment
Option I: (Scalar assignment)
ee \ " scalar-variable |
. . = scalar-expression ;
pseudo-variable , pseudo-variable ,
Option 2: (Array assignment)
array , array __ farray-expression [, BY NAME] ;
{ore array j oto-array oe (oy expression i \
Option 3: (Structure assignment)
structure , structure _
See rvcture h a evedes atructure |" 7
structure-expression [, BY NAME] ;
Option 4: (Statement label assignment)
scalar-label-variable |, scalar-label-variable] ... = {ola tebe ; \
scalar-label-variable ;
label-constant ;
array-label-variable [, array-label-variable] ... == + scalar-label-variable ;
array-label-variable ;
Option 5: (Pointer assignment)
pointer-variable |, pointer-variable| ... = pointer-expression;
array-pointer-variable [, array-pointer-variable] ... =
pointer-expression
array-pointer-variable
CALL
CALL entry-name [(argument [, argument]. . .)] [TASK [(scalar-task-name)|]
[EVENT (scalar-event-name)| [PRIORITY (expression)] ;
CLOSE
CLOSE FILE (filename) [IDENT (argument)|
[, FILE (filename) [IDENT (argument)]}] ... ;
DELAY
DELAY (scalar-expression) ;
DELETE
DELETE FILE (filename) KEY (expression) [EVENT (event-variable)] ;
558
Figure VIII-2. (cont.)
DISPLAY
Option I:
DISPLAY (scalar-expression) ;
Option 2:
DISPLAY (scalar-expression) REPLY (character-variable)
[EVENT (evenft-variable)| ;
DO
Option I:
DO ;
Option 2:
DO WHILE (scalar-expression) ;
Option 3:
pseudo-variable ups gs wpe gs
} = specification |, specification] ... ;
variable
A specification has the following format:
. TO expression2 [BY Otero ss on .
|
expression] ley expression3 [TO expression2| [WHILE (expression4)|
ENTRY
EXIT
EXIT ;
FREE
Option 1:
FREE identifier [, identifier] ... ;
Option 2:
FREE [pointer-variable —> | based-variable-identifier
[, pointer-variable —> | based-variable-identifier| ... ;
GET
GO TO.
GO TO) ([label-constant ;
GOTO scalar-label-variable ;
IF
IF scalar-expression THEN unift-1 [ELSE unit-2|
559
Figure VIII-2, (cont.)
LOCATE
LOCATE variable FILE (filename) SET (pointer-variable)
(KEYFROM (expression)] ;
Null
{label :] ... 3 -
Example:
ON OVERFLOW;
ON
Option 1:
ON condition [SNAP] on-unit
Option 2:
ON condition [SNAP] SYSTEM ;
OPEN
OPEN opftions-group [, options-group]| ... ;
Following is the format of options-group:
FILE (filename) [IDENT (argument)| [TITLE (expression)|
[INPUT | OUTPUT | UPDATE] [STREAM | RECORD]
[DIRECT | SEQUENTIAL] [BUFFERED | UNBUFFERED] [EXCLUSIVE]
[KEYED] [BACKWARDS] [PRINT] [LINESIZE (expression)|
[PAGESIZE (expression)|
PUT
PUT [FILE (filename) | STRING (character-string-name)] [data-specification]
[PAGE] [SKIP [(expression)]}] [LINE (expression)]} ;
READ
INTO (variable)
READ FILE (filename) | SET (pointer-variable) | [KEY (expression)|
IGNORE (expression)
[KEYTO (character-string-variable)| [EVENT (event-variable) |
[NOLOCK] ;
560
Figure VITII-2. (cont.)
RETURN
Option 1:
RETURN ;
Option 2:
RETURN (expression) ;
REVERT
REVERT ON-condition ;
REWRITE
SIGNAL
SIGNAL ON-condition ;
STOP
STOP ;
UNLOCK
WAIT
General format:
WAIT (evenf-name [, event-name]| ...) [(scalar-expression)| ;
WRITE
561
562 MULTIPURPOSE LANGUAGES
7 74
93 189
9 114
93 114
DECLARE 1 X, 2 Y, 2 Z, 2 R, 3 S, 3 P,
1A, 2 B, 2 C, 22D,3 D, E ’ 3 Q ,
X = X*A;
Y = YxB;
Z= ZxC;
Ss = Sx*E ;
P = PxQ;
Example. Given
When the BY NAME option is used, the basic principle of the rules is
that only those names which are common to all the variables on both sides
of the assignment statement are used to create appropriate assignments.
PL/I introduces the concept of using certain built-in functions as
pseudo-variables. (In addition to being used in an assignment statement,
pseudo-variables can also appear in a DO statement or in a data list in a
GET statement.)
As an example,
As IF X=Y THEN
IF S = R THEN
IF W < P THEN Y = 1;
ELSE P = Q;
ELSE;
ELSE X = 4;
Js S = 5;
Computational
CONVERSION
FIXEDOVERFLOW
OVERFLOW
SIZE
UNDERFLOW
ZERODIVIDE
Input/Output
ENDFILE (filename)
ENDPAGE (filename)
TRANSMIT (filename)
UNDEFINEDFILE (filename)
NAME (filename)
KEY (filename)
RECORD (filename)
Program checkout
SUBSCRIPTRANGE
CHECK (identifier-list)
List Processing
AREA
Programmer-Named
CONDITION (identifier)
System Action
FINISH
ERROR
type will occur whether or not an ON statement has been executed; the ON
statement merely determines the action to be taken when the condition
arises, but it has nothing to do with allowing or preventing an interruption
to occur. However, the programmer can actually control certain interrup-
tions through the use of condition prefixes. An enabling condition prefix
is a list of condition names, enclosed in parentheses, and prefixed to a
statement with a colon that precedes the label. Thus the user can write
(SIZE, SUBSCRIPTRANGE): LABEL: executable statements;. By preceding certain
condition names with the letters NO, the condition is disabled from causing
an interrupt. If the condition name is prefixed to any statement other thana
PROCEDURE or BEGIN statement, the condition is enabled (or disabled) only
through the execution of that single statement. If it is prefixed to an /F state-
ment, its scope is only through the evaluation of the expression in the /F clause.
If a condition name is prefixed to a DO statement, its scope is only through the
DO statement itself. If the condition name is prefixed to a PROCEDURE or
BEGIN statement, its scope is through the entire block including all nested
blocks except for any statements that lie within the scope of another condi-
tion prefix with a different specification for the same condition. Unlike the
scope in an ON statement, the scope of a condition prefix does not extend
to a block that is invoked remotely.
The REVERT command has essentially the effect of canceling an ON
statement once the latter has been actually executed, assuming that they
were internal to the same block. It also reactivates the most recent ON state-
ment in the containing block.
It is possible to simulate the existence of one of the interrupts through
the use of the SIGNAL statement, which causes the same action as if the
specified condition had actually occurred.
There are no algebraic expression manipulating statements. (However,
see the PL/I-FORMAC interpreter discussed in Section VII.3.)
The basic idea of the PL/I list processing facilities is to allow the user to
determine the detailed structure of his lists. In other words, instead of spec-
ifying a particular form of list structure like in previous list processing lan-
guages such as IPL-V and LISP (see Sections VI.3 and VI.5), the user is
given a variable type called pointer and a form of controlled variable called
a based variable. (The newer list processing language L® (see Section VI.4)
also permits the user to define his own structure.) The term based means
that the actual storage position accessed in a reference to the variable is
determined by the value of a pointer to it. For example, writing
the use of the built-in ADDR function, which returns a pointer value which
“points to” its argument. (The word BASED replaced the word CONTROLLED
which was used in [IB66b].)
In some list processing applications there is a need for more than one
pointer to identify a given item of data. In these cases, other pointers may
be used to refer to a based variable. The symbol —> (called a pointer
qualifier) is used for this. To identify the last item in a list, the NULL built-in
function 1s usually used to provide a null pointer.
A fairly thorough discussion of this subject is given by Lawson [LH67].
It is true but misleading to say that there are no specific string-handling
statements in PL/I. Since a character string is a very legitimate data type,
strings are handled in the same manner as most other data variables, with
appropriate rules for conversion, etc. These rules will be discussed briefly
here, but the reader is cautioned to realize that the strings are handled through
the assignment or some other statement.
Both bit and character strings are permitted. Most of the relevant
information has been provided earlier, but it is being summarized here for
reference. Bit strings can be combined using AND, OR, NOT. Strings of any
kind can be concatenated; if both are bit strings, then no conversion is done
and the result is a bit string; but in all other cases the operands are con-
verted to character strings. If the variable on the left of an assignment state-
ment is arithmetic, then a string to be converted must be either an arithmetic
constant with or without a sign or a real constant with a sign followed by
either a plus or a minus sign and an imaginary constant. In such an instance,
the arithmetic value of the constant is converted according to specified rules.
If the variable on the left side of the equals sign is a bit or character string,
the assignment is performed according to the rules of list-directed output
which is described later. There are specific rules about truncating and filling
out strings when needed.
There are a number of built-in string functions, and they are shown in
Figure VIII-4.
There are no pattern-handling statements in PL/I. A primitive facility
in this area is provided by the INDEX built-in function.
PL/I allows for two different kinds of data transmission, namely
stream- and record-oriented. The verbs GET and PUT are used for input and
output of data items in the stream, while the statements READ and WRITE do
similar things for the record-oriented data. In the stream-oriented case, the
data is considered to be a continuous stream of data items in character form,
and an assignment must be made from the stream to the variables or vice
versa. With record-oriented transmission, the data set is considered to con-
sist of a collection of physically separate records, each of which consists of
one or more data items in an encoded form; each record is transmitted as
an entity directly without any conversion.
There are three types of stream-oriented transmission, namely list-
Arithmetic generic String generic
ABS BIT
MAX CHAR
MIN SUBSTR
MOD INDEX
SIGN LENGTH
FIXED HIGH
FLOAT LOW
FLOOR REPEAT
CEIL UNSPEC
TRUNC BOOL
BINARY
Generic functions for manipulation of arrays
DECIMAL
SUM
PRECISION
PROD
ADD
ALL
MULTIPLY
ANY
DIVIDE
POLY
COMPLEX
LBOUND
REAL
HBOUND
IMAG
DIM
CONJG
Float arithmetic generic Condition
EXP ONFILE
LOG ONLOC
LOGIOT ONSOURCE
LOG2t ONCHAR
ATANDi ONKEY
ATAN?t ONCODE
TANDt DATAFIELD
TAN
List processing
SINDt
ADDR
SIN
NULL
cospt
COs Others
TANH DATE
ERFT TIME
SQRT ALLOCATION
ERFCi LINENO (filename)
COSH COUNT (filename)
SINH ROUND (expression, decimal-integer-constant)
ATANH STRING (structure-name)
ATAN EVENT (scalar-event-name)
ATAND PRIORITY (scalar-task-name)
568
vul.4. PLA 569
In the data-directed form of transmission, the data list need not appear
in the GET statement because the stream is in the form of a series of assign-
ment statements that specifies each variable name and the value assigned to
it. Thus, the data in the input stream might look like the following:
Note that the last data item is followed by a semicolon which is used to
delimit the number of items obtained by a single GET statement. On output,
the data list must be written to specify which data items are to be written
into the stream. The PUT statement referring to the data items just given
could be
output, blanks are supplied and the semicolon is written after the last item
specified in the data list.
In both the data-directed and list-directed cases, there are various rules
about what types of data may appear in the data list, when and how sub-
scripts can be used, and when subscripts are evaluated.
The edit-directed transmission allows the user to control the format by
providing information about things such as precision, strings, conver-
sion, etc. In addition, the user can control pagination and lines through the
use of the PUT statement. The LINE option causes the data to be written on
a new line; the PAGE option allows the user to start a new page; the expres-
sion in the LINE option essentially controls which line is used, 1.e., which
new line the data will start on. The SKIP option also allows the user to con-
trol the start of a new line and to indicate how many lines are to be skipped;
however, it also permits the user to overprint a particular line.
It is possible to use the input/output statements for an internal char-
acter string; this is done by using the STRING option, which allows the user
to obtain information from an internal character string and place data there.
Although the string option can be used with any of the three types of stream-
oriented transmission, it is usually most practical in association with a for-
mat list since individual items in the string need not be separated by commas
or blanks.
Each READ and WRITE statement transmits a single logical record
between the external medium and the variable specified, without any con-
versions. The variable specified must be a “level-1” item and normally contains
several data items or arrays. If the file specified in a READ or WRITE state-
ment is not open when the command Is given, it is opened automatically.
The variable associated with the words INTO and FROM in the READ and
WRITE, respectively, specifies the variable in internal storage into which or
from which the record is to be read or written. In the READ statement, the
SET option places a record in a buffer and assigns a pointer variable as its
identification so that a based variable can be subsequently referred to via
the pointer value. The IGNORE option may be specified for SEQUENTIAL INPUT
and SEQUENTIAL UPDATE FILES. It controls the number of records that are
skipped. The KEY option must appear if the file is DIRECT; the expression 1s
converted to a character string but it determines which record is read. The
KEYTO option can be given only if the file is SEQUENTIAL and keyed; it
specifies that the key of the record is to be copied onto the string variable.
The EVENT option allows processing to continue while the record is being
read or ignored. The NOLOCK option prevents the statement from causing
a record on an EXCLUSIVE file from being locked against access by other
tasks.
In the WRITE command, the KEYFROM option is converted to a char-
acter string and attached to the record as a key. As examples, the statement
vin.4. PLA = 5571
READ FILE (BETA) KEY (VALUE) INTO (WORK); causes the record identified by
the key VALUE to be transmitted from the data set associated with BETA into
the variable WORK. The statement WRITE FILE (BETA) FROM (UPDATE)
KEYFROM (UKEY); specifies that the record UPDATE is written as the next
record in the data set associated with the file BETA, and the key identifying
the record in the data set is taken from UKEY.
As noted later in the file description, a file can be INPUT, OUTPUT, or
UPDATE. The REWRITE statement can be used for the UPDATE and serves
the purpose of replacing an exiting record in the data set in the file involved.
The other key words provide options similar to those in the WRITE com-
mand.
The OPEN statement causes the opening of a file and provides a number
of additional file characteristics beyond those shown in the file description.
The JDENT option associates the identifying user label on an input file with
the variable given as the argument; for output, the argument is an expres-
sion which is evaluated and converted to a character string which is placed
as a header label. If an input file is a BACKWARDS file, the label will be a
trailer label; otherwise it will be a header label. The TITLE option causes the
conversion of the specified expression to a character string which identifies
the data set associated with the file; if this option does not appear, the file
name ts taken as the identifier. The other options are either self-explanatory
or are discussed under the file description.
The CLOSE statement dissociates the named file from the data set with
which it was associated by opening, and it also dissociates all the attributes
declared for it in the original opening of the file. However, attributes for that
file which are explicitly given in a DECLARE statement remain in effect. The
argument in the /DENT option essentially serves as a trailer label.
The DELETE statement removes a record from a DIRECT UPDATE file.
The expression associated with the KEY identifies the record to be deleted.
The DELETE statement can cause implicit opening of a file.
The UNLOCK statement makes accessible a record which would other-
wise be inaccessible as a result of the READ statement accessing it from an
EXCLUSIVE file.
The LOCATE statement applies to BUFFERED OUTPUT files and allows a
record to be created in buffer storage and later written out. The SET option
specifies a POINTER variable which is to be set to identify the variable in
the buffer.
The DISPLAY statement causes a message to be displayed to the machine
Operator; a response may be requested by using the REPLY option. If the
EVENT option is used, execution of subsequent statements will continue
before the reply is completed.
The library references which are specifically available to the user are
the built-in functions, of which there are a large number; they are listed in
572 MULTIPURPOSE LANGUAGES
Figure VIII-4. Many of these are generic; this means that the same name
can be used for differing types of arguments. For example, EXP 1s used for
the exponential function, regardless of whether the argument is of REAL
or COMPLEX mode, regardless of the precision, etc; the system automatically
supplies the function of the EXP family that fits the requirements. Almost
every built-in function, whether or not it is generic, has a specified number
of arguments given. In some cases the actual number of arguments is optional
beyond a specified minimum, while in others a maximum is specified. If a
built-in function which is not generic is used, then any argument whose
characteristics do not match the specified ones are converted to the appro-
priate form before the function is invoked; the return values are determined
by the function. There are also many built-in functions that can return array
or structure values. Although the names of the functions are fixed as far as
the language is concerned, they can also be used for identifiers. However,
in such a case, the name must be explicitly declared.
The functions can be divided into the following classifications: Arith-
metic generic (e.g., ABS, MAX, and TRUNC); float arithmetic, which converts
all input arguments to floating point before the function is invoked and
produces floating point numbers, as results (e.g., LOG2, SIND, which are
defined only for real arguments, and SIN, LOG, and SQRT, which are defined
for real and complex arguments); string generic (e.g., BIT, SUBSTR, and BOOL);
array manipulation, which has array expressions with scalar values as argu-
ments but no arrays of structures (e.g., SUM, POLY, and LBOUND). All the
built-in functions in the arithmetic and string generic categories may have
array or structure expressions as arguments except where integer decimal
constants are required, and they yield arrays or structures as results; condi-
tion (e.g., ONFILE, ONCHAR, ONKEY), /ist processing (ADDR and NULL), and
the miscellaneous category (DATE, TIME, LINENO, EVENT, and PRIORITY).
The category of debugging statements in some cases overlaps with the
error condition statements which were described earlier. There are currently
none which can be truly classed as pure debugging statements, although
some of the options under some of the commands have this effect, in par-
ticular, the SNAP in the ON statement.
Although there are only two actual commands dealing directly with
storage allocation, namely ALLOCATE and FREE, there are actually four
classes of storage which are controlled by the declarations. In order to
understand the meaning of the statement, it is necessary to discuss the
storage categories themselves here. The four storage classes are static, auto-
matic, controlled, and based. (The latter was added after the issuance of
[[B66d], and is described in later editions of [I[B67d]. The formats of
ALLOCATE and FREE shown in Figure VIII-2 do not reflect these changes
which are minor syntactically.) Static storage is assigned before first entry
to the program and remains in effect throughout the life of the program.
vi.4. PLA ©5573
The other three classes define dynamic storage allocation. Automatic storage
is assigned at object time upon entry to the block in which it is declared
and released upon exit from that block. The dimensions can of course be
variables or expressions.
Controlled and based storage are under programmer control. Variables
declared as CONTROLLED and BASED can and must have storage assigned
and released by the ALLOCATE and FREE statements, respectively. The
ALLOCATE command essentially. serves the purpose of placing something
on top of a pushdown stack, while the FREE command performs the popup
function. References to a stacked controlled variable always refer to the
most recent allocation, whereas ai/ current allocations for a based variable
can be obtained by a pointer value. In Option 1 of the ALLOCATE statement,
the attribute indicates a BIT, CHARACTER, or INITIAL attribute, where the
first two can only appear with identifiers of that type. Since bounds or lengths
can be Specified in the ALLOCATE statement, they override any similar infor-
mation which might be included in a DECLARE statement; if no bound or
length is specified in the ALLOCATE statement, it must be specified in a
DECLARE statement. When an identifier is allocated, the initial values will be
assigned if the identifier has that attribute. To ascertain whether or not
storage has been allocated for a particular identifier, the built-in function
ALLOCATION may be used.
Both controlled and based variables can be specified in the same
ALLOCATE and FREE statements. In Option 2 of the ALLOCATE statement,
there is no pushdown list, and any generation of the based variable can
be referenced through a pointer variable. The SET clause indicates the pointer
variable that is to receive the pointer value identifying the particular value
of the variable for which storage is to be allocated. If the JN clause appears
in the ALLOCATE statement, storage will be allocated in the named area for
the based variable; if that clause is omitted, space will be allocated in systems
storage. For based variables, all characteristics must be specified in the
declaration and cannot be included in the ALLOCATE statement. In the use
of the FREE statement, if a specific pointer qualification is not given for the
based variable, then the pointer declared with the based variable will be
used. In Option 1, a CONTROLLED variable must be used.
There are no specific segmenting instructions in PL/I.
Aside from the normal input/output, the primary way in which PL/I
has interaction with the operating system is through the creation and execu-
tion of tasks. As indicated under the CALL statement, the TASK, EVENT,
and PRIORITY options specify that the called and calling procedures are to
be executed asynchronously. The task is not a set of instructions but rather
the execution of a set of instructions. There is always one major task and
optionally available subtasks; each of the latter category can be named and
the name can be used to refer to and set the priority of the task. A task can
574 MULTIPURPOSE LANGUAGES
Data description
File description (Some of these are assumed when others are used or
when the variable name is used in an appropriate statement).
FILE
Identifies variable as a file.
file usage (STREAM, RECORD)
Specifies type of data in file.
function (INPUT, OUTPUT, UPDATE)
Specifies function of file; UPDATE means both input and
output.
PRINT
Specifies that data is eventually to be printed.
access (SEQUENTIAL, DIRECT)
In SEQUENTIAL the next record is the next one physically
available; in DIRECT a key must be specified.
buffering (BUFFERED, UNBUFFERED)
Applies to SEQUENTIAL RECORD files only; specifies whether
there is intermediate storage.
BACKWARDS
A SEQUENTIAL INPUT file is to be accessed from back to front.
576 MULTIPURPOSE LANGUAGES
EXCLUSIVE
A DIRECT UPDATE file cannot be used by two tasks simulta-
neously.
ENVIRONMENT
Implementation defined in order to cover any missing aspects.
Format descriptions
PICTURE
Is used as part of data description.
Storage allocation
DIMENSION
Specifies upper and lower bounds for each dimension, separated
by colons; missing lower bound is assumed to be 1; bounds
can be expressions.
SECONDARY
Data does not require efficient storage.
storage class (STATIC, AUTOMATIC, CONTROLLED, BASED)
Concepts were defined earlier.
ALIGNED or PACKED
PACKED data is stored contiguous to the fields surrounding
it; ALIGNED data may have each string data element start at a
storage boundary defined by each implementer.
DEFINED
Data declared is to occupy the same storage area as that as-
signed to other data.
CELL
Alternative declarations share the same storage.
list processing (AREA, POINTER, OFFSET)
AREA defines storage for based data items; PO/JNTER data identi-
fies values in any storage class; OFFSET data identifies data
relative to the start of an area. (This last item was added after
the issuance of [IB66d].)
Procedure declarations
ENTRY
Declares entry names.
entry namet (SETS, USES, GENERIC, BUILTIN, RETURNS, REDUCIBLE,
IRREDUCIBLE).
scope (INTERNAL, EXTERNAL)
Specifies scope of data.
vi.4. PLA = 5577
Miscellaneous
ABNORMAL or NORMAL
ABNORMAL data may be accessed at an unpredictable time
during execution.
scope (INTERNAL, EXTERNAL)
Specifies scope of identifiers.
In considering the data description, the basic data attribute for a numer-
ical variable is the arithmetic, which consists of base (BINARY or DECIMAL),
scale (FIXED or FLOAT), mode (REAL or COMPLEX), and precision (specifies
number of significant digits to be maintained and scale of the data). The
PICTURE declaration shows the formats of numeric and character-string data
fields and specifies editing. The string characteristic has the format
BIT
{ CHARA cer! (length) [VARYING]
| PICTURE specifications
LABEL defines the variable as a statement label. TASK specifies that the
variable is used as a task name. EVENT specifies the use as an event name.
These last two are really part of the interaction with the operating system.
ENTRY declares entry names referred to in a procedure. The attributes
SETS and USES for entry name specify, respectively, that the invoked pro-
cedure reassigns, allocates, or frees that item, or that it is accessed but not
reassigned unless it also has a SETS attribute. GENERIC defines the name
as a family of entry names; the proper one is selected, based on the char-
acteristics of the input arguments. BUILTIN specifies the reference is to a
built-in function or pseudo-variable. RETURNS defines the attributes of the
value to be returned by that entry. IRREDUCIBLE specifies that invocations
of the specified entry may not be reduced to a smaller number of invocations.
The default conditions for arithmetic data are basically dependent on
the first letter of the name; if it is | through N, FIXED REAL BINARY is
assumed; otherwise, FLOAT REAL DECIMAL. If some but not all attributes
are specified, then DECIMAL, FLOAT, and REAL are assumed for the missing
ones. Other default conditions are AUTOMATIC (for storage unless scope is
EXTERNAL, in which case STATIC is default), PACKED (for structures) and
ALIGNED (for arrays not in structures), and INTERNAL (for scope).
In certain contexts, identifiers are implicitly defined, e.g., FILE, EVENT,
entry name, and pointer.
Some illustrations of declarations and their meanings (taken from
[IB66b]) are as follows:
578 MULTIPURPOSE LANGUAGES
The parameters are names that are associated with the entry point and of
course are put into one-to-one correspondence with the arguments used
with a CALL statement. The OPTIONS attribute is implementation dependent.
The RECURSIVE attribute specifies that this procedure may be invoked
recursively. It applies to all the entry points for the given procedure.
The data attributes that are permitted in the PROCEDURE declaration
(which is actually defined as a statement in the PL/I manual) are the arith-
metic, string, picture, and pointer attributes. They apply to the value
returned by the procedure when it is invoked as a function. Default at-
tributes are supplied if necessary. The value specified in the RETURN state-
ment of the invoked procedure is converted to the specified data attributes.
There are no additional facilities that are specifically and only defined
as compile-time directives in PL/I, except for the macro facility to be de-
scribed later. However, there are a number of such language facets which have
been discussed under other headings. In particular, a number of the declara-
tions are really compiler directives.
There is no self-modification of programs at object time. However,
the macro facility provides this facility at compile time.
PL/I has a macro facility which can be used either to make it easier to
write some types of PL/I programs or alternatively to allow the user to write
a program with new command names and then have the compiler automati-
cally translate these into appropriate PL/I coding. There is no direct facility
to extend the data types, although the system can be judiciously used (and
tricked) to provide primitive capability in this direction (see, e.g., PL/I-
FORMAC in Section VII.3.3).
The macro (i.e., compile-time) facility is defined at the language level
to be handled by a preprocessor to the regular compiler. The preprocessor
interprets compile-time statements and acts upon the source program
accordingly. In most cases, the compile time-statements must be preceded
by a percent sign. The facilities of PL/I which are available in the macro
language are the following:
DO | = 1 TO 10;
Z(I) = X() + Y(I);
END;
This could be accomplished by writing the following:
vu.4. PLA ©5581
DECLARE | FIXED;
LL
|= 1;
LAB:;
Z(1) = X(Il) + Y(N);
l=!/1+1;
LV LK IF | <= 10 % THEN % GO TO LAB;
DEACTIVATE I;
While no PL/I compiler has yet been written in PL/I, it is believed that
this is definitely possible. Some of the facilities, in particular the pointer and
based variables, are provided very specifically to help with that problem.
Furthermore, because of the many features in PL/I which provide interac-
tion with the operating system, the use of PL/I itself might not introduce too
many further inefficiencies in writing the compilers.
PL/I provides many more facilities for producing object-time efficiency
than for improving compilation. Many of the features in the language have
been chosen to aid the user at the expense of compilation time. (In my
opinion, that is a desirable choice.) There are a number of features in PL/I
which are there specifically to permit the compiler to generate optimized
code, e.g., the ABNORMAL, NORMAL, IRREDUCIBLE, REDUCIBLE, and USES
and SETS attributes. The RECURSIVE attribute avoids the need to make all
object-time procedures recursive.
PL/I provides great flexibility to the user and, in particular, provides
generality rather than restrictions. (One of the major design goals of PL/I
was to provide this generality.) Among the specific features that have signifi-
cant (but harmful) effect on compilation efficiency are the ability to use the
key words as identifiers, the freedom to state many options in any order
that is desired, and the ability to factor attributes. Some of the features that
help to improve object-time efficiency have already been mentioned.
As noted earlier, the general problem of storage allocation has been
given considerable attention at the language level in PL/I. A large amount of
information is given to the compiler either directly or indirectly to assist
it in doing reasonably good storage allocation. Of course, if the user writes
inefficient programs, then he has only himself to blame if he obtains inef-
ficient object code; thus, if he declares all variables to be CONTROLLED, he
582 MULTIPURPOSE LANGUAGES
should certainly expect less efficient object code than if he deals more
intelligently with that portion of the problem.
As noted earlier, there are a number of facilities in the language for
both compile and object time debugging and error checking. There are a
large number of consistency rules, i.e., requirements that items either must
or must not appear together, and the compiler can and should certainly
check for these. Since PL/I was designed to have an almost universal applica-
tion area, it is not too surprising that it can be used for a wide variety of
problems. There are some things, however, that are unavailable in the lan-
guage as defined in [IB66b], e.g., graphics, simulation, formula manipula-
tion, and complicated pattern matching. However, PL/I provides many
powerful facilities in the areas heretofore covered by languages such as
FORTRAN, ALGOL, COBOL, and JOVIAL.
The first version of the Formula ALGOL system was developed on the
CDC G-20 at Carnegie Institute of Technology (now Carnegie-Mellon)
in 1963 by Professor Alan Perlis and R. Iturriaga. The version described
here was developed over the next few years by R. Iturriaga and T. Standish,
with assistance from R. Krutar and J. Earley, under the direction of Pro-
fessor Perlis. The initial development and motivation for this system was
to add a formula-manipulating capability to ALGOL. (See Perlis and
Iturriaga [PR64].) If that had been the sole extent of the work, then this
language would appropriately belong in Chapter VII, where formal algebraic
manipulation languages are discussed. However, over a period of several
years, the original system evolved into a much more general language, con-
taining not only the simple formula manipulation facilities but also string
and list processing operations. It is because of the inclusion of these three
somewhat different types of facilities within an ALGOL framework that the
language appropriately belongs in a chapter on multipurpose languages.
Since the language was developed at a university as an experimental
and educational tool (and on a fairly obsolete computer), it has been used
only at Carnegie. Furthermore, because of the environment, there were
numerous versions, and many of them underwent frequent change to better
suit the needs of the designers and users. The version described here is
reported in Perlis, Iturriaga, and Standish [PR66].
Related to editing:
Miscellaneous:
Formulas are written in the normal way, except that they can also
contain Boolean expressions. A dot (i.e., period) has several new meanings.
When used with the name of an expression, it means the actual name and
not the current value. A dot can also be used to prefix operators, identifiers,
subscript lists, parameter lists, and the assignment arrow in an expression;
when this is done, it causes a postponement of the indicated action. To
institute the indicated action, the user must explicitly write the eval operator;
this causes numeric evaluation of formulas and permits replacement by
numbers, Boolean variables, formulas, etc. It also causes trivial simplifica-
tions for both numeric quantities and Boolean variables.
The assignment statement is indicated by a dot and a left arrow; e.g.,
F .« F + G which means actually to create the data structure repre-
senting the expression F + G as the (new) value of F. The trivial simplifica-
tions of eval primarily include appropriate handling and disposal of ones
and zeros, such as A + 0-—>AandA x 0-—O. In addition, certain trans-
formations relating to negative signs are made, e.g., A —(—n)
— A + n,
(—n)—A — —(n+A). The Boolean simplification carries out four com-
mutative operations: A V true — true; A A false — false. For example,
executing the assignment statement
where F is of type form and G, A, and B are type real, causes the construc-
tion of the formula G <— K, where K = value (A + 8B), and causes this
formula to be assigned to F as a value. Execution of eval F causes eval (K)
to be stored as the value of G, and the value of the expression eval F
becomes eval (K).
There are two commands directly relating to formula manipulation,
namely subs and eval; there are two pattern-matching commands which
apply to formal expressions. A replace function is also available. The subs
command is written
D <- subs (x, Xo, ceey Xn) F(Y;, Yo, .--, Yn2)
ulation. The advantage to this approach is that the user is not hampered
by the existence of commands which are similar to what he wants and yet
do not exactly suit his purpose. The best analogy—and one which is not
meant to be derogatory—is that the facilities for manipulating formal alge-
braic expressions are similar in spirit to an assembly program. The user
has the ability—and simultaneously the need—to write and hand-tailor the
procedures which are provided automatically by many of the systems
described in Chapter VII. In some cases this leads to great inefficiency for
some very basic operations. This actually happened in the first several
versions of Formula ALGOL because differentiation was not a built-in
operation. It could be programmed very easily in the language but the
result was quite inefficient. For that reason, it was eventually put into the
language as a specific function.
It is possible for the user to specify transformation rules as produc-
tions, e.g.,
which, using two given sequencing rules, can be applied to a given formula.
IfF -— D t 2 x (Y +sin(Z)) is operated on by the production, then
the subexpressions D ft 2, Y, and sin(Z) are extracted into the variables A, B,
and C, respectively, and cause the replacement of the atomic names A, B,
and C on the right-hand side of the production. This results in the transfor-
mation of the value of F into the formula Dt 2x Y+Dt 2 x sin(Z). It
is clear that this type of facility is extremely powerful in terms of writing
the types of operations that a user would want in doing formula manipu-
lation.
A symbolic expression is a rule for computing either a single symbol
or a list as a value. The list is a string of symbols separated by commas and
contained within square brackets. The symbols can be any kind of expres-
sions or patterns, including description lists. Sublists are permitted. A
description list is of the form / attribute : [list]. Description lists are created
and attached by assignment statements and can be assigned to variables
of type form. Examples are as follows:
above, shape (.R) has the value round and 3rd of color (R) has the value pink.
There are a number of operations that can be performed on symbolic
expressions. First, there are pushdown and popup operators indicated by
| and ft, respectively. The actual contents of any variable of type symbol
are considered a pushdown stack; by applying these operators as many times
as needed, the desired information can be manipulated. It is also possible
to insert, delete, and alter symbolic expressions, and the user can also add
or delete values on the description lists.
Among the most interesting features in Formula ALGOL are the various
ways of handling patterns. It is possible to determine in both formulas and
lists whether one expression is an exact instance of another or whether it
contains an exact instance of another; furthermore, it is possible to name
these various subpatterns. More specifically, writing F = = P is a Boolean
expression whose value is determined by whether or not F is an exact
instance of P. The notation F>>P is a Boolean expression whose value is
determined by whether F contains an instance of P; more specifically, this
means that F>>P is true if F contains a subexpression W (which might equal
F) such that W==P Is frue. To illustrate these, consider an expression and
three cases (this is technically illegal because the Boolean and arithmetic
expressions cannot be combined, but it is a useful illustration nevertheless):
For Case 1, statement F==P is true; for Case 2, it is false. For Case 3,
the statement F==P is false but F>>P is true. |
A more complex illustration of the use of the search for a subpattern
and how it can be used is illustrated by considering the execution of the
statements
Since the contents of S$, which is the list [A, B, C, D], are an instance of the
pattern [$1,B,$], the list pattern S == [$1, B,$] is true. Therefore,
T < [T, B] is executed, which has the effect of appending B to the end
of the list stored as the value of T. If, however, the first part of the state-
ment were written
if S == [$1, C, $]
then it would be false and D would be appended to the list stored as the
value of T.
List-editing statements include insert, delete, and alter, with placement
and selector locators of before position of, after position of, and
the symbolic-expression of symbolic-expression is expression (where is can be
replaced by is not or is also). As an illustration, suppose § < [X, A, A, X]
has been executed. Then the statement
changes the value of S to look like [X, [Y, Z], A, A, [Y, Z], X]. If the user
Vi.6. LISP 2. 589
wrote § < / [class: freshman, sophomore], then the statement the class of S
is also junior would append the value junior to the value list following the
attribute class, while the class of S is not sophomore; would change the
original description list to be of the form / [class: freshman].
It 1s possible to define classes and test for membership in a class.
Additions have been made to the for statement, both in terms of the
variables which can be listed and the way in which they are processed. In
the first instance, the user can write elements of or attributes of symbolic
expressions or just show a symbolic expression. The purpose of this is to
permit the user to assign to the control variable in a for statement the
elements of a list or the attributes of a description list, one by one. This can
be done either in series or in parallel.
There are about 10 special built-in functions available to the user;
they include DERV(F, X), which takes the derivative of a formula F with
respect to the variable X, and REPLACE, which was discussed earlier. Most
of the others are specialized; they relate to modifying counters, erasing
lists, or testing Boolean expressions.
It is difficult to evaluate Formula ALGOL because its use has been
limited to one place and it continues to be changed as the need arises.
It is certainly the first language to include the three components of algebraic
formula manipulation (although to a very limited extent), list processing,
and string manipulation and pattern matching. Many of these facilities
have been included in a rather primitive way; the net overall effect 1s power-
ful (although awkward).
Vill.6. LISP 2
LISP 2 is too new to have much history except that which relates to its
creation; even its future is uncertain at the time of writing. Since the moti-
vation for LISP 2, as well as many of its technical developments, comes
from the earlier versions of LISP (primarily LISP 1.5), it is assumed that
the reader is familiar with LISP 1.5. (See Section VI.5.) Since LISP 2 is also
based heavily on ALGOL, familiarity with that language is also assumed.
(See Section IV.4.)
It was clear for a long time even to the staunchest advocates of LISP
1.5 that it had certain significant disadvantages. For one thing, the arith-
metic was very slow, making it impractical to use LISP for any problem
involving significant numerical computations. Secondly, the interpretation
(which was for a long time the major method of running LISP programs)
was also slow; that problem has been improved by the development of
LISP compilers. The biggest disadvantage of LISP was its notation, which
was bad from several points of view. One was the tremendous dependence
590 MULTIPURPOSE LANGUAGES
upon parentheses with the resultant difficulty in reading and writing LISP
programs. Another problem was the requirement for writing all mathe-
matical expressions in Polish notation and receiving them in that form as
output. Thus it became increasingly clear that while the fundamental con-
cepts of LISP were extremely valuable, the general framework within
which they existed was much more awkward to use than it really needed
to be. For these reasons, starting late in 1963, several people at M.I.T.
began to concern themselves with potential remedies for some of these
defects. One of the earliest documents relative to this situation was the
memorandum by Levin [LE64]. This paper described additions and changes
to be made in ALGOL 60 to incorporate the LISP concepts. Work has
subsequently been done jointly by the Systems Development Corporation
and Information International Inc. of Cambridge, Massachusetts, with
funds from ARPA (Advanced Research Projects Agency). The primary
people participating were, from I.I.I., P. W. Abrahams, L. Hawkinson,
M.I. Levin, and R. A. Saunders; from SDC, J. A. Barnett, E. Book, D.
Firth, S. L. Kameny, and C. Weissman. Support and contributions were
given by Professors Marvin Minsky of M.I.T. and John McCarthy of
Stanford and their associates; significant assistance was given by Dr. Daniel
Bobrow (Bolt, Beranek, and Newman).
The only published paper is by Abrahams et al. [AH66a], although
numerous internal SDC documents have been accessible. Quoting from
[AH66a] “Typical application areas for LISP 2 include heuristic pro-
gramming, algebraic manipulation, linguistic analysis and machine trans-
lation of natural and artificial languages, analysis of particle reactions in
high-energy physics, artificial intelligence, pattern recognition, mathe-
matical logic and automata theory, automatic theorem proving, game-
playing, information retrieval, numerical computation, and exploration of
new programming technology.”!® This list certainly makes LISP 2 the most
ambitious language to date, at least in terms of application areas that are
claimed to be covered. The careful reader will note that most of these
areas are those in which earlier versions of LISP proved useful. It seems to
me highly unlikely that someone wishing to do straight numerical com-
putation, or for that matter linguistic analysis, would deliberately choose
to use LISP 2. About the only area for which LISP 2 does not claim to be
useful is business data processing.
Since LISP 2 is a frequently changing item, any description must be
based on a particular version. The primary sources for the following mate-
rial are Abrahams et al. [AH66a], Book [BO66], Firth and Kameny [F166],
and Kameny [KA66].
LISP 2 is designed for a professional programmer. The general LISP 2
programming system description calls for not only a compiler but also
object-time facilities, including capabilities for on-line interaction and
communication with the computer monitor system, whatever it may be.
LISP has been implemented on the AN/FSQ-32V with intentions for boot-
strapping it onto other machines. Since this has not yet been accomplished,
The operators include the five basic arithmetic ones and the relational
operators =, <, >, /=, <=, and >=. There are logical operators AND,
OR, and NOT; also there are operators carried over from LISP 1.5, namely
CAR, CDR, ATOM, NULL, and CONS. Rules on punctuation, blanks, and
noise words are the same as in ALGOL, except that blanks cannot be
used within identifiers. Literals are defined through the use of the number
sign, #, at the beginning and the end. The character ' within the string
causes the character following it to be entered in the string; thus writing
FHA'#256## creates a string of six characters, namely A##256#.
The input form is similar in principle to that of ALGOL.
The program structure is similar to that of ALGOL, except for two
significant differences. First, any expression other than a variable can be
used as a statement; when an expression appears in a place where a state-
ment is expected, the expression is evaluated but the value is discarded.
Secondly, LISP 2 has functions but no procedures.
A block heading is in the form D] D2 D3 SI, $2, ... , Sn, where
the Di represent declarations described later. Each of the Si is either the
name of a variable or an assignment statement which gives an initial value
for the variable; if no initial value is given, a default value, depending on
the type, is used. A block declaration causes all the specified variables to
be internal parameters of the block and to have the properties specified by
the Di.
The delimiting of statements by semicolons, and of groups of state-
ments by BEGIN...END, is the same as in ALGOL. Since recursion is
even more crucial to the LISP concepts than to ALGOL, it is of course
permitted for functions. Parameter passage is of the call by value and call
by location type; there is no call by name, although the use of a functional
argument which remembers the context of its definition point together with
a call by location achieve most of the call by name capability.
The most general form of LISP 2 data is an S-expression. S-expressions
are built up from atoms which may be numbers, strings, identifiers, Booleans,
functionals, and arrays. As in LISP 1.5, the class of S-expressions is defined
recursively as follows: Every atom is an S-expression and if el and e2
are S-expressions, then (el . e2) is an S-expression. Constant arrays are
written by enclosing the elements in square brackets, e.g.,
[INTEGER 2 5 —1 4]
a SYMBOL type which includes all other classes of data. Except for SYMBOL,
all the data classes include atomic data only. A symbolic constant is denoted
by preceding an S-expression with a prime, e.g., 'ALPHA or ’(L1L2).
The operators CAR and CDR have the same meaning as in LISP 1.5;
e.g., CDR (A B C D) yields the list (B C D).
Arithmetic is performed in the normal ALGOL manner; the reverse
slash, \, is used for computing integer remainder, and integer division is
designated by a minus sign followed by a colon, —:. In the creation of expres-
sions, the prefix operators ATOM and NULL have lower precedence than the
relational operators but higher precedence than the Boolean operators.
The infix operator for CONS, which is #. & has the lowest precedence of all.
There are three levels of binding which control the scope of data
relative to the program structure.
Assignment statements are designated by a left-pointing arrow and are
similar to ALGOL, except that there are additional operators such as CAR
and CDR. The addition of these operators requires the user to be quite
careful about precedence. Thus, the assignment statement A — CAR C < D.E
means the same as A < (CAR(C < (D.E))).
There are no alphanumeric data-handling statements.
The unconditional control transfer is indicated by the single word GO
followed by the label.
A RETURN statement may be used inside a block and its effect is to
determine the value of a block expression. However, execution of the block
is terminated either by executing a RETURN statement or by executing the
last statement of the block without a transfer of control.
A conditional statement is of the form IF El THEN S17 [ELSE $2]
where £7 1s an expression and S] is any kind of statement except a condi-
tional statement or a FOR statement; $2 is any kind of statement. By enclos-
ing a conditional or FOR statement with BEGIN and END or with parentheses,
it can be used in place of the $1, e.g.,
terminal segments, CDR Y, CDDR Y, etc., until the list y is exhausted. There
are also WHILE and UNLESS expression clauses.
There is a TRY statement which causes control to be returned to itself
if an error condition is detected during the execution of a statement within
the TRY statement.
The CASE statement has the form CASE(S, &, Es, ..., E,), Where §
is an integer-valued expression known as the selector; if the value of § is
between 1 and n, then the expression Es 1s evaluated and is the resulting value
of the CASE expression; if § < 1 or S > n, the value is E,.
Although there are no direct list-handling statements in the LISP 2
source language, there are a number of list-handling functions, including
CAR and CDR. There has been some consideration about including string-
and/or pattern-handling statements but this has not been done yet.
The LISP input/output facilities are fairly general; every input or output
operation references implicitly or explicitly a specific file. Although the user
must associate a file with a particular device, the actual commands and
operations available to the user are fairly device independent. The largest
restrictions are that only one file can be active for input and one for output
simultaneously; furthermore, in order to reduce buffering requirements,
only one record for a given file can be in main memory at a time. (Since
the main objective of LISP 2 is to handle problems which need list processing
mechanisms and since such problems almost always have a shortage of
storage, this restriction is not unreasonable.) It is possible to select a single
file for both input and output simultaneously.
A file can be either inactive or available; in the latter case, it can be
either selected or deselected and only one input and one output file can be
selected at a given time. The commands for making an inactive file avail-
able or an available file inactive are, respectively, OPEN (name, descr) and
SHUT (name, descr), where name and descr obviously represent the name and
description of the file. The OPEN command establishes all the necessary
communication linkages between LISP 2 and the (time-sharing) monitor
or operating system. A variable FILES is used to maintain a list of all avail-
able file names and their descriptions. To select a file, the user writes
INPUT (name) or OUTPUT (name). By using one of these commands in an
assignment statement, the name of the previously selected file can be saved
for subsequent reselection, e.g., ALPHA < OUTPUT(ANSWER), and thus the
user can later write OUTPUT(ALPHA) to reselect the file named ANSWER.
The user has reading and printing facilities which always operate on
the currently selected input or output file. (The facilities are actually func-
tions rather than statements.) The user either can use default conditions or
program things such as page control and record control through the fol-
lowing functions:
596 MULTIPURPOSE LANGUAGES
READCH
Reads a character from the currently selected input record;
increments counters and positions for the next line or record
if necessary.
PRINCH(name)
The name is any expression evaluating to a one-character
identifier that is entered in the line at the current column;
counts and controls are automatically updated.
PRINATOM (expression)
The expression must evaluate to an atom and it is entered
into the output line starting at the current column.
PRINSTRING (expression)
The expression must evaluate to a string which is taken
literally as its print name.
PRIN (expression)
The expression is printed as an S-expression.
READ
Its value is the next S-expression in the file.
POSITION (exprl, expr2)
The expressions must evaluate to the name of an opened file
and an appropriate positioning action, respectively.
There are other functions for handling S-expressions, for dealing with
binary files, for printing unusually formed strings, etc. There are also
terminating functions which are affected as a result of page control variables
and relative positioning of input records.
One of the more interesting or unusual facilities available through the
LISP 2 input/output system is that the control variables can be changed
or examined. These are fixed variable names which are qualified to the
input/output section. For example, it is possible to define a new function
that would advance the current column of the selected output file to some
desired legal column and return the original column as output. There is
a rather long list of these variables and what can be done with them, but
naturally caution must be used.
The major emphasis in the development of LISP 2 has been at the
level of the internal operation and facilities. This is in contrast to most
languages, in which the language is first defined and then implemented.
For a long time it was facetiously said of LISP 2 that it was “an implemen-
tation in search of a language”. For these reasons, it is not surprising that
there is significant interaction with the operating system and/or environ-
ment, although it is not really that directly available to the normal user.
In particular, the storage allocation which is crucial in any list-handling
system is done by garbage collection which is invoked automatically and
can also be invoked by the user.
VIIL.6. LISP 2. 597
There is a CODE command which allows the user to write LAP assembly
language.
With the exception of the input/output functions, there are no direct
facilities for communicating with an operating system or a time-sharing
system. On the other hand, nothing in LISP 2 makes it unusable within
a time-sharing environment; in fact, it was designed to be so used.
There are three types of data declarations in LISP 2: Type, storage
mode, and transmission mode. The types are INTEGER, REAL, BOOLEAN,
SYMBOL, OCTAL, FUNCTIONAL, and type ARRAY. The data type SYMBOL
includes all other classes of data and, except for that type, all the others
include atomic data only. There are three types of storage mode, with one
of them a default condition. The two types of transmission mode are
LOC(ation) and by value, where the latter is the default condition. There
is also a section type which does not change until the programmer changes
it by means of another declaration; initially the section type is SYMBOL
and if no type declaration is given, then the default condition is the section
type. The section type determines the default data type for the section.
It is also possible to have free declarations that are not made within func-
tions or blocks but rather are made on the top level of LISP; free variables
essentially have universal scope.
The file description consists of a number of specific, free-formatted
entries which are actually on a file description list. The first is the UNIT,
which specifies the device type, e.g., (UNIT . DISK) or (UNIT TAPE REELS).
A second entry is the FORM, which can be either ASCII, BCD, or BINARY.
There is also the potential of setting a connection flag by writing NEW or
OLD so that the time-sharing system knows about the file. The NEW is the
default condition. File security can be obtained by using the dotted pair
(PROTECT . Z) to convey keys; the nature of the parameter Z depends
on the protection scheme provided by the monitor.
The last characteristic of a file is its format, specifically its blocked
and printed structure for input and output files, respectively. The parameter
RECORD specifies the number of lines to be blocked in each record and is
considered permanent for the life of the file. Page format is controlled by
declarations HORIZONTAL, VERTICAL, and OVERFLOW. HORIZONTAL has
a left margin, a right margin, and a maximum column parameter. VERTICAL
has an upper-line boundary, a lower-line boundary, and a page boundary.
All these declarations have default conditions.
There is a set of reserved variable names whose values are file de-
scriptions for various input/output devices; although these are fixed, they
can be modified. A few examples of these are
A key factor in the LISP 2 development is the creation and clear usage
of two distinct language levels—source language (SL) and intermediate
language (JL). The preceding discussion has been entirely about the source
language, which obviously strongly resembles ALGOL 60. On the other
hand, the syntax of JL is almost identical to LISP 1.5. JL is designed to retain
the characteristic of allowing the program to have the same structure as
data, so it can be manipulated by both the user and system programs. Thus
LISP 2 loses at the user level the facility of having programs look like data,
but it retains it at the intermediate language level. There is a macro expan-
sion capability at the JL level but not at the source language level.
There are some machine dependent operations which are useful com-
piler directives.
LISP 2 can be used to bootstrap itself onto a new machine, and in fact
the first LISP 2 system was written in JL. In any case, since earlier versions
of LISP have been written in themselves, this facility can certainly be con-
tinued at least at the intermediate language level and, presumably, also at
the source language level.
The most significant effect of the language on the compiler is the
mapping into the intermediate language, because a person who merely
looked at the source language and had no background whatsoever of
earlier work on LISP would not necessarily tend to develop an internal
system the way the designers did. One thing that has been done to improve
efficiency is to store numbers directly as single words rather than to pack
them. Because of the tradition of garbage collection in LISP, it was
continued in LISP 2. (See the discussion of this issue in Weizenbaum
[WZ67].)
Since LISP 2 has not received any real usage, no comment along those
lines can be made. It appears that little—if any—further work will be done
on it, but of course this is subject to immediate change.
REFERENCES
VilI.3. JOVIAL
[AA67] “JOVIAL Usage and Compilers (as of 8/67)”, Appendix 1, Minutes of
USASI X3.4 meeting (Sept. 29, 1967).
REFERENCES 599
[AF67] Standard Computer Programming Language for Air Force Command and
Control System (CED 2400), Air Force Manual AFM 100-24 (June,
1967).
[(CE67] Clark, E.R., “On the Automatic Simplification of Source-Language
Programs”, Comm. ACM, Vol. 10, No. 3 (Mar., 1967), pp. 160-65.
[(CO61] Coffman, E.G., Jr., A Brief Description and Comparison of ALGOL
and JOVIAL, System Development Corp., FN-5618, Santa Monica,
Calif. (June, 1961).
[KE62] Kennedy, P. R., A Simplified Approach to JOVIAL (A Training Docu-
ment), System Development Corp., TM-780/000/00, Santa Monica,
Calif. (Sept., 1962).
[KE65] Kennedy, P.R., The TINT Users’ Guide, System Development Corp.,
TM-1933/000/02, Santa Monica, Calif. (Mar., 1965).
[KK65] Klein, S., “Automatic Paraphrasing in Essay Format”, Mechanical
Translation, Vol. 8, Nos. 3 and 4 (June, Oct., 1965), pp. 68-83.
[MD64] Marsh, D.G., “JOVIAL in Class”, Annual Review in Automatic Pro-
gramming, Vol. 4 (R. Goodman, ed.). Macmillan, New York, 1964,
pp. 167-81.
[MI62] FAST—FORTRAN Automatic Symbol Translator (reference manual),
MITRE Corp., SR-24, Bedford, Mass. (Jan., 1962).
[PE66] Perstein, M.H., Grammar and Lexicon for Basic JOVIAL, System
Development Corp., TM-555/005/00, Santa Monica, Calif. (May, 1966).
[PE66a] Perstein, M. H., The JOVIAL (J3) Grammar and Lexicon, System Devel-
opment Corp., TM-555/002/04, Santa Monica, Calif. (May, 1966).
[SC60] Schwartz, J.I., Petersen, K.E., and Olson, W.J., JOVIAL and its
Interpreter, A Higher Level Programming Language and an Interpretive
Technique for Checkout, System Development Corp., SP-165, Santa
Monica, Calif. (Apr., 1960).
[SH00] Shaw, C. J., Programming Languages and JOVIAL, System Development
Corp., BR-3/11-60, Santa Monica, Calif.
[SH61] Shaw, C. J., “System Development Corporation’s Procedure-Oriented
JOVIAL”, Datamation, Vol. 7, No. 6 (June, 1961), pp. 28-32.
[SH6la] Shaw, C. J., The JOVIAL Manual, pt. 3, The JOVIAL Primer, System
Development Corp., TM-555/003/00, Santa Monica, Calif. (Dec., 1961).
[SH63] Shaw, C. J., “A Specification of JOVIAL”, Comm. ACM, Vol. 6, No. 12
(Dec., 1963), pp. 721-36.
[SH63a] Shaw, C.J., “JOVIAL—-A Programming Language for Real-time Com-
mand Systems”, Annual Review in Automatic Programming, Vol. 3
(R. Goodman, ed.). Pergamon Press, New York, 1963, pp. 53-119.
[SH63b] Shaw, C. J., “JOVIAL and Its Documentation”, Comm. ACM, Vol. 6,
No. 3 (Mar., 1963), pp. 89-91.
[SH64] Shaw, C. J., A Comparative Evaluation of JOVIAL and FORTRAN IV,
System Development Corp., N-21169, Santa Monica, Calif. (Jan., 1964).
[SN65] Sandin, N. A. and Foote, E. B., JTS User’s Manual, System Develop-
ment Corp., TM-1577/000/01, Santa Monica, Calif. (Apr., 1965).
[ST66] Steel, T. B., Jr., Some Observations on the Relationship Between JOVIAL
and PL/I, System Development Corp., TM-2930/000/01, Santa Monica,
Calif. (May, 1966).
600 MULTIPURPOSE LANGUAGES
Vil.4. PL/I
[AL67] Alber, K., Syntactical Description of PL/I Text and its Translation into
Abstract Normal Form, IBM Corp., TR 25.074, Vienna Lab., Vienna,
Austria (Apr., 1967).
[AN66] Allen, C. D. et al., An Abstract Interpreter of PL/I, (BM Corp., TN 3004,
Hursley, England (Nov., 1966).
[BA67] Bandat, K., On The Formal Definition of PL/I, IBM Corp., TR 25.073,
Vienna Lab., Vienna, Austria (Mar., 1967).
[BC66] Beech, D. et al., Concrete Syntax of PL/I, 1BM Corp., TN 3001, Hursley,
England (Nov., 1966).
[BC66a] Beech, D., Nicholls, J. E., and Rowe, R., A PL/I Translator, IBM
Corp., TN 3003, Hursley, England (Oct., 1966).
[BC67] Beech, D. et al., Abstract Syntax of PL/I, 1BM Corp., TN 3002 (Version
2), Hursley, England (May, 1967).
[BU66] Burkhardt, W. H., “PL/I: An Evaluation”, Datamation, Vol. 12, No.
11 (Nov., 1966), pp. 31-39.
[BZ67] Bond, E. R. and Cundall, P. A., “A Possible PL/I Extension for Mathe-
matical Symbol Manipulation”, Symbol Manipulation Languages and
Techniques, Proceedings of the IFIP Working Conference on Symbol Ma-
nipulation Languages (D. G. Bobrow, ed.). North-Holland Publishing
Company, Amsterdam, 1968, pp. 116-132.
[CQ65a] Christensen, C. and Mitchell, R., Reference Manual for the NICOL 1
Programming Language, 3rd ed., Computer Associates, CA-6511-3011,
Wakefield, Mass. (Nov., 1965).
[CQ67] Christensen, C. and Mitchell, R., Reference Manual for the NICOL 2
Programming Language, Computer Associates, CA-6701-2611, Wake-
field, Mass. (Jan., 1967).
[DL67] Donovan, J. J. and Ledgard, H. F., “A Formal System for the Speci-
fication of the Syntax and Translation of Computer Languages”, Proc.
FICC, Vol. 31 (1967), pp. 553-69.
[DQ66] Dodd, G.G., “APL—A Language for Associative Data Handling in
PL/I”, Proc. FJCC, Vol. 29 (1966), pp. 677-84.
[EC66] A Minimum PL/I Subset (working paper), European Computer Manu-
facturers Association, ECMA/TC10/67/2, Geneva, Switzerland (Dec.,
1966).
[GX67] Glass, R.L., SPLINTER, A PL/I Interpreter Emphasizing Debugging
Capability (presented at ACM-sponsored PL/I Forum, Aug., 1967),
Washington, D.C. (unpublished).
[1B00a] Introduction to PL/I (student text), IBM Corp., C20-1632, Data Process-
ing Division, White Plains, N.Y.
(1B64] NPL Technical Report, IBM Corp., 320-0908, Data Systems Division,
Poughkeepsie, N.Y. (1964).
[IB65] PL|I Subset Language Specifications, 1BM Corp., C28-6809-1, Data
Processing Division, White Plains, N.Y. (1965).
[I1B65a] A Guide to PL/I for FORTRAN Users (student text), IBM Corp., C20-
1637-1, Data Processing Division, White Plains, N.Y. (1965).
REFERENCES 601
[IB65b] A PL/I Primer (student text), IBM Corp., C28-6808-0, Data Processing
Division, White Plains, N.Y. (1965).
[1B65e] IBM System/360 Operating System: PL/I Language Specifications,
IBM Corp., C28-6571-0, Data Processing Division, White Plains, N.Y.
(1965).
[IB66] Formal Definition of PL/I, 1BM Corp., TR 25.071, Vienna Lab., Vienna,
Austria (Dec., 1966).
[I1B66a] IBM System/360 Operating System PLI/I(F): Programmer’s Guide,
IBM Corp., C28-6594-0, Data Processing Division, White Plains, N.Y.
(1966).
[IB66b] IBM System/360 Operating System: PL/I Language Specifications,
IBM Corp., C28-6571-4, Data Processing Division, White Plains, N.Y.
(Dec., 1966).
[1B66e] IBM System/360 Operating System: PL/I Subroutine Library, Com-
putational Subroutines, IBM Corp., C28-6590-0, Data Processing Divi-
sion, White Plains, N.Y. (1966).
[IB66f]} A Guide to PL/I for Commercial Programmers (student text), IBM Corp.,
C20-1651-0, Data Processing Division, White Plains, N.Y. (1966).
[1B66g] IBM System/360 Disk and Tape Operating Systems: PL/I Programmer’s
Guide, IBM Corp., C24-9005-0, Data Processing Division, White Plains,
N.Y. (1966).
[1B67] PL/I Reference Data: Keywords and Character Sets, IBM Corp.,
X20-1744-1, Data Processing Division, White Plains, N.Y. (1967).
[I1B67d] IBM System/360 PL/I Reference Manual, IBM Corp., C28-8201-0, Data
Processing Division, White Plains, N.Y. (1967). |
[1B67f] IBM System/360 PL/I Subset Reference Manual, IBM Corp., C28-8202-0,
Data Processing Division, White Plains, N.Y. (1967).
[LH67] Lawson, H. W., Jr., “PL/I List Processing”, Comm. ACM, Vol. 10,
No. 6 (June, 1967), pp. 358-67.
[MR64] McCracken, D. D., “The New Programming Language”, Datamation,
Vol. 10, No. 7 (July, 1964), pp. 31-36.
[PU67] Pursey, G., Concrete Syntax of Subset PL/I, IBM Corp., TN 3005,
Hursley, England (Feb., 1967).
[QB67] Bates, F. and Douglas, M. L., Programming Language/One. Prentice-
Hall, Inc., Englewood Cliffs, N.J., 1967.
[RG65] Radin, G. and Rogoway, H.P., “NPL: Highlights of a New Pro-
gramming Language”, Comm. ACM, Vol. 8, No. 1 (Jan., 1965), pp. 9-17.
[VK67] Walk, K. et al., Abstract Syntax and Interpretation of PL/I (draft for
version 2), IBM Corp., TR 25.082, Vienna Lab., Vienna, Austria, (Dec.,
1967).
[WC66] Weinberg, G. M., PL/I Programming Primer. McGraw-Hill, New York,
1966.
[XY 64] Report of the SHARE Advanced Language Development Committee
(Mar., 1964) (unpublished).
[XY 64a] Specifications for the New Programming Language (Apr., 1964) (un-
published).
602 MULTIPURPOSE LANGUAGES
[FJ66] Feldman, J. A., “A Formal Semantics for Computer Languages and its
Application in a Compiler-Compiler”, Comm. ACM, Vol. 9, No. 1
(Jan., 1966), pp. 3-9.
[1T66] Iturriaga, R. et al., “Techniques and Advantages of Using the Formal
Compiler Writing System FSL to Implement a Formula ALGOL
Compiler”, Proc. FJCC, Vol. 28 (1966), pp. 241-52.
(IT66a] Iturriaga, R. et al., The Implementation of Formula ALGOL in FSL,
Carnegie Inst. of Tech., Pittsburgh, Pa. (Oct., 1966).
[1T67] Iturriaga, R., Contributions to Mechanical Mathematics, Carnegie Inst.
of Tech., Pittsburgh, Pa. (Ph. D. thesis) (1967).
[PR64] Perlis, A. J. and Iturriaga, R., “An Extension to ALGOL for Manip-
ulating Formulae”, Comm. ACM, Vol. 7, No. 2 (Feb., 1964), pp. 127-30.
[PR66] Perlis, A. J., Iturriaga, R., and Standish, T. A., A Definition of Formula
ALGOL, Carnegie Inst. of Tech., Pittsburgh, Pa. (Aug., 1966).
Vill.6. LISP 2
603
604 = spECIALIZED LANGUAGES
to reserve that phrase for a very wide area which essentially encompasses
all programming languages. Because many of the languages (although cer-
tainly not all of them) contain terms and concepts which are meaningful
only to those people with specialized knowledge, relatively little detail about
each language is provided. In many cases, what has been done is merely to
indicate the intended scope of the language, show an example or two, and,
wherever appropriate, provide the list of basic statements or facilities in the
language. Those interested in obtaining more detail about any particular
area can do so by consulting the cited references, which are deemed to be
the most significant.
One of the characteristics of these special application languages is that
they tend to require more software support in the way of special application
programs than the more general languages do. Thus, many of these special
languages not only require a large majority of the facilities which are in the
more general languages discussed in earlier chapters but need their own
specialized routines as well. For example, most languages—even though
they may be very specialized—provide some type of arithmetic, control trans-
fers and some type of testing facilities. However, in addition to these, spe-
clalized routines may be required, such as computing a set of coordinates
or representing an analogue computer integrator. In some cases, what has
been done is first to provide a large set of subroutines; these might
even be in a form which could be used with a CALL from FORTRAN or
some other similar language. A language syntax is then placed on top to
avoid the necessity of subroutine calls and notation. I do not mean to
imply that the languages in this chapter are merely addenda to existing
languages; with only a few exceptions, this 1s not the case. However, in a
number of languages, they have been designed so that it is very easy to
make additions from a language viewpoint to correspond to new facilities
that might be desired or developed.
Most of the languages which are not additions to existing ones tend to
have a fairly rigid format which resembles the macros in assembly programs
more than the higher level languages in this book. Thus, the defining char-
acteristics of a programming language which were given in Section I.4.2
have been interpreted much more loosely in this chapter than in any of
the others, systems which would not have been included in the general
categories discussed in Chapters IV—VIII are included here. I feel they are
worth mentioning because they reflect a very significant trend in showing
the need for specialized languages. For some of the application areas the
syntactic flexibility of the more general languages is neither necessary nor
desirable.
This entire area has received what I consider insufficient attention in
developing generalized systems, but the proliferation of specialized languages
attests to its importance. A discussion of the need for the latter is given by
Licklider [LI65]. Early work in the development of tools for generating
1X.2.1.1. APT 605
specialized languages was done in the SHADOW systems (see Barnett and
Futrelle [BI62]). Although the term syntax-directed compiler was not used
when the SHADOW work was originally started in the late 1950’s, the
designers were actually providing tools whereby a single system could
handle the syntax for languages of widely differing kinds. (The SHADOW
system needed specialized routines created to carry out the specialized
tasks.) The syntax-directed compiling efforts discussed in Section IX.2.5
are more oriented toward generalized languages. Other attempts to provide
systems whereby people can define their own specialized languages in narrow
areas (and have them translated and executed) are being developed within
the ICES system (see Section [X.2.2.3) and the AED work (see Section
IX.3.4.2). As noted in Chapter XI, I personally feel this is an extremely im-
portant direction for future developments, and I actually started a project
in 1962 with this objective. For various reasons, it was never completed.
The use of tools for cutting pieces of metal is well-known even for
those not involved in the field known as numerical control (N/C). What is
perhaps not so clear is that these tools can be controlled either manually
or by means of a paper tape. The latter is presumably preferable from
most viewpoints. The punched paper tape contains a steady stream of
signals which provide appropriate direction to the tools involved. However,
it is, of course, necessary for instructions to be prepared on the paper tape;
the person who does this is commonly called a part programmer and the
latter word has nothing to do with the programming associated with digital
computers. The part programmer is the individual who takes a blueprint
or other specification and prepares the punched paper tape. Since a tre-
mendous amount of computation is involved in determining the coordinates
of specified shapes (e.g., an ellipse), it seems natural to consider the use of
a computer for doing this.
1. APT
2. Others
SET POINT
O 1 2 3 4 5
N
ao
@
Fart to be cut
607
Figure IX-2.
608
Array Declarations Cutter Specifications
RESERV CUTTER
Direction Declarations
Tool Position Declarations
INDIRP TLLET
INDIRV TLRGT
TLNDON
Tolerance Specifications TLON
TOLER TANCRV
INTOL TLONPS
OUTTOL TLOFPS
Modifier Words
ATANGL NOMORE IPR POSY TYPE
CENTER SAME CIRCUL POSZ NIXIE
CROSS MODIFY LINEAR RADIUS LIGHT
FUNOFY MIRROR PARAB RIGHT FOURPT
INTOF START RPM SCALE TWOPT
INVERS ENDARC MAXRPM SMALL PTSLOP
LARGE CCLW TURN TANTO PTNORM
FEFT CLW FACE TIMES SPLINE
LENGTH MEDIUM BORE TRANSL RTHETA
MINUS HIGH BOTH UNIT THETAR
NEGX LOW XAXIS XLARGE XYZ
NEGY CONST YAXIS XSMALL TRFORM
NEGZ DECR ZAXIS MIST NORMAL
NOX INCR TOOL TAPKUL UP
NOY ROTREF AUTO STEP DOWN
NOZ TO FLOOD MAIN LOCK
IN PAST PARLEL SIDE SFM
OUT ON PERPTO LINCIR XCOORD
ALL OFF PLUS MAXIPM YCOORD
LAST IPM POSX REV ZCOORD
609
610 SPECIALIZED LANGUAGES
Figure IX-2. APT vocabulary list. Each of these words has a meaning and is
understood by people working in this field.
Source: Brown, Drayton, and Mittman [BP63], pp. 657-658. By permission
of the Association for Computing Machinery, Inc.
There have been more than 100 part programming languages developed
over the years, but relatively few have received widespread use. The trend
appears to be to generalize the APT system to include all types of features
from point-to-point to sophisticated geometric programming and then to
extract subsets for various purposes.
The languages in this section are those specifically designed for use
by people concerned with civil engineering. They certainly use languages
such as FORTRAN, but the languages mentioned here are oriented specif-
ically toward problems in the cited area. Among the most important char-
acteristics of these languages is the minimum amount of computer expertise
required. In other words, the objective is to allow the engineers to state
the operations they wish to perform in a manner which is reasonably natural
or logical for them. There is no question but that the same logical effect
could be obtained by adding the necessary subroutine packages to a language
such as FORTRAN or PL/I, but this would allow neither the syntactic
flexibility that the engineer can obtain from a special language nor the
scale of capabilities required to integrate the computer into the engineering
process. Considered from the opposite point of view, it might be possible
to develop systems whereby the engineer needs only to fill out a form to
1X.2.2.1. coco 611
obtain his desired results. However, there is obviously less flexibility and
freedom of development that way,
1. COGO
One of the most widely implemented and used languages for a special
area is COGO. It has been implemented on at least the following computers:
IBM 1620, 1130, 7040/44, 7090/94, 1410, 7070, and System/360; Burroughs
5000/5500; CDC 3600 and 160 A/1604; RCA Spectra 70; UNIVAC 1107;
and under several time-sharing systems, e.g., CTSS (see Crisman [ZR65])
and QUIKTRAN. It was initially developed on the 1620 around 1960 under
the direction of Professor C. Miller at M.I.T.’s Civil Engineering Department.
COGO (COordinate GeOmetry) is a language to assist civil engineers
Point 1 \
(1000., 2000.)
Point 95
(?, ?)
2. STRESS
CROSS/TANGENT M J RL K N RS SIGN
ble solutions.
Coordinates of M and K
Distance and Azimuth of the tangent from M to K
{10,000 Ibs.
| C) Joint numbers
5,000 Ibs.
614
1X.2.2.3. ICES 615
MEMBER INCIDENCES
2 1
=
& W
WD
WH
NOOO
kh
bh WD
OH
&
AO
WNND
OO
ON
Oo
RW
10
11
-F
12 7 2
MEMBER PROPERTIES, PRISMATIC
AX 1.0
=
AX 1.0
bk WHD
AX 1.0
OG
AX 1.0
AX 1.0
AX 1.0
AX 1.0
ON
AX 1.0
AX 1.0
Oo
10 AX 1.0
11 AX 1.0
12 AX 1.0
NUMBER OF LOADINGS 1
LOADING ARBITRARY
TABULATE FORCES, JOINT DISPLACEMENTS, REACTIONS
JOINT LOADS
1 FORCE Y —10.0, FORCE Z 5.0
4 FORCE X 6.0
SOLVE THIS PART
Figure IX-6. STRESS program for analysis of space truss shown in the
diagram.
Source: Fenves [FE66], p. 50. Reprinted by permission from Proceedings of
the IBM Scientific Computing Symposium on Man-Machine Communication.
© 1966 by International Business Machines Corporation.
3. ICES
around 1967. It was released in November 1967 and ordered by over 300
organizations. ICES consists of four major elements: (1) A set of en-
gineering subsystems, each of which is designed to solve problems in
a particular area of civil engineering, such as structural analysis and
design, soil mechanics, and highway engineering; some specific systems are
COGO, STRUDL, ROADS, BRIDGE, TRANSIT, PROJECT, (2) a set
of special application area languages which are used to operate these sub-
systems, (3) facilities whereby people can relatively easily design new lan-
guages and embed them in the system and modify existing subsystems,
and (4) an executive system which combines all these modules in the correct
fashion. It is hoped that one of the most useful characteristics of ICES
will be its facility to allow the user access to subroutines from more than
one particular branch of engineering.
1X.2.2.3. ICES 617
The terms count and name refer to the number of items to be handled and
the address of the stack.
There are a number of error processing statements such as /NHIBIT,
ENABLE, and ERROR RETURN. There are various statements to permit control
of secondary storage. There is a matrix declaration which enables the user
to write statements which are similar in structure to the regular ones but
which operate on matrices. Thus, for example, the user could write
V(2)=V(2)—TRN(X(1))*B*V(2)* INV(TRN(X(1))*B*X(1))*X(1)
where TRN means matrix transposition and INV means inversion.
It should be stressed again that the purpose of ICETRAN 1s to permit
programmers (who might themselves be the engineers) to write the necessary
subsystem programs for the differing application areas.
One of the most interesting facets of ICES is its command definition
language (CDL) which is used by the subsystem programmers to define
and specify the processing of the language command for each subsystem.
It is assumed that each of the application-oriented commands will consist
of a word or a phrase defining some unit of engineering computation (e.g.,
LOCATE AZIMUTH and STIFFNESS ANALYSIS). The data for the command
may be on the same or a following card. Phrases themselves may be data,
and complex commands consisting of phrases mixed with data are permitted.
One common thing to do, of course, is to add to the vocabulary. This
is done by means of the following type of statement:
The 'label' is the vocabulary word, the MODE represents the internal form
of the data, the ‘variable’ specifies the internal name of the variable or
array, and treatment specifies whether the data is required or not. Com-
mands are handled by means of the following:
ADD ; ; ae
‘pep A ce} command name’ [MODE ‘variable’ treatment]
where MODE specifies the internal form for the data. Other commands are
shown in Figure [X-8. As an illustration of this, if the STORE command,
used to define the X and Y coordinates of a known point, is to be added
to the COGO subsystem, then the engineer might write
Data Descriptors
\ ID ‘label’
NO ID \ MODE ‘variable’ TREATMENT
Existence Data
EXISTENCE ‘list’ SET ‘variable’ TREATMENT
Counting
INCREMENT [MODE] ‘variable’ [BY constant]
Equating Variables
MOVE [MODE] ‘variable-I' to ‘variable-2'
Ignorable Words
IGNORE ‘word-I' 'word-2' ...
Command Modifier
MODIFIER ‘label’ [MODE ‘variable’ TREATMENT]
. requests ...
OR MODIFIER ‘label’ [MODE ‘variable’ TREATMENT]
. requests ..
END MODIFIER \ OPTIONAL
—— {CONDITION REQUIRED
Incremental Processing
REPEAT
—_—— ' I’
laereat rapuLar} ['symbol]
. requests ...
END REPEAT [TABULAR]
Figure IX-8. Some of the CDL commands in ICES. The general notation is
the COBOL metalanguage described in Section IT.6.2. In addition, the use
of... requests... represents any request that adds to a subsystem a vocabu-
lary word which describes a data item.
Source: [MTOO], extracts from pp. 3-5—3-19.
619
620 sPECIALIZED LANGUAGES
and this would be added to the COGO vocabulary by the following small
program:”
SYSTEM 'COGO'
ADD 'STORE’
ID 'P’ INTEGER 'NPOINT’ REQUIRED
ID 'X' REAL 'XCOORD’ STANDARD O
ID 'Y’ REAL 'YCOORD’ STANDARD 0
EXECUTE ‘STORE’
FILE
1. APL (Iverson)
2. LOTIS
3. LDT
4 » xFER S&S
wep A & (KEe Ae LOGCUs ZEROe ARITHe Co LM) &
128 “7 AES = (ZERO. ONE) $&
ARITH = (LM. KEe ONEs Co As 8B) &
THIN— FILM Br(LMeKE.OeCIS
REGISTERS BRF = (ZERO. ONE) §&
C = (ARITHe KE) &
CAOD = (LM) &
2 aoa nh eayo ees
CLOCK = (ZERO. ONE) &
THIN- FILM INTERRUPT CORE = (LM) &
COUNT = (ZERO + SCMeSeAs
COUNT )S
ADDRESS REGISTER
Fo « (KEe ZERO) &
GATING
FRP = (KE. ZEROe ONE) &
2 (ZERO. ONE?) S$
etree aE.
os ve tetet tend aes atta,
Hnedhtbnwnwa
UNIT (ZERO. ONE) $
(ZERO. ONE) $
4 A (ZERO. ONE) $
REGISTER (KEe ONE» ZERO) &
ADDER (KEe ONE. ZERO) §$
CKEe ONE. ZERO) §&
(KE. ONE. ZERO) $
8
REGISTER = (KEe ONE. ZERO) §&
L
[so RATOR
REGISTER M REGISTER | eh
=
=
(KEe
(LOGCUe
ONEe ZERO)
ONE. ZERO)
&
&
(KEse LM) &
| REGISTER | = (ZERO, COUNTe KEe Se Fe Ie LOGCU) &
UPPER LIMIT = (SCM, S$) $
(x) pTFMEM = (TEAG. KE) §
xX 2 (A) $&
{Y)
READ X,ABC,N
LOOP.. STEP
PRINT X,ABC,N
N=N-1
IF (N.GT.0) THEN GO TO LOOP
STOP
5. Computer Compiler
The work of Chu [CB65] is one of the two very ALGOL-like systems
in this area, but it was also not claimed to be implemented. A subset was
implemented on the 7094 for simulation purposes; it 1s described in Mesztenyi
[YZ67]. Not only the flavor but much of the terminology and syntax is that
of ALGOL. An example is shown in Figure [X-12.
7. SFD-ALGOL
/ \ M
[MUR | MIAD Y, MCIR | MCAD
MI x MC
ral // RQ
L \
Figure IX-11. System layout and data paths in a sample computer, and part
of computer compiler program.
Source: Metze and Seshu [MX66], p. 259
624
1X.2.3.7. SED-ALGOL 625
sequence MULTIPLICATION
comment begin This sequence describes
a multiplication which employs Booth's
algorithm for binary numbers in signed
two's complement representation. The
multiplier and multiplicand are_ initially
in register B and R respectively, and the
product is finally in the cascaded register
A&B[0-26]. end
register B[O-27], S[0-5], MULTIPLYALARM
operation MULTIPLY, RIGHTSHIFT
WFO5kTO: R«< MA[C];B <— A; A —0
WxFOSXT1: do PARITY; S — 26
WFO5&T2: G <—H[G]; do MULTIPLY
WxFO5*T3: H<— MB[G]; do RIGHTSHIFT; C — D
WxFO6xTO: do MULTIPLY
WxXFO6%TI: do RIGHTSHIFT
WFO6&T2: do MULTIPLY; if S = 0 then G — H[G]
WxXFO6xT3: do RIGHTSHIFT; if S = 0 then H — MB[G]
WFO7&TO: de MULTIPLY; Y < R[O]
WFO7K&T1: STOP — MULTIPLYALARM < A[O}%B[27]*Y
WFO7KT2: G<—H[G];
WFO7%T3: H<— MG[G]; W —0
MULTIPLY: if B[27]xY' = 1 then A — A subR
if B[27]'xY = 1 then A <— AaddR
RIGHTSHIFT: A&B&Y <— shr A&B&Y;
if S¥#0 then S — S sub 1
CONTROLDOWN TOPOUT
CONTROLUP BOTTOMOUT
BOTTOMIN
begin
Boolean array DATA [1:5]
input Boolean CONTROLUP, CONTROLDOWN, TOPIN,
BOTTOMIN;
output Boolean TOPOUT, BOTTOMOUT;
procedure INPUT (1); value |; integer |;
begin
if! <5 then CONTROLUP := CONTROLDOWN := false
else
ifl>4AI<9 then begin
CONTROLUP := true;
CONTROLDOWN := false;
I: 1—4
end else
if | > 8 then begin
CONTROLUP := false;
CONTROLDOWN := true;
{:= I—8 end;
BOTTOMIN := 1 > 2;
TOPIN :=!1=1VIi=3
end of INPUT
INITIALIZATION: time begin integer |;
for |:= 1 step 1 until 5 do DATA [I]: false;
TOPOUT := BOTTOMOUT := false
end of initialization;
WORK: time begin integer |;
if CONTROLUP then begin
for | := 4 step —1 until 1 do DATA [I+1] := DATA [I];
DATA [1] := BOTTOMIN
end else
if CONTROLDOWN then begin
for|:= 4 step 1 until 4 do DATA [I] := DATA [I+1];
DATA [5] :== TOPIN;
end;
626
IX.2.4. DIGITAL SIMULATION OF BLOCK DIAGRAMS 627
1. Introduction
Simulation languages have been written for two more or less diverse
reasons: to provide analog check cases, and to solve differential equa-
tions (in other words, replace an analog computer). .. . The overwhelming
majority of authors state that their language (or program) was designed
to simulate systems that can be represented by block diagrams.‘
A few of the systems which are apparently of great use in this area
are not specifically mentioned because their /anguages are even less problem-
oriented than the ones cited below. In this category are PACTOLUS (see
Brennan and Sano [YR64]), MIDAS (see Petersen et al. [PS64]), and
TELSIM (see Busch [QD66]). One of the earliest papers in this area is
Selfridge [YD55]. An on-line system which is designed for use in a hybrid
configuration is described by Cramer and Strauss [CR66]. Excellent summa-
ries and reviews of the programs and/or languages in this field are given in
Brennan and Linebarger [YR64a] and Clancy and Fineberg [ZZ65].
2. DYANA
LLLLLLLLLLLLLLLLAL
LALA AAA LA LALA ALA AAA
|! |EOOCO3
EOOKO! & LJ EOOCOt
O03
EO3KO2
EOINO2
EOOMO1!] O01 *~ O2 |EQOMO2E
EFO'
INPUT WITH DIAGNOSTIC COMMENTS FLAGGED BY AN @
3. DYSAC
DYSAC (DigitallY Simulated Analog Computer) is a language (imple-
mented on the CDC 1604) where the user has available to him a large
number of analog computer components which he can interconnect accord-
ing to the needs of his problem. The list of components available to him is
shown in Figure IX-15 and the various input data required to describe the
In + 1+1.2S pe peed 1 25
EY 25 Qut >
20.4 Y X| 14.025 [xs] 79 x3 | 1+.4S — 1+25 | xs] 145 XG
<— 002
BCD 3 TITLE
3cv CURRENT REGULATION SYSTEM
oCD 5 2064 VOLT STEP INPUT
aco 3 PATCHING
NO1#AC2. NO2=AQ4SPLIENOZP 126 NO3*NO2P134 NO3P14—
5CD NO42P15N03+P16NO04e
aco AO1L#PO5+P06N04G~4 AIZ=POTADL+POBNO Le AO3*=PO9ADZeNOl.
A042P10A03. OUTsP0l1. OuUT#A01, OUTZA036¢
3 OUTS A04G. OUT= NO2e OUTZNOQ3-6 OUT=ENO4e
3 CLEAR INITIAL VALUES
3 POT SETTINGS
DEC 0920050794
20 040-2 002 0 809-50
1620040 e2050-205
LeeS ere e25s- 1
aoa
630
1X.2.4.4. DAS 631
4. DAS
The DAS (Digital Analog Simulator) system on the IBM 7090 also
provides a number of components representing analog computer elements.
A sample block diagram and equivalent program are shown in Figure
IX-18.
X+X=0
X (0) =10 1)K TF, PI, DELT
O<T <3 2)IC 1
IC 3)START
4)NEG1 I1
5 )I1 NEG1
BS 6)FIN IT, TF
| 7 )RO PI, IT, 11, NEG1
{ 8 EN
9)3. > 0.1 O.|
Xx Xx }O}10-9
NEG1 > 11 —< RO1> I1)0DAS SOLUTION OF A FIRST
B2 ORDER LINEAR
I2) DIFFERENTIAL EQUATION
WITH UNITY TIME
13) CONSTANT AND NO
) FORGING TERM
14
I5) TIME-SECS. DISPLACEMENT
VELOCITY
|
IT FIN1
5. DSL/90
A more recent system called DSL/90 is an extension of FORTRAN
implemented on the IBM 7090/94. A few of the blocks, switching functions,
and function generators available to the user are shown in Figure IX-19. A
block diagram and the program to represent it are shown in Figure I1X-20.
The variable TIME is a system name representing the independent variable
of integration and it can be renamed by the user. The right-hand sides of
the assignment statements are merely FORTRAN expressions, since things
such as INTGRL are merely new functions as far as FORTRAN is concerned.
SWITCHING FUNCTIONS
FUNCTION GENERATORS
GENERAL FORM FUNCTION
Y= AFGEN (FUNCT, X) Y=FUNCT (X) XpeX « Xq
LINEAR INTERPOLATION
Y=FUNCT (X,) X< XQ
ARBITRARY LINEAR FUNCTION GENERATOR Y=FUNCT (Xp) X>Xpy
> YoDOT
=| = o> JS YOO! JS >Y
MULT. x be
FCN A cos t
There are also control statements, e.g., PRINT, PREPAR, GRAPH, LABEL, and
ARRANGE. Control statements can be used to set error bounds or cutoff
conditions, integration methods, etc. (e.g., CONTRL and CONTIN).
One of the interesting characteristics of DSL is that it has a certain
amount of nonprocedural aspect to it since it will alter the sequence of
input statements if desirable, and any operational statement is considered
properly sequenced if all its inputs are available.
1. Introduction
more interest to many readers than several of the other specialized appli-
cation areas discussed here. It is essential to realize that this is definitely
not a section on writing compilers, nor does the reference list at the end of
this chapter provide a complete bibliography of compilation techniques.
An overall view of compilation techniques from several (but not all) view-
points is given by Feldman and Gries [FJ68]; that report also contains
a good bibliography.
To reemphasize the difference between compiler-writing techniques and
languages, we can consider the analogies between techniques used for
solving differential equations and FORTRAN, or the systems design and
analysis for an accounts receivable application and the language (e.g.,
COBOL), in which this application is actually written. Unfortunately, one
major class of techniques for writing compilers, namely the syntax-directed
(sometimes called syntax-oriented or table-driven), tends to blur the distinc-
tion between the technique and the language.
It is ironic that many compiler writers have tended to be very resistant
to the use of higher-level languages for their own application. There has
been a common attitude of “it is all right for people writing application
programs to use my compilers, but I cannot afford any potential inefficiency
in the compiler itself”. This is probably one of the reasons that there has been
less development along the lines of languages for writing compilers than
one might expect.
There are really two major directions in which compiler-writing lan-
guages have progressed. The second has just been mentioned, and the first
one is not very prevalent currently. The first, and actually classical, approach
to a compiler-writing language is simply to design a language which provides
in a convenient way those facilities deemed necessary by a compiler writer,
independently of the types of algorithms that he might wish to use for
various phases of the compiler-writing activity such as scanning, storage
allocation, and code generation. One of the earliest of these languages is
the CLIP work (see Section IX.2.5.2) done at the System Development
Corporation; this was mentioned in Section VIII.3.1 as part of the history
of JOVIAL.
There does not seem to be any other significant and successful develop-
ment in the area of providing or defining a language specifically useful for
writing compilers, although various attempts have been made. The relatively
recent emergence of PL/I may cause it to become a strong contender for
use in this area since it contains essentially all the provisions and features
that are needed. It has in fact been used to write much of a large time-sharing
system (1.e., MULTICS) which is an application with some similarity to
compiler writing.
The modern techniques for compiler writing are primarily based on the
concept of syntax-directed compilation, sometimes called table-driven com-
1X.2.5.2. CLIP 635
pilers. The foundation work in this technique was done by Irons [IR6]],
Glennie [GC60], and Brooker and Morris [BX62]. Even earlier—though
unpublished—work by Barnett at M.I.T. on the SHADOW systems had
many of the rudiments of this concept (see Barnett and Futrelle [BI62]).
It is completely beyond the scope of this book to provide a description of
what 1s meant by syntax-directed compiling. A good reference for obtaining
fundamental information about this subject is the article by Cheatham and
Sattley [CH64]; the article by Floyd [FL64] also provides useful background.
Unfortunately, the distinction between the syntax-directed compiling tech-
nique and the languages that have been developed along these lines is an
extremely subtle one which cannot be described here. A further and even
more difficult subtlety is the distinction between the metalanguage used to
define the language syntax (as discussed in Section I1.6.2.2) and the language
used to write programs to handle the definitions. In some cases mentioned
here, this difference is blurred or ignored for the sake of simplicity. As
in the other sections in this chapter, only a few examples can be given to
show the flavor of what is involved. The essential point is that given a set
of syntactic definitions for a language, there needs to be a program written
to handle them, and a language might be designed to be useful in writing
programs of that type. Furthermore, there is increasing recognition of the
need for defining the semantics of the language, and again a possible need
for a language to write either the semantic definitions or the programs to
handle such definitions. As the simplest illustration of this concept, we must
recognize that a syntactic definition can specify that A+B is legitimate, but
we need further information to know that the machine code for such an
expression might be something of the form CLA A, ADD B. One of the dif-
ficulties in discussing these languages is that they presuppose a particular
form for the syntactic definition of the language. These are not described.
Various attempts at compiler-writing language systems, not discussed
in later sections, are listed in the references for this section at the end of the
chapter.
2. CLIP
3. TMG
This statement says that the scanning mechanism should skip over an
arbitrary number of leading zeros, mark the start of the string, find at least
one digit and then space over all additional consecutive digits, and put the
symbol in the symbol table and the output tree. Arithmetic can be done dur-
ing compilation using a function COMPUTE which has anassignment statement
as its argument, e.g., COMPUTE (NEXT—VALUE = LAST—ONE+2). A condi-
tional statement can also be written, e.g., IF (INTVAL .LE. LAST—LABEL).
There are a number of built-in functions in TMG; e.g., ARBNO (_) looks
for an arbitrary number of occurrences of the syntactic unit which is its
argument, GLOT spaces over the input string to the next card boundary,
etc. The reader interested in pursuing this system in detail will find a com-
pletely worked out example in [MZ65a]. A small section of this is shown
in Figure IX-21.
TMG was used to write ALTRAN (see Section VII.5). It has been
implemented on a few machines.
637
638 sPECIALIZED LANGUAGES
4. COGENT
Z /= (TERM/(FACTOR)*(FACTOR)),X,Y-
+10 IF
will cause X and Y to be assigned the factors of Z if it has any, and it will
transfer control to statement 10; otherwise control goes to the next state-
ment without changing X and Y.’
A complete example for translating algebraic expressions from Polish
prefix notation into conventional infix notation is given in Reynolds [RE65a].
A small section of this is shown in Figure [X-22.
5. META 5
On the West Coast, an active working group of the ACM Los Angeles
Chapter and a number of specific individuals have been involved in producing
$SECSYN
(FACTOR) = (VAR),(()(EXP)()).
(TERM) = (FACTOR),(TERM)(MOP)(FACTOR).
(EXP) = (TERM),—(TERM),(EXP)(AOP)(TERM).
$PROGRAM
$GENERATOR GVAR ((X)
X /= (EXP/VAR)),X. $RETURN(X). ).
$GENERATOR GMULT((OP,X,Y)
+1 IF X =/ (EXP/TERM)),X.
X /= (TERM/(()(EXP)())),X-
1/ +2 IF Y =/ (EXP/(FACTOR)),Y.
Y /== (FACTOR/(()EXP)())),Y-
2/ X /= (EXP/(TERM)(MOP)(FACTOR)),X,OP,Y.
$RETURN(X), ).
"ABC','(("'))’
*KTHIS IS A DEMONSTRATION PROGRAM
IN METAS xx (1)
eMETAS DEMO SEQCON (2)
ITEM CNT XV; (3)
SEQCON 1$(.BK HOLCON .OUT(—x/)); (4)
HOLCON = .NUM 'H(’.SET(*V).PUT(*,CNT)
-PUT('"',*) (5)
$1(.GR(CNT,0)(—""".CHAR/.CHAR.PUT('"'))
-SOR(CNT)) (6)
')'-PUT("''*); (7)
-END (8)
6. TRANDIR
One of the most prolific groups in the field of compiler writing 1s the
small firm, Massachusetts Computer Associates, Inc. (COMPASS). They
have developed a series of compilers and compiling techniques, most of
which are beyond the scope of this section. However, the TGS-II (Translator
Generator System) involves a significant language embedded within an
overall system. The language is called TRANDIR, and the system 1s called
TRANGEN; the latter is essentially an interpreter which executes programs
written in TRANDIR to describe a specific translation process. TRANDIR
contains primarily an algebraic section, a pattern-matching section, and
a number of built-in functions. The TRANDIR language is used for all
phases of the compiler, as distinguished from the FSL language to be dis-
cussed later. TRANDIR contains a number of action operators, such as
CYCLE, EMIT, and SCAN, which involve system-defined tables. There are
7. FSL
[X.2.6. MISCELLANEOUS
The previous sections in this chapter have discussed languages for the
indicated application areas. The purpose of this last section for special
application areas is to mention briefly some languages which do not con-
veniently (or by any stretch of the imagination) fall into one of the other
sections. Except for the Matrix Compiler, the languages here are relatively
recent and pretty much “one of a kind”. While there are other languages
which could be considered to fall into special categories, the ones mentioned
here appear to be the most unusual or interesting.
2. Cryptanalysis: OCAL
Do 8
PARAMETERS ARE:
CRYPT - A STRING GIVING THE CRYPTOGRAM
soe
ee oD
PER - AN INTEGER VECTOR WITH SUBSCRIPT RANGE N TO M
THE WEIGHTED TALLIES ARE RETURNED IN THIS VECTOR
N - AN INTEGER GIVING THE LOWEST PERIOD TO BE TESTED
M - INTEGER GIVING HIGHEST PERIOD TO BE TESTED
DECLARATIONS NEXT
STRING CRYPT
CHARACTER C
INTEGER PER,N,M
INTEGER DIST, INDEX, ALPS,K, LI, L2
INTEGER SEP, TR
READER R,
DECLARE PER(#)
* THE VECTOR PER IS DIMENSIONED IN THE CALLING PROCEDURE
DECLARE DIST(LENGTH. (CRYPT)/S)
* DECLARING THE LOCAL VECTOR DIST
READER R
C =$NC.(R)
K = 1
DO UNTIL ENOSTRING, LOOP2: BEGIN
©
K =K +1
END CONDI]
C = $I1C.(R)
END LOOP2
Ll 21
DO UNTIL LI .E. K, LOOP3: BEGIN
L2 = L1l+*1
DO UNTIL L2 .G. K, LOOPh: BEGIN
SEP = DIST(L2) - DISTCL1)
R=WN
DO UNTIL TR .G. M, LOOPS: BEGIN
»
IF
(SEP .R. TR) .E. 0,
. PER(TR) = PER(TR) + 1
TR = TR #1
END LOOPS
L2 = t2+¢41
END LOOPS
Ll = tl +1
END LOOP3
INDEX = INDEX + 1
END LOOP1
»
K = 1
DO UNTIL K .G. M, LOOP6: BEGIN
PER(K) = PER(K) + 1
K zk +]
END LOOP6
*®
* ALL DONE
*
END PERIOD
643
644 = sPECIALIZED LANGUAGES
synthesis of MAD and SNOBOL, together with some ideas from SLIP and
PL/I. OCAL includes declarations and statements for sequence control,
string pattern-matching, assignment, and error control. An example of
an OCAL program is shown in Figure IX-26.
® This has no connection with the IBM on-line system for text editing called
DATATEXT which is mentioned in Section IX.3.5.
1X.2.6.5. STROBES AND DIMATE 647
Other slightly more powerful forms are available. A few of the operations
available include TON (turn the oscilloscope trace on), TP/ (type in a set
of integers starting at a specified location), JN/ (clear the temporary library),
and ATO (type the alphanumeric contents of specified number of words
648 spECIALIZED LANGUAGES
T TSK, MEM, 2, 1;
0000 ENT; SPACE FOR THE MARK
0001 PAR, 1; BRING THE FIRST PARAMETER
0004 STL,, LO; STORE IT IN LOCATION LO
0005 PAR, 2; BRING THE SECOND PARAMETER
0010 STL,, L1; STORE IT IN LOCATION L!
0013 STZ, 1, LO; STORE ZEROS IN THE LOCATION SPECIFIED BY LO
0014 CAL,, L1; CLEAR ADD THE PATTERN IN LOCATION LI}
0015 STL, 1, LO; STORE THE PATTERN IN THE LOCATION SPECIFIED BY LO
0016 TOF; TURN OFF THE OSCILLOSCOPE TRACE
0017 RTM; RETURN TO MARK
0020 LO, 0; DECLARE LO AND ITS CONTENTS
0021 LI, 0; DECLARE Li AND ITS CONTENTS
0022 END; TERMINATE ASSEMBLY
Stimuli available include voltage (both AC and DC), sine waves (both AM
and FM), and pulse train. Measurement capabilities include voltage, resis-
tance, frequency, and pulse width. Stimulus statements include relay supply,
signal ground, and chassis ground. Measurement statements include AC
and DC voltage, frequency, and time. A sample of a portion of a test pro-
gram is given in Figure I[X-33.
PAUSE
oNEASUREL,S VRF °,5 A
CONNECT C SWITCH Ji0e14 Ji0012 cnccces
MEASURE
@oro 8003
PRINT (MSGi)
TRIGGER
MEASURE 0 KOWMS 002 J100145 J10°46
LOWER LIMIY 18 OUT OF RANGE
GOTO ° Ae A004
PRINT (MSGi)
MALT
&NOD 9073 4 a
649
650 = sPECIALIZED LANGUAGES
1. Introduction
each block represents a step in the action of the system. This is higher level
but less flexible than the other languages which consist of statements com-
bined to form subprograms. Except for GPSS and DYNAMO, each lan-
guage requires some knowledge or understanding of a particular general
purpose language.
A still further distinction that can be made is whether the languages
are stand-alone or additions to existing languages. SIMULA is a direct
extension of ALGOL; the others are independent, except that SIMSCRIPT
is an extended FORTRAN-like language which in its first version used
the implementation technique of translating to FORTRAN statements.
One other characteristic of the simulation languages is important to
note. The latter represent a field in which the existence of a Janguage spurred
a great deal of activity, whereas the previous sets of subroutine packages
had been used but not as extensively. The most widely used languages are
GPSS and SIMSCRIPT; most of the others are research-oriented.
For the reader who is interested in pursuing the differences and simi-
larities of these systems in a general way, there are several excellent articles,
in particular those by Teichroew and Lubin [TE66], Krasnow [KQ67], and
Kiviat [KW66]. I would like to specifically acknowledge the invaluable
background given to me by those articles in preparing much of this section.
2. DYNAMO
One of the earliest of the simulation languages, and the only one dis-
cussed here which is continuous, is DYNAMO; this was developed at M.I.T.
and completed as early as 1959 on the IBM 704. Versions were developed on
the 709 and 7090 computers. A significantly improved version, DY NAMO II,
was written using AED-0 (see Section [X.3.4.2) and was running on the
7094. Plans exist for making DYNAMO II available on the IBM System/360
and GE 645. Only DYNAMO (I) is discussed here.
DYNAMO is a continuous system, meaning that every basic variable
is continuous and has a first derivative with respect to time. DYNAMO
actually approximates the continuous process by a set of first-order difference
equations. In this sense it is similar to the languages discussed in Section
IX.2.4, but the area of usage is the same as the others in this section. Level
equations are used to describe the basic variables. A level at TIME K depends
only upon the preceding time instant (TIME J) and the rates of change over
the time interval JK (K = J + DT), where DT is a standard time incre-
ment. For example, an inventory at TIME K (=IAR.K) is equal to the inven-
tory at TIME J (=IAR.J), plus what was received during the interval JK
(=SRR.JK), minus what was shipped during the interval JK (=SSR.JK). This
is represented by the level equation
V = V + (DT) ((P+Q)/Y)
is actually punched exactly as
M478—248,DYN,TEST,1,1,0,0
RUN 2698JP
NOTE MODEL OF RETAIL STORE
NOTE
TL IAR.K==IAR.J-+(DT) (SRR.JK—SSR.JK) INVENTORY ACTUAL
TL UOR.K==UOR.J+(DT) (RRR.JK-+SSR.JK) UNFILLED ORDERS
20A NIR.K==IAR.K/DT NEGATIVE INVENTORY
20A STR.K=UOR.K/DFR SHIPMENTS TRIED
54R SSR.KL=MIN(STR.K,NIR.K) SHIPMENTS SENT
4OR PSR.KL==RRR.JK-+(1/DIR) (IDR.K—IAR.K) PURCHASE ORDERS SENT
12A IDR.K==(AIR) (RSR.K) INVENTORY DESIRED
3L RSR.K==RSR.J-+(DT) (1/DRR) (RRR.JK-RSR.J) REQUISITIONS SMOOTHED
39R SRR.KL =DELAY3(PSR.JK,DTR) SHIPMENTS RECEIVED
NOTE
NOTE INITIAL CONDITIONS
NOTE
12N UOR=(DFR) (RRR)
6N RSR=RRR
6N IAR=IDR
NOTE
NOTE INPUT
NOTE
7R RRR.KL=RRI-+RCR.K REQUISITIONS RECEIVED
45A RCR.K=STEP(STH,5) REQUISITION CHANGE
NOTE
NOTE CONSTANTS
NOTE
AIR=8 WKS CONSTANT FOR INVENTORY
DFR=1 WK
NANAANA
3. GPSS
XXXXX
A,B,C,D
i
LEAVE
LOGIC
C) EXAMINE
MATCH GATE
PREEMPT SCAN
QUEUE GENERATE TEST
RELEASE TERMINATE TRANSFER
REMOVE
RETURN
SEIZE
SELECT
SPLIT
TABULATE
UNLINK
Figure IX-35. Some of the GPSS block types and corresponding operations.
Source: [IB67j], p. 73. Reprinted by permission from General Purpose
Simulation System/360 Introductory User’s Manual. © 1967 by International
Business Machines Corporation.
654 = sPECIALIZED LANGUAGES
7090 and since then newer versions have been implemented on other machines,
e.g., IBM 7040/44, 7090/94, System/360, RCA Spectra 70, and the UNIVAC
1107.
Unlike most of the other simulation languages, GPSS programs are
based on a block diagram drawn by the user to represent the system he
wishes to simulate. The principal data elements in GPSS are transaction
(representing units of traffic), equipment acted upon by transactions (includ-
ing facilities, storages, and logic switches), and blocks (specifying the logic
of the system). Other elements are provided for statistical measurements,
. L
Ship leaves harbor. |
LOCATION OPERATION
* SIMPLE HARBOR SYSTEM
* BLOCK DEFINITION CARDS
GENERATE 32,5 ONE SHIP EVERY 322%5 HOURS
QUEUE 1 JOIN QUEUE, WAIT FOR PIER
SEIZE 1 OBTAIN PIER WHEN FREE
DEPART 1 LEAVE QUEUE (NO LONGER WAITING)
ADVANCE 25,20 HOLD PIER 2520 HOURS
RELEASE 1 FREE PIER FOR NEXT SHIP
TABULATE 10 ENTER TRANSIT TIME IN TABLE 10
TERMINATE 1 REMOVE SHIP FROM SYSTEM
*
* TABLE DEFINITION CARD
10 TABLE M1,10,5,20 DEFINE TRANSIT TIME TABLE
*
* CONTROL CARD
START 100 RUN FOR 100 TERMINATIONS
4. SIMSCRIPT
6. MILITRAN
7. SIMULA
Three
other
PBU
pairs
Le
" “ ZA
Tu[6] sB(3] Jo
Figure IX-39. Complete SOL program for the multiple console on-line
communication system shown in the diagram on the preceding page.
Source: Knuth and McNeley [K N64], p. 403.
1X.3.1.7. SIMULA 659
READ (5,INPUT)
ARRIVAL RATE, SERVICE RATE, DAYS PER RUN,
] PROFIT PER TRUCK, COST PER SPACE PER DAY
INPUT FORMAT (5F10.3)
PLACE (DAYS PER RUN) IN END OF RUN
PLACE (—LOG(RANDOM)/ARRIVAL RATE) IN ARRIVAL
NEXT EVENT ... SIMULATION BEGINS
CONTINGENT EVENT ARRIVAL ((ARRIVAL TIME), 1)
IF(LENGTH(SERVICE QUEUE).GE.SPACES), NEXT TRUCK
SERVE TIME = MAX(TIME,SERVE TIME) — LOG(RANDOM)/SERVICE RATE
PLACE (SERVE TIME) IN SERVICE QUEUE
NEXT TRUCK REPLACE ENTRY ARRIVAL (1) BY (TIME—LOG(RANDOM)/ARRIVAL RATE)
END ... THIS STATEMENT IS ALSO INTERPRETED AS ‘NEXT EVENT'
CONTINGENT EVENT SERVICE QUEUE ((SERVICE TIME), SPACES)
PROFIT = PROFIT + PROFIT PER TRUCK
REMOVE ENTRY SERVICE QUEUE (INDEX)
END
CONTINGENT EVENT END OF RUN ((END TIME), 1)
WRITE (6, OUTPUT) PROFIT — SPACESXTIMEXCOST PER SPACE PER DAY
OUTPUT FORMAT (9H PROFIT = F7.2)
STOP
END
8. OPS
A SCHED operator has three options (to denote time T or the current time
or to meet a condition), and parameters may be passed to an activity when
it is called. Conditions are (unfortunately) specified in prefix notation, but
they may be quite complex, e.g., SCHED JOE WHEN OR LESS A B GREATER
C 25, which places a conditional call to the activity named JOE on the
AGENDA with stipulations on the relation to the variable TIME and with
the condition that execution should take place when either A is less than B
or C is greater than 25.
Other operators include DELAY, WAIT, RETRNA, PRINTK, CALLAK,
LOCAL, DRAW, CANCEL, RSCHED, PRINT, and READ. An example is shown
in Figure 1X-43.
Plans for OPS-4 are described in Jones [JM67]. The key points are as
follows: It will use the MULTICS system being implemented on the
GE 645 at Project MAC; PL/I will be used as the basic language, and special
data types (e.g., sets, queues, and tables) will be added; the activity repre-
sentation of SOL and SIMULA will be used rather than the event orien-
tation of SIMSCRIPT.
662 SPECIALIZED LANGUAGES
KOP ARRIVE
10 SETQ =Q +1
20 DRAW DT EXPONE 5
30 SCHEDK ARRIVE AT SUM TIME DT
40 SCHEDK STAT IMMED
390) =RETRNA
KOP STAT
10 IF @ .LE. QMAX
20 GOTO 50
30 SET QMAX = @
40 PRINT QMAX
590 =#=IF S .GE. 5
60 WAIT LESS S 5
70 SETS =S + 1
80 SCHEDK SERVIC IMMED
90 RETRNA
KOP SERVIC
10 SETQ =Q- 1
20 DRAW STIME RANDOM 5 50
30 DELAY STIME
40 SETS =S- 1
50 RETRNA
TX.3.2. QUERY
1. Introduction
listed in the references at the end of the chapter, even though they have
little or no interest from a language point of view. Those systems that I
deem to be the most interesting or typical, from a language viewpoint,
are discussed below.
The phrase question-answering system is applied primarily to those
systems which accept a natural-looking English statement or question as
input, and provide answers based on files whose format might be rigidly
fixed as in the data base systems, or general text from an encyclopedia, or
somewhere in between. Almost all these systems, of necessity, concern
themselves with the three aspects of syntax, semantics, and fact retrieval.
In the syntax, the sentence is analyzed to obtain its grammatical structure;
the semantics determines which of several possible meanings is most relevant
in the given case; and the fact retrieval portion actually does the work that
is required. This last aspect becomes related to the file structure problem.
If we assume that the information stored is well structured but sufficiently
general to be capable of being used to answer a number of questions, then
its method of storage and retrieval becomes a significant problem. On the
other hand, some of the systems use English text as a data base from which
to find answers. Naturally, the flexibility of the English language input is
quite significant. Some of the systems, e.g., STUDENT (see Bobrow [BB64],
[BB64c]), operate primarily on recognizing key words. Those mentioned
later perform grammatical analysis to varying levels of complexity. Those
readers who are particularly interested in this aspect of the query language
problem will find additional useful references in Section X.5.
File Generation
GENERATE
DIG
ANALYZE
3. 473L Query
Another system with similar principles but which allows more com-
plicated (although still formally defined) sentences is the query language
developed for the Air Force 473L system. A typical statement in this system
666 sPECIALIZED LANGUAGES
is the following:
Punctuation
‘xe []:,
=#><
7 Lo () ?
Key Words
ALL PUNCH
AND READ
ANY RETAIN
BY RETRIEVE
CARDS RN (Retained File Number)
DECR (Decreasing) SAME
GCD (Great Circle Distance) SAVE
GET SUM
GREATEST TAPE
H (Horizontal) THEN
INCR (Increasing) TITLE
LEAST TOTAL
LIST TRANSFER
MAX UPDATE
MIN V (Vertical)
OR WITH
PRINT
Figure IX-46. Punctuation characters and key words in 473L Query language.
Source: Barlow and Cease [BL65], extracts from pp. 81-86. Reprinted from
INFORMATION SYSTEM SCIENCES: Proceedings of the Second Con-
gress, Ed. by Joseph Spiegel and Donald E. Walker, Spartan Books, 1964.
4. ADAM
and
would be transformed to
5. BASEBALL
The input sentences are restricted to single clauses and do not permit
logical connectives such as and and or. Relation words such as most or highest
are also not permitted.
BASEBALL is programmed in IPL-V (see Section VI.3) and organizes
the data into list structures. The first part of the program uses a dictionary,
parsing routines and semantic analysis routines to translate the input ques-
tion into a specification list similar in format to that of the data. This
permits retrieval of the answers.
6. DEACON
DEACON (Direct English Access and COMtrol) has been under devel-
opment at GE TEMPO since at least 1963. Some of the allowable state-
ments in DEACON strongly resemble those in the systems discussed earlier,
but that 1s because they are related to military subjects rather than because
of their structure, which is far more general. In systems such as COLINGO
1X.3.2.7. PROTOSYNTHEX 669
and the 473L Query Language, the languages are definitely artificial with
limited or no syntactic flexibility, whereas DEACON actually uses linguistic
techniques to analyze sentences which are far more complex, e.g.,
7. Protosynthex
The smallest unit with the greatest intersection with these words is then
found, where some weighting is applied to certain words in the search.
The highest scoring units are selected and then both the question and the
proposed answer are parsed to make sure that the structures are the same.
An example of input data, questions, and answers is given in Figure
1X-47.
8. AESOP
GET WEAP-DATA
GET - TABULAR
[ + TREE
> FILE MANIP
- ERASE
FILENAME - COPY
EOM EOM -
ERASE MESSAGE
ALL \
ALLPROPS
GET filename objectspec ERASE
OBJECTNAME
propertylist
LINE) # BEFORE
GET filename INSERT {umes} #—-#F# \areR \ #
——" ##HF... -—
672
Figure [X-49, (cont.)
oO
GET filename objectspec SWAP (Sor 5} propertyname AND propertyname
oO
. . COL . BEFORE
GET filename objectspec INSERT {esr} propertylist \aeee \
propertyname
COPY MESSAGE
COPY FROM filename (objectspec)
‘Fecerea
—_ propertylist
ALLPROPS
INTO filename (objectspec) {
oer
COPY WITH OBJECTNAMES FROM filename (objectspec)
INTO filename (objectspec)
ALLPROPS
COPY WITH OBJECTNAMES FROM filename (objectspec) {
ee}
ALLPROPS
INTO filename (objectspec) {
oe
ALLPROPS
COPY WITH PROPNAMES FROM filename (objectspec) {
rere
ALLPROPS
INTO filename (objectspec) {
er |
OBJECTNAMES AND PROPNAMES
—_________ —___ —__________—. FR fil
cory win | PROPNAMES AND OEECTNAMES| FROM filename
ALLPROPS | ALLPROPS \
(objectspec) | INTO filename (objectspec)
propertylist propertylist
MISCELLANEOUS MESSAGES
DATE dd—dd
SAVE
673
674 SsPECIALIZED LANGUAGES
top of the screen. The variable positions of these messages are filled in by
using the light pen to select data from other parts of the screen. Any reader
interested in more details on this system will find an excellent set of figures
of many screen displays in the paper by Summers and Bennett [UT67].
The language used for input from a typewriter is shown in Figure [X-49.
1. GRAF
include POINT, LINE, PLACE, CHAR, and PRINT, each of which has a value
which is a string of graphic orders, e.g., LINE(X, Y) generates orders for
plotting a line. A display expression is a sequence of display variables and
display functions separated by plus signs; its value is the string of graphic
orders obtained by concatenating the values from left to right, e.g.,
BOX = PLACE (xX, Y)+LINE(U, Y)+LINE(U, V)+LINE(X, Y). An assignment state-
ment can be used to give a value to a display variable. The functions PLOT
and UNPLOT, respectively, transmit or remove the values of the statement
arguments to the device buffer. A cursor can be set in a display variable by
the SETCUR subroutine and removed by RMVCUR. Other functions are
available. A sample program is shown in Figure [X-50. This system was
implemented on the IBM System/360 using FORTRAN CE level).
Definition
t POINT/NAME/X,Y/OP where OP =N for NAME, and
+ LINE/NAME/PTI/PT2 T for TEXT
ARC/NAME/PT1/PT2/PT3
PARC/NAME/F/V/PT1/PT2
EARC/NAME/F1/F2/PT1/PT2
Manipulation (level 1)
+ COIN/PTI/PT2
+ MERGE/PTI/PT2
+ COPY/NAME/L/PT
+ INTPT/NAME/L/X,Y
SPIN/L1/L2/PT/DEGREE
Transformation
tT MOVE/NAME/OP/PT/QUAL where OP = P for point
+ ROTATE/NAME/OP/PT/DEGREE/QUAL N for node
+ SCALE/NAME/OP/PT/DEGREE,XX,YY/QUAL S for subpicture
D for display, .e.,
the screen level
picture
Control
+ CLEAR
f DELETE/NAME/OP/QUAL where OP =P for point
+ ASSIGN/NAME/NODEI/ .../NODEn N for node
+ USE/NAME/QUAL L for line
tT SHOW/NAME S for subpicture
t LOCATE/X,Y; ENDLOC U for uniformly
+ TEXT/PT/OP1/H/W/OP2/---...$---...-$..-$$ | where OPT = TL for top left
TR for top right
BL for bottom left
BR for bottom right
OP2 L for left
R for right
+Those primitives included in the present version [see source] of PENCIL are identified byt. This set
provides all basic capabilities, including hierarchical assembly of pictures.
} |
an <3
\
4
XTRANS PROC BUFIN POINT/IN3/=—48,=0
CLEAR LINE/L1/P1/P3
USE/DIODE/1 LINE/L2/P3/P5
USE/DIODE/2 LINE/L3/P5/P4
USE/DIODE/3 LINE/L4/P4/P6
USE/RESIS/4 LINE/L5/P7/P8
USE/RESIS/5 POINT/P10/=15,=0
USE/RESIS/6 LINE/L6/P8/P10
USE/RESIS/7 LINE/L7/P10/P9
USE/TRANS/8 MOVE/DQ1/N/P1/1
USE/CAPAC/9 MOVE/DQ2/N/P2/2
USE/GROUND/11 MOVE/DQ3/N/P3/3
POINT /P1/==—21,=24 MOVE/A4/N/P3/4
POINT /P2/=—21,=12 MOVE/A5/N/P9/5
POINT /P3/=—21,=0 MOVE/D28/N/P9/8
POINT /P4/==—15,==12 MOVE/B6/N/C8/6
POINT/P5/=—15,=0 ROTATE/RESIS/S/A7/=90./7
POINT /P6/==/—12,==12 MOVE/A7/N/P5/7
POINT/P7/=12,==12 MOVE/D29/N/P6/9
POINT/P8/==15,=12 MOVE/A11/N/D8/11
POINT/P9/=21,=0 ASSIGN /BUFIN/IN1 /IN2/IN3/OUT
POINT/OUT/=57,=12 END
POINT/IN1 /=—48,==24 XBEGIN
POINT/IN2/= —48,=12
676
1X.3.3.3. GRAPHIC LANGUAGE 677
2. PENCIL
3. Graphic Language
request, and a few miscellaneous items. Some of the facilities available under
the plot request include DRAW LEAST SQUARES LINE, DRAW LINE
BETWEEN THE POINTS, HORIZONTAL MAXIMUM FROM DATA, VERTICAL
MINIMUM FROM DATA, and SAME HORIZONTAL MAXIMUM. Some of
the optional specifications available to the user include the following:
NUMBER OF HORIZONTAL INTERVALS, DRAW ALL AXES, DRAW
HORIZONTAL AXIS, NUMBER OF PERPENDICULAR INTERVALS, SUPPRESS
PLOT OUTPUT, and SAME PERPENDICULAR SCALE. In order to combine
these facilities with calculations which might be required, the user is permit-
ted to include a breakout character which allows him to use whatever other
language he wants. Figure IX-53 shows an example of a program written
in this language, assuming FORTRAN as the “other” language.
4. DOCUS
1. General
structure and CORAL (see Section VI.9.3.2), have somewhat wider impli-
cations than that of computer-aided design. On the other hand, much of
the work done at the General Motors Laboratories to provide computer aid
to designers has little or nothing to do with languages as such; the primary
concern is with the types of items that the user can display on a screen and
change by operating with a light pen.'®
From a purely language point of view, the only major system in this
field (aside from possible consideration of the specialized list systems just
mentioned) is the AED work at M.L.T.
2. AED
'6 See Proc. FJCC (1964) for a number of articles describing this system.
1X.3.4.2. AED 681
Y=Z+(Z=A +B)
(causing the value of Y to become 2(A + B)), and valued blocks of the general
form
INTEGER BEGIN... END
of AED usage depends heavily upon these packages, several of which inter-
lock directly with the compiled features of the language itself. For example,
an ISARG package permits the use of optional arguments in procedure
calls; the DOIT package permits procedure names to be stored in and
executed from data structures, including dynamic loading so that program
control and data structures are interlocked (enabling generalizations of such
techniques as coroutines to be easily performed); the GENCAL package
permits dynamic compilation of molecular procedure calls at run time.
Various techniques for using these features, in combination with the ability
to nest procedure definitions and declare procedures separately from their
definitions, permit many sophisticated control structures such as multientry
procedures to be developed. Other packages provide facilities for system
building. The RWORD package gives sophisticated free-format input and
the ASMBL package gives free-format output of character streams; the
generalized string package creates and manipulates arbitrary string structures
of arbitrary elements in any combination, including ordered and unordered
uni- or multidirectional lists and rings, stacks, queues, hash-coded tables,
or other more elaborate specialized data structures; the JOBCP (input/output
buffer control package) provides a uniform operating system interface for
word- and character-oriented files for arbitrary storage or input/output
devices, including control of logical and physical records, buffering, and
timing; the delayed merge package and the generalized alarm package permit
segmentation of large program actions, including alteration of control and
a wide spectrum of error-handling facilities. Although many of these pack-
ages are more closely related to software design than language, their use is
so integral with the direct linguistic features of AED-O that they form a
significant part of the pragmatics of AED-O0 as a language.
The pragmatics of AED are completed by referring to Figure IX-55,
which indicates the lexical, parsing, modeling, and analysis phases of a system
constructed according to the AED philosophy (see Ross [RD67a]), using
the machine and language independent AED-1| compiler as an example.
(Initially that compiler processed the AED-0 language and there was no
specific AED-1 language.) The RWORD system constructs a finite-state
machine lexical processor in accordance with item descriptions expressed
in the language of regular expressions; the AEDJR system (a syntax-driven
parser based on Ross’s algorithmic theory of language {[RD62]) constructs
tables for parsing a specified language; and the modeling and analysis
phases (shown in Figure IX-55 for the special case of program compilation),
may also be set up to handle specialized problem-oriented languages, though
not yet in as systematic a fashion as the other phases. Because of the inter-
relationships of the elements in the compiling process, it 1s easy to inter-
mingle graphical elements (e.g., push buttons and light pen responses at a
1X.3.4.2, AED 683
AED-O
AED-O Item Language Machine and Listing Machine-Code
Descriptions Definition Description Macros
AED-O Binary
Program | ltem—Builder _|First-Pass _ | Second-Pass ela bI Program
" Machine" ™| Algorithm | & | Algorithm ssemdler -——————>-
Character String AED-O Item String First-Pass Structure Symbolic Program
Delete and close from the fifth paragraph through the second occurrence of a
paragraph beginning with the name "Alice".
Delete and close the expression ''and then unrolled the parchment scroll".
Delete ‘she made some tarts. All on a”.
Insert “and precisely’ before the fourth line in the eighth paragraph.
Run on the first paragraph.
Start a new line with the last sentence in the seventeenth paragraph.
Start a new paragraph with the last two words in the fourth line of the seventh
paragraph.
Start a new page with the paragraph ending with the expression ‘'the king”.
Indent the second sentence in the eighth paragraph.
Start a new line with the fourth word in the twentieth paragraph.
Exchange the last four words in the second line of the sixth paragraph with the first
two words in the paragraph ending in the word ‘'talking”.
Exchange the eighth occurrence of the word ‘King’ with the word "Hatter" in the
twenty-first paragraph.
Exchange the word ‘Hatter’ with the word king” in the twenty-third paragragh.
Exchange the tenth paragraph through the paragraph ending in ‘away’ with the
thirteenth paragraph.
Exchange "''Not yet, not yet!'"’ with ‘the Rabbit hastily interrupted."’.
Replace the word ''the’’ +f
in the thirteenth paragraph with ‘'The”.
Replace in the thirteenth paragraph with ".
Instruc- Instruc-
tiont Meaning tiont Meaning
a Automatic mode t Transmit message
as Automatic mode—suppress space u Uncontrolled mode
between paragraphs uc Line centering mode
c Clear working storage + Additional line request
d Delete permanent storage if Form letter mode
e Erase lines and/or units Ig Storage report
f Footing mode Ip Page numbering begins’ with
9 Get document from permanent number following p
storage Ir Reprint action
h Heading mode I-t---+ Tab settings
i Insert Inumber Number of lines to be printed
i Justify (printout) per page
jn Justify with unit numbers tO Transmit to customer assistance
m Message retrieval terminal
n Request for next unit number t96 Transmit to upper- and lower-
p Print case printer
po Print as entered t97 Transmit to tape from working
pOn Print as entered with unit num- storage
bers t98 Transmit to printer
pn Print with unit numbers t99 Transmit to card punch
s Store in permanent storage
a
AUTOMATIC MODE
110
jn65
DBL ATTN EA PAGE
This book was typed using ATS andI am now merely 3
demonstrating some of the facilities that it has. Soppose I mkae 4
an error leave out a word. I will make the corrections and also 5
insert a sentence.
4 Soppose Suppose
Suppose I mkae an error leave out a word.
i4
Suppose I make an error
jn65
DBL ATTN EA PAGE
This book was typed using ATS and I am now merely
demonstrating some of the facilities that it has. Suppose I make
On&
Another way to consider this problem is to say that this control lan-
guage should be, to the largest extent possible, the same as the actual lan-
guage used to write the solutions to problems. This means that whenever
the same functional capabilities are needed (e.g., input/output, tests, and
obtaining data), the syntax should be the same as the problem language.
Space does not permit a detailed description of the various types of
commands that exist in operating and on-line systems. It will be more
useful to provide general principles with specific illustrations and let the
user draw on his own experience.
In considering the on-line systems, we must distinguish carefully be-
tween those which are general purpose and those which are dedicated to
one, or at most, a few specific activities. In the first category exist the
Project MAC system (CTSS) at M.I.T. (Crisman [ZR65]) and the time-
sharing system at the System Development Corporation (Coffman,
Schwartz, and Weissman [CO64]). In the second category are those systems
described in Section IV.6, plus a few scattered others. In all these systems
there is a provision for some type of sign in (usually a LOGIN command)
and some type of sign off (e.g., LOGOUT). These serve the purpose of
identifying the user and permitting the necessary accounting to take place.
In the general purpose system with several higher level language com-
pilers available, it becomes necessary to specify in some way what the
specific task is that the user wishes done. For example, he may want to type
ina FORTRAN program and have it compiled, or he may wish to retrieve
from some storage area a program (in another language) he had been working
on, change it, and then have it compiled and executed. This type of facility
is usually provided by specifying the exact name of the language involved
(e.g., in CTSS the user wrote mad in order to cause compilation of a MAD
program). Editing facilities are strongly required, both for changing indi-
vidual lines and for modifying large units of information. For example,
when the user is typing in, he must have some immediate way to correct
a typing error; this is usually handled by striking a special key which
indicates where the error is, or how far back to go, and then permits retyping.
On a larger level, it is often necessary (and, in fact, one of the valuable
features of an on-line system) to insert, delete, or change individual lines or
portions of a program. Thus there is a need for specific commands which
can perform editing either by accessing numbered lines or by context. In
the former case, the system is usually supplying specific line numbers as
the user types in his program. In the latter, the user wants to say something
like change the + in A + B to —. A more likely notation might be
chA+BA—B
~
5/17/63 DPFA SYMTB P
5/17/63 DPFA BSS P 1
5/17/63 DPFA FAP P
READY.
input
WAIT,
00010 entry recoup
00020 recoup tra *+1
00030 cal 1,4
00040 sto recoup
00050 trs 2,4
00060 end
00070 1
MAN. 40 sta recoup
MAN. file subr fap
WAIT,
READY.
fap subr
WAIT,
Oo 00005 .000 00 4 00002 TRS 2,4 00000050
00006 FIRST LOCATION NOT USED
FAILED
READY.
start
WAIT,
FILE TEST DATA NOT FOUND.
NO ERROR RETURN SPECIFIED
READY.
pm lights
WAIT,
PROG SEEK STOP= 112 REL., 14273 ABS. TSX 007400414161
AC = 000014000000, S =0, Q =0 MQ = 000010000000 SI = 400004000000
IxXl = 2 IX2 = 14 1X4 = 63505 SENSE LIGHTS ON 4
FPT ON ,DCT OFF, ACOF OFF
READY,
save may27
WAIT,
READY.
listf
WAIT,
16 FILES 66 TRACKS USED
DATE NAME MODE NO. TRACKS
5/27/63 MAY27 SAVED Pp 31
5/27/63 MAIN BSS P 3
5/27/63 MAIN MADTAB # QUIT,
READY.
logout
WAIT,
M141G 1591 LOGGED OUT 5/27 1140.3
TOTAL TIME USED= 01.6 MIN.
READY.
Figure IX-60. Sample of actual CTSS session. The user types in lower case
and the computer responds in upper case.
Source: Corbato [ZV63], pp. 89-91.
690
1X.3.6. CONTROL LANGUAGES FOR ON-LINE AND OPERATING SYSTEMS 691]
concatenation, with commands for these and other operations, e.g., INSERT,
EXTRACT, CONCAT, LIST, ERASE, COPY, STORE, DELETE, COMPILE,
SAVECOMP, TRANSFORM, and INCLUDE.
The concept whereby people enter jobs at a terminal but expect them
to be executed at some future time, presumably in a batch environment or
as background, is becoming increasingly important. The terms remote job
entry (RJE) or foreground initiated background (FIB) are often used; regard-
less of the term, the user has entered information from a terminal but is
not waiting for instantaneous response.
At least two different systems (see Pyle [PY65] and Bequaert [BV67])
have a hazy border line between the actual problem language and the
means of communication with the specific system. In both cases, the system
asks the user for information rather than having the user supply it directly.
For example, in Pyle’s QUIN system, the user replies in lower case to the
upper-case system query:!?
When the on-line system involves the use of graphic display, then some
differing types of control functions are either needed or useful. The ability
to point with a light pen rather than type in information provides a different
framework within which to work. Relevant examples are given in Section
IX.3.3.
Turning now from the subject of on-line systems, let us consider a
complex operating system such as that for the IBM System/360 (OS/360).
The Job Control Language (JCL) is the method by which the user communi-
cates with the operating system. It provides him with facilities for retrieving
data sets of varying kinds and optimizing the use of input/output equipment,
as well as the basic requirement for specifying just what is to be done with
the program. There are six types of statements involved in JCL: job, ex-
ecute, data definition, command, delimiter, and null. The general format for
the first four of these statements is
where the name is optional in some cases. The operation codes for the first
three statement types are JOB, EXEC, and DD. Some of the parameters can
appear in an arbitrary order. The purpose of JOB is to identify the job and
the user. A COND parameter permits the user to test the completion of
previous jobs and use this to control what is to happen next; this is done
by means of a code number returned by the operating system and tests
REFERENCES
IX.2.2.1. COGO
{[EI67] Engineer’s Guide to ICES COGO I (first edition), M.1.T., R67-46, Dept.
of Civil Engineering, Cambridge, Mass. (Aug. 1967).
[RS64] Roos, D. and Miller, C. L., COGO-90: An Engineering User’s Manual,
Dept. of Civil Engineering, Research Report R64-12, M.I.T., Cam-
bridge, Mass. (Apr., 1964).
TX.2.2.2. STRESS
IX.2.2.3. ICES
[X.2.3.2. LOTIS
[QY 64] Schlaeppi, H. P., “A Formal Language for Describing Machine Logic,
Timing, and Sequencing (LOTIS)”, JEEE Trans. Elec. Comp., Vol.
EC-13, No. 4 (Aug., 1964), pp. 439-48.
[X.2.3.3. LDT
[MX66] Metze, G., and Seshu, S., “A Proposal for a Computer Compiler”,
Proc. SJCC, Vol. 28 (1966), pp. 253-63.
[X.2.3.7. SFD-ALGOL
1X.2.4.1. Introduction
IX.2.4.2. DYANA
IX.2.4.3. DYSAC
IX.2.4.4. DAS
[GL63] Gaskill, R. A., Harris, J.W., and McKnight, A. L., “DAS—A Digital
Analog Simulator”, Proc. SJCC, Vol. 23 (1963), pp. 83-90.
[GL64] Gaskill, R.A., “A Versatile Problem-Oriented Language for Engi-
neers”, JEEE Trans. Elec. Comp., Vol. EC-13, No. 4 (Aug., 1964),
pp. 415-21.
IX.2.4.5. DSL/90
[QP66] Syn, W. M. and Linebarger, R. N., “DSL/90—A Digital Simulation
Program for Continuous System Modeling”, Proc. SJCC, Vol. 28
(1966), pp. 165-87.
1X.2.5.1. Introduction
[CH64] Cheatham, T.E., Jr. and Sattley, K., “Syntax Directed Compiling”,
Proc. SJCC, Vol. 25 (1964), pp. 31-57. (Also in [RO67].)
(FJ68] Feldman, J. A. and Gries, D., “Translator Writing Systems”, Comm.
ACM, Vol. 11, No. 2, (Feb., 1968), pp. 77-113.
[FL64] Floyd, R.W., “The Syntax of Programming Languages—A Survey”,
IEEE Trans. Elec. Comp., Vol. EC-13, No. 4 (Aug., 1964), pp. 346-53.
(Also in [RO67].)
[GC60] Glennie, A. E., On the Syntax Machine and the Construction of a Uni-
versal Compiler, Tech. Report No. 2, Carnegie Inst. of Tech. Com-
putation Center (AD-240512) (July, 1960).
[GW64a] Garwick, J. V., “GARGOYLE, A Language for Compiler Writing”,
Comm. ACM, Vol. 7, No. 1 (Jan., 1964), pp. 16-20.
[IC6é2b] “Panel Discussion: Languages for Aiding Compiler Writing”, Sym-
bolic Languages in Data Processing. Gordon and Breach, New York,
1962, pp. 187-203.
[IR61] Irons, E. T., “A Syntax Directed Compiler for ALGOL 60”, Comm.
ACM, Vol. 4, No. 1 (Jan., 1961), pp. 51-55. (Also in [RO67].)
[IR63] Irons, E. T., “The Structure and Use of the Syntax Directed Compiler”,
Annual Review in Automatic Programming, Vol. 3 (R. Goodman, ed.).
Pergamon Press, New York, 1963, pp. 207-28.
[PT66] Pratt, T. W. and Lindsay, R.K., “A Processor-Building System for
Experimental Programming Languages”, Proc. FJCC, Vol. 29 (1966),
pp. 613-21.
[QS61] Sibley, R. A., “The SLANG System”, Comm. ACM, Vol. 4, No. 1 (Jan.,
1961), pp. 75-84.
[RO64] Rosen, S., “A Compiler-Building System Developed by Brooker and
Morris”, Comm. ACM, Vol. 7, No. 7 (July, 1964), pp. 403-14. (Also
in [RO67].)
[X.2.5.2. CLIP
[BO60] Book, E. and Bratman, H., Using Compilers to Build Compilers, System
Development Corp., SP-176, Santa Monica, Calif. (Aug., 1960).
{[BR59] Bratman, H., Project CLIP (The Design of a Compiler and Language
for Information Processing), System Development Corp., SP-106, Santa
Monica, Calif. (Sept., 1959).
[EG61] Englund, D. and Clark, E., “The CLIP Translator’, Comm. ACM,
Vol. 4, No. | VJJan., 1961), pp. 19-22.
[1S59] Isbitz, H.M., CLIP: A Compiler Language for Information Processing,
System Development Corp., SP-117, Santa Monica, Calif. (Oct., 1959).
[X.2.5.3. TMG
[X.2.5.4. COGENT
[RE65] Reynolds, J. C.. COGENT Programming Manual, Argonne Nat’! Lab.,
ANL-7022, Argonne, II]. (Mar., 1965).
698 sPECIALIZED LANGUAGES
TX.2.5.5. META 5
[OP66] Oppenheim, D. K. and Haggerty, D.P., “META 5: A _ Tool to
Manipulate Strings of Data”, Proc. ACM 2Ist Nat'l Conf., 1966,
pp. 465-68.
[QT64] Schorre, D. V., “META-II—A Syntax-Oriented Compiler Writing Lan-
guage”, Proc. ACM 19th Nat’! Conf., 1964, pp. D1.3-1-D1.3-11.
[QV64] Schneider, F. W. and Johnson, G. D., “META-3—A Syntax-Directed
Compiler-Writing Compiler to Generate Efficient Code”, Proc. ACM
19th Nat’l Conf., 1964, pp. D1.5-1-D1.5-8.
1X.2.5.6. TRANDIR
IX.2.5.7. FSL
IX.2.6. MISCELLANEOUS
TX.3.1.1. Introduction
[JM67] Jones, M. M., “On-Line Simulation”, Proc. ACM 22nd Nat’l Conf.,
1967, pp. 591-99.
[KQ67] Krasnow, H.S., “Computer Languages for System Simulation”,
Digital Computer User’s Handbook (M. Klerer and G. A. Korn, eds.).
McGraw-Hill, New York, 1967, pp. 1-258—-1-277.
[KW66] Kiviat, P. J., “Development of New Digital Simulation Languages”,
Jour. Ind. Eng., Vol. XVII, No. 11 (Nov., 1966), pp. 604-609.
[RP67] Reitman, J., “The User of Simulation Languages—The Forgotten Man”,
Proc. ACM 22nd Nat’! Conf., 1967, pp. 573-79.
[TE66] Teichroew, D. and Lubin, J. F., “Computer Simulation—Discussion of
the Technique and Comparison of Languages”, Comm. ACM, Vol. 9,
No. 10 (Oct., 1966), pp. 723-41.
[X.3.1.2. DYNAMO
[PG63] Pugh, A. L., DYNAMO User’s Manual (2nd ed.). M.1.T. Press, Cam-
bridge, Mass., May, 1963.
700 = sPECIALIZED LANGUAGES
[X.3.1.3. GPSS
[X.3.1.4. SIMSCRIPT
1X.3.1.5. SOL
[X.3.1.6. MILITRAN
[X.3.1.7. SIMULA
1X.3.1.8. OPS
[JM67] Jones, M. M., “On-Line Simulation”, Proc. ACM 22nd Nat?’l Conf,
1967, pp. 591-99.
[Y P65} Greenberger, M. et al., On-line Computation and Simulation: The
OPS-3 System. M.1.T. Press, Cambridge, Mass., 1965.
[Y P66} Greenberger, M. and Jones, M. M., “On-Line Simulation in the OPS
System”, Proc. ACM 2Ist Nat'l Conf., 1966, pp. 131-38.
TX.3.2. QUERY
[X.3.2.1. Introduction
[QZ67] Steil, G. P., Jr., “File Management on a Small Computer: The C-10
System”, Proc. SJCC, Vol. 30 (1967), pp. 199-212.
[SZ65] Spitzer, J. F., Robertson, J. G., and Neuse, D. H., “The COLINGO
System Design Philosophy”, Information System Sciences: Proceedings
of the Second Congress. Spartan Books, Washington, D.C., 1965,
pp. 33-47.
REFERENCES 703
TX.3.2.4. ADAM
[CY 66] Connors, T. L., “ADAM—A Generalized Data Management System”,
Proc. SJICC, Vol. 28 (1966), pp. 193-203.
1X.3.2.5. BASEBALL
[GB61] Green, B. F., et al., “BASEBALL: An Automatic Question-Answer”,
Proc. WICC, Vol. 19 (1961), pp. 219-24. (Also in [FG63].)
IX.3.2.6. DEACON
[CJ64] Craig, J. A., Pruett, J., and Thompson, F., DEACON Breadboard
Grammar, General Electric Co., RM64TMP-14, TEMPO, Santa
Barbara, Calif. (1964).
[CJ66] Craig, J. A., et al., “DEACON: Direct English Access and COMtrol”,
Proc. FJCC, Vol. 29 (1966), pp. 365-80.
[TH63] Thompson, F. B., The Semantic Interface in Man-Machine Communi-
cations, General Electric Co., RM63TMP-35, TEMPO, Santa Barbara,
Calif. (1963).
[TH64] Thompson, F.B. et al., DEACON Breadboard Summary, General
Electric Co., RM64TMP-9, TEMPO, Santa Barbara, Calif. (1964).
(TH64a] Thompson, F. B., The Application and Implementation of DEACON
Type Systems, General Electric Co., RM64TMP-11, TEMPO, Santa
Barbara, Calif. (1964).
[TH66] Thompson, F. B., “English for the Computer”, Proc. FJCC, Vol. 29
(1966), pp. 349-56.
IX.3.2.7. Protosynthex
[SE63] Simmons, R. F. and McConlogue, K. L., “Maximum-Depth Indexing
for Computer Retrieval of English Language Data”, Amer. Documen-
tation, Vol. 14, No. 1 (1963), pp. 68-73.
[SE64] Simmons, R. F., Klein, S., and McConlogue, K. L., “Indexing and
Dependency Logic for Answering English Questions”, Amer. Documen-
tation, Vol. 15, No. 3 (1964), pp. 196-204.
[SE65] Simmons, R.F., “Answering English Questions by Computer: A
Survey”, Comm. ACM, Vol. 8, No. 1 (Jan., 1965), pp. 53-69.
1X.3.2.8. AESOP
[QA65] Bennett, E., Haines, E.C., Jr., and Summers, J. K., “AESOP: A
Prototype for On-Line User Control of Organizational Data Storage,
Retrieval and Processing”, Proc. FJCC, Vol. 27, pt. 1 (1965), pp. 435-55.
704 sPECIALIZED LANGUAGES
IX.3. 3. GRAPHICS
IX.3.3.1. GRAF
[HW67] Hurwitz, A., Citron, J. P., and Yeaton, J. B., “GRAF: Graphic Addi-
tions to FORTRAN”, Proc. SJCC, Vol. 30 (1967), pp. 553-57.
IX.3.3.2. PENCIL
[VD67] Van Dam, A. and Evans, D., “A Compact Data Structure for Storing,
Retrieving and Manipulating Line Drawings”, Proc. SJCC, Vol. 30
(1967), pp. 601-610.
[WP67] Wexelblat, R. L. and Freedman, H.A., “The MULTILANG On-line
Programming System”, Proc. SJCC, Vol. 30 (1967), pp. 559-69.
[X.3.3.4. DOCUS
[CF66] Corbin, H.S. and Frank, W. L., “Display Oriented Computer Usage
System”, Proc. ACM 2Ist Nat’l Conf., 1966, pp. 515-26.
REFERENCES 705
1X.3.4.1. General
[JG67] Gray, J. C., “Compound Data Structure for Computer Aided Design;
A Survey”, Proc. ACM 22nd Nat’l Conf., 1967, pp. 355-65.
[QW63] Sutherland, I. E., Sketchpad: A Man-Machine Graphical Communi-
cation System, M.1.T. Lincoln Lab., Tech. Report No. 296, Lexington,
Mass. (Jan., 1963).
[UU63] Stotz, R.H., “Man-Machine Console Facilities for Computer-Aided
Design”, Proc. SJCC, Vol. 23 (1963), pp. 323-28.
1X.3.4.2. AED
[LB65] Lapin, R. B., Ross, D. T. and Wise, R. B., Some Experiments with an
Algorithmic Graphical Language, M.1.T., ESL-TM-220, Electronic
Systems Lab., Cambridge, Mass. (Aug., 1965).
[LB67] Lapin, R. B., Translation Between Artificial Programming Languages,
M.I.T., ESL-R-306, Electronic Systems Lab., Cambridge, Mass. (Apr.,
1967).
[MT00a] AED Kit, (unpublished).
[RD61] Ross, D. T., “A Generalized Technique for Symbol Manipulation and
Numerical Calculation”, Comm. ACM, Vol. 4, No. 3 (Mar., 1961),
pp. 147-50.
[RD62] Ross, D. T., An Algorithmic Theory of Language, M.1.T., ESL-TM-156,
Electronic Systems Lab., Cambridge, Mass. (Nov., 1962).
[RD63] Ross, D. T. and Rodriguez, J. E., “Theoretical Foundations for the
Computer-Aided Design System”, Proc. SJCC, Vol. 23 (1963), pp.
305-322.
[RD67] Ross, D. T., “The AED Free Storage Package”, Comm. ACM, Vol. 10,
No. 8 (Aug., 1967), pp. 481-92.
[RD67a] Ross, D. T., “The Automated Engineering Design (AED) Approach
to Generalized Computer-Aided Design”, Proc. ACM 22nd Nat?’l
Conf., 1967, pp. 367-85.
[Y W66] Wolman, B.L., “Operators for Manipulating Language Structures”,
(summary only), Comm. ACM, Vol. 8, No. 9 (Aug., 1966), pp. 553-54.
[AU67] Auroux, A., Bellino, J., and Bolliet, L., “DIAMAG: A Multi-Access
System for On-Line ALGOL Programming”, Proc. SJCC, Vol. 30
(1967), pp. 547-52.
[BV67] Bequaert, F.C., “RPL: A Data Reduction Language”, Proc. SJCC,
Vol. 30 (1967), pp. 571-75.
[C064] Coffman, E. G., Jr., Schwartz, J. I., and Weissman, C., “A General-
Purpose Time-Sharing System”, Proc. SJCC, Vol. 25 (1964), pp. 397-411.
[FZ67] Feingold, S.L., “PLANIT: A Flexible Language Designed for Com-
puter-Human Interaction”, Proc. FJCC, Vol. 31 (1967), pp. 545-52.
[GQ67] Gross, L. N., On-Line Programming System User’s Manual, MITRE
Corp., MTP-59, Bedford, Mass. (Mar., 1967).
[I1B67g] IBM System/360 Operating System Job Control Language, 1BM Corp.,
C28-6539-4, Data Processing Division, White Plains, N.Y. (Mar. 1967).
[PY65] Pyle, I.C., “Data Input by Question and Answer”, Comm. ACM,
Vol. 8, No. 4 (Apr., 1965), pp. 223-26.
[ZV62] Corbato, F. J.. Merwin-Daggett, M., and Daley, R.C., “An Experi-
mental Time-Sharing System”, Proc. SJCC, Vol. 21 (1962), pp. 335-44.
[ZV63] Corbato, F. J. et al., The Compatible Time-Sharing System, A Program-
mer’s Guide. M.1.T. Press, Cambridge, Mass., 1963.
x SIGNIFICANT UNIMPLEMENTED
CONCEPTS
This very short chapter serves the purpose of providing a space for a few
ideas that either have not been mentioned in any earlier chapter or, alterna-
tively, deserve somewhat more attention in a more general content.
It was stated in the preface to this book that only languages which had
been implemented were going to be described. The reason for this restriction
is that the number of proposed languages is probably at least as great as
those already in existence, if one considers significant additions to existing
languages as new ones. In spite of this previous stipulation, there are several
ideas, concepts, or unimplemented languages (the term depends on your
viewpoint) which have been around for differing lengths of time and which
seem to be of greater than average importance or interest. Whether any of
these can or ever will come into practical existence is highly questionable;
they are currently of theoretical interest only but it seems essential that the
concepts at least be recorded. Clearly, my personal biases and interests show
through strongly here.
Brief sections are devoted to (1) one of the earliest—but still unsolved
—problems, namely that of a Universal Computer-Oriented Language to
bridge the gap between higher level languages and machine code; (2) a
theoretical approach to data processing, the Information Algebra; (3) the
programming language of Iverson, beyond the implemented subset in Section
IV.6.8; (4) the use of English as a programming language; and (5) attempts
to consider building hardware to accept higher level languages directly.
707
708 SIGNIFICANT UNIMPLEMENTED CONCEPTS
X.2. UNCOL
Languages Machines
L, M,
Lo Mo
mN LO, M3
UNCOL
L4— oom May
Ly Mu
this language would then be available on all computers because the UNCOL
machine program existed. Similarly, if a new computer were developed,
it would only be necessary to write the second half of the compiler, namely
the UNCOL-to-machine-language translator. These first and second halves
could be joined together in any appropriate fashion. This concept is de-
scribed in great detail in the referenced papers by Strong et al. [QR58] and
[QR58a]. Unfortunately, in my opinion, the people proposing this concept
(which I think is a valid one) did a disservice in proposing the word generator
to mean the first half of the compiler and translator to mean the second half.
This is contrary to the intuitive notions of these terms held by many people.
To a limited extent, people involved in writing JOVIAL compilers have
provided an intermediate language for their own use. However, since they
have a fixed front end, this is not really a useful UNCOL for a variety of
languages. A few attempts at specifying UNCOL are given in the reference
list at the end of this chapter.
Properties Value set Old pay file Daily work file New employee file New pay file
OP DW NE NP
q, = File ID PF, DW NE X X X X
(always PF) (always DW) (always NE) (always PF)
gq. = Man ID 00000 --- 99999 X xX X XxX
gq; = Name 20 alphabetic characters X Q X X
gq, = Rate 00.00 --- 99.99 X D X X
OTL
qs = Hours 00 --- 24 Q X QD Q
de = Day # 0--- 7 Q xX Q Q
Gz = Total salary 00000.00 - - - 99999.99 X Q Q X
Gg = Pay period # 00 --- 52 X Q X xX
9g = Salary 000.00 - -- 999.00 XxX Q QD X
Figure X-2. System information for payroll problem written in Information Algebra.
Items designated by © are undefined.
Source: [CC62], p. 202. By permission of Association for Computing Machinery, Inc.
X.3. INFORMATION ALGEBRA 711
might be selected are identification number, name, sex, and pay rate. A payroll
file would contain a set of values of these properties for each entity. Various
ways of grouping data must be provided and these are done through specifi-
cally defined concepts called line, area, and bundle and the definitions of
the concept of functions of lines, areas, and bundles. \n a very rough intuitive
Function of a Glump
Glumping function
Area glumped
yen of areas
NP = Filqie — 4225 H(q2, DW), OP] U Felis = 922, H(q2, DW), NE]
Bundling function
| Function of a Bundle
| |
L_Derived area for L_perived area for
old employees new employees
qo =e
Qs = lds(4s < 8) 7 1.5%95—-41 +h,
fe = SIs <— (Gs < 8) > 8]
fi =90<— (fo < 40) > 0.5 x fg — 20
Qe = ar + Ws * Goa
Fi= 498 = 4 + 1
qo = G15 * Fas
q; = PF
Fy —= 3%JW = 5 * Gu
Vas’ = dog + 1
do = 15 * Ju
The language developed by Iverson (see the various references at the end
of this chapter, with his book [[V62] as the definitive work) has been known
in public form since at least 1962 and had then been under development for
several years. It has more recently been referred to as APL (A Programming
Language), which means the language, as distinct from APL/360, which is
an implemented subset (described in Section IV.6.8.) The computer world
seems to be divided into an inside and an outside on this particular subject;
namely those who think it is the solution to all problems and those who see
no use whatsoever for it. I am not trying to evade the issue in taking a middle
ground because I can see many of the advantages and the power of this
language, while still recognizing its practical limitations. To quote Iverson,
“The language is based on a consistent unification and extension of existing
mathematical notations, and upon a systematic extension of a small set of
basic arithmetic and logical operations to vectors, matrices, and trees.”!
I think this is a very fair statement, but it overlooks what many people find
1 ([V62a], p. 345.
Operation Notation® Definition®
Scalar x
a Vector x X =X, Ky °° ', XOx-1 vX = number of components
a
a Xo Bix -1 X* = ith row vector
a . X; = jth column vector
© | Matrix « X= ; ; uX = number of rows
XV yt vX = number of columns
713
a
—
s <0 P= 0,” 22
NWO
v:i€ — i<0 23
Z<v i<xit+l] 24
Oo
s<st+l j<s 25
Co
j-GRODIO) r <k(p) 26
eek
OS
r —K(D;)
mk
—|
A
p<? J 28
mmm
©,” <p;
NO
mm
<
p; < 0; — r: k(p) 29
WY
mek
S #
r : k(p;) =|Jj/<j-! 30
&
>
v,;<1
wr
7:
Z.e€
®,1 | Input to merge; output of
I
ph
classification, i « U(m).
®,? | Output of merge; input to
classification.
p | Item positions
Legend | 2 File partitions yam.
v | Exhausted files
z | Ineligible items
s | String count.
r | Key of last recorded item.
° | Final dummy item.
i | Index of output file.
j_ | Index of input file.
714
X.5. ENGLISH 715
X.5. ENGLISH
(1) A deck of cards is given to be read in format (/3, F/0.2), one card for
each person in a certain village. The number in the first field is the person’s
age; the number in the second is his income for 1960. Following this deck
is a card with —/ in the first field; this information will be used to test
for the end of deck.
Find the average salary of the people in each 5-yr. age group, 1.e.,
0-4, 5-9, 10-14, ..., 95-99. Print out the lower age limit for each group,
i.e., 0,5, 10,...,95, the average salary for that group, and the number
of people in each group. Precautions should be taken to avoid division by
zero in case there are no people in an age group.’
(2) Determine the current in an AC circuit consisting of resistance, induc-
tance, and capacitance in series, given a number of sets of values of resis-
tance, inductance, and frequency. The current is to be determined for
a number of equally spaced values of the capacitance (which lie between
specified limits) for voltages of /.0, 1.5, 2.0, 2.5, and 3.0 volts. The equa-
tion for determining the current flowing through such a circuit 1s
E
TR? + nfl — lanfC?
where @) is meant to show one of the data levels. The verbs that they de-
scribe include define (shown as a right arrow), insert, join, and delete. Verbs
which operate on data strings as sets include intersect, union, and difference.
Normal arithmetic verbs are allowed and set and truncate are provided;
they may be modified by the adverb round. Verbs to change structure, to
do editing, and for control and conditional statements are also described.
This machine was not implemented.
In machines which permit micro-programming, there is much more
potential for this type of thing to be done. CPS (see Section IV.6.5) has a
version in which the micro-programming facility of the IBM System/360 was
used to provide more efficiency in some of the frequently used operations. A
REFERENCES 719
REFERENCES
X.2. UNCOL
[BR61] Bratman, H., “An Alternate Form of the ‘UNCOL Diagram’”, Comm.
ACM, Vol. 4, No. 3 (Mar., 1961), p. 142.
[C158] Conway, M.E., “Proposal for an UNCOL”, Comm. ACM, Vol. 1,
No. 10 (Oct., 1958), pp. 5-8.
[ST61] Steel, T. B., Jr., “UNCOL: The Myth and the Fact”, Annual Review
in Automatic Programming, Vol. 2 (R. Goodman, ed.). Pergamon Press,
New York, 1961, pp. 325-44.
[ST6la] Steel, T. B., Jr., “A First Version of UNCOL”, Proc. WJCC, Vol. 19
(1961), pp. 371-78.
[QR58] Strong, J. et al., “The Problem of Programming Communication with
Changing Machines: A Proposed Solution”, Comm. ACM, Vol. 1,
No. 8 (Aug., 1958), pp. 12-18.
[(QR58a] Strong, J. et al., “The Problem of Programming Communication with
Changing Machines: A Proposed Solution, Part 2”, Comm. ACM,
Vol. 1, No. 9 (Sept., 1958), pp. 9-16.
[1V62] Iverson, K.E., A Programming Language. John Wiley & Sons, New
York, 1962.
[IV62a] Iverson, K.E., “A Programming Language”, Proc. SJCC, Vol. 21
(1962), pp. 345-51.
[IV62b] Iverson, K, E., “A Common Language for Hardware, Software, and
Applications”, Proc. FJCC, Vol. 22 (1962), pp. 121-29.
[1V64a] Iverson, K. E., “Formalism in Programming Languages”, Comm. ACM,
Vol. 7, No. 2 (Feb., 1964), pp. 80-88.
See also entries under IV.6.8 and 1X.2.3.1.
X.5. ENGLISH
X1I.1. INTRODUCTION
Any reader who expects this chapter to provide a crystal ball which will
specifically foretell the future is doomed to disappointment. Without the
facilities of Nostradamus or more modern people with similar abilities,
it is only possible for me to extrapolate from present knowledge. Considering
the normal delay between writing and physical publication, it is highly likely
that some (although hopefully not all) of the material in this chapter will be
either irrelevant or obsolescent by the time it is actually being read. In spite
of these disclaimers, it does seem worthwhile to attempt to forecast what is
likely to be done and to indicate some purely personal opinions on what
should be done. No particular attempt is being made to distinguish between
what is likely to, and what should, be done although in some places an indica-
tion will be given. In both cases, the prognostication 1s basically long-range
rather than something which involves the next few years.
Pertinent references are listed at the end of this chapter, but without
any specific citations of them in the text since the titles are generally self-
explanatory relative to the topics involved.
It seems likely that the future development of programming languages
will fall primarily into two major categories, one of which can be labeled as
theory-oriented, while the other can be called user-oriented. The first area is
but a subset of what hopefully will be forthcoming within the next 10 years,
namely a real theory of programming. Right now, the analysis of a problem,
its statement in some type of machine-understandable form, and the pro-
duction of the desired results in a reasonable amount of time and at a non-
prohibitive cost is very much of an art with very little associated science.
Among the two most important aspects of this general theory of program-
722
XI.2. THEORY-ORIENTED CATEGORY 723
ming which will not be discussed in this chapter are the general problem of the
tradeoff between time and space in a program and a scientific way of mea-
suring tradeoffs between hardware and software. These are problems which
need general solutions; when these solutions are available, they can be applied
to programming languages and their implementation.
The user-oriented category naturally contains those facets which are
directly related to making it easier for the user to communicate with a com-
puter to solve his problem.
It is no accident that the development of a specially created universal
programming language is omitted from this chapter. It 1s my firm opinion
that not only is such a goal unachievable in the foreseeable future, but it 1s
not even a desirable objective. It would force regimentation of an undesir-
able and impractical kind and either would prevent progress or, alterna-
tively, would surely lead to deviations. However, the possibility of a single
programming language with powerful enough features for self-extension to
transform it into any desired form is interesting to consider. (By any desired
form, | mean all the languages in this book, plus any others which are devel-
oped subsequently.) The techniques for this development are clearly un-
known currently, but they could conceivably be found in the future.
may in fact have had (or least thought they had) rational reasons for their
decisions. Thus, if a specific objective is defined, there is no algorithm for
designing a programming language to meet that objective; there is not even
any clear delineation of various tradeoffs involved, let alone any quantita-
tive measures of them. As a result, language designers continue to argue over
the merits (or lack thereof) of things such as requiring data names to begin
with a letter, allowing them to coincide with fixed words in the language, or
having fewer than N characters. Each of these decisions is made on an
arbitrary—although often well-founded—basis, usually with some concern for
tradeoffs involved. However, there is no general overall approach to language
design which would say that to achieve certain objectives the following well-
defined tradeoffs exist, and the language designers need only go down the
list and check what they are least willing to sacrifice and what facets or
facilities are most important to them. The ultimate in this direction would
be a true /anguage generator whose input parameters would be the complete
characterization of all objectives to be achieved by the proposed language.
This is a utopia that does not seem likely to be achieved for many decades—
if ever.
It seems clear that one of the necessary directions for theoretical develop-
ment is to pinpoint more specifically the concept of proceduralness. It was
pointed out in Chapter I that nonprocedural is really a relative term that
changes with the state of the art. It would be very desirable to have some
way of making these concepts fixed rather than relative by assigning a
proceduralness factor. Thus we might establish machine code as a base at
one end and a true problem-describing language (which is discussed in the
next section) at the other end; however, while it is relatively easy to establish
the end points, there does not appear to be any way at the moment to
establish fixed points along the scale. Certainly the number of primitives or
executable commands in the language is a factor, but it is far from clear how
one compares the statement integrate F(x) dx from A to B with calculate the
square root of the prime numbers from 3 to 97 and print in three columns.
In an intuitive sense, the first statement corresponds to what we think of as
a subroutine, whereas the second is essentially a concatenation of a series
of individual statements, of which some may be real subroutines and others
may be basic components of any language (e.g., looping facilities). However,
it is not clear which should be considered more procedural than the other.
The theoretical problem involved 1s really to establish some type of mea-
suring scale by which the amount of proceduralness to be specified by the
user can be defined for any given language.
It seems to me that one of the most likely candidates for the next
major conceptual step forward lies along the lines of defining what is meant
by more nonprocedural languages and then designing and implementing
them. The Information Algebra (see Section X.3) was an attempt at this
which collapsed at the first attempt to develop an approach to implementa-
tion.
There are five main aspects to the user-oriented developments: (1) User-
defined languages, (2) natural language usage, (3) utilization of, and
communication with, the hardware and executive software systems, (4) lan-
guages for new application areas, and (5) languages for creating software.
this phrase. The one thing that has become clear over the relatively short
life of the computer industry is that there are almost as many ways to say
add a to b as there are people capable of saying it. Furthermore, while each
of these different ways achieves the same result, almost every person has a
specific reason for preferring his notation to somebody else’s. In other
words, we have a very heavy built-in personal prejudice to either satisfy or
counteract. Trying to satisfy people has not worked too well; for every group
that is pacified with a particular language, another group that is trying to
do similar kinds of problems finds itself unhappy and either develops a new
language or makes significant changes in the existing one. Some of the ways
in which these people could be satisfied are indeed trivial; for example, these
changes might range from something as elementary as allowing the user to
specify whether he wants to say GO TO, JUMP, or TRANSFER TO to some-
thing which provides him with some type of simple language extension and,
therefore, would permit him to add integrate to his list of commands (at
the language level, not just as a subroutine) if it were not available to him
initially. However, in this case there is a great efficiency problem, particularly
in this conceptually trivial area of providing alternative ways of saying the
same thing. Of more fundamental significance, and correspondingly harder
to satisfy, is the need for differing executable packages. Thus, the mathemati-
cally oriented people are concerned with integration, matrix inversion, etc.,
and they need not only the language facilities for requesting these operations
but the routines which will carry them out. On the other hand, the insurance
or banking people will be very concerned with report writing, tabulations,
etc. Although we have attempted to develop languages which are fairly
general purpose for certain broad categories (as defined in Chapters IV to
VIII), the very number of them indicates that we have not succeeded. It
therefore seems appropriate to look very hard at techniques and systems for
permitting users to define their own artificial languages. In order for this to
be meaningful and practical, there must be some type of simple language-
translating-mechanism creator; i.e., it is not enough for the user to be able
to easily define his own language; he must also have some type of system
which will have it implemented for him very easily. To accomplish this, there
needs to be great assistance from some of the aspects under the theory-
oriented future developments, namely improved means of defining lan-
guages, having them translated, and knowing that we have actually created
a translator for them. One very broad approach to this problem of user-
defining languages is of course to provide large sets of subroutines which
will actually do the work and then provide a language on top which allows
the user to specify the way in which he wants to invoke these facilities.
The advantage of allowing the user to define his own language is that
he can insist that the computer (and compiler) adapt itself to his terminology
and method of expression and not vice versa as the situation has been up
XI.3. USER-ORIENTED CATEGORY 729
until now. Another reason for this particular approach being extremely
important is that there are now, and will surely continue to be, very diverse
opinions on the overall types of languages that should exist. As noted in the
next section, one school of thought holds that future language development
should be toward the direction of natural language input; on the other
hand, there is a vociferous school that says this is very bad because users
need to be forced to use the rigor and clarity that come with formal notations
and languages. There does not appear to be any potential resolution of
these diverse viewpoints on the horizon; by permitting users to choose the
course they prefer, it may be that one or the other of these approaches will
show itself to be more valid.
A short-range goal and approach is the inclusion of effective macro
facilities in programming languages. Just as assembly programs with powerful
macro capabilities begin to approach the higher level languages, so the latter
might really begin to approach user-defined languages. The original PL/I
macro facility was an excellent step in the right direction, but naturally it
could not be expected to provide the full capability of this type which is
needed. Thus we can expect to see an increase in the development of lan-
guages which are relatively simple but provide very good facilities for
extensions at the same level as the base language. However, just as macros
added to assembly languages do not cause them to become full-fledged pro-
gramming languages, we cannot necessarily expect programming languages
with macros to become full-fledged user-defined languages.
I have long favored the use of natural language (and for myself that
means English) as a programming language, where this concept definitely
includes mathematical or any other relevant scientific notation. An increas-
ingly large number of programmers will be needed to keep the computers
of future generations busy, where the term future generation applies to
hardware and not to people. Since we have had new computer generations
roughly every 5 years and since the engineers seem to be able to design bigger
and faster machines more rapidly than the programmers can keep them
occupied, it is clear that the number of programmers, or at least programmer
productivity, must be significantly improved. There are generally conceded
to be two approaches to improving this productivity. One is to give the
professional programmer better tools with which he can perform his work;
whether these tools are better languages, better subroutine packages, or on-
line systems, is almost irrelevant. The significant thing is that improved
facilities are given to those people whose fundamental training and mission
is to take some kind of problem statement and put it into a form which can
730 FUTURE LONG-RANGE DEVELOPMENTS
approach are that it encourages lack of rigor and that the user must under-
stand the computer in order to use it. To dispose of the latter point first,
most people are today using equipment whose inner workings they do not
understand at all; it is a rare and unusual person who knows very much
about what goes on under the hood of a car, inside a television set, or even
inside something as simple as a toaster. With regard to the lack of rigor, I
have never noticed that a programming language really forced rigor onto
anybody. An individual is just as likely to omit logically necessary steps from
a FORTRAN program as he is from stating the problem in English; in fact,
he 1s more likely to omit them from the FORTRAN than from the English
because in the former case he must remember a whole host of notational
devices which are irrelevant to his problem and detract from his thoughts
about the application. In other words, when we made the step from assembly
languages to the higher level languages discussed in this book, one of the
great advantages of the programming languages was that the user could
concentrate upon the logic of his program and not have to worry about
intricate details of modifying index registers appropriately. Similarly, we
are ready to take the step forward to again allow an order-of-magnitude
improvement in the ability to think constructively about the problem rather
than about the means of stating the way of solving it.
One of the objections to this approach has been its potential cost and
difficulty. It is clearly not within the current state of the art; it is not even
within any reasonable cost factor relevant to current technology. However,
that has never deterred us before and it does not seem a sufficient reason to
stop us now.
There are two main ways in which this approach can be brought to
fruition, and both seem worthy of support. One is the approach which can
be called bottom up, in which artificial languages are developed to become
increasingly close to natural language; the opposing, or top down view is
that exemplified by the work of the linguists who are concentrating on
understanding English grammar and developing generative and recognition
procedures for increasingly large subsets of it. Neither of these approaches
seems to have any major advantage over the other and it is probable that
both will continue to proceed and perhaps meet near the middle to solve
this problem.
In summary, it seems essential that a major area of future language work
is to allow people to communicate with the computer in the same way that
they communicate with each other, at least from a language point of view.
Naturally it would be desirable to have hardware developments go along
with this so that a person could indeed talk to the computer rather than
writing what he wants to say, but this is a factor not within the scope of this
discussion.
732 FUTURE LONG-RANGE DEVELOPMENTS
on-line facilities indeed make it easier to debug the program and/or obtain
fast response. However, there is nothing at all significant about the language
elements here. The second distinction involves a separate language develop-
ment which provides the user with specific facilities which are only mean-
ingful in an on-line environment. Some of the facilities in QUICKTRAN,
for example, are not meaningful unless the user 1s at a computer terminal.
Similarly, in the field of algebraic manipulation, certain facilities which are
meaningful and essential in an on-line environment are out of place or irrele-
vant in a batch situation. Thus we need the further development of lan-
guages which are specifically oriented to the user who is operating in an
on-line situation and whose characteristics relate to the problem solution
rather than the control functions. Finally, the last facet actually does relate
to the control function. In other words, the fact that the user is on line gives
him both the duty and the right to instruct the system to carry out certain
tasks for him. These are the kinds of facilities that were mentioned in Section
[X.3.6. These might be along the lines of editing or correcting, etc., and have
relatively little to do with the problem solution itself.
It is possible to develop control functions for use with a time-sharing
system that is combined with a standard language. This has been done and
described in some of the existing developments, e.g., QUIKTRAN.
One interesting combination and/or usage of time-sharing and pro-
gramming languages is in the area of a teaching machine. It is not the purpose
of this book to go into a discussion of teaching machines per se. However,
to the extent that a programming language is not a natural language and
therefore must be learned, the on-line situation may be ideally suited to
help in this. Some systems have already developed simple facilities in this
direction (e.g., MAP, described in Section IV.6.6). For the inexperienced
user, long and elaborate directions are given on what to type in and how,
as well as for the interpretation of the response. These same systems provide
the knowledgeable or sophisticated user with shortcuts, both in terms of
input and shorter responses, thus making the entire time span much shorter.
This type of facility should be increased and improved in future develop-
ments.
but people did not rush to use a computer in this area until suitable languages
became available. In other words, it is not necessarily sufficient to have the
subroutines which will carry out the desired operations; the user may either
want or need, in order to work effectively, a better means of communication
with these packages than simply invoking them as subroutines. Thus, one
of the functions of future language development must be to look for areas
in which the nonexistence of a suitable language is a barrier or at least a
hindrance in using the computer in this particular direction.
DO I = 3, 95, 2
CALL PRIME (I)
IF T, CALL SQURT(I); ELSE RETURN
PRINT I, SQURT(I)
RETURN
was an improvement in clarity for both reading and writing. In this case,
however, two different concepts are being combined. The first is the use of
a more natural (i.e., English-like) language. The second concept is the com-
bination into a single sentence of all the actions to be performed, thus
eliminating the requirement for the sequential information inherent in the
program steps. Hence, one is dealing with the natural language aspect, while
the other deals with the nonprocedural aspect; they are clearly not the same.
If we assume the desirability of allowing people to define their own
artificial languages, with some type of general system for generating the
necessary processors, then obviously some type of common core is necessary.
The one common core among all applications which can be utilized is English.
Thus, the approach to developing a system which permits people to define
their own application languages goes hand in hand with certain develop-
ments in the use of English as a programming language. If each language
is highly symbolic, then there is no common central core and the develop-
ment of a general generating system requires much more work by the
language builder. On the other hand, improved knowledge of how to handle
English-like input for a particular application probably sheds very little (if
any) light on the problems of developing a system in which people can define
their own languages.
The issue of developing nonprocedural languages is separate from the
two problems above. In addition to the examples given earlier, the key factor
736 FUTURE LONG-RANGE DEVELOPMENTS
REFERENCES
738
BIBLIOGRAPHY 7739
number, not by author, to expedite lookup from the text where there was
no author. Much effort has been used to try to provide full citations of the
source documents, in order to help readers with differing methods of access
to the literature.
The GENERAL list of references consists of either items which are
referred to in the text many times, or material which might be of interest to
readers of this book even though not necessarily referred to in the text. The
RELATED INFORMATION list contains items which do not logically fit
anywhere else but might be of interest to some readers, or appeared too late
to be put in a more appropriate place.
Following the RELATED INFORMATION references, there is an
AUTHOR LIST containing an alphabetic listing of the author for each item,
together with the code numbers assigned to each of his references and the
specific page(s) in the book where the full citation occurs. Documents by a
single author are shown separately from those by a leading author or editor.
The documents without specific authors are not included in this list. The
major issuer of such material is the IBM Corporation, whose manuals are
identified by the code letters IB.
It is hoped that this arrangement will provide the reader with all the
relevant material on a subject grouped together in the appropriate chapter,
and also a listing of authors so that a particular document may be easily
found if the author is known.
The following abbreviations for the major sources have been used:
For the 1962 F/CC through the 1966 FJCC, the publisher is Spartan
Books, Washington, D.C.; this is not shown in the individual citations. The
1967 SJCC and FJCC were published by Thompson Books, Washington,
D.C. (also not shown in the citations). Earlier publishers are not listed since
the volume could be found in a library without knowing the publisher or
the reader may have a copy or be able to find information through AFIPS.
BIBLIOGRAPHY
GENERAL
[ACOO0] ACM SIGPLAN Notices, ACM, New York, N.Y. (appears monthly).
740 BIBLIOGRAPHY ARRANGEMENTS AND AUTHOR LIST
RELATED INFORMATION
AUTHOR LIST
Page numbers set in bold face indicate the pages on which the full citation appears.
Page numbers set in regular type indicate pages in the text which contain a reference
to the document specified. Sets of page numbers are subdivided by chapters.
Abrahams, P. W. [AH63], 467; [AH66], 126, 109; [AH67], 464.
Abrahams, P. W., ef al. [AH66a], 602, 590, 591, 592; 761.
Adams, C. W., et al. [AD54], 26, 132, 300.
Alber, K. [AL67], 62, 600.
Allen, C. D., et al. [AN66], 62, 600.
Allen, J. J., et al. [AX63], 62, 42; 302, 147; 153, 164.
Alt, F.L. [AT64], 62.
Anderson, J. P. [AJ61], 721, 718; [AJ65], 736.
Arden, B. W., et al. [AR61], 304; [AR6la], 308, 206.
Ash, R., et al. [AS57], 301; 135.
742 BIBLIOGRAPHY ARRANGEMENTS AND AUTHOR LIST
Brooker, R.A., ef al. [BX62], 62, 57; 696, 635; [BX63], 696.
Brown, P. J. [UH67], 127.
Brown, S. A., ef al. [BP63], 693, 606, 610; 755.
Brown, W.S. [BW66], 522; [BW66a], 522, 502; 754.
Brown, W.S., et al. [BW63], 522.
Bryan, G. E. [UJ67], 308.
Bryan, G.E., et al. [UJ67a], 308; 760; [UJ67b], 308.
Bryant, J. H., et al. [QE66], 702.
Budd, A. E. [QH66], 28, 23; 303; 380.
Burkhardt, W. H. [BU65], 62; 302; 156; [BU65a], 740; [BU66], 600, 548.
Busch, K. J. [QD66], 695, 627.
Callahan, M. D.,et al. [ZQ67], 381, 335.
Cameron, S. H., et al. [CS66], 311, 255; [CS67], 311, 255, 257; 757.
Cantrell, H. N. [ZY62], 737.
Carleton, J. T., et al. [CT64], 302, 170, 171, 172; 763.
Carracciolo di Forino, A. [FF63], 740.
Carter, G. L., et al. [CA63], 312, 265.
Chanon, R.N. [ZS66], 469, 435.
Chapin, N. [CZ64], 466; [CZ65], 27, 23.
Chapin, P. G., et al. [ZT67], 470; 702.
Cheatham, T. E., Jr. [CH66], 127; 736; [CH66a], 698.
Cheatham, T. E., Jr., et al. [CH62], 701; [CH64], 63, 57; 697, 635.
Christensen, C. [CQ64], 470, 454, 457; 754; [CQ65], 470, 455; 754; [CQ66], 470,
457.
Christensen, C., et al. [CQ6Sa], 600, 542; [CQ67], 600.
Chu, Y. [CB65], 695, 623, 625, 656.
Church, A. [ZP41], 468, 413.
Clancy, J. J., et al. [ZZ65], 696, 627.
Clapp, L. C., et al. [CL63], 522, 510, 511, 512; [CL66], 522, 512; 522.
Clark, E.R. [CE67], 599, 530.
Clem, P. L., Jr., et al. [CM66], 311, 258.
Climenson, W. D. [CD63], 701.
Clippinger, R. F. [CP61], 378, 327.
Coffman, E. G., Jr. [CO61], 599, 530.
Coffman, E. G., Jr., et al. [CO64], 706, 688.
Cohen, L. J. [ZX67], 127.
Connors, T. L. [CY66], 703, 667, 703.
Conway, M.E. [C158], 719.
Conway, R. W., et al. [CN63], 313, 756; [CN65], 470; 755.
Cooper, W.S. [CV64], 701; [CV65], 701.
Corbato, F. J., et al. [ZV62], 706; [ZV63], 706, 690.
Corbin, H.S., et al. [CF66], 704, 679; 757.
744 BIBLIOGRAPHY ARRANGEMENTS AND AUTHOR LIST
Fenves, S. J., et al. [FE64], 694; 616; 764; [FE65], 694; 764; [FE66], 694, 611, 615.
Ferguson, H.E., et al. [FR63], 27.
Fimple, M. D. [FP64], 302, 157; 379.
Firth, D., et al. [F166], 602, 590.
Floyd, R. W. [FL64], 63,52, 53, 57; 697, 635.
Forest, B. [FS61], 305, 174.
Forgie, J. W. [FY65], 310, 245.
Forte, A. [FT67], 469; [FT67a], 469.
Foster, D.C. [FO65], 701.
Fowler, M.E., et al. [FH64], 302, 164.
Fox, L. (ed.) [FX66], 740.
Franks, E.W. [FW66], 701.
Fraser, J.B. [FV67], 720, 715; 737.
Fredericks, D.S., et al. [FD65], 379, 338.
Freeman, D.N. [FM64], 313.
Fried, B.D. [FQ66], 311, 253.
Fried, B. D., et al. [FQ64], 311, 253.
Galler, B. A., et al. [GA67], 127; 305, 192.
Garwick, J. V. [GW64], 305; [GW64a], 697.
Garwick, J. V., et al. [GW00], 305, 192, 195; 759.
Gaskill, R. A. [GL64], 696, 631.
Gaskill, R. A., et al. [GL63], 696; 757.
Gawlik, H.J. [GK63], 312, 281, 283; 762.
Gawlik, H. J., et al. [GK67], 312, 281; 762.
Gelernter, H., et al. [GE60], 465, 467, 388, 406.
Ginsberg, A.S. [GI167], 741.
Glass, R. L. [GX67], 600, 542.
Glennie, A. E. [GC60], 63, 57; 697, 635.
Goodman, R. (ed.) [GD61], 740; [GD63], 740.
Goodstat, P. B. [GS67], 62, 46.
Gordon, G. [GG61], 700, 653; [GG62], 700.
Gordon, R. M. [GN63], 380.
Gorn, S. [GO61], 63; [GO6la], 63, 57; [GO62], 741; [GO67], 741.
Gosden, J. A. [GY66], 741.
Grad, B. [UC61], 29, 11.
Graham, R., et al. [GMO00], 301, 142; 759.
Grant, E.E. [GH65], 701.
Grau, A.A. [GU62], 741.
Gray, J.C. [JG67], 465, 705.
Green, B. F. [GB6la], 465.
Green, B. F., et al. [GB61], 466; 703; 755.
Green, J. [GT59], 305, 174.
Greenberger, M., et al. [Y P65], 701; 762; [YP66], 701, 662; 762.
746 BIBLIOGRAPHY ARRANGEMENTS AND AUTHOR LIST
Naur, P. (ed.) [NA60], 53; 305, 176, 181; [NA63], 53; 126, 103; 306, 177, 181,
182, 191, 754; [NA63a], 306, 181.
Neidleman, L.D. [ND67], 521.
Nelson, D. B., et al. [NB67], 702.
Nelson, E. A., et al. [NE65], 28, 19.
Newell, A. [NW63], 466, 393.
Newell, A., et al. [NW56], 465, 466, 382, 389, 391 ; [NW57], 466, 389; [NW57a],
466, 389; [NW60], 466, 389; [NW61], 466, 393; [NW65], 466, 389, 391,
393, 395, 398; 765.
Nolan, J. [NOS53], 520, 472.
Olsen, T. M. [OL65], 62, 42; 303, 153.
Olsztyn, J.T. [OZ58], 696; 757.
Opler, A. [OA65], 737; [OA66], 741.
Oppenheim, D. K., et al. [OP66], 698, 639; 762.
O’Sullivan, T.C. [O0U67], 308, 216.
Oswald, H. [OS64], 303, 147, 152.
Pantages, A. [PA65], 740.
Parnas, D. L. [PN66], 695, 623, 627; 763; [PN66a], 695, 623.
Parnas, D. L., et al. [PN67], 741.
Peck, J. E. [PK67]}, 306, 194.
Perlis, A. J. [PR64a], 741; [PR65], 126, 65, 104.
Perlis, A. J., et al. [PR57], 302, 139; 760; [PR57a], 302, 139; [PR58], 28, 22; 306,
173; [PR64], 602, 583; [PR66], 602, 584; 758.
Perstein, M. H. [PE66], 599, 529; [PE66a], 599, 529, 539; 760.
Petersen, H. E., et al. [PS64], 695, 627.
Pratt, T. W., et al. [PT66], 697.
Proctor, R. M. [PC64], 695, 622; 760.
Pugh, A. L. [PG63], 699, 652; 758.
Pursey, G. [PU67], 63; 601.
Pyle, I. C. [PY65], 706, 691.
Quatse, J.T. [QU65], 699, 648; 764.
Rabinowitz, I. N. [RN62], 303, 156.
Radin, G., et al. [RG65], 601, 548.
Raphael, B. [RA64], 702; [RA66], 126, 65; [RA66a], 465, 385; [RA66b], 465, 385.
Raphael, B., et al. [RA67], 126, 65; 465, 387; 520.
Reinfelds, J., et al. [R66], 311, 258; 754.
Reitman, J. [RP67], 699.
Reynolds, J.C. [RE65], 697; 756; [RE65a], 698, 638, 639; 756.
Rice, J. R., et al. [R166], 28, 20; 313, 299.
Rice, R., et al. [RC65], 737.
Robbins, D. K. [RM62], 28, 14; 303, 157, 164.
Roberts, L.G. [RB65], 470, 462; 704; 756.
Rochester, N. [RT53], 29, 2; [RT66], 63, 56.
750. ~=—s BIBLIOGRAPHY ARRANGEMENTS AND AUTHOR LIST
Roos, D. [RS65], 694, 620; 759; [RS67], 694; [RS67a], 694; 759.
Roos, D., et al. [RS64], 694, 612, 613; 756.
Rose, A. J. [RJ66], 310, 247.
Rosen, S. [RO61], 303; 153; [RO64], 697; [RO64a], 740; [RO67], 740.
Rosen, S., ef al. [RO65], 303, 164.
Ross, D. T. [RD61], 705, 681; [RD62], 705, 682; [RD67], 705, 681; [RD67a], 705,
682, 683.
Ross, D. T., et al. [RD63], 705.
Roth, J. P., et al. [RQ67], 310, 247.
Ruyle, A., et al. [RU67], 308, 217, 240, 245, 254, 258.
Sakoda, J. M. [SA65], 303, 164; 465, 388.
Sammet, J. E. [SM61], 306; 379, 380, 330; 598; [SM6la], 63, 56; 380, 340, 344;
[SM61b], 380, 332; [SM6lc], 381, 332; [SM62], 381, 345; [SM66], 465,
385; 520, 472; [SM66a], 520, 471, 472; [SM66b], 61, 35; 720, 715; 737;
[SM67], 520, 521, 471, 472; [SM67a], 465, 385; 520, 472; [SM68], 740,
753.
Sammet, J. E., et al. [SM64], 521, 476, 486.
Sanders, N., et al. [SS63], 306.
Sandin, N.A., et al. [SN65], 599, 528.
Satterthwait, A.C. [SR66], 465.
Savitt, D. A., et al. [SK67], 702.
Saxon, J. A. [SX63], 381, 345.
Saxon, J. A., ef al. [SX66], 307.
Scheff, B. H. [SD66], 699, 648, 649; 757; [SD66a], 699, 648.
Schlaeppi, H. P. [QY64], 695, 621; 761.
Schlesinger, S., et al. [QL67], 28, 20; 313, 299.
Schneider, F. W., et al. [QV64], 698.
Schorré, D. V. [QT64], 602, 592; 698.
Schwalb, J. [SB63], 379, 329.
Schwartz, J. I. [SC65], 29, 23.
Schwartz, J.I., et al. [SC60], 599, 528.
Schwarz, H.R. [QN62], 306, 181.
Schwinn, P. M. [UZ67], 704, 677; 759.
Sconzo, P., et al. [SO65], 521, 474.
Seitz, R. N., et al. [UV67], 311, 258, 259, 263; 754.
Selfridge, R.G. [YDS55], 696, 627.
Shantz, P. W., et al. [SY67], 303, 164.
Shaw, C.J. [SH00], 599, 525, 529; [SH61], 599, 529; [SH61la]}, 599; [SH62], 29,
23; 126, 65; [SH63], 599; 760; [SH63a], 599, 529; [SH63b], 599, 524,
525, 528, 529, 530; [SH64], 599, 530; [SH64a], 29; [SH65], 377; [SH66],
29, 19, 23.
Shaw, J.C. [JC64], 308, 217, 218; 760; [JC65], 308, 220.
Shaw, J. C., et al. [JC58], 466, 389.
Sibley, R. A. [QS61], 697.
Siegel, M., ef al. [SG62], 380.
AUTHOR List ‘751
Simmons, R. F. [SE65], 702, 703, 662, 669; 720; [SE66a], 702, 662, 670; 720.
Simmons, R. F., et al. [SE63], 703; [SE64], 703; 763; [SE66], 702, 720.
Singman, D., et al. [S165], 307, 205.
Skinner, F.D. [QX66], 704.
Slagle, J. R. [SL61], 468, 410; [SL65], 702.
Spiegel, J., et al. [SP65], 740.
Spitzer, J. F., et al. [SZ65], 702, 665; 756.
Standish, T. A. [QM67], 126.
Steel, T. B., Jr. [S157], 29, 8; [ST61], 719; [ST61a], 719; [ST64], 741; [ST66], 599,
525, 528, 530 [ST66a], 63, 52; [ST67], 62, 46.
Stefferud, E. [SF63], 467, 393.
Steil, G. P., Jr. [QZ67], 702, 666; 755.
Stone, H.S. [TS67], 306, 192.
Stone, P. J., et al. [SJ63], 468, 435.
Stotz, R.H. (UU63], 310, 240; 705.
Stotz, R. H., et al. [UU67], 310, 240.
Stowe, A. N., et al. [SW66], 310, 245, 246; 761.
Strachey, C. [SQ65], 470, 450.
Strachey, C., et al. [SQ61], 126, 90; 306, 181, 194.
Strong, J., et al. [QR58] and [QRS58a], 709; 719; 764.
Summers, J. K., et al. [UT67], 704, 671, 673; 674; 754.
Summit, R. K. [UW67], 702.
Sutherland, I. E. [QW63], 470, 462; 704, 705, 678; [QW66], 704.
Sutherland, W.R. [SU66], 470, 463; 704; [SU67], 704.
Swets, J. A., et al. [UY63], 702.
Swigert, P. [SV66], 521.
Syn, W. M., et al. [QP66], 696, 632, 633; 757.
Tabory, R., et al. [TR67], 720.
Taylor, A. [TB60], 301; 378.
Taylor, W., et al. [TA61], 306.
Teichroew, D., et al. [TE66], 699, 651.
Theodoroff, T. J. [TD58], 696, 628; 757.
Thompson, C.E. [TM56], 29, 5.
Thompson, F. B. [TH63], 703; [TH64a], 703; [TH66], 703; 720, 715; 758.
Thompson, F. B., et al. [TH64], 703.
Tobey, R.G. [TO66], 521.
Tonge, F.M. [TN60], 467, 393.
Tonge, F. M., et al. [TN65], 700.
Van Dam, A., et al. [VD67], 704, 675, 676; 762.
van Wijngaarden, A. [VW63], 306; [VW68], 306, 178.
von Sydow, L. [VS67], 306, 193.
Voorhees, E. A. [VR58a], 741.
Waite, W. M. [WA67], 127; 737.
Waks, D. J. [WK67], 308.
752 BIBLIOGRAPHY ARRANGEMENTS AND AUTHOR LIST
753
754 LANGUAGE SUMMARY
Animated Movie_ t
A language to assist in preparing animated movies.
IX.2.6.3 [KO64], p. 699.
APL/360 (A Programming Language on 360)
An on-line version of a subset of APL.
IV.6.8 [FA67a], p. 310.
APL (A Programming Language)
A general but unimplemented language with complex notation and
unusual but powerful operations. See also APL/360 and PAT.
IX.2.3.1 [FA64], p. 694; X.4 [IV62], p. 720.
APT (Automatically Programmed Tools) ft
A language for numerically controlled machine tools. A USASI stand-
ard is being developed.
IX.2.1.1 [BP63], p. 693; [II67], p. 693.
B-@ {
See FLOW-MATIC.
BACAIC (Boeing Airplane Company Algebraic Jnterpreter Coding System) f
One of the early languages for mathematical problems, 1.e., a pre-
FORTRAN system on the 701.
IV.2.1.5 [GRS55], p. 301.
BASEBALL ft
A question-answering system whose data base contains information
about baseball.
IX.3.2.5 [GB61], p. 703.
BASIC (Beginner’s All-Purpose Symbolic Jnstruction Code)
A very simple language for use in solving numerical problems developed
in an on-line system.
IV.6.4 [K M67], p. 309.
BUGSYS ft
A language for use in preparing animated movies.
IX.2.6.3 [LL66], p. 699.
C-10 fT
An improved version of COLINGO.
IX.3.2.2 [QZ67], p. 702.
CLIP (Compiler Language for /nformation Processing) + f
A language based on ALGOL 58, useful for writing compilers. JOVIAL
is an outgrowth of CLIP.
1X.2.5.2 [IS59], p. 697; [EG61], p. 697.
CLP (Cornell List Processor)
An extension of CORC to do list processing.
VI.9.3.1 [CN65], p. 470.
756 LANGUAGE SUMMARY
DYNAMO ‘ft
One of the first continuous simulation languages.
1X.3.1.2 [PG63], p. 699.
DYSAC (DigitallY Simulated Analog Computer) t
A language to provide representation of a number of analog com-
puter components.
IX.2.4.3 [HJ63], p. 696.
English
The concept of using a natural language (e.g., English) as a program-
ming language.
X.5 [HL66], p. 720; [TH66], p. 720.
Extended ALGOL
A specific set of additions to ALGOL.
IV.4.5.8 [QG66], p. 306.
473L Query 7
A formalized English-like query system for use in the Air Force 473L
system.
[X.3.2.3 [BL65], p. 703.
FACT (Fully Automatic Compiling Technique) #
An English-like language suitable for business data processing. Largely
supplanted by COBOL.
V.2.4 [HO61], p. 379.
FLAP
A program to do symbolic mathematics.
VII.6 [MB67], p. 522.
FLOW-MATIC ¢
The first English-like language for doing business data processing;
implemented on UNIVAC I. Supplanted by COBOL.
V.2.1 [RR59a], p. 378.
Lincoln Reckoner
An on-line system on the TX-2 to do mathematical computations with
high level matrix operations provided.
IV.6.7 [SW66], p. 310.
LISP 1.5 (LISt Processing)
A sophisticated and theoretically oriented language for doing list pro-
cessing. LISP | and LISP 1.5 differ significantly from LISP 2.
VI.5 [BY66], p. 467; [WE67], p. 468.
LISP 2
An ALGOL-like language which includes facilities and many concepts
from LISP 1.5.
VIII.6 [AH66a], p. 602.
LOLITA (Language for the On-Line Investigation and Transformation of
Abstractions)
An addition to one of the Culler-Fried systems to permit symbol
manipulation.
VI.9.3.4 [QK67], p. 470.
LOTIS (LOgic, Timing, Sequencing) ft
A language for describing a computer by describing the structure and
behavior of its data flow.
IX.2.3.2 [QY64], p. 695.
MAD (Michigan Algorithm Decoder)
A language for doing numerical computations which has a fast compiler.
IV.5.2 [UM66], p. 308.
MADCAP
A language for numerical mathematical problems and set theoretic
operations, based on the use of a special typewriter which permits two-
dimensional (i.e., natural) input of mathematical expressions.
IV.7.3 [WS63], p. 312.
Magic Paper
An on-line system on a specialized computer configuration for doing
certain types of formal algebraic manipulations.
VII.7.1 [(CL66], p. 522.
MAP (Mathematical Analysis Without Programming)
An on-line system (under CTSS) for doing numerical computation;
it has certain higher level mathematical operations (e.g., integrate) and
considerable dialogue with the user.
IV.6.6 [K P66], p. 309; [K P66a], p. 310.
MATHLAB
An on-line system for doing certain types of formal algebraic manipula-
tion.
VII.4 [EN65], p. 521.
762 LANGUAGE SUMMARY
MATH-MATIC (AT-3) ¢
A language developed on UNIVAC, around the same time as FOR-
TRAN, to do mathematical computations. Supplanted by FORTRAN.
IV.2.2.1 [RR60], p. 301.
Matrix Compiler ft {
An early language to do matrix computations on the UNIVAC.
IX.2.6.1 [MF57], p. 698.
META 5 ft
A language for syntax-directed compiling.
IX.2.5.5 [OP66], p. 698.
MILITRAN fT
A discrete simulation language particularly oriented toward military
applications.
IX.3.1.6 [YC64], p. 700.
MIRFAC (Mathematics Jn Recognizable Form Automatically Compiled)
A language for mathematical problems, based on a specialized type-
writer to permit two-dimensional (i.e., natural) input of mathematical
expressions.
IV.7.4 [GK63], p. 312; [GK67], p. 312.
NELIAC (Navy Electronics Laboratory /nternational ALGOL Compiler)
A language for doing numerical computation and some logical pro-
cesses. The compilers are written largely in NELTAC.
IV.5.1 [HS62], p. 307.
OCAL (On-Line Cryptanalytic Aid Language) Tf
A language for use in doing cryptanalysis.
IX.2.6.2 [ED66], p. 698.
OMNITAB
A very simple language containing some operations which are the same
as those on a desk calculator and some which are at a high mathematical
level (e.g., matrix inversion).
IV.8.2 [HR66], p. 313.
OPS (On Line Process Synthesizer) ft
A system under CTSS containing a discrete simulation language, among
other facilities.
IX.3.1.8 [YP65], p. 701; [Y P66], p. 701.
PAT (Personalized Array Translator)
A small subset of APL.
IV.6.8 [HH64], p. 310.
PENCIL (Pictorial ENCoding Language) ft
A language in an on-line system for use with simple data structures
to display line drawings.
IX.3.3.2 [VD67], p. 704.
LANGUAGE SUMMARY 763
PL/I
A language suitable for doing problems involving both numerical
scientific computations and business data processing. It combines the
most significant concepts from previous languages in the individual
areas.
VIII.4 [IB66b], p. 601; [[B67d], p. 601; [IB67f], p. 601.
PRINT (PRe-edited JNTerpreter) {+
An early language on the 705 for doing mathematical computations.
IV.2.1.6 [IB56a], p. 301.
Proposal Writing
An extension of FORTRAN to facilitate the preparation of proposals.
IV.3.6.1 [CT64], p. 302.
Protosynthex f
A question-answering system whose data base is English text.
IX.3.2.7 [SE64], p. 703.
QUIKTRAN
An on-line version of FORTRAN with some restrictions, but with added
facilities for debugging.
IV.6.3 [IB67e], p. 309.
SFD-ALGOL (System Function Description—ALGOL) ft
An extension of ALGOL to permit descriptions of synchronous systems.
[X.2.3.7 [PN66], p. 695.
Short Code f
Appears to be the first attempt at a higher level language for mathe-
matical problems. Ran on UNIVACI. Really allows.a string of param-
eters for each operation.
IV.2.1.1 [RR52], p. 300.
SIMSCRIPT ft
A language for doing discrete simulation problems.
IX.3.1.4 [MA63], p. 700.
SIMULA (S7MUlation LAnguage) ft
An extension to ALGOL to do discrete simulation.
IX.3.1.7 [DH66], p. 701.
Simulating Digital Systems t
A language with a flavor like that of FORTRAN, for describing the
logical design of digital computers.
IX.2.3.4 [MZ65], p. 695.
SNOBOL
A string-handling and pattern-matching language.
VI.7 [FB66], p. 469; [GF68], p. 469.
SOL (Simulation Oriented Language) t+
A language for doing discrete simulation problems.
IX.3.1.5 [KN64], p. 700; [KN64a], p. 700.
764 LANGUAGE SUMMARY
Speedcoding ;
One of the early attempts at a higher-level language for mathematical
problems on the 701. Really allows a string of parameters following
an operation code.
IV.2.1.2 [BS54a], p. 300.
SPRINT
An approach to list processing which involves direct action on an
operand stack.
VI.9.3.3 [KC67], p. 470.
STRESS (STRuctural Engineering Systems Solver) Tt
A specialized language useful for solving structural analysis problems
in civil engineering.
IX.2.2.2 [FE64], p. 694; [FE65], p. 694.
STROBES (Shared Time Repair Of Big Electronic Systems) ft
A language for communicating with the computer hardware for purposes
of testing.
1X.2.6.5 [QU65], p. 699.
Symbolic Mathematical Laboratory
An on-line system (under CTSS) to do formal algebraic manipulations,
based on major use of a display screen and light pen.
VII.7.2 [ZB67], p. 522.
TMG ft
A syntax-directed compiling language.
1X.2.5.3 [MZ65a], p. 697.
TRAC (Text Reckoning And Compiling)
A string manipulation language involving nested functions and macro
facilities. |
VI.8 [ME66], p. 469.
TRANDIR (TRAWNslation D/Rector) Tt
A syntax-directed compiling language.
IX.2.5.6 [DE64], p. 698.
TREET
A list processing language which embodies many of the LISP concepts
but in an easier notation.
VI.9.2 [HA67], p. 470.
UNCOL (UNiversal Computer Oriented Language)
The concept of using a language intermediate between a programming
language and machine language to minimize the number of compilers
to be written.
X.2 [QR58], p. 719; [QR58a], p. 719.
UNICODE f
A language (similar to MATH-MATIC) on the 1103 to do mathematical
problems. Supplanted by FORTRAN.
IV.2.2.2 [RR59], p. 301.
NAME AND
SYSTEM INDEX
This index contains names of people, organizations, systems, and languages. Page
numbers shown in bold face represent a significant discussion, rather than just casual
mention. Page numbers in italics for the major languages specify the location of the
Sample Program for that language. Other italic page numbers indicate the existence
of a bibliographic citation that is not referenced from the text or is not within an
obvious subheading in the Reference Lists. Note that authors are not included in this
index; they appear in the Author List in Appendix A.
A ADAPT, 606
AED, 244, 605, 641, 680-683, 754
A-0, 6, 12, 132 AED-0, 651, 680-682
A-1, 6, 132 AED-1, 682-683
A-2 and A-3, 5, 6, 129, 132, 134, 137, AEDIR, 682
316, 322, 753
Aerospace Industries Association, 606
A-3 (see A-2 and A-3)
AESOP, 461, 670-674, 678, 754
Abrahams, P., 590
Abrams, P. S., 247
AIMACO, 314, 323, 324, 331, 754
ACM, 173, 542, 638 Air Force, 525, 665
Collected Algorithms, 176 Materiel Command, 324, 330, 605
Communications, 175, 176, 181, 335, ALCOR (see ALGOL, subsets)
345, 472 ALGOL, 22, 39, 45, 48, 53, 56, 58, 75, 82,
Programming Languages Committee, 84, 92, 103, 104, 134, 143, 144,
176, 180 152, 153, 154, 172-196, 178, 205,
SICPLAN Notices, 58, 341, 530, 548, 208, 229, 245, 294, 328, 329, 330,
739 335, 340, 344, 388, 400, 454, 501,
SICSAM, 65 541, 542, 543, 544, 582, 583-589,
ADAM (IBM), 718 592-598, 621, 623, 625, 638, 651,
ADAM (MITRE), 667-668, 753 656-658, 680, 719, 723, 754
765
766 NAME AND SYSTEM INDEX
Brown, L., 540 COBOL, 20, 21, 23, 33, 35, 43, 46, 47,
Brown, W. S., 502 53, 56, 58, 73, 78, 80, 82, 84, 85,
BUGSYS, 644-646, 755 97, 106, 119, 121, 152, 153, 180,
Burroughs, 330 193, 314, 324, 325, 326, 327, 328,
Burroughs computers: 329, 330-376, 336-337, 536, 541,
Burroughs 220, 174, 198, 294, 389 542, 543, 544, 582, 634, 717, 723,
Burroughs 5000, 718 725, 756
Burroughs 5000/5500, 611, 656 (COBOL) 60, 324, 332, 333, 339
Burroughs 5500, 196, 261, 306, 612 (COBOL) 61, 328, 332-333, 344
Burroughs D825, 197, 527, 622 (COBOL) 61 Extended, 328, 333
(COBOL) 61 Required, 339
(COBOL) 65, 333-334, 345-375
Cc (COBOL) standard, 340-343 (see also
X3.4.4)
C-10 (MITRE), 664—665, 755 Basic, 339
C-10 (UNIVAC), 137 Compact, 339
CADET, 683 Extended COBOL 61, 328, 333
CAL, 217 Information Bulletin, 333, 340, 341,
California, University of: 345
Berkeley, 205 Maintenance Committee, 332-334, 340
Los Angeles, 253 metalanguage, 53-56 (see also
Santa Barbara, 253 Metalanguage, COBOL, in
Carnegie-Mellon University, 389, 583 Subject Index)
Case Institute of Technology, 139 Short Range Committee, 323, 324, 325,
CDC, 332 327, 330-333, 339
CDC computers: CODAP, 678
CDC 160A, 198, 611 CODASYL, 330, 340 (see also COBOL;
CDC 1604, 198, 294, 389, 525, 526, Information Algebra)
527, 611, 612, 622, 629, 678 Executive Committee, 330, 331, 344
CDC 3100, 197, 436 Intermediate Range Committee, 330
CDC 3200, 447 Language Structure Group (see LSG;
CDC 3400, 612 see also Information Algebra)
CDC 3600, 197, 393, 436, 525, 526, Long Range Committee, 330
527, 611, 612, 655, 718 LSG, 709, 712, 719
CDC 3800, 197, 655 Short Range Committee (see COBOL,
CDC 6400, 655 Short Range Committee)
CDC 6600, 655 COGENT, 638-639, 756
CDC 6800, 655 COGO, 21, 247, 611-613, 616, 618, 619,
CDC G20, 389, 583 756
CDL, 618-620 COLASL, 79, 265-271, 268, 281, 756
CHARYBDIS, 522 COLINGO, 664—665, 668, 756
Chicago, University of, 417 COMIT, 56, 58, 68, 386, 416-436, 418,
Chipps, J., 139 438, 439, 447, 449, 453, 454, 455,
CIB (see COBOL, Information Bulletin) 756
CITRAN, 217 (COMIT) II, 417, 418, 419-420, 423
Clapp, L., 511 compared with SNOBOL, 386-387
Clem, P. L., Jr., 258 COMMEN, 127
CLIP, 174, 196, 197, 215, 524, 529, 634, Commercial Translator, 314, 324-326,
635-636, 755 327, 334, 375, 756
Clippinger, R., 327, 712 COMPASS (see Massachusetts
CLP, 387, 461-462, 755 Computer Associates)
COMPOOL, 526, 533, 536, 539
768 NAME AND SYSTEM INDEX
USASI, 8, 46-48, 154, 339, 340 (see also Wood, L. H., 258
X3; X3.4; X3.4.1; X3.4.2; etc.) Woodger, M., 176, 177, 178
USE, 173
U. S. Steel, 332 X
Utman, R. E., 177
X3, 47, 48, 341, 547
X3.4, 47-48, 154, 180, 546-547
Vv X3.4.1, 47
van der Poel, W., 177 X3.4.2, 47, 180
van Wijngaarden, A., 176, 177 X3.4.2C, 547
Vauquois, B., 176 X3.4.3, 47, 150, 154-156, 340
VITAL, 641 X3.4.4, 47-48, 333, 340-341, 345
X3.4.5, 48
Ww
X3.4.6, 48
X3.4.7, 48, 606
Waite, 4 X3.4.8, 49, 180
Washington State University, 419 XPOP, 8
WATFOR, 303
Watt, J. B., 197 Y
Wattenburg, W., 197 Yang, G., 226
Weegstein, J., 174, 176, 177, 330 Yngve, V., 417, 420
Weinstein, M., 417 Yntema, D. B., 245
Weissman, C., 590 Yu, L., 135
Weitzenhoffer, B., 540
Wells, M. B., 271 Z
Westinghouse, 339
Whirlwind, M.L.T., 2, 5, 7, 129, 131-132, Ziller, I., 143, 147
301, 605 Zilles, S., 475
Wiesen, R. A., 245 Zoeren, H. V., 139
SUBJECT
INDEX
Page numbers shown in bold face represent significant discussion of the indicated
subject, rather than just casual mention. Page numbers in italics indicate the presence
of a bibliographic citation pertaining to this subject. This was done in only the few
cases where the reference otherwise might be overlooked. The page references for
all language names, system names, people, and organization names are given in the
Name and System Index.
A Arithmetic (cont.):
Addresses: fixed point, 98
regional, 2 floating point, 98
relative, 2 integer, 98
symbolic, 3 logical, 99~100
Alphameric data (see Data types, mixed mode, 100 (see also Mode)
alphanumeric) mixed number, 98
Aiphanumeric data (see Data types, multiple precision, 99
alphanumeric) rational, 98—99, 479
Ambiguity, 38, 52 precision, 102 (see also types of,
Application (see also individual double; types of, multiple)
applications listed by name): Arrays, 74, 95, 97, 100, 118, 124
area, 21, 23, 24, 25, 31, 33-34, 39, 45, Artificial intelligence, 383, 385, 389, 405,
730, 733-734, 736 409, 740
oriented languages, 19, 21, Chapter IX ASCII, 70
package, 13-14 Assembly language, 1, 2, 8, 14, 15, 16, 17,
Arithmetic: 18, 21, 23, 32, 42, 81, 86, 114,
types of: 120, 386, 389, 391, 604, 731
complex, 99 symbolic, 2, 3, 5, 8, 11, 730 (see also
double precision, 99 Symbolic assembly program)
776
SUBJECT INDEX 777
Graphic(s) (cont.): K
languages, 674-678
Keyboard, 81, 82, 217, 512 (see also
Typewriter)
H
Key punch, 69, 264, 732
Hardware, 12, 15, 19, 36, 41, 50, 59, 95, Key words, 70, 71, 73, 77, 80, 89, 108,
119, 730 (see also under manu- 109, 124, 725
facturer’s name in the Name and
System Index) L
compatibility, 16
data units, 95 Labels (see Identifier, types of)
descriptions of (see Logical design; see Language (see Assembly language;
also APL in Name and System Machine language; Metalanguage;
Index) Programming languages; see also
effective use of, 9, 34, 87, 732 the individual languages in the
facilities, 9, 19, 37, 96, 113, 264, 732, Name and System Index)
734 Language generator, 725
implementation of programming Language L-like, 39
languages, 707, 717-719 Level numbers (see Data, hierarchical;
instructions, 9 see also descriptions of COBOL
new, 16 and PL/I)
representation (see Hardware Library routines, 4 (see also Subroutine,
language) library)
selection, 30, 31 Light pen, 82, 216, 217, 255-257, 510,
Hardware language, 19, 22, 23, 69, 70, 74 512, 516, 670, 671, 680, 682, 685,
Hierarchy (see Data, hierarchical) 691
Higher level languages (see Programming Linguistic data processing, 383
languages) List, 382, 383-385 (see also Free list;
‘Garbage collection; Statements,
I executable, types of )
processing, 383-385, 386, 388, 650, 658
Identifier, 24, 39, 71, 72, 725 languages for, 388—416
definition of, 69, 72-76, 82 structure, 385
types of, 72 Literals, 71-72, 80
data names, 72, 73 Local variable, 103 (see also Scope of
program unit labels, 72, 73 data)
statement labels (see program unit Logical design, 33, 603
labels) languages for, 620-627
statement names (see program unit Loops, 4, 84, 85, 110 (see also Statements,
labels) executable, types of, loop control)
Implementation, 24, 31, 32, 50, 51, 57, parameters, 85, 109
59, 74, 95, 100, 113, 114, 115 (see range of, 84, 85, 109
also Compiler) termination of, 85
efficiency, 25, 74, 122-124
Implicit multiplication (see Juxtaposition) M
Information retrieval (see Query)
Interpreter, 5, 11, 12—13 Machine code (see Machine language)
Machine independence, 10, 16, 37, 62, 96,
J 112, 331
Machine language, 1, 2, 8, 9, 10, 14, 18,
Juxtaposition, 73, 102, 131, 275, 512 35, 88, 114, 120
SUBJECT INDEX 781
Machine tool control, 21, 33, 48, 603, Nonprocedural language, 19, 20, 22, 726,
605-610 734-736
languages for, 605-610 Notation, 14, 39, 715
Machines (see Computer; Hardware) better, 4
Macro (see also User defined languages) : formalism in, 24
assemblers, 10, 121 formalized, 52-57 (see also Metalan-
in PL/I, 579-581 guage; Semantics; Syntax)
with programming languages, 86, 120, natural, 4, 5, 16, 24, 31, 32, 35
121, 196, 453, 524, 729 problem-oriented, 10-11, 15, 87
with symbolic assembly program, 8, 14, Numerical analysis and computations,
604, 729 128, 134, 216, 472, 490, 539, 540
Matrix computation, language for (see (see also Scientific applications)
Matrix Compiler in Name and Numerical control (see Machine tool
System Index) control)
Metalanguage, 53-57, 635 (see also Numerical scientific languages, 21, 33,
Compiler, syntax directed) Chapter IV
ALGOL, 53-56 (see also BNF)
used 191, 231, 409 O
Backus Normal Form (see BNF) Object code, 11, 17, 125
BNF (see BNF) efficiency, 18, 21, 59, 120, 122, 123, 124
COBOL, 53-56 errors, 125 (see also Debugging;
used 234—235, 353-359, 364—365, Diagnostics)
367, 368—374, 481-484, 557, 558- inefficiency, 18
561, 619, 672-673 Object program, 11, 12, 32, 38, 59, 137
metalinguistic formula, 53 On line (see Time-sharing)
metametalanguage, 53 Open shop, 24, 148
M-expression (see description of Operating system, 3, 12, 35, 36, 37, 111,
LISP 1.5) 113, 115, 603, 687, 732, 734 (see
Microprogramming, 232, 718-719 also Control cards; Control
Mixed mode, 100, 144 (see also Data language; FIB; RJE; Statements,
types, combining of; Mode) executable, types of, operating
Mnemonics, 2, 3 system interaction; Time-sharing;
Mode, 100, 102, 106 (see also Data types) see also JCL, in Name and
Movie creation, languages for, 644-646 System Index)
Multipurpose languages, Chapter VIII Operation, high level primitive, 20
Operators, 66, 71, 77, 105 (see also
Commands)
N
computational, 66
Names (see Identifiers) graphic, 70
Natural English, 82, 669-670 (see also infix, 67
English-like; Natural language; logical, 66
Query; see also English in Name post fix, 67
and System Index precedence rules for, 100
Natural language, 662-664, 715, 729- prefix, 67
731, 734-736 (see also English- relational, 66, 71
like; Natural English; Natural suffix (see post fix)
language translation; Query; see Overlays, 115, 118
also English, in Name and System
Index) P
Natural language translation, 386 Paper tape, 81, 82, 113, 131, 255, 510
Noise words, 74, 79-80 Parallel processor, 306, 732, 736, 737
782 SUBJECT INDEX
Commercial Translator
Computer Compiler
CORAL CORC
Computer Design
DAS
CPS Culler—Fried
DIALOG | DIAMAG
DEACON
DATA-TEXT DSL/90 DYANA
DIMATE DOCUS
.
DYSAC English
DYNAMO sOn-NAL
Extended ALGOL LAP en.
£ ZoRTRAN
FACT
473L Query GECOM
Formula ALGOL
FORMAC Kaerer-May
FORTRANSIT FSL t ra a aN
yPL
GRAF
(arin
algebra
a Fieriet
sis
IDS oY
Information
us '
ICES
=
se |
JOSS JOVIAL LISP > N
DC AP
mn RECKONe!
i) ee NA \c
ae 5 wine Ae
LDT| MATHLAB N \
LOLITA i MILITRAN AY nek uy
MAP “a
METAS prorosy
Magic paper S
OMNIT AB
Matrix Compiler es
OCAL
a PRINT ProP Short Code
NELIAC ce -ALGOL
SENCIL PL SIMSCRIPT | | SIMULA
QuintRAN, SNOBOL sot} { Speedcoding
Simul. Dig. Syst: |
[_JsTROBES | __} Symbolic Math. Lab.
4
= —— SPRINT(] STRESS
TRANDIR TREET UNCOL | | UNICODE
PROGRAMMING
LANGUAGES:
History and Fundamentals
by Jean E. Sammet
Here at last, in a definitive single
source, the reader can find basic
information about all of the major
and most of the minor higher level
languages developed in the U. S.
This is not just another collection
of previously published articles;
rather, it is an original reference
work that provides fundamental in-
formation on programming lan-
- guages, including history, general
characteristics, similarities, and
differences. The fundamental as-
pects of programming languages
are divided into technical and non-
technical characteristics. These
are defined and the concepts are
then used consistently for the des-
criptions of the major languages.
The broad coverage, combined
with numerous examples and a
large bibliography, enables the
reader to decide which languages
he should investigate in more de-
tail for his particular purpose.
Outstanding Features:
= Broad coverage—about 120 lan-
guages.
= Over 800 individual bibliographic
items.
= Sample programs show the
basic elements of about 30 lan-
guages at a glance.
=» Extensive bibliographies for
each language, including cita-
tions of the major source docu-
(continued on back flap)
(continued from front flap)
PRENTICE-HALL, INC.
Englewood Cliffs, New Jersey
270 © Printed in U.S. of America
PROGRAMMING LANGUAGES:
History and Fundamentals
by JEAN E. SAMMET
A unique and definitive source book providing an overall view
of higher level languages. The book brings together in one
place fundamental information about programming languages,
including history, general characteristics, similarities ai.d dif-
ferences, as well as detailed technical descriptions. The book
contains basic information and provides perspective on 120
higher level languages, including all of the major, and most
of the minor, languages developed in the United States. Major
languages are described in a consistent way, following a funda-
mental outline and general discussion of technical and non-
technical characteristics of programming languages. Readers
will be able to understand simple programs and write very
simple programs in many of the current languages, to decide
which languages to investigate in more detail, and to know what
significant documents should be examined for different aspects
of further study.
Extensive bibliographies for each language include citations
of major source documents, general descriptions, illustrations
of actual usage, and other related material; also included is an
appendix containing an author list showing the page number
where each full citation can be found and the pages from
which it is referenced. A second appendix provides a convenient
reference by listing each language together with the meaning
of its acronym, a very brief description, the section of the book
in which it is discussed, and the best reference(s) for the lan- a
guage. Other useful features in the book include sample prob-
lems for about 30 languages showing the basic elements of
the language at a glance, and a detailed table of contents
which shows the structure of the programming language field.
PRENTICE-HALL, INC.
Englewood Cliffs, New Jersey
13-729988-5