Plankalkül () is a
programming language
A programming language is a system of notation for writing computer programs.
Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
designed for engineering purposes by
Konrad Zuse
Konrad Ernst Otto Zuse (; ; 22 June 1910 – 18 December 1995) was a German civil engineer, List of pioneers in computer science, pioneering computer scientist, inventor and businessman. His greatest achievement was the world's first programm ...
between 1942 and 1945. It was the first
high-level programming language
A high-level programming language is a programming language with strong Abstraction (computer science), abstraction from the details of the computer. In contrast to low-level programming languages, it may use natural language ''elements'', be ea ...
to be designed for a computer. Zuse never implemented Plankalkül on any of his Z-series machines.
''Kalkül'' (from Latin ''
calculus
Calculus is the mathematics, mathematical study of continuous change, in the same way that geometry is the study of shape, and algebra is the study of generalizations of arithmetic operations.
Originally called infinitesimal calculus or "the ...
'') is the
German term for a
formal system
A formal system is an abstract structure and formalization of an axiomatic system used for deducing, using rules of inference, theorems from axioms.
In 1921, David Hilbert proposed to use formal systems as the foundation of knowledge in ma ...
—as in ''Hilbert-Kalkül'', the original name for the
Hilbert-style deduction system—so ''Plankalkül'' refers to a formal system for planning.
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
David Hilbert (; ; 23 January 1862 – 14 February 1943) was a German mathematician and philosophy of mathematics, philosopher of mathematics and one of the most influential mathematicians of his time.
Hilbert discovered and developed a broad ...
's and
Ackermann's book on elementary mathematical logic (see
Principles of Mathematical Logic).
To describe logical circuits, Zuse invented his own diagram and notation system, which he called "combinatorics of conditionals" (). After finishing the
Z1 in 1938, Zuse discovered that the calculus he had independently devised already existed and was known as
propositional calculus
The propositional calculus is a branch of logic. It is also called propositional logic, statement logic, sentential calculus, sentential logic, or sometimes zeroth-order logic. Sometimes, it is called ''first-order'' propositional logic to contra ...
.
What Zuse had in mind, however, needed to be much more powerful (propositional calculus is not
Turing-complete
In computability theory, a system of data-manipulation rules (such as a model of computation, a computer's instruction set, a programming language, or a cellular automaton) is said to be Turing-complete or computationally universal if it can be ...
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:
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
Chess is a board game for two players. It is an abstract strategy game that involves Perfect information, no hidden information and no elements of game of chance, chance. It is played on a square chessboard, board consisting of 64 squares arran ...
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
A formal system is an abstract structure and formalization of an axiomatic system used for deducing, using rules of inference, theorems from axioms.
In 1921, David Hilbert proposed to use formal systems as the foundation of knowledge in ma ...
.
In 1945, Zuse described Plankalkül in an unpublished book.
The collapse of
Nazi Germany
Nazi Germany, officially known as the German Reich and later the Greater German Reich, was the German Reich, German state between 1933 and 1945, when Adolf Hitler and the Nazi Party controlled the country, transforming it into a Totalit ...
, however, prevented him from submitting his manuscript.
At that time the only two working computers in the world were
ENIAC
ENIAC (; Electronic Numerical Integrator and Computer) was the first Computer programming, programmable, Electronics, electronic, general-purpose digital computer, completed in 1945. Other computers had some of these features, but ENIAC was ...
and
Harvard Mark I, neither of which used a compiler, and ENIAC needed to be reprogrammed for each task by changing how the wires were connected.
Although most of his computers were destroyed by Allied bombs, Zuse was able to rescue one machine, the
Z4, and move it to the Alpine village of
Hinterstein (part of
Bad Hindelang).
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
"Sleeping Beauty" (, or ''The Beauty Sleeping in the Wood''; , or ''Little Briar Rose''), also titled in English as ''The Sleeping Beauty in the Woods'', is a fairy tale about a princess curse, cursed by an evil fairy to suspended animation in fi ...
, 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 republished with commentary in 1972.
The first compiler for Plankalkül was implemented by Joachim Hohmann in his 1975 dissertation.
Other independent implementations followed in 1998
and 2000 at the
Free University of Berlin.
Description
Plankalkül has drawn comparisons to the language
APL, and to
relational algebra
In database theory, relational algebra is a theory that uses algebraic structures for modeling data and defining queries on it with well founded semantics (computer science), semantics. The theory was introduced by Edgar F. Codd.
The main applica ...
. It includes assignment statements,
subroutine
In computer programming, a function (also procedure, method, subroutine, routine, or subprogram) is a callable unit of software logic that has a well-defined interface and behavior and can be invoked multiple times.
Callable units provide a ...
s, conditional statements, iteration,
floating-point arithmetic
In computing, floating-point arithmetic (FP) is arithmetic on subsets of real numbers formed by a ''significand'' (a Sign (mathematics), signed sequence of a fixed number of digits in some Radix, base) multiplied by an integer power of that ba ...
, 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'' (), which can be used to represent geometrical structures.
Many features of the Plankalkül reappear in later programming languages; an exception is its idiosyncratic two-dimensional notation using multiple lines.
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
Data types
The only primitive data type in the Plankalkül is a single
bit or
Boolean ( – yes-no value in Zuse's 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
The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable un ...
) 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 () in Plankalkül consists of 3 elements: structured value (), pragmatic meaning () and possible restriction on possible values ().
User defined types are identified by letter A with number, like
– first user defined type.
Examples
Zuse used a lot of examples from chess theory:
Identifiers
Identifiers are alphanumeric characters with a number.
There are the following kinds of identifiers for variables:
* Input values () — marked with a letter V.
* Intermediate, temporary values () — marked with a letter Z.
* Constants () — marked with a letter С.
* Output values () — 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 reading 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" (). 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 /code>, V0 i]
, V0 i] /code> (although to access a single bit in modern programming languages a bitmask is typically used).
Two-dimensional syntax
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 (), then indexes of variable subcomponents marked with K (), and then () 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 .
Examples:
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:
Assignment operation
Zuse introduced in his calculus an assignment operator, unknown in mathematics before him. He marked it with «», and called it yields-sign (). Use of concept of assignment is one of the key differences between mathematics and computer science.
Zuse wrote that the expression:
:
is analogous to the 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
Heinz Rutishauser (30 January 1918 – 10 November 1970) was a Swiss people, Swiss mathematician and a pioneer of modern numerical mathematics and computer science.
Life
Rutishauser's father died when he was 13 years old and his mother died t ...
. 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 Zürich, European participants proposed to use the assignment character introduced by Zuse, but the American delegation insisted on :=
.
The variable that stores the result of an assignment ( l-value) is written to the right side of assignment operator. The first assignment to the variable is considered to be a declaration.
The left side of assignment operator is used for an expression (), that defines which value will be assigned to the variable. Expressions could use arithmetic operators, Boolean operators, and comparison operators ( etc.).
The exponentiation operation is written similarly to the indexing operation - using lines in the two-dimensional notation:
Control flow
Boolean values were represented as integers with and . Conditional control flow took the form of a guarded statement , which executed the block if was true. There was also an iteration operator, of the form which repeats until all guards are false.
Terminology
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, something today would be called a translator
Translation is the communication of the meaning of a source-language text by means of an equivalent target-language text. The English language draws a terminological distinction (which does not exist in every language) between ''trans ...
or compiler
In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
.
Example
The original notation was two-dimensional, i.e. the indentation and thus spatial relation of different terminal symbols mattered in regard to the semantics ''spanning multiple lines''. 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.0V1 8.0V2 8.0 → R0 8.0 max(V0 8.0V1 8.0 → Z1 8.0 max(Z1 8.0V2 8.0 → R0 8.0 END
P2 max (V0 8.0V1 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
See also
* History of programming languages
* Timeline of programming languages
* List of programming languages
References
Further reading
*
* (9 pages)
(22 pages)
* (24 pages)
External links
* (NB. Plankalkül Java applets and documents.)
{{DEFAULTSORT:Plankalkul
Programming languages created in 1948
Procedural programming languages
Non-English-based programming languages
German inventions of the Nazi period
German inventions
Konrad Zuse
1940s establishments in Germany