There are many approaches to formal semantics; these belong to three major classes: •
Denotational semantics, whereby each phrase in the language is interpreted as a
denotation, i.e. a conceptual meaning that can be thought of abstractly. Such denotations are often mathematical objects inhabiting a mathematical space, but it is not a requirement that they should be so. As a practical necessity, denotations are described using some form of mathematical notation, which can in turn be formalized as a denotational metalanguage. For example, the denotational semantics of
functional languages often translate the language into
domain theory. Denotational semantic descriptions can also serve as compositional translations from a programming language into the denotational metalanguage and be used as a basis for designing
compilers. •
Operational semantics, whereby the execution of the language is described directly (rather than by translation). Operational semantics loosely corresponds to
interpretation, although again the "implementation language" of the interpreter is generally a mathematical formalism. Operational semantics may define an
abstract machine (such as the
SECD machine), and give meaning to phrases by describing the transitions they induce on states of the machine. Alternatively, as with the pure
lambda calculus, operational semantics can be defined via syntactic transformations on phrases of the language itself; •
Axiomatic semantics, whereby one gives meaning to phrases by describing the
axioms that apply to them. Axiomatic semantics makes no distinction between a phrase's meaning and the logical formulas that describe it; its meaning
is exactly what can be proven about it in some logic. The canonical example of axiomatic semantics is
Hoare logic. 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==