Semantics (computer science) explained

In programming language theory, semantics is the rigorous mathematical study of the meaning of programming languages.[1] Semantics assigns computational meaning to valid strings in a programming language syntax. It is closely related to, and often crosses over with, the semantics of mathematical proofs.

Semantics describes the processes a computer follows when executing a program in that specific language. This can be done by describing the relationship between the input and output of a program, or giving an explanation of how the program will be executed on a certain platform, thereby creating a model of computation.

History

In 1967, Robert W. Floyd published the paper Assigning meanings to programs; his chief aim was "a rigorous standard for proofs about computer programs, including proofs of correctness, equivalence, and termination".[2] [3] Floyd further wrote:

A semantic definition of a programming language, in our approach, is founded on a syntactic definition. It must specify which of the phrases in a syntactically correct program represent commands, and what conditions must be imposed on an interpretation in the neighborhood of each command.

In 1969, Tony Hoare published a paper on Hoare logic seeded by Floyd's ideas, now sometimes collectively called axiomatic semantics.[4]

In the 1970s, the terms operational semantics and denotational semantics emerged.[5]

Overview

The field of formal semantics encompasses all of the following:

It has close links with other areas of computer science such as programming language design, type theory, compilers and interpreters, program verification and model checking.

Approaches

There are many approaches to formal semantics; these belong to three major classes:

Apart from the choice between denotational, operational, or axiomatic approaches, most variations in formal semantic systems arise from the choice of supporting mathematical formalism.

Variations

Some variations of formal semantics include the following:

Describing relationships

For a variety of reasons, one might wish to describe the relationships between different formal semantics. For example:

It is also possible to relate multiple semantics through abstractions via the theory of abstract interpretation.

See also

Further reading

Textbooks

. 1990 . Matthew Hennessy. The semantics of programming languages: an elementary introduction using structural operational semantics . Wiley . 978-0-471-92772-3.

Lecture notes

External links

Notes and References

  1. Book: Goguen, Joseph A.. Joseph Goguen. Semantics of computation . Category Theory Applied to Computation and Control . Lecture Notes in Computer Science . . 1975 . 25 . 151–163 . 10.1007/3-540-07142-3_75. 978-3-540-07142-6 .
  2. Book: Floyd, Robert W. . 1967 . Robert W. Floyd . Assigning Meanings to Programs . https://people.eecs.berkeley.edu/~necula/Papers/FloydMeaning.pdf . J.T. . Schwartz . Mathematical Aspects of Computer Science . American Mathematical Society . 0821867288 . 19–32 . Proceedings of Symposium on Applied Mathematics . 19 .
  3. Web site: Donald Knuth. Donald E.. Knuth . Memorial Resolution: Robert W. Floyd (1936–2001) . Stanford University Faculty Memorials . Stanford Historical Society .
  4. Hoare . C. A. R. . Tony Hoare . An axiomatic basis for computer programming . 10.1145/363235.363259 . . 12 . 10 . 576–580 . October 1969 . 207726175 . free .
  5. Book: Winskel . Glynn . The formal semantics of programming languages : an introduction . 1993 . MIT Press . Cambridge, Mass. . 978-0-262-23169-5 . xv .
  6. Book: David A.. Schmidt . Denotational Semantics: A Methodology for Language Development . William C. Brown Publishers . 1986 . 9780205104505.
  7. Gordon Plotkin. Gordon D.. Plotkin . A structural approach to operational semantics . Technical Report DAIMI FN-19 . . 1981.
  8. Joseph Goguen. Joseph A.. Goguen . James W.. Thatcher . Eric G.. Wagner . Jesse B.. Wright . Initial algebra semantics and continuous algebras . . 24 . 1 . 1977 . 68–95 . 10.1145/321992.321997. 11060837 . free .
  9. Peter Mosses. Peter D.. Mosses . 1996 . Theory and practice of action semantics . . BRICS Report RS9653.
  10. Book: Pierre. Deransart . Martin. Jourdan . Bernard. Lorho . "Attribute Grammars: Definitions, Systems and Bibliography . 1988 . Lecture Notes in Computer Science 323 . . 9780387500560.
  11. William Lawvere. F. William. Lawvere . Functorial semantics of algebraic theories . . 50 . 5 . 1963 . 869–872 . 10.1073/pnas.50.5.869. 16591125 . 221940 . 1963PNAS...50..869L . free .
  12. Andrzej Tarlecki . . . Some fundamental algebraic tools for the semantics of computation: Part 3. Indexed categories . . 91 . 2 . 1991 . 239–264 . 10.1016/0304-3975(91)90085-G. free .
  13. Mark. Batty . Kayvan. Memarian . Kyndylan. Nienhuis . Jean. Pichon-Pharabod . Peter. Sewell . The problem of programming language concurrency semantics . Proceedings of the European Symposium on Programming Languages and Systems . 283–307 . . 2015 . 10.1007/978-3-662-46669-8_12. free .
  14. Book: Samson Abramsky. Samson. Abramsky . Semantics of interaction: An introduction to game semantics . Semantics and Logics of Computation . 2009 . 1–32 . 10.1017/CBO9780511526619.002 . Cambridge University Press . 9780521580571 . Andrew M. Pitts . P. Dybjer.
  15. Edsger W. Dijkstra. Edsger W.. Dijkstra . 1975 . Guarded commands, nondeterminacy and formal derivation of programs . . 18 . 8 . 453–457 . 10.1145/360933.360975. 1679242 . free .