-1-

'The Input Language System of Automatic Programming (ABS14) '

By: A.P. Ershov., G.I. Koschuhin, U. M. Voloshin.

Published by the Computational Centre of the Academy of Sciences of the U.S.S.R. Mosc9w 1961. Also distributed to the Algol Bulletin List as ABS 14.

The translation of the foreword and introduction comprises the first 22 pages out of the total 173 pages of the above book, and contains a 'talky - talky' description of the authorB aims and proposals, some of which have subsequently been revised. The translation was made by R. W. Hockney with help of G. Williams and @. J. Tee in April 1962. A complete translation of the final version of the tInput ~anaguage I ~ill be published by the Brighton APIC as Vol.III of APIC studies in Data Processing. !be structure of this description of the input language follows to the maximum extent the structure of the 'Report on the Algor~thmic language Ugcl 60'. In particular the numbering and naming of the corresponding sections is retained. The whole text, rslating $0 those parts of the which coincide with the corresponding parts of Algol 60, . is taken where possible in full from the correspondi text of' Algol 60, All the paragraphs or larger units of the text? section, paragraphs etc. ,) ,which are supplements to Algol 60; are pointed out by asterisks.

Additional metitlinguistic formulad (1),&fining the establised (1) for brevity neta-linguistic fornulM are called Id - formube.

units of the language mill also be indicated in the margin by asterisks. Additional M- formulae of an auxiliary character, are indicated in the margin by dots. - In the case, when an Id- formulas ,present in Algol 60, is removed, this will be clearly indicated in the corresponding section.

All references from the 'Report on the Algorithmic language Algol 60' will have the form ALGn, where n is the number of the oorresponding section, for emmple ALG.5, ALG4.7.3.2 etc. Moscow July 1960,

Introduotion

The present work contains a description of the input language system of automhtic programming in the form suggested by the Institute of Mathematics of the Siberian section of the Academy of Sciences of the U.S .S.R. - Work was started in the Institue of Mathematics on the automation of progrnmming in the autumn of 19%. From the beginning it became clear that, it was necessary to acwve full clarity with regard to the input language, before proceeding with the preparation of programming and the construction of a pragramming programme. Therefore the basic work, which was accomplished in the first stage consisted of the study and analysis of the input languages of the most interesting systems for the automation of przograrnrning. Of the systems investigated which have influenced the concepts of the authors, we must mention the following PPS (l), PP MGU (2). FOR!f!RAN (3) and UNICODE (4).

(1) Ershov. A.P. , KIM KV, PPS - A translator for the computing machine AP;ROW - 3, Published by the Computation Centre of Academy of Sciences of the U.S. S.R, Moscow 1960. (2) Trif'onov N.P. Concerning some special translators at Moscow State University. Lecture which was given to All-Union meeting on computer mathema-tics and computer techrLques. Mosoow State University, Mosoow, 16 - 21 November 1959. (3) FOR!I!FUN, Instruction for use, From the collection of translations 'Autonatic prog~arnming' under the editorship AoP* Ershov. FIZMPITGIZ Moscow, 1960 (b cing printed). L (4) UNICODE - P system of automatic programming for the automatic c~mput~emachine UNIVAC SCIL'NTIFIC llO3A. From the collection of transiations 'Automatic programmingt under the editorship of AJ?, Ershov, FIZIULTGIZ Moscow 1960 (being printed). However~ in contrast with the earlier input languages, it was decile~ to lay down as a foundation of the project the following basic principles°

(i) To sto.y within the framework of an algebraic language and to give the maximum assistance to mathematicians in the recording of algorithms for the solution of problems in numerical analysis and their solution on a machine.

To make the languages as far as possibile, independent of the specific characteristics of particular computing machines, thus giving it tile character of a universal common language.

In this cor~ection it was natural that the project of the international algorithmic languv~ge ALGOL, especially attracted our attention, and interest both when it first appeared and when the first information was received for the Zurich Conference. (5).

