Semantics (computer science)

In programming language theory, semantics is the field concerned with the rigorous mathematical study of the meaning of programming languages. It does so by evaluating the meaning of syntactically legal strings defined by a specific programming language, showing the computation involved. In such a case that the evaluation would be of syntactically illegal strings, the result would be non-computation. Semantics describes the processes a computer follows when executing a program in that specific language. This can be shown by describing the relationship between the input and output of a program, or an explanation of how the program will execute on a certain platform, hence creating a model of computation.

Formal semantics, for instance, helps to write compilers, better understand what a program is doing and to prove, e.g., that the following if statement

if 1 = 1 then S1 else S2

has the same effect as S1 alone.

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:

The distinctions between the three broad classes of approaches can sometimes be vague, but all known approaches to formal semantics use the above techniques, or some combination thereof.

Apart from the choice between denotational, operational, or axiomatic approaches, most variation in formal semantic systems arises 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.

History

Robert W. Floyd is credited with founding the field of programming language semantics in Floyd (1967).[1]

See also

References

  1. Knuth, Donald E. "Memorial Resolution: Robert W. Floyd (1936-2001)" (PDF). Stanford University Faculty Memorials. Stanford Historical Society.

Further reading

Textbooks
Lecture notes
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.