Denotational semantics is a formal method for expressing the semantic definition of a programming language (or a program in that language).
Other approaches are axiomatic (Hoare methods), algebraic (Guttag ADTs), and operational (a virtual machine, Java).
In denotational semantics, the idea is to map every syntactic entity in a PL into some appropriate mathematical entity. The math is the "denotation" for the syntax, of the "syntax denotes the semantic entity."
Each denotational semantic definition consists of 5 parts:
D in Digits (decimal digits) N in Num (decimal natural numbers)Syntax BNF
D ::= 0 | 1 | ... | 9 N ::= D | N DValue Domains
Nat = { 0, 1, 2, 3, 4, ... } natural numbersSemantic Functions
DD : Digits --> Nat MM : Num --> NatSemantic Equations
DD [0] = 0 DD [1] = 1 DD [2] = 2 ... DD [9] = 9 MM [D] = DD [D] MM [N D] = 10 * MM [N] + MM [D]