(5) tReport on the algorithmic langauge ALGOL t. UBder the editorship of A.J. Perlis and K. Samelson. Translated from the English. Published by the Computation Centre ~f the Academy of Sciences of the U.S.S.R. 1960.

, ill i ill , - - l J |.| IH m ' l II ,i i i

A thorough study of the project ALGOL 58 (1) lead us to the

...... | i l|i ,|, l i i |L i I .

(1) The earlier 'Report on an algorithmic langmage' By analogy with f~GOL 60 was called Algol 58.

conclusion that this project could be made the foundations of our work of constructing an input language. Howeverj at this timer the analysis of Algol 58 on the one hand, and of typical formulae of mathematical problems on the other, convinced us that the de~riptive means of Algol 58 should be considerably extendedp in order that it might become in fact a convenient tool of the programmer an~ mathematician.

The creation of the first version of the input language was the ~second stage of the work. The general outlines of the language were developed between June and October 1959. They were discussed at a meeting of a seminar of the programming section of the Institue of Mathematics and were first explained in a lecture by A.P. Ershov (6).

~i i i i |.. U HH , | , . m i , |,m , I | '

(6) Ershov A.P. Wh~.t ought to be next in programming programme s? Leetu2e, which was given to the All - Union meeting on computational mathematics and computational techniques. Mosoo~ State University, Moscow,s, 16 - 21 November 1959.

-- i .I u i i i. , j iii i ,m ,i i ii ,i, , | n i i

The precise description of the 1st version of the input language was written by U. M. Voloshin. A. P. Ershov, and V. A. Yankov in March 1960.

At this time information became available to us of the Paris Conference o~ Algol~ held in January 1960, as a result of which a new version of the algorithmic langauge, known as Algol 60 (7) appeared. -4-

V~rLle studying Algol 60, we hotedwith satisfaction that practically all the imp~ovements~ which were made in Algol 60 as compared with Algol 58, corresponded with our point of view. This agreement (dlssregarding certain differences in the formulation of these improvements) was the more remarkable, when it is borne in mind that until March 1960 we, in point of fact did not have any preliminary information about the character of the reworking of Algol 58.

As a consequence at this we resolved to construct a 2nd version of the input language the structure of which would approach as olosel~ ,J as possible t~ that of Algol 60.

The development of the second version which, was accomplished by the authors between April and July 1960, formed the third stage of the creation of the input language. The description of the second version forms the subject of the present report. The basic constituents of this work consisted of a oc~eful analysis and comparison of the 1st version of the input language and Algol 60, in the removal of secondary a~fferenees and supplements, by proposing supplements in such a way that they would correspond as far as possible to the framework of Algol 60. Fellow workers in the department of the theory of Algorithms and programz~ng of the Institute of Mathematics of the Siberian Section of the Academy of Sciences of the U.S.SoR, were of great assistance to the authors by preparing various ~examples of computational algorithms written both in the input language and in Algol 60.

In the proposed project of the input language the and structure of Algol 60 is completely retained. In particular any , written in Algol 60 is the same algorithm in the input language. In this zase it is more correct to say of the input language, not that it is a sepante language but that it is an extension of Algol 60. Even if we do not mention that the basic principles of Algol 60 formed the basis of the input langauge the other points in view of the authors are reflected in the proposed additions.

Full infozmation concerning the syntax and scmantio s of the proposed additions are found in the basic part of this work called 'The Description b~c~e Input Language t . However, for the purpose of orientation, we would like to describe shortly in the introdution the essence of the proposed supplements and to give some motivation.

