|Designed by||Konrad Zuse|
|First appeared||1948– concept first published|
|Plankalkül-Compiler by the FU Berlin in 2000|
|Superplan by Heinz Rutishauser, |
Plankalkül (German pronunciation: [ˈplaːnkalkyːl]) is a programming language designed for engineering purposes by Konrad Zuse between 1942 and 1945. It was the first high-level programming language to be designed for a computer.
History of programming
In the domain of creating computing machines, Zuse was self-taught, and developed them without knowledge about other mechanical computing machines that existed already -- although later on (building the Z3) being inspired by Hilbert's and Ackermann's book on elementary mathematical logic (cf. Principles of Mathematical Logic). To describe logical circuits, Zuse invented his own diagram and notation system, which he called "combinatorics of conditionals" (German: Bedingungskombinatorik). After finishing the Z1 in 1938, Zuse discovered that the calculus he had independently devised already existed and was known as propositional calculus. What Zuse had in mind, however, needed to be much more powerful (propositional calculus is not Turing-complete and is not able to describe even simple arithmetic calculations). In May 1939 he described his plans for the development of what would become Plankalkül. He wrote the following in his notebook:
Almost half a year of gradual introduction into formal logic. I rediscovered there lots of my previous thoughts. (combinatorics of conditionals = propositional calculus; study of intervals = lattice theory). Now I plan creation of "Calculus of plans". There are series of concepts needed to clarify for this.
Seit etwa einem halben Jahr allmähliches Einführen in die formale Logik. Viele meiner früheren Gedanken habe ich dort wieder gefunden. (Bedingungskombinatorik = Aussagenlogik; Lehre von den Intervallen = Gebietenkalkül). Ich plane jetzt die Aufsetzung des 'Plankalküls'. Hierzu sind eine Reihe von Begriffen zu klären.
|—Konrad Zuse's notebook|
While working on his doctoral dissertation, Zuse developed the first known formal system of algorithm notation capable of handling branches and loops. In 1942 he began writing a chess program in Plankalkül. In 1944, Zuse met with the German logician and philosopher Heinrich Scholz, who expressed appreciation for Zuse's utilization of logical calculus. In 1945, Zuse described Plankalkül in an unpublished book. The collapse of Nazi Germany, however, prevented him from submitting his manuscript.
At that time the only two working computers in the world were ENIAC and Harvard Mark I, none of which used compiler, and ENIAC needed to be reprogrammed for each task by changing connection of wires.
The very first attempt to devise an algorithmic language was undertaken in 1948 by K. Zuse. His notation was quite general, but the proposal never attained the consideration it deserved.
Unable to continue building computers -- which was also forbidden by the Allied Powers -- Zuse devoted his time to the development of a higher-level programming model and language. In 1948 he published a paper in the Archiv der Mathematik and presented at the Annual Meeting of the GAMM. His work failed to attract much attention. In a 1957 lecture, Zuse expressed his hope that Plankalkül, "after some time as a Sleeping Beauty, will yet come to life." He expressed disappointment that the designers of ALGOL 58 never acknowledged the influence of Plankalkül on their own work.
Plankalkül was more comprehensively published[vague] in 1972. The first compiler was implemented by Joachim Hohmann in his 1975 dissertation. Other independent implementations followed in 1998 and 2000 at the Free University of Berlin.
Plankalkül has drawn comparisons to the language APL, and to relational algebra. It includes assignment statements, subroutines, conditional statements, iteration, floating point arithmetic, arrays, hierarchical record structures, assertions, exception handling, and other advanced features such as goal-directed execution. The Plankalkül provides a data structure called generalized graph (verallgemeinerter Graph), which can be used to represent geometrical structures.
Some features of the Plankalkül:
- only local variables
- functions do not support recursion
- only supports call by value
- composite types are arrays and tuples
- contains conditional expressions
- contains a for loop and a while loop
- no goto
The only primitive data type in the Plankalkül is a single bit or boolean (German: Ja-Nein-Werte - yes-no value in Zuses terminology). It is denoted by the identifier . All the further data types are composite, and build up from primitive by means of "arrays" and "records".
So, a sequence of eight bits (which in modern computing could be regarded as byte) is denoted by , and boolean matrix of size by is described by . There also exists a shortened notation, so one could write instead of .
Type could have two possible values and . So 4-bit sequence could be written like L00L, but in cases where such a sequence represents a number, the programmer could use the decimal representation 9.
Record of two components and is written as .
Type (German: Art) in Plankalkül consists of 3 elements: structured value (German: Struktur), pragmatic meaning (German: Typ) and possible restriction on possible values (German: Beschränkung). User defined types are identified by letter A with number, like - first user defined type.
Zuse used a lot of examples from chess theory:
|Coordinate of chess board (it has size 8x8 so 3 bits are just enough)|
|square of the board (for example L00, 00L denotes e2 in algebraic notation)|
|piece (for example, 00L0 — white king)|
|piece on a board (for example L00, 00L; 00L0 — white king on e2)|
|board (pieces positions, describes which piece each of 64 squares contains)|
|game state ( — board, — who moves, — possibility of castling (2 for white and 2 for black), A2 — information about cell on which En passant move is possible|
- Input values (German: Eingabewerte, Variablen) — marked with a letter V.
- Indermediate, temporary values (German: Zwischenwerte) — marked with a letter Z.
- Constants (German: Constanten) — marked with a letter С.
- Output values (German: Resultatwerte) — marked with a letter R.
Particular variable of some kind is identified by number, written under the kind. For example:
- , , etc.
Programs and subprograms are marked with a letter P, followed by a program (and optionally a subprogram) number. For example , .
Output value of program saved there in variable is available for other subprograms under the identifier , and readin value of that variable also means executing related subprogram.
Accessing elements by index
Plankalkül allows access for separate elements of variable by using "component index" (German: Komponenten-Index). When, for example, program receives input in variable of type (game state), then — gives board state, — piece on square number i, and bit number j of that piece.
In modern programming languages, that would be described by notation similar to
V0[i][j] (although to access a single bit in modern programming languages a bitmask is typically used).
Because indexes of variables are written vertically, each Plankalkül instruction requires multiple rows to write down.
First row contains variable kind, then variable number marked with letter V (German: Variablen-Index), then indexes of variable subcomponents marked with K (German: Komponenten-Index), and then (German: Struktur-Index) marked with S, which describes variable type. Type is not required, but Zuse notes that this helps with reading and understanding the program.
In the line types and could be shortened to and . 
|variable V3 — list of pairs of values of type|
|Row K could be skipped when it is empty. Therefore, this expression means the same as above.|
|Value of eights bit (index 7), of first (index 0) pair, of і-th element of variable V3, has boolean type ().|
Indexes could be not only constants. Variables could be used as indexes for other variables, and that is marked with a line, which shows in which component index would value of variable be used:
|Z5-th element of variable V3. Equivalent to expression |
Zuse introduced in his calculus an assignment operator, unknown in mathematics before him. He marked it with «», and called it yields-sign (German: Ergibt-Zeichen). Use of concept of assignment is one of the key differences between math and computer science.
Zuse wrote that expression:
is analogous to more traditional mathematical equation:
There are claims that Konrad Zuse initially used the glyph as a sign for assignment, and started to use under the influence of Heinz Rutishauser. Knuth and Pardo believe that Zuse always wrote , and that was introduced by publishers of «Über den allgemeinen Plankalkül als Mittel zur Formulierung schematisch-kombinativer Aufgaben» in 1948. In the ALGOL 58 conference in Zurich, European participants proposed to use for assignment character introduced by Zuse, but the American delegation insisted on
The left side of assignment operator is used for expression (German: Ausdruck), that defines which value will be assigned to variable. Expressions could use arithmetic operators, boolean operators, and comparison operators ( etc.).
Exponentiation operation is written similarly to the indexing operation - using lines in 2d notation:
This section needs expansion. You can help by adding to it. (September 2020)
Zuse called a single program a Rechenplan ("computation plan"). He envisioned what he called a Planfertigungsgerät ("plan assembly device"), which would automatically translate the mathematical formulation of a program into machine-readable punched film stock.
The original notation was two dimensional.[clarification needed] For a later implementation in the 1990s, a linear notation was developed.
The following example defines a function
max3 (in a linear transcription) that calculates the maximum of three variables:
P1 max3 (V0[:8.0],V1[:8.0],V2[:8.0]) → R0[:8.0] max(V0[:8.0],V1[:8.0]) → Z1[:8.0] max(Z1[:8.0],V2[:8.0]) → R0[:8.0] END P2 max (V0[:8.0],V1[:8.0]) → R0[:8.0] V0[:8.0] → Z1[:8.0] (Z1[:8.0] < V1[:8.0]) → V1[:8.0] → Z1[:8.0] Z1[:8.0] → R0[:8.0] END
- "Early Programming Languages / CS208e: Great Ideas in Computer Science" (PDF).
- Rojas, Raúl; Hashagen, Ulf (2002). The First Computers: History and Architectures. MIT Press. p. 292. ISBN 978-0262681377. Retrieved October 25, 2013.
- Hector Zenil (ed.), 2012. A Computable Universe: Understanding and Exploring Nature As Computation with a Foreword by Sir Roger Penrose. Singapore: World Scientific Publishing Company. Page 791.
- Hans Dieter Hellige, ed. (2004). Geschichten der Informatik. Visionen, Paradigmen, Leitmotive (in German). Berlin: Springer. pp. 113n 152, 216. ISBN 978-3-540-00217-8.
- Rojas et al. 2004, p. 3.
- "Why is propositional logic not Turing complete?".
- Knuth & Pardo 1976, p. 9
- Giloi 1997
- Hans Dieter Hellige (ed.): Geschichten der Informatik. Visionen, Paradigmen, Leitmotive. Berlin, Springer 2004, ISBN 3-540-00217-0. p. 56.
- Hans Dieter Hellige (ed.): Geschichten der Informatik. Visionen, Paradigmen, Leitmotive. Berlin, Springer 2004, ISBN 3-540-00217-0. p. 216,217.
- Hartmut Petzold,Moderne Rechenkünstler. Die Industrialisierung der Rechentechnik in Deutschland. München. C.H. Beck Verlag 1992
- (full text of the 1945 manuscript)
- Rojas et al. 2000, p. 3.
- Knuth & Pardo 1976, p. 8
- Prof. Wolfgang Coy: Was ist Informatik? Zur Entstehung des Faches an den deutschen Universitäten, in: Hans Dieter Hellige (ed.): Geschichten der Informatik. Visionen, Paradigmen, Leitmotive. Berlin, Springer 2004, ISBN 3-540-00217-0. p. 474.
- Hans Dieter Hellige (ed.): Geschichten der Informatik. Visionen, Paradigmen, Leitmotive. Berlin, Springer 2004, ISBN 3-540-00217-0. p. 89.
- Knuth & Pardo 1976, p. 15
- Joachim Hohmann: Der Plankalkül im Vergleich mit algorithmischen Sprachen. Reihe Informatik und Operations Research, S. Toeche-Mittler Verlag, Darmstadt 1979, ISBN 3-87820-028-5.
- Description of Plankalkül-Compiler by Wolfgang Mauerer
- Rojas et al. 2000, p. 2.
- Prof. Wolfgang Giloi: Konrad Zuses Plankalkül als Vorläufer moderner Programmiermodelle, November 1990
- Hans Dieter Hellige (ed.): Geschichten der Informatik. Visionen, Paradigmen, Leitmotive. Berlin, Springer 2004, ISBN 3-540-00217-0. p. 217.
- Bauer & Wössner 1972, p. 679.
- Bauer & Wössner 1972, p. 680.
- Zuse 1945, p. 10. sfn error: no target: CITEREFZuse1945 (help)
- Bauer & Wössner 1972, p. 681.
- Knuth & Pardo 1976, p. 14.
- Bauer & Wössner 1972, p. 682.
- Zuse 1945, p. 45. sfn error: no target: CITEREFZuse1945 (help)
- Hellige, Hans Dieter, Geschichten der Informatik. Visionen, Paradigmen, Leitmotive. Berlin, Springer 2004, ISBN 3-540-00217-0. pp. 45, 104, 105
- Giloi, Wolfgang (1997). "Konrad Zuse's Plankalkül: The First High-Level "non von Neumann" Programming Language". IEEE Annals of the History of Computing. 19 (2): 17–24. doi:10.1109/85.586068.
- Knuth, Donald Ervin; Pardo, Luis Trabb (1976), The Early Development of Programming Languages (PDF), Stanford University, Computer Science Department, archived from the original (PDF) on 2017-09-12, retrieved 2017-12-28
- Zuse, Konrad (1943), "Ansätze einer Theorie des allgemeinen Rechnens unter besonderer Berücksichtigung des Aussagenkalküls und dessen Anwendung auf Relaisschaltungen", (i.e. Inception of a universal theory of computation with special consideration of the propositional calculus and its application to relay circuits.) unpublished manuscript, Zuse Papers 045/018.
- Zuse, Konrad (1948/49). "Über den allgemeinen Plankalkül als Mittel zur Formulierung schematisch-kombinativer Aufgaben". Arch. Math. 1, pp. 441–449, 1948/49.
- Zuse, Konrad (1972). "Der Plankalkül". Gesellschaft für Mathematik und Datenverarbeitung. Nr. 63, BMBW - GMD - 63, 1972.
- Bauer, Friedrich L.; Wössner, Hans (1972). "The "Plankalkül" of Konrad Zuse: A Forerunner of Today's Programming Languages" (PDF). Archived from the original (pdf) on 2009-02-20. Cite journal requires
- Rojas, Raúl; Göktekin, Cüneyt; Friedland, Gerald; Krüger, Mike (2000). Plankalkül: The First High-Level Programming Language and its Implementation (PDF). Archived from the original on 2006-05-01.
- Rojas, Raúl; Göktekin, Cüneyt; Friedland, Gerald; Krüger, Mike; Scharf, Ludmila (2004). Konrad Zuses Plankalkül – Seine Genese und eine moderne Implementierung (PDF). doi:10.1007/978-3-642-18631-8_9. Archived from the original (PDF) on 2006-05-01.
- The "Plankalkül" of Konrad Zuse: A Forerunner of Today's Programming Languages by Friedrich L. Bauer (alternative source)
- Rojas, Raúl, et al. (2000). "Plankalkül: The First High-Level Programming Language and its Implementation". Institut für Informatik, Freie Universität Berlin, Technical Report B-3/2000. (full text)(archived)
- Mauerer, Wolfgang (2016-06-03). "Der Plankalkül von Konrad Zuse" (in German). Implementation in German. Archived from the original on 2016-06-03. Retrieved 2017-10-03.
- "Plankalkül". Konrad Zuse Internet Archive. Archived page with Plankalkül java applets (non functioning) and several documents (German/English). 2014-08-21. Archived from the original on 2014-08-21. Retrieved 2017-10-04.CS1 maint: others (link)
- Bram Bruines: Plankalkul(2010) - Plankalkül described in a formal way