*** Welcome to piglix ***

Formal semantics of programming languages


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

has the same effect as S1 alone.

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.

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.

Some variations of formal semantics include the following:

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


...
Wikipedia

...