All essential supplements to Algol 60, which are contained in the input language, fall into the foll qwing_cate{ories. ~he Introduction of Mu~ti-~imens!onal quantities and 0perat.ions on them.

It is well known that in Algol 60 components in arithmetic operations can be only scalar quantities. This seems to us to be extremely incoHvenient as, in the majority of cases, schemes for algorithms are encumbered by surplus information, It is well known that computational algorithms in linear algebra take a particular eleg~ut and compact form when written in~ector and matrix notation. Even if we leave out what has greadybeen said about algorithms in linear algebra, the uniform manipulation of arrays of numbers also occupies ~ important place in many other mathematical problems. The principal way of performing operations on arrays, which is permitted in Algol 60, is the use of procedure s but this is cumbersome to write down and strongly distorts the original appee~anceof the formulation. Therefore it seems to us absolutely necessary to allow simple variables to signify not only scalar values but also vectors, matrioes, and in general ~, any mt~ti~mensional array.

1.1 S t ructlu~ De cl_aration.~

In this connection, when describing the type of a variable one must, point out, not only what value can be taken b y the variables (real, integer, or Boolean) but also to describe the structure of the variables i. e. !The size of the array, which is represented by this variable, and the orders of the array according to its dimensions.

1,2. 'i"n8 de:fini.t:ion of' Operators,

Arithmetic operations and stnndard functions should be defLned in a ~or:~et;pondingmanner for arguments which are arrays. The majority 02 operetions are interprettea as the combined operation over correspondiag scalar components of the arrays (or array). For veators and matrices certain operations (mulitplication ., t~ 'an jlnt'kger power ) are understood in a particular manner, corresponding to their straucture (!t'he product of matrices, the product of a vector to a matrix and vice.uersap scalar product, product of a vector to a scalar, and the inverse, of n matrix e$b.)

1.3. The ConstructS.on of Arrays.

The admission of arrays as the value of variaSles requires the introduotion into the language of a means for the act- construction of the arraysr The principle operations which are introdwed are the operations of f omation' and' composition' . The operation of formation allows arrays to be built f'rom components of lower dimension; the operation of oomposition allows severe1 am&.d-s to unite into a bigger array of the same dimension Still ,.nother vi0.y to inliroduce arrays into a prcgramme is to make use of ,an empty index position, Men up. by the authors from Algol 58. It is especially oonvenient, when one aomes to speak about sub-arrays of intermediate dimension, which are components of arrays of hhgher dimension.

1.4. Conpound variables,

The presence of the operations of composition and formation permits the introduction of variables with complicated structure, i. e. many dimensional variables, the components of which are simple variables of lower dimensions. The possibility of using suoh ' compound variablest in many cases avoids unnecessary loops and descrip%ions, and sometimes besoms absolutely necessary. (c.f. the exnmple, the procedure of the DANIIEVSKI method given in supplement 2).

Let us consider a certain expcession depending on an index, e.g. LW :. In mathematics shortened notations we widely used for an extract from a sequence of expressions T (i), which me p~oducedwhen the running index, i, takes on all values from C1 to C2 (~1t$ ~2). This shortened notation usually has the form

where m is some delimiter, for example T(c~), ... , T(c~) T (~1)< ... t4~(~2) T (~1)=. . . . = T(c~)etc These constructions whioh we call ~innumerations', have proved themselves very oonvenient in the operations of formation and composition and also in some other cases.

Chains of Inequalities

b It is extremely natural to allowas elemental objects not only binary relations of the form.

afb a ( b etc, but ~lsosuch generally understood and general purpose oonstruoficns as

a b B a [1] = ... = a In) = 0 x 3. (...

4. The Transfer of Control to the Interior of a

!he authors of Algol 60 introduced o recsonable rule that lnbds are local to the interior of the block in which they are found. However, at the present level the Algol 60 prificiple of localized labds has the effec-l, that one can only enter a blook through its beginning. In many i:sses this rule is very confining, compelling one to introduce, in an artificid manner, supplementary switches. It seems to us that it will be possible to avoid this Lnconvenience if on; admits Bs valuesof desimatii~i.lal expressions compound labds, having the form of sequence& of simple lables separated by dots@ In this case, for example the statement

go to L. IQ L -* produces a junp to the statement with lam&M, which is found in the block with the label L. The use bf compouad labds reconciles the principle of localised labels with the ability to jump to the interior of a block.

5. !l%e Ouerntor 'Pa

Nothing is said in Algol 60 about the termination of a completed algorithm. To ach4ive this aim it is proposed to introduce a new operator stop for this purposet which will not produce any aotion and will not define after itself' any successor,

6. Standar? f~mtions

4 It is proposed to extend somewhat the list of identif'iers reserved for stantlard functions, in order to include all principle elementary functions, some standard operations om vectors and matrices and also the operations of summation and oontinued product. (oontinued bproduct retracted see APIC ~0.12). 7, The recording of aritietio Statements. In addition to the aocepted rule used in Algol 60 for the recording of arithmetic statements in the form

it is proposed to regard as equivalent the recordhg of the statement in the form

taking into account the fact that such a method is aocepted in all Si-iriet programing programmes and also in several foreign programming programmes. (since retracted see APIC ~0.12).

Loops without rmnmeter~

It is ~roposedto introduce loops, which do not oontain a parameter and which are repaated either a given number of times or , wtil such time that soine logical condition is &.f;isfied. This saves the programmer from the necessity of introducing an artificial parapeter in some cases, . In those cases when the parameters takes integral values, with unit step, in the indicated interval, the following formulation seems very simple mil natural : for i := A, ,,.,B 3 instead of for i : = A step 1until B _do I 10. &per Index of a variable

This inportant concept contains the idea of an upper or temporal index. The application of an upper index on some variable means that the values of this variable are evaluated in some temporal sequence. The current value of the upper index indicates which of a number of values of the variable in the sequence is used or is evaluated, The sequence of values for a variable with an upper inOex are evaluated in a cycle with the help of recurrenoe relation~,whichare the ordinary arithmetic fornulae containing variables with upper indices, me use of upper indices gives recurrence relations cn eupe~iall:~ nraphic form. The principle difference betmeen an upper index and a dtver index, occurs during the realisation &' cm algorithm on a machine. In the case of an upper index one holds, at one time, in the memory only as many current elements in the eequence of values as are necessary for the evaluation of the next member of the sequence.

11, Formal parameters replaced by the substution of values.

According to the rules of Algol 60, those formal parameters which are listed in the heading of a procedure under the specification value, are considered as local variables during the execution of the procedure and are given the current values of the corresponiling actual po-rmeters at the beginning 06 the execution of the procedure. Such an interpretation of the specirication value permits this list to contain only those panmeterswhich are arguments of the procedure. It is sensible to generalise the meaning of the specification to parameters which are the results of the procedure. Such parameters are considerei as local variables during the execution of the procedure ahd receive some values at the end of the procedure, These values are then given to the variables -hich occupies corresponding positions in the actual parameter list ~f the procedure statement,

12. Functions and Procedures with empty pammbter positions as actual ar~uments.

It is proposed to preserve the concept, which vas proposed in Algo158, of allowing functions and procedures to contain empty parameter positions in the role of actual parameters, Having connected the surplus number of arguments with some fixea values, this oonoept allows one to consider as ectunl arguments functions and procedures, which Lave a larger number of arguments than the function or p,w,weter, the identif'ieils of which appear in the procedure as a formal argument. (since retracted see APIC ~0.12).

3 Procedure declaring with several procedure names( since retracted see APIC NO .12) It is proposed to allow, as was proposed in Algol 58, deecriptions of procednres which contain several prooedure names in their heading. E~erienceof programming show that there always exists enough procedures of a universal character, which have many entrances and, depending on the entrance acoomplish the work in one way or another. The classical emmaple of a procedure of this kind is the universal prooedure Rmge - KuL,.t-,a, which depending on the entrance carries out either one step of the integration, or computes the whole trajectory, with constant or variable step until some or other conditi n for termination is reached, k b universal remedy, which combines several entrances into one, is the introduction into the proce&ure hending of n new argument, the value of which gives the number of the modeof operation, and the introduction into the same procedure of a switoh which transfers control to the required --8-- starting place according to the number of the mode of operation. This method, howe~er/becomes fairly inconvenient, if different modes require different actual parameters. In this case the universal call of the procedure will contain much surplus information. All these difficulties are removed by allowing the presense of several procedure names in the heading of the procedure description.

14. Declaration of substitution Fo~.ulae.

It is proposed to introduce several declarations, having the form of substitution formulae. This and other declarations do not have operational valuep and therefore the order of occurence is not essential.

]/~.I. The Declaration of the startin~ values of variables.

These specification have the form

X o = ]~ where x is a variablep which is localisedin the block by the given declaration w cad E is an expression, containing constants or variables not localised in the given block. 14.2. The Declaration of a Functior~lr Expression

~4 These declaration have the form

F(x) = E

where F is the name of the function, x is the argument part, and E is an expression which specifies this function.

14.3 Declaration of identity (this has been altered see APIC No.12)

These declaration have the form

x = y

where x and y are variables.

In explaining these proposals it is necessary to mam~Icm one general concept. In mathematical computation especially in engineering calculations, many problems are met, the formulae in w~oh do not have the character of an assignment statement, but simply show how a given quantity depends on other quantities. The order of evaluating such formulae is not defined by the order of the written form an paper but by way of analysis of the positions of variables in the left or right part of these formulae. It is often the case that the order of writing of such formulae is in direct contrast with the crier of their evaluation; the formulae for the result is written down first and this is followed b~ formulae for sevenalcomponents of the first formula and so on. In view of what has been said it is extremely tempting to give mathematicians and engineers the opportunity of writing the condition for the problems in a form which they are used top using the proposed substitution formula,

As well as the general concept one can also mention a series of special considerations concerning individual forms of declarations. Information ~bout a variable such as its initail value given at the entrance to a given block in point of fact does not have an operational character.

The giving of an inithl value in the form of an assignment statement keads to the situation where unnecesB~ry operations are carried out in the bldek. This is especially noticable when the ihitial value is a constant.

The sel)~rat~ IreGt~cnt of functions~r~hich are~cwlucted ~th the help of arithmetic expressions, allows this most frequently met class of procedures to be written without that surplus information, which wou~d be necessary if such functions were written in the cumbersome formulation at the standard procedure declaration. - 9 - Fir~llyindentities play an especially important role as a convenient means for the description of the structure of variables which are used.

The article consists of a main part 'The Description of the Input Language' and ~vo supplements. The proposed means of recording Algol 60 and additions to it by a . : representation of 128 ch~xaeters is given in supplement 1. Example of Algorithms written both in Algol 60 and the ~nput language are given is supplement 2.

Following the tradition, which was established by the composers of Algol 60, the authors prefaced the 'Description of the Input Language' with a quotatior~. The authors distinctly re~lise that the given work presents ektremely convenient object for criticism from the ~oint of view of this quotation.

• (The best is an enemy of the good)

Besides this, as far as a considerable part of the proposals are concerned, the authors cannot present shsolute evidence that these proposals should be accepted and they will be compelled to appeal to such vague concepts aslconvenienceI,'ease&br~vity of writing I etc. ~How~ver, apparently, it is clear to every man seriously working in the field of programming languages, that these subjective ideas play a decisive role in the development of a descriptive language.

The authors can only hote that all the proposals, whioh have been given here, were thoroughly thought over for a long time and were verified on sufficient large and realistic eKamples (some tens of algorithms of different degrees of complexity). Besides this the majority of the proposals described here were discussed at the following meetings and conferences.

All-Union meeting on computational mathematics and computational techniques, Moscow Statw University, Moscow, Nov.1959.

2. Scientific Conference on computational mathematics and computational techniques. Computational Centre of the Aoademy of Bciences of U.S.S.R. Kiev, June 1960.

~3. Special meeting for the discussion of a supplement to Algol 60. Computational Centre of the Academy of Sciences of U.S.S.R. Novosib,inak.. June. 1960.

Working meeting on the question of Algol 60. Compuatation~l Center of the Academy of Sciences of U.S.S.R. Moscow, June. 1960.

Observations that have been made at these meeting, have assisted, to an important extent, the crystallisation of the points of vfew m~dh~ve lead to the removal of those supplements which played ah unessential role.